您的位置:首页 > 编程语言 > PHP开发

Gstreamer GstPipeline管道

2011-07-18 17:29 211 查看
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检索元素投递的消息。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: