Just when I thought it couldn't get much simpler!!
-----Original Message-----
From: Emmanuele Bassi [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 30, 2008 10:37 AM
To: [email protected]
Subject: Re: [clutter] Simple python gst player using playbin
On Wed, 2008-01-30 at 10:25 -0500, Kashyap Ashwin wrote:
> Hello all,
>
> Here is some sample code to play any type of file supported by
> gstreamer's playbin. I think it is a good substitute for
> pyclutter/examples/videosink.py.
videosink.py allows you to show how to use the VideoSink object, not the
VideoTexture class; an example can be added, but the code is trivial -
even more than the attached example:
> self.video_texture = cluttergst.VideoTexture()
>
> self.pipeline = gst.Pipeline("mypipe")
>
> self.playbin = self.video_texture.get_playbin()
>
>
>
> # Setup uri and sinks
>
> self.set_location(vfile)
>
> self.pipeline.add(self.playbin)
you don't need this, if you just want to play videos onto a
VideoTexture.
> # play it
>
> self.pipeline.set_state(gst.STATE_PLAYING)
and certainly you don't need this...
>
> def set_location(self, location):
>
> if not gst.uri_is_valid(location):
>
> location = "file://" + location
>
>
>
> self.playbin.set_property('uri', location)
... and this.
to use VideoTexture you should just use the clutter.Media interface API,
like:
self.video_texture.set_uri(uri)
self.video_texture.set_playing(True)
which the VideoTexture implements.
ciao,
Emmanuele.
--
Emmanuele Bassi, OpenedHand Ltd.
Unit R, Homesdale Business Centre
216-218 Homesdale Rd., Bromley - BR12QZ
http://www.o-hand.com
--
To unsubscribe send a mail to [EMAIL PROTECTED]
--
To unsubscribe send a mail to [EMAIL PROTECTED]