# HG changeset patch # User rosfran # Date 1159312083 -3600 # Node ID b45e9fe9f593c16494ad8e1fa6b901944c5f1b49 # Parent bd0908bf6a148cf077299af0a2f74f1700ff48c9 [svn r18] Configure the GStreamer bus call. diff -r bd0908bf6a14 -r b45e9fe9f593 gmyth/src/libgmyth/gmyth_tvplayer.c --- a/gmyth/src/libgmyth/gmyth_tvplayer.c Tue Sep 26 16:16:28 2006 +0100 +++ b/gmyth/src/libgmyth/gmyth_tvplayer.c Wed Sep 27 00:08:03 2006 +0100 @@ -49,8 +49,8 @@ /* static gboolean idle_state (gpointer data); +*/ static gboolean bus_call (GstBus * bus, GstMessage * msg, gpointer data); -*/ static void gmyth_tvplayer_class_init (GMythTVPlayerClass *klass); static void gmyth_tvplayer_init (GMythTVPlayer *object); @@ -300,8 +300,8 @@ g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL); g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL); -// gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (tvplayer->gst_pipeline)), -// bus_call, tvplayer); + gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (tvplayer->gst_pipeline)), + bus_call, tvplayer); gst_bin_add_many (GST_BIN (pipeline), source, parser, videoqueue, videodec, videosink, audioqueue, audiodec, audioconv, audiosink, NULL); @@ -487,24 +487,18 @@ return TRUE; } -#if 0 static gboolean bus_call (GstBus * bus, GstMessage * msg, gpointer data) { - GMythTVPlayer *tvplayer = GMYTH_TVPLAYER ( data ); - GMainLoop *loop = tvplayer->loop; + //GMythTVPlayer *tvplayer = GMYTH_TVPLAYER ( data ); + //GMainLoop *loop = tvplayer->loop; switch (GST_MESSAGE_TYPE (msg)) { case GST_MESSAGE_EOS: printf ("End of stream\n"); -/* if (miptv_ui->idle_id != 0) { - g_source_remove (miptv_ui->idle_id); - miptv_ui->idle_id = 0; - }*/ - //g_idle_add ((GSourceFunc) idle_eos, data); - gst_element_set_state (GST_ELEMENT (GST_MESSAGE_SRC (msg)), - GST_STATE_READY); + gst_element_set_state ( GST_ELEMENT (GST_MESSAGE_SRC (msg)), GST_STATE_NULL ); + gst_element_set_locked_state ( GST_ELEMENT (GST_MESSAGE_SRC (msg)), FALSE ); break; case GST_MESSAGE_ERROR: { @@ -517,37 +511,9 @@ printf ("Error: %s\n", err->message); g_error_free (err); - g_main_loop_quit (loop); + //g_main_loop_quit (loop); } break; - case GST_MESSAGE_STATE_CHANGED:{ - GstState oldstate; - GstState newstate; - GstState pending; - GstPlayerWindowStateChange *st = - g_new (GstPlayerWindowStateChange, 1); - - gst_message_parse_state_changed (msg, - &oldstate, - &newstate, &pending); - - st->play = tvplayer->gst_pipeline; - gst_object_ref (GST_OBJECT (tvplayer->gst_pipeline)); - st->old_state = oldstate; - st->new_state = newstate; - - st->tvplayer = tvplayer; - - /* State debug messages */ - printf ("oldstate = %s, newstate = %s, pendingstate = %s\n", - gst_element_state_get_name (oldstate), - gst_element_state_get_name (newstate), - gst_element_state_get_name (pending)); - - //g_idle_add ((GSourceFunc) idle_state, st); - - } - break; default: printf (gst_message_type_get_name (GST_MESSAGE_TYPE (msg))); printf ("\n"); @@ -556,7 +522,6 @@ return TRUE; } -#endif #if 0