Segmentation Fault

Ian Davidson id012c3076 at blueyonder.co.uk
Sat Jan 5 07:26:34 PST 2013


Thanks Tim and Kris,

I assumed that Tim meant "gst_caps_from_string" rather than 
"gst_caps_new_from_string".  Now to see if the rest of my application 
links together OK.

Ian

On 05/01/2013 13:55, Tim-Philipp Müller wrote:
> On Sat, 2013-01-05 at 09:12 +0000, Ian Davidson wrote:
>
> Hi Ian,
>
>> I am trying to write a GStreamer app where I  use a caps filter.  I have
>>
>>     vcapsfilter  = gst_element_factory_make ("capsfilter", "vid-caps");
>>
>> which appears to have been successful.
>>
>> Then I tried
>>
>>     g_object_set (G_OBJECT (vcapsfilter), "caps",
>> "video/x-raw,format=(string)I420,width=320,height=240,framerate=(fraction)25/1",
>> NULL);
>>
>> When my program comes to execute that line I get a "Segmentation fault
>> (core dumped)" message.  I suspect that I must be doing something wrong
>> <grin>, but I don't know what I should be doing.  I have tried to wind
>> up the debug level to 9 but absolutely nothing gets logged.
> The reason is that the "caps" property takes a GstCaps object/structure,
> not a string. g_object_set() is a vararg function, so this kind of
> mistake can not always be detected before crashing.
>
> gst-launch-1.0/gst_parse_launch() converts things automagically from
> string into the right type.
>
> You have two options:
>
> a)
>
>    GstCaps *caps;
>
>    caps = gst_caps_new_from_string ("video/x-raw,....");
>    g_object_set (foo, "caps", caps, NULL);
>    gst_caps_unref (caps);
>
> b)
>
>    gst_util_set_object_arg (foo, "caps", "video/x-raw,...");
>
> Cheers
>   -Tim
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>

-- 
--
Ian Davidson
--
Facts used in this message may or may not reflect an underlying 
objective reality. Facts are supplied for personal use only.
Recipients quoting supplied information do so at their own risk. Facts 
supplied may vary in whole or part from widely accepted standards.
While painstakingly researched, facts may or may not be indicative of 
actually occurring events or natural phenomena.
The author accepts no responsibility for personal loss or injury 
resulting from memorisation and subsequent use.


More information about the gstreamer-devel mailing list