[gst-devel] debugging caps

Michael Joachimiak mjoachimiak at gmail.com
Fri May 28 11:42:12 CEST 2010


Thank you Martin.
This works perfectly.

2010/5/27 Martin Bisson <martin.bisson at gmail.com>

> I use GST_DEBUG( "The caps I want to output : %" GST_PTR_FORMAT, caps);
>
> I got this from the documentation of gst_caps_to_string (
> http://www.gstreamer.net/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#gst-caps-to-string)
> that recommends using that.  It's shorter than having to free the memory
> allocated by gst_caps_to_string.
>
> Martin
>
>
> On Thu, May 27, 2010 at 5:12 PM, Michael Joachimiak <mjoachimiak at gmail.com
> > wrote:
>
>> I read that GST_DEBUG_CAPS is deprecated - and it does not work.
>> Is there any other way for debugging CAPS?
>>
>> 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
>>
>> .................................................................................................
>> void print_caps(Myfilter *filter)
>> {
>>  int width=0,height=0;
>>     guint32 fourcc;
>>     if (GST_IS_CAPS(GST_PAD_CAPS(filter->sinkpad_video)))
>>     {
>>     GstStructure *sinkcaps = gst_caps_get_structure
>> (GST_PAD_CAPS(filter->sinkpad_video), 0);
>>     gst_structure_get_int (sinkcaps, "width", &width);
>>     gst_structure_get_int (sinkcaps, "height", &height);
>>     gst_structure_get_fourcc (sinkcaps, "format", &fourcc);
>>            switch (fourcc) {
>>            case GST_MAKE_FOURCC ('I', '4', '2', '0'): GST_INFO("SINK CAPS:
>> width %d, height: %d format: I420\n",width,height);
>>                break;
>>              case GST_MAKE_FOURCC ('I', 'Y', 'U', '1'):   GST_INFO("SINK
>> CAPS: width %d, height: %d format: IYU1\n",width,height);
>>                break;
>>            default:
>>                 GST_INFO("SINK CAPS: Incompatible format");
>>              }
>>     }
>>     else
>>         GST_WARNING("No caps on sink\n");
>>     if (GST_IS_CAPS(GST_PAD_CAPS(filter->srcpad)))
>>     {
>>     GstStructure *srccaps = gst_caps_get_structure
>> (GST_PAD_CAPS(filter->srcpad), 0);
>>     gst_structure_get_int (srccaps, "width", &width);
>>     gst_structure_get_int (srccaps, "height", &height);
>>     gst_structure_get_fourcc (srccaps, "format", &fourcc);
>>            switch (fourcc) {
>>            case GST_MAKE_FOURCC ('I', '4', '2', '0'): GST_INFO(" SRC CAPS:
>> width %d, height: %d format: I420\n",width,height);
>>                break;
>>              case GST_MAKE_FOURCC ('I', 'Y', 'U', '1'):   GST_INFO("SRC
>> CAPS: width %d, height: %d format: IYU1\n",width,height);
>>                break;
>>            default:
>>                 GST_INFO("SRC CAPS: Not compatible format");
>>              }
>>     }
>>     else
>>         GST_WARNING("No caps on source\n");
>> }
>> ....................................
>>
>> --
>> Your Sincerely
>> Michael Joachimiak
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>


-- 
Your Sincerely
Michael Joachimiak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100528/bb6d901c/attachment.htm>


More information about the gstreamer-devel mailing list