[Xfce4-commits] <parole:gst1.0> Revert "Port to gstreamer 1.0"

Sean Davis noreply at xfce.org
Sun Jan 13 04:04:07 CET 2013


Updating branch refs/heads/gst1.0
         to fd1be86edaed111b25b878316bc296c2c0e35732 (commit)
       from 088e74b3e40761d1d042a2446e5ee5d8d71354c5 (commit)

commit fd1be86edaed111b25b878316bc296c2c0e35732
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Jan 12 21:36:46 2013 -0500

    Revert "Port to gstreamer 1.0"
    
    This reverts commit f5edf2865624b24e3eb8bdf7680a9b6e0a76939c.

 configure.ac.in          |   19 ++++----
 src/gst/parole-gst.c     |  116 +++++++++++++++++++++++++--------------------
 src/parole-conf-dialog.c |    6 +-
 src/parole-vis.c         |    2 +-
 4 files changed, 78 insertions(+), 65 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index fde24a1..f0b6922 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -80,7 +80,7 @@ XDT_I18N([@LINGUAS@])
 #=====================================================#
 m4_define([gtk_minimum_version], [2.20.0])
 m4_define([glib_minimum_version], [2.32.0])
-m4_define([gstreamer_minimum_version], [1.0.0])
+m4_define([gstreamer_minimum_version], [0.10.24])
 
 m4_define([dbus_minimum_version], [0.60])
 m4_define([dbus_glib_minimum_version], [0.70])
@@ -97,15 +97,16 @@ XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [glib_minimum_version])
 XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [glib_minimum_version])
 XDT_CHECK_PACKAGE([GIO], [gio-2.0], [glib_minimum_version])
 
-XDT_CHECK_PACKAGE([GST], [gstreamer-1.0], [gstreamer_minimum_version])
-XDT_CHECK_PACKAGE([GST_BASE], [gstreamer-base-1.0], [gstreamer_minimum_version])
-XDT_CHECK_PACKAGE([GST_VIDEO], [gstreamer-video-1.0], [gstreamer_minimum_version])
-XDT_CHECK_PACKAGE([GST_PBUTILS], [gstreamer-pbutils-1.0], [gstreamer_minimum_version])
+XDT_CHECK_PACKAGE([GST], [gstreamer-0.10], [gstreamer_minimum_version])
+XDT_CHECK_PACKAGE([GST_BASE], [gstreamer-base-0.10], [gstreamer_minimum_version])
+XDT_CHECK_PACKAGE([GST_VIDEO], [gstreamer-video-0.10], [gstreamer_minimum_version])
+XDT_CHECK_PACKAGE([GST_INTERFACES], [gstreamer-interfaces-0.10], [gstreamer_minimum_version])
+XDT_CHECK_PACKAGE([GST_PBUTILS], [gstreamer-pbutils-0.10], [0.10.2])
 
-GST_API_VERSION=1.0
-GST_REQS=1.0.0
-GSTPLUG_REQS=1.0.0
-GST_LIBS="$GST_LIBS -lgstbase-$GST_API_VERSION -lgstvideo-$GST_API_VERSION -lgstaudio-$GST_API_VERSION -lgstpbutils-$GST_API_VERSION -lgsttag-$GST_API_VERSION"
+GST_MAJORMINOR=0.10
+GST_REQS=0.10.30
+GSTPLUG_REQS=0.10.30
+GST_LIBS="$GST_LIBS -lgstbase-$GST_MAJORMINOR -lgstinterfaces-$GST_MAJORMINOR -lgstvideo-$GST_MAJORMINOR -lgstaudio-$GST_MAJORMINOR -lgstpbutils-$GST_MAJORMINOR -lgsttag-$GST_MAJORMINOR"
 
 XDT_CHECK_PACKAGE([DBUS], [dbus-1], [dbus_minimum_version])
 XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [dbus_glib_minimum_version])
diff --git a/src/gst/parole-gst.c b/src/gst/parole-gst.c
index 85b26c1..6e27725 100644
--- a/src/gst/parole-gst.c
+++ b/src/gst/parole-gst.c
@@ -28,8 +28,8 @@
 
 #include <glib.h>
 
