<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 01/29/2015 11:53 AM, Ben Bridgwater
wrote:<br>
</div>
<blockquote
cite="mid:CABH16+nYhqNRAXpMC1BUQBhbPSOwib-9Ov8E_JRV=-4CL2J-bQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hi,</div>
<div>I'm new to gstreamer development - converting an existing
application (interactive spectrogram) from using my own
pipeline to use gstreamer instead.</div>
<div><br>
</div>
<div>I gather that in gstreamer 0.1 the caps of a pad sourcing a
buffer were also recorded in the buffer itself, but since 1.0
that is no longer the case, and it's up to elements to tracks
caps via caps events instead...</div>
<div><br>
</div>
<div>My question is what are the options and best practices with
gstreamer 1.x for tracking buffer caps in the case where caps
are changing rapidly and buffers may be processed out of
order? In my case this requirement comes fromĀ a downstream
display buffer where paint events may request arbitrary parts
of the display to be updated - corresponding to arbitrary
sequences of buffers needing to be processed, and the need to
know what the caps (data format) are for each buffer.</div>
</div>
</blockquote>
<br>
The GstCaps are not stored on buffers anymore, they are only present
on GstPads. Instead of calling gst_pad_set_caps or pushing a buffer
with a caps set, now elements should push a caps event before the
buffers and all buffers following a caps event should have the caps
of that event. You can use GstPad's API to get the current
negotiated caps on a pad and all buffers flowing on that pad should
have that caps until a new event arrives. Check
<a class="moz-txt-link-freetext" href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#gst-pad-get-current-caps">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#gst-pad-get-current-caps</a><br>
<br>
So, to keep track of buffers and caps, you need to look for the caps
event. For example, suppose you receive the following events and
buffers:<br>
<br>
CAPS_1 BUF_A BUF_B BUF_C CAPS_2 BUF_D BUF_E<br>
<br>
Buffers A B and C will be on format defined by CAPS_1, while buffers
D and E will be on format CAPS_2.<br>
<br>
I hope it makes it clear. If for some reason you need to store
buffer + caps together you can use the GstSample :
<a class="moz-txt-link-freetext" href="https://developer.gnome.org/gstreamer/stable/gstreamer-GstSample.html">https://developer.gnome.org/gstreamer/stable/gstreamer-GstSample.html</a><br>
<br>
<blockquote
cite="mid:CABH16+nYhqNRAXpMC1BUQBhbPSOwib-9Ov8E_JRV=-4CL2J-bQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Thanks for any pointers and advice!</div>
<div><br>
</div>
<div>Ben</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Thiago Sousa Santos
Senior Multimedia Engineer, Open Source Group
Samsung Research America - Silicon Valley</pre>
</body>
</html>