[gst-devel] debugging caps

Michael Joachimiak mjoachimiak at gmail.com
Thu May 27 19:12:29 CEST 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100527/cd5938fd/attachment.htm>


More information about the gstreamer-devel mailing list