[longomatch] Replace gst_bus_poll with gst_bus_timed_pop_filtered



commit c03b615041ea8cf9e567aa688abfebce62a9d7f4
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Jan 7 12:19:51 2015 +0100

    Replace gst_bus_poll with gst_bus_timed_pop_filtered
    
    gst_bus_poll run a main loop and callbacks attached to the default
    context might be fired in this thread, like GUI events.

 libcesarplayer/gstscreenshot.c    |    2 +-
 libcesarplayer/lgm-video-player.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libcesarplayer/gstscreenshot.c b/libcesarplayer/gstscreenshot.c
index 03f67a8..94bb3e7 100644
--- a/libcesarplayer/gstscreenshot.c
+++ b/libcesarplayer/gstscreenshot.c
@@ -156,7 +156,7 @@ bvw_frame_conv_convert (GstBuffer * buf, GstCaps * to_caps)
 
   bus = gst_element_get_bus (pipeline);
   msg =
-      gst_bus_poll (bus, GST_MESSAGE_ERROR | GST_MESSAGE_EOS, 25 * GST_SECOND);
+      gst_bus_timed_pop_filtered (bus, 25 * GST_SECOND, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
 
   if (msg) {
     switch (GST_MESSAGE_TYPE (msg)) {
diff --git a/libcesarplayer/lgm-video-player.c b/libcesarplayer/lgm-video-player.c
index 526214a..87790d7 100644
--- a/libcesarplayer/lgm-video-player.c
+++ b/libcesarplayer/lgm-video-player.c
@@ -394,7 +394,7 @@ poll_for_state_change_full (LgmVideoPlayer * lvp, GstElement * element,
     GstMessage *message;
     GstElement *src;
 
-    message = gst_bus_poll (bus, events, timeout);
+    message = gst_bus_timed_pop_filtered (bus, timeout, events);
 
     if (!message)
       goto timed_out;
@@ -663,7 +663,7 @@ lgm_stop_play_pipeline (LgmVideoPlayer * lvp)
      * cleaned up properly (before the state change to NULL flushes them) */
     GST_INFO ("processing pending state-change messages");
     bus = gst_element_get_bus (lvp->priv->play);
-    while ((msg = gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, 0))) {
+    while ((msg = gst_bus_timed_pop_filtered (bus, 0, GST_MESSAGE_STATE_CHANGED))) {
       gst_bus_async_signal_func (bus, msg, NULL);
       gst_message_unref (msg);
     }


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