Gstreamer pad activation mechanism

Source: Internet
Author: User
Tags gstreamer
Padactivation mechanism of gstreamer(translated by part-activation.txt)

Activate
When the status changes, pipeline sets the status of its elements in the order of sink-> source. When elements change from ready-> paused state, their pads are activated to prepare for processing data streams, and some pads start to drive data streams.
An element activates its pad in the order of source pad-> sink pad, which ensures that when the sink pad is activated and is preparing to receive data, the source pad is ready to transmit data streams to the downstream.
Pad can be activated in two modes: push and pull. Push is the default mode. Souce pad transfers data by calling the stst_pad_push of the sink pad. In PULL mode, sink pad requests data by calling the stst_pad_pull_range of the source pad.
To activate the pad, the core will call the maid (true) to activate the pad. If pad has been activated, in push or pull mode, stst_pad_set_active will directly return and will not process anything; otherwise, the pad activation handler will be called.
Because the core does not know which mode (push or pull) is used to activate the pad, the core entrusts the activation function activate () of the pad to complete this function. The activate () function of pad works in push or pull mode. By default, the activate () function calls activate_push () to activate it because it is the default data stream transmission method. If the sink PAD calls check_get_range () and returns true, activate_pull () is called to activate the sink pad; otherwise, activate_push () is called to activate the pad.
For example, pipe: fakesrc! Fakesink and fakesink work in the PULL mode. The status change of the pipeline starts with the fakesink element at the most downstream, and the core activates the sink pad of the fakesink element. Because fakesink works in the PULL mode, it implements a custom activate () function and calls activate_pull () to activate the sink pad. Activate_pull () is responsible for starting the task of retrieving data from the SRC pad of fakesrc. Obviously, fakesrc needs to be notified that it will retrieve data from its SRC pad even if the pipeline has not changed the fakesrc status. For this reason, activate_pull () must call the activate_pull () function of the SRC pad of fakesrc before starting the data pulling task.
In short, after the activate_pull () function of their source pad is called, the upstream elements working in the PULL mode are ready to generate data in the ready state; that is, activate_pull () the effect of the function will be transmitted to the position () to reach every pad.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.