Overview of concepts that are easy to confuse with gstreamer

Source: Internet
Author: User
Q: What is the difference between bus message and event? What is the difference with signal?
A:
Bus message is used for interaction between gstreamer and application, such as EOS. If it is a bus message, gstreamer tells app -- end of stream. The event is used inside gstreamer. For example, if SRC element sends an EOS event and the event is passed along the pipeline to downstream elements, these elements can be notified and cleanup is implemented, then pass the event. This should be the difference between bus message and event.
For the EOS, refer to the description of the stst_event_new_eos function. It is clear that the element generates the EOS and then goes along the way until the last sink element, if all the sink elements in pipeline issue EOS, gstreamer automatically generates an EOS stststmessage, which can be captured by the app. Therefore, the ststmessage is used for communication between the app and gstreamer, and the event is used internally.
The following describes the functions of gst_event_new_eos:

========================================================== ==============
Create a new EOS event. the EOS event can only travel downstream synchronized with the buffer flow. elements that receive the EOS event on a pad can return maid after the EOS event arrives.
The EOS event will travel down to the sink elements in the pipeline which will then post the ststst_message_eos on the bus after they have finished playing any buffered data.
When all sinks have posted an EOS message, an EOS message is forwarded to the application.
========================================================== ==============

Signal and message/event are different. Signal actually comes from the gobject system and is used for interaction between application and gobject. In gstreamer, the element itself is also a gobject. Therefore, through signal, you can associate the app with the element. When something happens in the element to let the app know, you can use signal to notify the app-for example, creating a pad dynamically. Unlike the bus message, the bus message is on the pipeline, which is generally a method for the interaction between the app and the pipeline. Signal is specific to each element.

Q: What are the differences between property, Dynamic Controllable property, and interface?
A:
Property comes from gobject, which is the property of the object. It is defined using the _ install_property function. Each property can correspond to the get/set method. Dynamic Controllable property is a kind of thing that can be modified dynamically in Stream-time, which is introduced by gstreamer, this is useful when interacting with GUI. We can define how long it will automatically assign to a property, so it is called Dynamic Controllable property. For details, refer to the content of appdev manual chapater 15. The interface is also from gobject, similar to Java interfaces, gobject does not support multiple inheritance. Therefore, like Java, an interface is integrated to indirectly implement multiple inheritance. The interface definition is similar to a gobject, but you only need to define the class structure instead of the Instance structure (because the interface cannot be instantiated ), define the functions to be implemented in the interface (after glib 2.14, the interface can define the property. Of course, you also need to implement the gobject of the interface to implement the property ), then, generate a gobject as usual. If the gobject requires an interface of implement, call g_type_add_interface_static to implement an interface after g_type_add_interface_static is registered. G_type_add_interface_static provides a ginterfaceinfo structure. To specify the init function of the interface, we can replace the function pointer defined in the interface with the function pointer in our gobject, this is equivalent to implementing the method in this interface.

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.