I use GST_DEBUG( "The caps I want to output : %" GST_PTR_FORMAT, caps);<br><br>I got this from the documentation of gst_caps_to_string (<a href="http://www.gstreamer.net/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#gst-caps-to-string">http://www.gstreamer.net/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#gst-caps-to-string</a>) that recommends using that. It's shorter than having to free the memory allocated by gst_caps_to_string.<br>
<br>Martin<br><br><br><div class="gmail_quote">On Thu, May 27, 2010 at 5:12 PM, Michael Joachimiak <span dir="ltr"><<a href="mailto:mjoachimiak@gmail.com">mjoachimiak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I read that GST_DEBUG_CAPS is deprecated - and it does not work.<br>Is there any other way for debugging CAPS?<br><br>I wrote some function for this purpose but what if have caps with other formats? It would be nice to have smth like GST_DEBUG_CAPS<br>
.................................................................................................<br>void print_caps(Myfilter *filter)<br>{<br> int width=0,height=0;<br> guint32 fourcc;<br> if (GST_IS_CAPS(GST_PAD_CAPS(filter->sinkpad_video)))<br>
{<br> GstStructure *sinkcaps = gst_caps_get_structure (GST_PAD_CAPS(filter->sinkpad_video), 0);<br> gst_structure_get_int (sinkcaps, "width", &width);<br> gst_structure_get_int (sinkcaps, "height", &height);<br>
gst_structure_get_fourcc (sinkcaps, "format", &fourcc);<br> switch (fourcc) {<br> case GST_MAKE_FOURCC ('I', '4', '2', '0'): GST_INFO("SINK CAPS: width %d, height: %d format: I420\n",width,height);<br>
break;<br> case GST_MAKE_FOURCC ('I', 'Y', 'U', '1'): GST_INFO("SINK CAPS: width %d, height: %d format: IYU1\n",width,height);<br> break;<br>
default:<br> GST_INFO("SINK CAPS: Incompatible format");<br> }<br> }<br> else<br> GST_WARNING("No caps on sink\n");<br> if (GST_IS_CAPS(GST_PAD_CAPS(filter->srcpad)))<br>
{<br> GstStructure *srccaps = gst_caps_get_structure (GST_PAD_CAPS(filter->srcpad), 0);<br> gst_structure_get_int (srccaps, "width", &width);<br> gst_structure_get_int (srccaps, "height", &height);<br>
gst_structure_get_fourcc (srccaps, "format", &fourcc);<br> switch (fourcc) {<br> case GST_MAKE_FOURCC ('I', '4', '2', '0'): GST_INFO(" SRC CAPS: width %d, height: %d format: I420\n",width,height);<br>
break;<br> case GST_MAKE_FOURCC ('I', 'Y', 'U', '1'): GST_INFO("SRC CAPS: width %d, height: %d format: IYU1\n",width,height);<br> break;<br>
default:<br> GST_INFO("SRC CAPS: Not compatible format");<br> }<br> }<br> else<br> GST_WARNING("No caps on source\n");<br>}<br>....................................<br clear="all">
<span></span><br>-- <br>Your Sincerely<br><font color="#888888">Michael Joachimiak<br>
</font><br>------------------------------------------------------------------------------<br>
<br>
<br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br>