-#include <gst/video/videooverlay.h>
-#include <gst/video/navigation.h>
+#include <gst/interfaces/xoverlay.h>
+#include <gst/interfaces/navigation.h>
 #include <gst/pbutils/missing-plugins.h>
 #include <gst/pbutils/install-plugins.h>
 
@@ -497,7 +497,7 @@ parole_gst_set_video_color_balance (ParoleGst *gst)
 }
 
 static void
-parole_gst_set_video_overlay (ParoleGst *gst)
+parole_gst_set_x_overlay (ParoleGst *gst)
 {
     GstElement *video_sink;
     
@@ -508,7 +508,7 @@ parole_gst_set_video_overlay (ParoleGst *gst)
     g_assert (video_sink != NULL);
     
     if ( GDK_IS_WINDOW (GTK_WIDGET (gst)->window) )
-	gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (video_sink),
+	gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (video_sink),
 				      GDK_WINDOW_XWINDOW (GTK_WIDGET (gst)->window));
     
     gst_object_unref (video_sink);
@@ -531,7 +531,7 @@ parole_gst_expose_event (GtkWidget *widget, GdkEventExpose *ev)
 		  "has-video", &playing_video,
 		  NULL);
 
-    parole_gst_set_video_overlay (gst);
+    parole_gst_set_x_overlay (gst);
 
     TRACE ("EXPOSE event state=%d  target=%d", gst->priv->state, gst->priv->target);
     
@@ -540,14 +540,14 @@ parole_gst_expose_event (GtkWidget *widget, GdkEventExpose *ev)
 	case GST_STATE_PLAYING:
 	    if ( playing_video || gst->priv->vis_loaded)
 	    {
-		gst_video_overlay_expose (GST_VIDEO_OVERLAY (gst->priv->video_sink));
+		gst_x_overlay_expose (GST_X_OVERLAY (gst->priv->video_sink));
 	    }
 	    else
 		parole_gst_draw_logo (gst);
 	    break;
 	case GST_STATE_PAUSED:
 	    if ( playing_video || gst->priv->vis_loaded || gst->priv->target == GST_STATE_PLAYING )
-		gst_video_overlay_expose (GST_VIDEO_OVERLAY (gst->priv->video_sink));
+		gst_x_overlay_expose (GST_X_OVERLAY (gst->priv->video_sink));
 	    else
 		parole_gst_draw_logo (gst);
 	    break;
@@ -555,7 +555,7 @@ parole_gst_expose_event (GtkWidget *widget, GdkEventExpose *ev)
 	    if (gst->priv->target != GST_STATE_PLAYING)
 		parole_gst_draw_logo (gst);
 	    else
-		gst_video_overlay_expose (GST_VIDEO_OVERLAY (gst->priv->video_sink));
+		gst_x_overlay_expose (GST_X_OVERLAY (gst->priv->video_sink));
 	    break;
 	case GST_STATE_NULL:
 	case GST_STATE_VOID_PENDING:
@@ -607,6 +607,7 @@ parole_gst_tick_timeout (gpointer data)
     ParoleGst *gst;
     
     gint64 pos;
+    GstFormat format = GST_FORMAT_TIME;
     gint64 value;
     gboolean video;
     gboolean seekable;
@@ -621,8 +622,11 @@ parole_gst_tick_timeout (gpointer data)
 		  "duration", &duration,
 		  NULL);
     
-    gst_element_query_position (gst->priv->playbin, GST_FORMAT_TIME, &pos);
+    gst_element_query_position (gst->priv->playbin, &format, &pos);
     
+    if ( G_UNLIKELY (format != GST_FORMAT_TIME ) )
+	goto out;
+
     if ( gst->priv->state == GST_STATE_PLAYING )
     {
 	if (duration != 0 && seekable == FALSE)
@@ -673,20 +677,27 @@ parole_gst_query_duration (ParoleGst *gst)
     gint64 absolute_duration = 0;
     gint64 duration = 0;
     gboolean live;
+    GstFormat gst_time;
+    
+    gst_time = GST_FORMAT_TIME;
     
     gst_element_query_duration (gst->priv->playbin, 
-				GST_FORMAT_TIME, &absolute_duration);
+				&gst_time,
+				&absolute_duration);
     
