[gst-devel] could not set property "caps" in element "udpsrc0"

Michael Smith msmith at xiph.org
Fri Mar 19 23:12:51 CET 2010


On Fri, Mar 19, 2010 at 2:50 PM, Durgesh Mishra
<durgesh.mishra at gmail.com> wrote:
> Thanks Aurelien. I made it out after some time.
>
> Actually I am writing an application that uses udpsrc.
>
> This is the piece of code that is giving problem while setting CAPS.
>
> #define ALAW_CAPS "\"application/x-rtp, media = (string)\"audio\",
> clock-rate = (int) 8000, encoding-name = (string)\"PCMA\"\""
>
> mUdpSrc = gst_element_factory_make("udpsrc",NULL);
> g_object_set (mUdpSrc, "caps", ALAW_CAPS, NULL);
>
> But in the last statement, it gives segmentation fault.

You need to pass a GstCaps * as the argument here, not a string. You
can use gst_caps_from_string() to convert. Remember to unref if when
you're done.

Mike




More information about the gstreamer-devel mailing list