I use GST_DEBUG( &quot;The caps I want to output : %&quot; 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&#39;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">&lt;<a href="mailto:mjoachimiak@gmail.com">mjoachimiak@gmail.com</a>&gt;</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-&gt;sinkpad_video)))<br>



    {<br>    GstStructure *sinkcaps = gst_caps_get_structure (GST_PAD_CAPS(filter-&gt;sinkpad_video), 0);<br>    gst_structure_get_int (sinkcaps, &quot;width&quot;, &amp;width);<br>    gst_structure_get_int (sinkcaps, &quot;height&quot;, &amp;height);<br>



    gst_structure_get_fourcc (sinkcaps, &quot;format&quot;, &amp;fourcc);<br>           switch (fourcc) {<br>           case GST_MAKE_FOURCC (&#39;I&#39;, &#39;4&#39;, &#39;2&#39;, &#39;0&#39;): GST_INFO(&quot;SINK CAPS: width %d, height: %d format: I420\n&quot;,width,height);<br>



               break;<br>             case GST_MAKE_FOURCC (&#39;I&#39;, &#39;Y&#39;, &#39;U&#39;, &#39;1&#39;):   GST_INFO(&quot;SINK CAPS: width %d, height: %d format: IYU1\n&quot;,width,height);<br>               break;<br>



           default:<br>                GST_INFO(&quot;SINK CAPS: Incompatible format&quot;);<br>             }<br>    }<br>    else<br>        GST_WARNING(&quot;No caps on sink\n&quot;);<br>    if (GST_IS_CAPS(GST_PAD_CAPS(filter-&gt;srcpad)))<br>



    {<br>    GstStructure *srccaps = gst_caps_get_structure (GST_PAD_CAPS(filter-&gt;srcpad), 0);<br>    gst_structure_get_int (srccaps, &quot;width&quot;, &amp;width);<br>    gst_structure_get_int (srccaps, &quot;height&quot;, &amp;height);<br>



    gst_structure_get_fourcc (srccaps, &quot;format&quot;, &amp;fourcc);<br>           switch (fourcc) {<br>           case GST_MAKE_FOURCC (&#39;I&#39;, &#39;4&#39;, &#39;2&#39;, &#39;0&#39;): GST_INFO(&quot; SRC CAPS: width %d, height: %d format: I420\n&quot;,width,height);<br>



               break;<br>             case GST_MAKE_FOURCC (&#39;I&#39;, &#39;Y&#39;, &#39;U&#39;, &#39;1&#39;):   GST_INFO(&quot;SRC CAPS: width %d, height: %d format: IYU1\n&quot;,width,height);<br>               break;<br>



           default:<br>                GST_INFO(&quot;SRC CAPS: Not compatible format&quot;);<br>             }<br>    }<br>    else<br>        GST_WARNING(&quot;No caps on source\n&quot;);<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>