Search code examples
cgstreamer

Explanation of Gstreamer graph


I am trying to understand the word "ANY" in the gstreamer graph that I have gotten. Try searching everywhere but could not have a proper definition. Is there anyone who knows the definition?

enter image description here

Regards


Solution

  • Any is a wild card used when the plugins are assembled to create a pipeline before the media type is negotiated between a source and a sink using QUERY_CAPS, QUERY_ACCEPT_CAPS and EVENT_CAPS. It has a different meaning for source and sink pads:

    Source Pads use ANY to let the downstream pad they do not know yet the type of the data they will produce, and that the exact type will be declared during the pipeline state, where Sink Pads use ANY to indicate they can accept data of any type.


    Here's an example:

    Videorate is a plugin that changes the frame rate by removing or repeating some video frames during the playback. Since it doesn't manipulate the content of the frame buffer, it can change the rate of any raw video stream (RGB, YUV, YUYV ...etc). It can also turn a png image into a 30 fps video stream by repeating the same image again and again. One of the CAPS for its sink pad is video/x-raw(ANY) to indicate that it will accept any type of raw video.

    The CAPS for its source pad is video/x-raw(ANY),video/x-bayer(ANY),image/jpeg(ANY),image/png(ANY) to indicate it will produce either a raw video frame, a bayer frame, a png frame, or a jpeg frame and that the exact CAPS or subset of CAPS or list of CAPS will be known during CAPS negotiation.