PySide and PyGST on Microsoft Windows

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PySide and PyGST on Microsoft Windows

Josh Doe
I had some difficulty getting PySide (Qt bindings) and PyGST working together on Microsoft Windows, so I thought I'd share my working example. I've attached the code, as well as made a github:gist (https://gist.github.com/1120231). Most of this is based on examples and tutorials I found, but I just brought it all together. For example, it took me a bit to realize that with PySide, QWidget.winId() returns a PyCObject, unlike PyQt which returns a void pointer, requiring the use of pythonapi.PyCObject_AsVoidPtr.

If you see any problems with this code, please let me know and I'll update the gist.

Thanks,
-Josh

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

pyside_pygst_on_windows.py (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PySide and PyGST on Microsoft Windows

jech
Hi Josh,

I'd like to respond to your post regarding getting PySide and PyGST on Windows to work.

I checked your sample and except of some warnings it works fine. I'm working on a music player with QML user interface. I tried MPlayer and Phonon as backends for my player but both of them have some major problems. So I would like to use GStreamer because it seems to be the best backend available.

But I have problem to create an audio player. I've never used GStreamer before and I'm a little lost.

I found it is possible to do something like this:
self.player = gst.element_factory_make("playbin2", "player")
fakesink = gst.element_factory_make("fakesink", "fakesink")
self.player.set_property("video-sink", fakesink)
self.player.set_property("uri", "file:/c:\\Python27\\_tests\\Friends.ogg") # I had to put only 1 slash after file:
self.player.set_state(gst.STATE_PLAYING)

But what about the next file in my playlist? I need to get the "about to finish" signal and add a new track to list before the actual track ends. But I don't know how to do it. Could you advice me, please?