GStreamer-QoS

175 阅读1分钟

Quality Of Service (QoS)

GStreamer 中的 QoS 是关于测量和调整管道的实时性能。 实时性能始终是相对于管道时钟来测量的,并且通常发生在接收器中,在它们根据时钟同步缓冲区时。

当缓冲区延迟到达接收器时,即当它们的运行时间小于时钟的运行时间时,我们说管道存在服务质量问题。 以下是一些可能的原因:

  • CPU 负载高,没有足够的 CPU 能力来处理流,导致数据缓冲 buffer 延迟到达接收器 sink

  • Network problems 网络问题

  • 其他资源问题,例如磁盘负载,内存瓶颈

gst_message_new_qos

GstMessage *
gst_message_new_qos (GstObject * src,
                     gboolean live,
                     guint64 running_time,
                     guint64 stream_time,
                     guint64 timestamp,
                     guint64 duration)

A QOS message is posted on the bus whenever an element decides to drop a buffer because of QoS reasons or whenever it changes its processing strategy because of QoS reasons (quality adjustments such as processing at lower accuracy).

This message can be posted by an element that performs synchronisation against the clock (live) or it could be dropped by an element that performs QoS because of QOS events received from a downstream element (!live).

running_timestream_timetimestampduration should be set to the respective running-time, stream-time, timestamp and duration of the (dropped) buffer that generated the QoS event. Values can be left to GST_CLOCK_TIME_NONE when unknown.

Parameters:

src – The object originating the message. live – if the message was generated by a live element running_time – the running time of the buffer that generated the message stream_time –  the stream time of the buffer that generated the message timestamp – the timestamps of the buffer that generated the message duration – the duration of the buffer that generated the message

Returns  

The new qos message.