Re: Gst::Caps and the "caps" property.



Victor Bogado da Silva Lins wrote:
How can I set the "caps" property of an element? I'm tried the following ways but until now I had no luck.

Glib::RefPtr<Gst::Element> source =  Gst::ElementFactory::create("multifilesrc", "source");
Glib::RefPtr<Gst::Caps> caps = Gst::Caps::from_string("image/jpeg,framerate=2/1");

source->set_property("caps", caps); // This gives me a compilation error.

source->set_property("caps", caps->gobj()); // This gives me a runtime warning and the pipeline does not work.
//(teste:20546): GLib-GObject-WARNING **: unable to set property `caps' of type `GstCaps' from value of type `glibmm__CustomPointer_P8_GstCaps'

I also tried to create a c caps object using the gstreamer C syntax instead of a C++ object, but this gave a similar problem that the caps->gobj().


Gst::Element does not directly have a caps property. Instead, use the pads of the element to set the caps property that way.

--
José Alburquerque



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]