Gstreamer bus and message

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

Gstreamer bus and message

Mailing List SVR
Hi all,


I'm trying to build a gstreamer application all is fine until I try to get a message from the bus. I tested the sample python webcam viewer (http://pygstdocs.berlios.de/pygst-tutorial/webcam-viewer.html) and all is fine: when I start the viewer messages are sent to the bus and if I disconnect the camera an error message is sent to the bus, good,


so I added the following code to my own application (twisted based), this is a cut and paste from the webcam viewer app:


bus = self.pipeline.get_bus()
bus.add_signal_watch()
bus.connect("message",self.on_message)


and:


def on_message(self,bus,message):
print 'new message'
t=message.type
print t
print type(t)


this time i can start and see the video but no message go to the bus neither when I start to see the video or disconnect the camera and no errors are given, maybe the gstreamer bus rely on gtk? Can I use the bus inside twisted?


What I missed?


thanks
Nicola


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer bus and message

Mailing List SVR
In data venerdì 29 maggio 2009 11:11:21, MailingList SVR ha scritto:
: > Hi all,
>
> I'm trying to build a gstreamer application all is fine until I try to get a message from the bus. I tested the sample python webcam viewer (http://pygstdocs.berlios.de/pygst-tutorial/webcam-viewer.html) and all is fine: when I start the viewer messages are sent to the bus and if I disconnect the camera an error message is sent to the bus, good,
>
> so I added the following code to my own application (twisted based), this is a cut and paste from the webcam viewer app:
>
> bus = self.pipeline.get_bus()
> bus.add_signal_watch()
> bus.connect("message",self.on_message)
>
> and:
>
> def on_message(self,bus,message):
> print 'new message'
> t=message.type
> print t
> print type(t)
>
> this time i can start and see the video but no message go to the bus neither when I start to see the video or disconnect the camera and no errors are given, maybe the gstreamer bus rely on gtk? Can I use the bus inside twisted?
>
> What I missed?
>
> thanks
> Nicola
>


Ok the problem seems solved, I have to start my gstreamer pipeline as gobject loop and from my twisted frontend I have to start the loop as a separate thread .... nothing simpler? Is this the only way?


Nicola


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer bus and message

gbarchiesi
No, the gobject MainLoop() is the only mode (i think) for activating messages and dynamic connections between pads. If you want to control the loop you can use this pattern:

self.pipeline.set_state(gst.STATE_PLAYING)
...        
loop = gobject.MainLoop()
gobject.threads_init()
context = loop.get_context()
while self._stop == True:
    # do what you want...
    context.iteration(True)