[Vala] [Gst] Adding capabilities to the Elements



Hello, I'm trying to accomplish this with Vala:

gst-launch -v gnomevfssrc
location="http://admin:12345 192 168 1 100/nphMotionJpeg?Resolution=320x240&Quality=Standard&Framerate=1"
do-timestamp=true ! multipartdemux !
image/jpeg,width=320,height=240,framerate=1/1 ! jpegdec !
video/x-raw-yuv,framerate=1/1 ! xvimagesink

(it is displayed correctly using gst-launch)

So far I have: (using the gst-videotest.vala example at:
http://live.gnome.org/Vala/GStreamerSample)

    private void setup_gst_pipeline () {
        this.pipeline = new Pipeline ("mypipeline");
        this.src = ElementFactory.make ("gnomevfssrc", "video");
        this.src.set_property("location","http://admin:12345 192 168 1 
100/nphMotionJpeg?Resolution=320x240&Quality=Standard&Framerate=1");
        this.src.set_property("do-timestamp",true);
        this.filter1 = ElementFactory.make ("multipartdemux","demuxer");
        this.filter2 = ElementFactory.make ("jpegdec","jpg");
        this.sink = ElementFactory.make ("xvimagesink", "sink");

        //These lines should be wrong:
        this.filter2.set_property("caps",Caps.from_string("image/jpeg,width=320,height=240,framerate=1/1"));
        this.sink.set_property("caps",Caps.from_string("video/x-raw-yuv,framerate=1/1"));

        this.pipeline.add_many (this.src, this.filter1, this.filter2,
this.sink);
        this.src.link (this.filter1);
        this.filter1.link (this.filter2);
        this.filter2.link (this.sink);
    }

I'm also using the following link as reference (in pyGst), that is
where the << set_property("caps") >> idea came from:
http://pygstdocs.berlios.de/pygst-tutorial/capabilities.html  (example 6.1)

However, when I compile it shows me this error:
gst-videotest.vala.c:(.text+0x77d): undefined reference to
`gst_value_take_caps'

Which tells me that is not the correct way to set the Capabilities in Vala.
I have read the valadocs
(http://www.valadoc.org/gstreamer-0.10/index.htm), but I can't
understand how it works.
Neither the Gst examples at the gnome.org website shows how to add
those capabilities.

Anyone knows how to achieve that?

Thanks!

A. Lepe



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