[maemo-commits] [maemo-commits] r16690 - in projects/haf/trunk/hildon-thumbnail: . daemon/plugins
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Mon Nov 17 11:42:05 EET 2008
- Previous message: [maemo-commits] r16689 - projects/connectivity/bluez-utils-debian/tags
- Next message: [maemo-commits] r16691 - in projects/haf/trunk/hildon-thumbnail: . daemon daemon/plugins
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: pvanhoof Date: 2008-11-17 11:42:04 +0200 (Mon, 17 Nov 2008) New Revision: 16690 Modified: projects/haf/trunk/hildon-thumbnail/ChangeLog projects/haf/trunk/hildon-thumbnail/daemon/plugins/gstreamer-video-plugin.c Log: 2008-11-17 Philip Van Hoof <philip at codeminded.be> * daemon/plugins/gstreamer-video-plugin.c: Fixed a criticial warning in the video thumbnailer plugin Modified: projects/haf/trunk/hildon-thumbnail/ChangeLog =================================================================== --- projects/haf/trunk/hildon-thumbnail/ChangeLog 2008-11-17 09:24:50 UTC (rev 16689) +++ projects/haf/trunk/hildon-thumbnail/ChangeLog 2008-11-17 09:42:04 UTC (rev 16690) @@ -1,3 +1,8 @@ +2008-11-17 Philip Van Hoof <philip at codeminded.be> + + * daemon/plugins/gstreamer-video-plugin.c: Fixed a criticial warning + in the video thumbnailer plugin + 2008-11-14 Philip Van Hoof <philip at codeminded.be> * daemon/plugins/gstreamer-video-plugin.c: Replaced a GMainLoop with a Modified: projects/haf/trunk/hildon-thumbnail/daemon/plugins/gstreamer-video-plugin.c =================================================================== --- projects/haf/trunk/hildon-thumbnail/daemon/plugins/gstreamer-video-plugin.c 2008-11-17 09:24:50 UTC (rev 16689) +++ projects/haf/trunk/hildon-thumbnail/daemon/plugins/gstreamer-video-plugin.c 2008-11-17 09:42:04 UTC (rev 16690) @@ -134,6 +134,7 @@ return TRUE; } + static void callback_newpad (GstElement *decodebin, GstPad *pad, @@ -167,6 +168,7 @@ } +/* static gboolean callback_bus(GstBus *bus, GstMessage *message, @@ -226,7 +228,6 @@ } break; - case GST_MESSAGE_STATE_CHANGED: old_state = new_state = GST_STATE_NULL; @@ -235,14 +236,14 @@ break; } - //gst_message_parse_state_changed (message, &old_state, &new_state, NULL); + gst_message_parse_state_changed (message, &old_state, &new_state, NULL); if (old_state == new_state) { break; } format = GST_FORMAT_TIME; - //gst_element_query_duration (thumber->pipeline, &format, &duration); + gst_element_query_duration (thumber->pipeline, &format, &duration); if (duration != -1) { position = duration * 5 / 100; @@ -250,19 +251,18 @@ position = 1 * GST_SECOND; } - //gst_element_query_duration (thumber->pipeline, &format, &duration); + gst_element_query_duration (thumber->pipeline, &format, &duration); if (old_state == GST_STATE_READY && new_state == GST_STATE_PAUSED) { - // if (!gst_element_seek_simple (thumber->pipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, position)) { - //g_warning ("Seek failed"); - // } + if (!gst_element_seek_simple (thumber->pipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, position)) { + g_warning ("Seek failed"); + } } break; - case GST_MESSAGE_APPLICATION: case GST_MESSAGE_TAG: default: - /* unhandled message */ + // unhandled message break; } g_mutex_unlock (thumber->pipe_lock); @@ -270,6 +270,7 @@ return TRUE; } +*/ static void video_thumbnail_create (VideoThumbnailer *thumber, GError **error) @@ -298,6 +299,8 @@ thumber->source = gst_element_factory_make ("filesrc", "source"); thumber->decodebin = gst_element_factory_make ("decodebin", "decodebin"); + g_object_ref (thumber->decodebin); + if (!(thumber->pipeline && thumber->source && thumber->decodebin)) { g_set_error (error, GSTP_ERROR, 0, "Couldn't create pipeline elements"); @@ -308,16 +311,20 @@ thumber->source, thumber->decodebin, NULL); + /* Doing this causes warnings at gst_element_set_state bus = gst_pipeline_get_bus (GST_PIPELINE (thumber->pipeline)); gst_bus_add_watch (bus, (GstBusFunc) callback_bus, thumber); gst_object_unref (bus); + */ g_object_set (thumber->source, "location", g_filename_from_uri (thumber->uri, NULL, NULL), NULL); + g_signal_connect (thumber->decodebin, "new-decoded-pad", G_CALLBACK (callback_newpad), thumber); + if (!gst_element_link_many(thumber->source, thumber->decodebin, NULL)) { g_set_error (error, GSTP_ERROR, 0, @@ -395,8 +402,8 @@ if (thumber->pipeline) { - if (thumber->pipeline && !thumber->bugged) - gst_element_set_state (thumber->pipeline, GST_STATE_NULL); + //if (thumber->pipeline && !thumber->bugged) + gst_element_set_state (thumber->pipeline, GST_STATE_NULL); /* This should free all the elements in the pipeline FIXME * Check that this is the case */ @@ -415,6 +422,9 @@ if (thumber->video_sink) gst_object_unref (thumber->video_sink); } + + g_object_unref (thumber->decodebin); + g_mutex_unlock (thumber->pipe_lock); }
- Previous message: [maemo-commits] r16689 - projects/connectivity/bluez-utils-debian/tags
- Next message: [maemo-commits] r16691 - in projects/haf/trunk/hildon-thumbnail: . daemon daemon/plugins
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]