Gstreamer GstPipeline管道 时钟

GstPipeline作为顶级bin提供时钟和GstBus。在状态改变时,它重置running_time,选择时钟,并计算延迟。时钟选择发生在进入PLAYING状态时,遵循特定算法。GstPipeline的GstBus允许应用程序接收元素消息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

GstPipeline管道 翻译自part-gstpipeline.txt

GstPipeline
------------------------------
    GstPipeline是一个顶级的bin,给所有的子元素提供时钟。
    GstPipeline也提供一个顶级的GstBus。
    GstPipeline基于选择的时钟计算running_time。
    GstPipeline为管道中的所有元素计算全局的延迟。

State changes 
~~~~~~~~~~~~~
    除了父类GstBin正常的状态改变过程外,GstPipeline在状态改变过程中还提供如下的动作。
    - NULL -> READY:
        - set the bus to non-flushing
    - READY -> PAUSED:
        - reset the running_time to 0
     - PAUSED -> PLAYING:
        - Select and a clock.
        - calculate base_time using the running_time.
        - calculate and distribute latency.
        - set clock and base_time on all elements before performing the state change.
     - PAUSED -> PLAYING:
        - calculate the running_time when the pipeline was PAUSED.
     - READY -> NULL:
        - set the bus to flushing (when auto-flushing is enabled) 
    当执行一次flush seek后,running_time被设置成0。

Clock selection 
~~~~~~~~~~~~~~~
    既然GstPipeline的所有子元素都共用同一个时钟,GstPipeline就必须选择一个时钟,时钟选择发生在GstPipeline进入PLAYING状态时。
    默认的时钟选择算法如下:
    1)如果应用程序指定了一个时钟,则使用该时钟。
    2)使用最上游元素提供的时钟,这个选择从sink元素开始,然后往上游迭代。
    * since this selection procedure happens in the PAUSED -> PLAYING state change, all the sinks are prerolled and we can thus be surethat each sink is linked to some upstream element.
    * in the case of a live pipeline (NO_PREROLL), the sink will not yet be prerolled and the selection process will select the clock of a more upstream element.
    3)如果没有元素提供时钟,选择GstSystemClock。
    应用采用gst_pipeline_use_clock和gst_pipeline_auto_clock来决定时钟选择。
    gst_pipeline_use_clock强迫采用指定的时钟,如果为设置为NULL,将会禁止时钟,GstPipeline将会尽可能快的运行。
    gst_pipeline_auto_clock采用上述算法选择时钟。

GstBus
~~~~~~
    GstPipeline提供一个GstBus给应用程序,调用gst_pipeline_get_bus获得GstBus,通过GstBus检索元素投递的消息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值