bus call without g_main_loop

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

bus call without g_main_loop

BGraaf

Hi @ all,

 

One short question: Is it possible to get the messages from the bus without using the gstreamer loop (for example using the gtk+ loop)?

 

Thanks a lot for helping!

Bernhard


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: bus call without g_main_loop

Ha-P.
Hi,

I do it this way:
    GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipe));
    gst_bus_add_watch(bus, (GstBusFunc)bus_callback, m_pipe);
    gst_object_unref(GST_OBJECT(bus));

void bus_callback(GstBus *bus, GstMessage *msg, gpointer data)
{
// handle messages here
}

Regards,



On 21.03.2012 11:04, Bernhard Graaf wrote:

Hi @ all,

 

One short question: Is it possible to get the messages from the bus without using the gstreamer loop (for example using the gtk+ loop)?

 

Thanks a lot for helping!

Bernhard



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


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

AW: bus call without g_main_loop

BGraaf

Hi Peter,

 

thank you for answer. That’s the same way I do, but you will only call this function in a loop (like g_main_loop). Without a loop, this function will never be called.

But I want to call this function without the gstreamer loop, but I don’t know how I get the signal implemented in a gtk-loop.

 

BR

Bernhard

 


Von: gstreamer-devel-bounces+bernhard.graaf=[hidden email] [mailto:gstreamer-devel-bounces+bernhard.graaf=[hidden email]] Im Auftrag von Peter Staab
Gesendet: Mittwoch, 21. März 2012 11:43
An: Discussion of the development of and with GStreamer
Betreff: Re: bus call without g_main_loop

 

Hi,

I do it this way:
    GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipe));
    gst_bus_add_watch(bus, (GstBusFunc)bus_callback, m_pipe);
    gst_object_unref(GST_OBJECT(bus));

void bus_callback(GstBus *bus, GstMessage *msg, gpointer data)
{
// handle messages here
}

Regards,



On 21.03.2012 11:04, Bernhard Graaf wrote:

Hi @ all,

 

One short question: Is it possible to get the messages from the bus without using the gstreamer loop (for example using the gtk+ loop)?

 

Thanks a lot for helping!

Bernhard




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

 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: AW: bus call without g_main_loop

Tim-Philipp Müller-2
On Wed, 2012-03-21 at 12:00 +0100, Bernhard Graaf wrote:

Hi Bernhard,

> thank you for answer. That’s the same way I do, but you will only call
> this function in a loop (like g_main_loop). Without a loop, this
> function will never be called.
>
> But I want to call this function without the gstreamer loop, but I
> don’t know how I get the signal implemented in a gtk-loop.

The "Gtk Loop" is exactly the same as "the gstreamer loop", it's just a
g_main_loop_run() for the default main context.

You can also get at the messages without a main loop using
gst_bus_*pop*(), but if you are using a Gtk+ main loop, you may just as
well do what Peter suggested.

If you want to use bus *signals* (rather than the bus watch function)
you need to use gst_bus_add_signal_watch() instead.

Cheers
 -Tim


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

AW: AW: bus call without g_main_loop

BGraaf
Hi Tim,

many thanks for your answer. I think that works and I will try to fix my
problem on weekend.

BR
Bernhard

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel-bounces+bernhard.graaf=[hidden email]
[mailto:gstreamer-devel-bounces+bernhard.graaf=[hidden email]]
Im Auftrag von Tim-Philipp Müller
Gesendet: Mittwoch, 21. März 2012 12:11
An: [hidden email]
Betreff: Re: AW: bus call without g_main_loop

On Wed, 2012-03-21 at 12:00 +0100, Bernhard Graaf wrote:

Hi Bernhard,

> thank you for answer. That’s the same way I do, but you will only call
> this function in a loop (like g_main_loop). Without a loop, this
> function will never be called.
>
> But I want to call this function without the gstreamer loop, but I
> don’t know how I get the signal implemented in a gtk-loop.

The "Gtk Loop" is exactly the same as "the gstreamer loop", it's just a
g_main_loop_run() for the default main context.

You can also get at the messages without a main loop using
gst_bus_*pop*(), but if you are using a Gtk+ main loop, you may just as
well do what Peter suggested.

If you want to use bus *signals* (rather than the bus watch function)
you need to use gst_bus_add_signal_watch() instead.

Cheers
 -Tim


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

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