-    duration =  absolute_duration / GST_SECOND;
-    live = ( absolute_duration == 0 );
-
-    TRACE ("Duration %" G_GINT64_FORMAT "is_live=%d", duration, live);
-
-    g_object_set (G_OBJECT (gst->priv->stream),
-          "absolute-duration", absolute_duration,
-          "duration", duration,
-          "live", live,
-          NULL);
+    if (gst_time == GST_FORMAT_TIME)
+    {
+	duration =  absolute_duration / GST_SECOND;
+	live = ( absolute_duration == 0 );
+	
+	TRACE ("Duration %" G_GINT64_FORMAT "is_live=%d", duration, live);
+	
+	g_object_set (G_OBJECT (gst->priv->stream),
+		      "absolute-duration", absolute_duration,
+		      "duration", duration,
+		      "live", live,
+		      NULL);
+    }
 }
 
 static void
@@ -773,14 +784,13 @@ parole_gst_get_pad_capabilities (GObject *object, GParamSpec *pspec, ParoleGst *
     guint num;
     guint den;
     const GValue *value;
-    GstCaps *caps = gst_pad_get_current_caps (pad);
     
     pad = GST_PAD (object);
     
-    if ( !GST_IS_PAD (pad) || !caps )
+    if ( !GST_IS_PAD (pad) || !GST_PAD_CAPS (pad) )
 	return;
     
-    st = gst_caps_get_structure (caps, 0);
+    st = gst_caps_get_structure (GST_PAD_CAPS (pad), 0);
     
     if ( st )
     {
@@ -805,8 +815,6 @@ parole_gst_get_pad_capabilities (GObject *object, GParamSpec *pspec, ParoleGst *
 
 	parole_gst_size_allocate (GTK_WIDGET (gst), &GTK_WIDGET (gst)->allocation);
     }
-
-  gst_caps_unref (caps);
 }
 
 static void
@@ -835,7 +843,7 @@ parole_gst_query_info (ParoleGst *gst)
 	{
 	    GstCaps *caps;
 	    
-	    if ((caps = gst_pad_get_current_caps (videopad)))
+	    if ((caps = gst_pad_get_negotiated_caps (videopad)))
 	    {
 		parole_gst_get_pad_capabilities (G_OBJECT (videopad), NULL, gst);
 		gst_caps_unref (caps);
@@ -995,8 +1003,11 @@ parole_gst_evaluate_state (ParoleGst *gst, GstState old, GstState new, GstState
 static void
 parole_gst_element_message_sync (GstBus *bus, GstMessage *message, ParoleGst *gst)
 {
-    if ( gst_message_has_name (message, "prepare-xwindow-id") )
-	parole_gst_set_video_overlay (gst);
+    if ( !message->structure )
+	goto out;
+	
+    if ( gst_structure_has_name (message->structure, "prepare-xwindow-id") )
+	parole_gst_set_x_overlay (gst);
 out:
     ;
 }
@@ -1007,14 +1018,10 @@ parole_gst_buffer_to_pixbuf (GstBuffer *buffer)
   GdkPixbufLoader *loader;
   GdkPixbuf *pixbuf = NULL;
   GError *err = NULL;
-  GstMapInfo map;
-
-
-  if (!gst_buffer_map (buffer, &map, GST_MAP_READ))
-    return;
 
   loader = gdk_pixbuf_loader_new ();
-  if (gdk_pixbuf_loader_write (loader, map.data, map.size, &err) &&
+
+  if (gdk_pixbuf_loader_write (loader, buffer->data, buffer->size, &err) &&
       gdk_pixbuf_loader_close (loader, &err)) {
     pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
     if (pixbuf)
@@ -1024,7 +1031,6 @@ parole_gst_buffer_to_pixbuf (GstBuffer *buffer)
     g_error_free (err);
   }
 
-  gst_buffer_unmap (buffer, &map);
   g_object_unref (loader);
   return pixbuf;
 }
@@ -1093,7 +1099,7 @@ parole_gst_tag_list_get_cover_real (GstTagList *tag_list)
 
   for (i = 0; ; i++) {
     const GValue *value;
-    GstSample *sample;
+    GstBuffer *buffer;
     GstStructure *caps_struct;
     int type;
 
@@ -1103,10 +1109,10 @@ parole_gst_tag_list_get_cover_real (GstTagList *tag_list)
     if (value == NULL)
       break;
 
-    sample = gst_value_get_sample (value);
-
-    caps_struct = gst_caps_get_structure (gst_sample_get_caps(sample), 0);
+    buffer = gst_value_get_buffer (value);
 
+    caps_struct = gst_caps_get_structure (buffer->caps, 0);
+    
     gst_structure_get_enum (caps_struct,
 			    "image-type",
 			    GST_TYPE_TAG_IMAGE_TYPE,
@@ -1149,11 +1155,11 @@ parole_gst_tag_list_get_cover (ParoleGst *gst, GstTagList *tag_list)
   }
 
   if (cover_value) {
-    GstSample *sample;
+    GstBuffer *buffer;
     GdkPixbuf *pixbuf;
 
-    sample = gst_value_get_sample (cover_value);
-    pixbuf = parole_gst_buffer_to_pixbuf (gst_sample_get_buffer (sample));
+    buffer = gst_value_get_buffer (cover_value);
+    pixbuf = parole_gst_buffer_to_pixbuf (buffer);
     return pixbuf;
   }
 
@@ -1180,7 +1186,7 @@ parole_gst_get_meta_data_dvd (ParoleGst *gst)
     format = gst_format_get_by_nick ("chapter");
 
     /* Get the number of chapters for the current title. */
-    if ( gst_element_query_duration (gst->priv->playbin, GST_FORMAT_TIME, &val) )
+    if ( gst_element_query_duration (gst->priv->playbin, &format, &val) )
     {
         n_chapters = (gint) val;
         num_chapters = (guint) n_chapters;
@@ -1198,7 +1204,7 @@ parole_gst_get_meta_data_dvd (ParoleGst *gst)
     
     /* Get the current chapter. */
     val = -1;
-    if ( gst_element_query_position (gst->priv->playbin, GST_FORMAT_TIME, &val) )
+    if ( gst_element_query_position (gst->priv->playbin, &format, &val) )
     {
         chapter = (guint)(gint) val;
         if ( chapter != current_chapter || num_chapters != 1 )
@@ -1371,13 +1377,18 @@ parole_gst_application_message (ParoleGst *gst, GstMessage *msg)
 {
     const gchar *name;
 
+    name = gst_structure_get_name (msg->structure);
+    
+    if ( !name )
+	return;
+	
     TRACE ("Application message : %s", name);
     
-    if ( gst_message_has_name (msg, "notify-streaminfo") )
+    if ( !g_strcmp0 (name, "notify-streaminfo") )
     {
 	parole_gst_update_stream_info (gst);
     }
-    else if ( gst_message_has_name (msg, "video-size") )
+    else if ( !g_strcmp0 (name, "video-size") )
     {
 	parole_gst_size_allocate (GTK_WIDGET (gst), &GTK_WIDGET (gst)->allocation);
     }
@@ -1546,7 +1557,7 @@ parole_gst_bus_event (GstBus *bus, GstMessage *msg, gpointer data)
 	             details[0] = gst_missing_plugin_message_get_installer_detail(msg);
 	             details[1] = NULL;
 	             ctx = gst_install_plugins_context_new();
-	             gst_install_plugins_async((const gchar * const *) details, ctx, parole_gst_install_plugins_result_func, gst);
+	             gst_install_plugins_async(details, ctx, parole_gst_install_plugins_result_func, gst);
 	             
 	             gst_install_plugins_context_free(ctx);
 	        }
@@ -1783,7 +1794,7 @@ parole_gst_seek_by_format (ParoleGst *gst, GstFormat format, gint step)
 {
     gint64 val = 1;
     
-    if ( gst_element_query_position (gst->priv->playbin, GST_FORMAT_TIME, &val) )
+    if ( gst_element_query_position (gst->priv->playbin, &format, &val) )
     {
 	val += step;
 	if ( !gst_element_seek (gst->priv->playbin, 1.0, format, 
@@ -2010,7 +2021,7 @@ parole_gst_constructed (GObject *object)
 		  "enable-xv", &enable_xv,
 		  NULL);
     
-    gst->priv->playbin = gst_element_factory_make ("playbin", "player");
+    gst->priv->playbin = gst_element_factory_make ("playbin2", "player");
  
     if ( G_UNLIKELY (gst->priv->playbin == NULL) )
     {
@@ -2066,7 +2077,7 @@ parole_gst_constructed (GObject *object)
      * Handling 'prepare-xwindow-id' message async causes XSync 
      * error in some occasions So we handle this message synchronously
      */
-    gst_bus_set_sync_handler (gst->priv->bus, gst_bus_sync_signal_handler, gst, NULL);
+    gst_bus_set_sync_handler (gst->priv->bus, gst_bus_sync_signal_handler, gst);
     gst->priv->sig2 =
 	g_signal_connect (gst->priv->bus, "sync-message::element",
 			  G_CALLBACK (parole_gst_element_message_sync), gst);
@@ -2554,7 +2565,7 @@ gint parole_gst_get_current_cdda_track (ParoleGst *gst)
     
     format = gst_format_get_by_nick ("track");
     
-    if ( gst_element_query_position (gst->priv->playbin, GST_FORMAT_TIME, &pos) )
+    if ( gst_element_query_position (gst->priv->playbin, &format, &pos) )
     {
 	TRACE ("Pos %" G_GINT64_FORMAT, pos);
 	ret_val = (gint) pos;
@@ -2575,9 +2586,10 @@ gint64	parole_gst_get_stream_duration (ParoleGst *gst)
 
 gint64 parole_gst_get_stream_position (ParoleGst *gst)
 {
+    GstFormat format = GST_FORMAT_TIME;
     gint64 pos;
     
-    gst_element_query_position (gst->priv->playbin, GST_FORMAT_TIME, &pos);
+    gst_element_query_position (gst->priv->playbin, &format, &pos);
     
     return  pos / GST_SECOND;
 }
diff --git a/src/parole-conf-dialog.c b/src/parole-conf-dialog.c
index 38e27f0..1afac29 100644
--- a/src/parole-conf-dialog.c
+++ b/src/parole-conf-dialog.c
@@ -256,7 +256,7 @@ void parole_conf_dialog_vis_plugin_changed_cb (GtkComboBox *widget,  ParoleConfD
     if ( f )
     {
 	g_object_set (G_OBJECT (self->priv->conf),
-		      "vis-name", gst_object_get_name (GST_OBJECT (f)),
+		      "vis-name", GST_PLUGIN_FEATURE_NAME (f),
 		      NULL);
     }
     
@@ -354,10 +354,10 @@ parole_conf_dialog_set_default_vis_plugin (GtkTreeModel *model, GtkTreePath *pat
     
     if ( !g_strcmp0 (vis_name, "none") )
     {
-	if ( !g_strcmp0 (gst_object_get_name (GST_OBJECT (f)), "Goom") )
+	if ( !g_strcmp0 (GST_PLUGIN_FEATURE_NAME (f), "Goom") )
 	    ret = TRUE;
     }
-    else if ( !g_strcmp0 (gst_object_get_name (GST_OBJECT (f)), vis_name) )
+    else if ( !g_strcmp0 (GST_PLUGIN_FEATURE_NAME (f), vis_name) )
     {
 	ret = TRUE;
     }
diff --git a/src/parole-vis.c b/src/parole-vis.c
index f523c36..5f0648b 100644
--- a/src/parole-vis.c
+++ b/src/parole-vis.c
@@ -60,7 +60,7 @@ GHashTable *parole_vis_get_plugins (void)
     
     hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
     
-    plugins = gst_registry_feature_filter (gst_registry_get (),
+    plugins = gst_registry_feature_filter (gst_registry_get_default (),
 					   parole_vis_filter,
 					   FALSE,
 					   NULL);


More information about the Xfce4-commits mailing list