Height and width for displayed video

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Height and width for displayed video

vaisaari
Hi all,

I'm new in GStreamer programming and I'm stuck in the following problem. If I have arbitrary pipeline that decodes video and eventually displays it on screen, like filesource -> decodebin -> filter1 -> filter2 -> ... -> xvimagesink. How can I get height and width of the resulting video?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Height and width for displayed video

Sandeep Prakash
Hi,

vaisaari wrote
 How can I get height and width of the resulting video?
You can get the height, width, framerate, etc,. from the caps. Caps will be present either as part of
a Pad or as part of the buffer or both.
You can get caps from pad using gst_pad_get_caps, and you can get caps from buffer using gst_buffer_get_caps function. Once you have the caps use the gst_caps_get_structure to access
the individual fields. You have to gst_structure_get_<type> series of functions to fetch each individual.
E.G.: For integer fields use gst_struture_get_int function.

Regards,
Sandeep Prakash
http://sandeepprakash.homeip.net