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



On Sun, 2008-09-14 at 14:04 -0300, 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().
> 
> 
> 

Replying to myself to append some information to this request, I made it
work by using the g_object_set c interface the following code seam to
work, even though it give me a weird warning : 

Glib::RefPtr<Gst::Element> source = Gst::ElementFactory::create("multifilesrc", "source");

source->set_property("location", std::string("../testes/chess/IMG_%4d.JPG"));
source->set_property("index", 3425);
source->set_property("num-buffers", 36);

Glib::RefPtr<Gst::Caps> caps = Gst::Caps::from_string("image/jpeg,framerate=2/1");
g_object_set(source->gobj(), "caps", caps->gobj());





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