Index: configure.in
===================================================================
RCS file: /cvs/gnome/totem/configure.in,v
retrieving revision 1.308
diff -u -p -r1.308 configure.in
--- configure.in	1 Nov 2006 10:55:06 -0000	1.308
+++ configure.in	1 Nov 2006 18:54:22 -0000
@@ -210,7 +210,6 @@ if test x$ENABLE_GTK = "xno" ; then
 else
 # FIXME: use gmodule-no-export instead!
 	PKG_CHECK_MODULES(EXTRA_GNOME, glib-2.0 >= $GLIB_REQS gtk+-2.0 >= $GTK_REQS libglade-2.0 gnome-vfs-2.0 >= $GNOMEVFS_REQS gnome-vfs-module-2.0 >= $GNOMEVFS_REQS gnome-icon-theme >= $GNOMEICON_REQS gmodule-2.0 iso-codes $MM)
-	AC_DEFINE(USE_STABLE_LIBGNOMEUI, 1, [defined if we don't have GNOME])
 	AC_DEFINE(HAVE_GTK_ONLY, 1, [defined if GNOME isn't used])
 	HAVE_GNOME=no
 fi
@@ -249,10 +248,18 @@ if test "x$with_dbus" != "xno"; then
 	else
 		AC_MSG_RESULT([not found])
 	fi
-
 fi			  
 AM_CONDITIONAL(WITH_DBUS, test "x$enable_dbus" = "xyes")
 
+if test "x$enable_dbus" = xyes; then
+	if test x$ENABLE_GTK = "xno" ; then
+		PKG_CHECK_MODULES(METADATA, glib-2.0 >= $GLIB_REQS gtk+-2.0 >= $GTK_REQS libgnomeui-2.0 >= $GNOMEUI_REQS libglade-2.0 gnome-vfs-2.0 >= $GNOMEVFS_REQS gnome-vfs-module-2.0 >= $GNOMEVFS_REQS gnome-icon-theme >= $GNOMEICON_REQS gmodule-2.0)
+	else
+		PKG_CHECK_MODULES(METADATA, glib-2.0 >= $GLIB_REQS gtk+-2.0 >= $GTK_REQS libglade-2.0 gnome-vfs-2.0 >= $GNOMEVFS_REQS gnome-vfs-module-2.0 >= $GNOMEVFS_REQS gnome-icon-theme >= $GNOMEICON_REQS gmodule-2.0)
+	fi
+fi
+
+
 AC_MSG_CHECKING([whether iso-codes has iso-639 domain])
 if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 ; then
 	AC_MSG_RESULT([yes])
@@ -358,6 +365,7 @@ if test "x$ENABLE_MOZILLA" = "xyes" ; th
 		[glib-2.0
 		 gnome-vfs-2.0 >= $GNOMEVFS_REQS
 		 gnome-vfs-module-2.0 >= $GNOMEVFS_REQS
+		 gtk+-2.0 >= $GTK_REQS
 		 gthread-2.0],
 		[],[ENABLE_MOZILLA=no])
 
@@ -487,13 +495,10 @@ AC_ARG_ENABLE(nautilus,
 	[ENABLE_NAUTILUS=yes]) dnl Default value
 
 if test x$ENABLE_NAUTILUS = "xyes" ; then
-	PKG_CHECK_MODULES(NAUTILUS, gtk+-2.0 $MM gthread-2.0 libnautilus-extension,
+	PKG_CHECK_MODULES(NAUTILUS, gtk+-2.0 gthread-2.0 libnautilus-extension,
 			[HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
 fi
 
-NAUTILUS_LIBS="$NAUTILUS_LIBS $EXTRA_BACKEND_LIBS"
-AC_SUBST(NAUTILUS_CFLAGS)
-AC_SUBST(NAUTILUS_LIBS)
 if test x$HAVE_NAUTILUS = "xyes"; then
 	AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
 fi
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/totem/src/Makefile.am,v
retrieving revision 1.172
diff -u -p -r1.172 Makefile.am
--- src/Makefile.am	1 Nov 2006 10:23:08 -0000	1.172
+++ src/Makefile.am	1 Nov 2006 18:54:23 -0000
@@ -7,9 +7,16 @@ else
 VANITY=
 endif
 
+if WITH_DBUS
+BACON_METADATA_WIDGET = backend/libbaconvideowidget_dbus.la
+else
+BACON_METADATA_WIDGET = backend/libbaconvideowidget.la
+endif
+
 if HAVE_NAUTILUS
 TOTEM_PROPERTIES_PAGE = libtotem-properties-page.la
 TOTEM_PROPERTIES_PAGE_TEST = test-properties-page
+#TOTEM_PROPERTIES_PAGE_TEST =
 else
 TOTEM_PROPERTIES_PAGE =
 TOTEM_PROPERTIES_PAGE_TEST =
@@ -29,7 +36,7 @@ noinst_LTLIBRARIES = \
 	libtotem_player.la
 nautilus_LTLIBRARIES = $(TOTEM_PROPERTIES_PAGE)
 
-modules_flags = -export_dynamic -avoid-version -module
+modules_flags = -no-undef -export_dynamic -avoid-version -module
 
 BACON_VOLUME = \
 	bacon-volume.c			\
@@ -108,10 +115,9 @@ libtotem_properties_page_la_SOURCES = 	\
 	totem-properties-view.c		\
 	totem-properties-view.h
 libtotem_properties_page_la_LIBADD =					\
-	backend/libbaconvideowidget.la libbaconpropertiespage.la	\
-	$(EXTRA_GNOME_LIBS) $(XVIDMODE_LIBS)				\
-	$(NVTV_LIBS) $(NAUTILUS_LIBS)					\
-	$(XTEST_LIBS) $(X_LIBS)
+	$(BACON_METADATA_WIDGET)					\
+	libbaconpropertiespage.la					\
+	$(METADATA_LIBS) $(NAUTILUS_LIBS)
 libtotem_properties_page_la_LDFLAGS = $(modules_flags)
 
 test_properties_page_CFLAGS = -I$(top_srcdir)
@@ -121,10 +127,7 @@ test_properties_page_SOURCES =		\
 	totem-properties-view.h		\
 	test-properties-page.c
 test_properties_page_LDADD =		\
-	backend/libbaconvideowidget.la libbaconpropertiespage.la	\
-	$(EXTRA_GNOME_LIBS) $(XVIDMODE_LIBS)				\
-	$(NVTV_LIBS) $(NAUTILUS_LIBS)					\
-	$(XTEST_LIBS) $(X_LIBS) 
+	$(TOTEM_PROPERTIES_PAGE)
 
 
 BUILT_SOURCES = 
@@ -162,10 +165,9 @@ vanity_LDADD = \
 
 totem_video_indexer_SOURCES = totem-video-indexer.c
 totem_video_indexer_LDADD =				\
-	backend/libbaconvideowidget.la			\
-	$(GTK_LIBS) $(XVIDMODE_LIBS) $(NVTV_LIBS)	\
-	$(EXTRA_GNOME_LIBS)				\
-	$(XTEST_LIBS) $(X_LIBS) 
+	$(BACON_METADATA_WIDGET)			\
+	$(GTK_LIBS) 					\
+	$(METADATA_LIBS)
 
 disc_test_SOURCES = disc-test.c
 disc_test_LDADD = \
Index: src/backend/Makefile.am
===================================================================
RCS file: /cvs/gnome/totem/src/backend/Makefile.am,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile.am
--- src/backend/Makefile.am	10 May 2006 10:11:10 -0000	1.6
+++ src/backend/Makefile.am	1 Nov 2006 18:54:23 -0000
@@ -1,6 +1,12 @@
 noinst_PROGRAMS = bvw-test
 
-noinst_LTLIBRARIES = libbaconvideowidget.la
+if WITH_DBUS
+METADATA_BACKEND = libbaconvideowidget_dbus.la
+else
+METADATA_BACKEND = 
+endif
+
+noinst_LTLIBRARIES = libbaconvideowidget.la $(METADATA_BACKEND) libbaconvideowidget_shared.la
 
 INCLUDES = \
 	-I$(top_srcdir) \
@@ -15,6 +21,8 @@ bvw_test_LDADD = \
 	libbaconvideowidget.la \
 	$(GTK_LIBS) $(XVIDMODE_LIBS) $(NVTV_LIBS) $(XTEST_LIBS) $(X_LIBS)
 
+libbaconvideowidget_shared_la_SOURCES = $(BVWMARSHALFILES) video-utils.c video-utils.h debug.h
+
 if TOTEM_GST
 MM = bacon-video-widget-gst-0.10.c \
 	gstscreenshot.c \
@@ -33,18 +41,25 @@ baconvideowidget-marshal.c: baconvideowi
 	( $(GLIB_GENMARSHAL) --prefix=baconvideowidget_marshal $(srcdir)/baconvideowidget-marshal.list --body --header > baconvideowidget-marshal.c )
 
 libbaconvideowidget_la_SOURCES = \
-	$(BVWMARSHALFILES) $(MM) bacon-video-widget.h \
+	$(MM) bacon-video-widget.h \
 	bacon-video-widget-private.h bacon-resize.h \
-	bacon-resize.c video-utils.c video-utils.h debug.h
+	bacon-resize.c
 libbaconvideowidget_la_CFLAGS = \
 	-D_REENTRANT \
 	$(NVTV_CFLAGS) \
 	-DGCONF_PREFIX=\""/apps/totem"\"
+libbaconvideowidget_la_LIBADD = libbaconvideowidget_shared.la
+
+if WITH_DBUS
+libbaconvideowidget_dbus_la_SOURCES = bacon-video-widget.h bacon-video-widget-dbus.c debug.h
+libbaconvideowidget_dbus_la_LIBADD = libbaconvideowidget_shared.la
+endif
 
 CLEANFILES = $(BUILT_SOURCES)
 
 EXTRA_DIST = \
 	bacon-video-widget-xine.c \
+	bacon-video-widget-dbus.c \
 	bacon-video-widget-gst-0.10.c \
 	gstscreenshot.c \
 	gstscreenshot.h \
Index: src/backend/bacon-video-widget-dbus.c
===================================================================
RCS file: src/backend/bacon-video-widget-dbus.c
diff -N src/backend/bacon-video-widget-dbus.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/backend/bacon-video-widget-dbus.c	1 Nov 2006 18:54:23 -0000
@@ -0,0 +1,967 @@
+/* 
+ * Copyright (C) 2006 Bastien Nocera <hadess@hadess.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <config.h>
+
+#include <glib/gi18n.h>
+
+#include "debug.h"
+#include "bacon-video-widget.h"
+#include "bacon-video-widget-private.h"
+#include "baconvideowidget-marshal.h"
+
+/* Signals */
+enum {
+	ERROR,
+	EOS,
+	REDIRECT,
+	TITLE_CHANGE,
+	CHANNELS_CHANGE,
+	TICK,
+	GOT_METADATA,
+	BUFFERING,
+	LAST_SIGNAL
+};
+
+/* Arguments */
+enum {
+	PROP_0,
+	PROP_LOGO_MODE,
+	PROP_SPEED,
+	PROP_POSITION,
+	PROP_CURRENT_TIME,
+	PROP_STREAM_LENGTH,
+	PROP_PLAYING,
+	PROP_SEEKABLE,
+	PROP_SHOWCURSOR,
+	PROP_MEDIADEV,
+	PROP_SHOW_VISUALS
+};
+
+struct BaconVideoWidgetPrivate {
+	char *mrl;
+};
+
+static void bacon_video_widget_class_init (BaconVideoWidgetClass *klass);
+static void bacon_video_widget_init (BaconVideoWidget *bvw);
+static void bacon_video_widget_finalize (GObject *object);
+
+static void bacon_video_widget_set_property (GObject *object,
+		guint property_id, const GValue *value, GParamSpec *pspec);
+static void bacon_video_widget_get_property (GObject *object,
+		guint property_id, GValue *value, GParamSpec *pspec);
+
+static GtkWidgetClass *parent_class = NULL;
+
+static int bvw_table_signals[LAST_SIGNAL] = { 0 };
+
+G_DEFINE_TYPE(BaconVideoWidget, bacon_video_widget, GTK_TYPE_BOX)
+
+static void
+bacon_video_widget_class_init (BaconVideoWidgetClass *klass)
+{
+
+	GObjectClass *object_class;
+	GtkWidgetClass *widget_class;
+
+	object_class = (GObjectClass *) klass;
+	widget_class = (GtkWidgetClass *) klass;
+
+	parent_class = gtk_type_class (gtk_box_get_type ());
+
+	/* GObject */
+	object_class->set_property = bacon_video_widget_set_property;
+	object_class->get_property = bacon_video_widget_get_property;
+	object_class->finalize = bacon_video_widget_finalize;
+
+	/* Properties */
+	g_object_class_install_property (object_class, PROP_LOGO_MODE,
+			g_param_spec_boolean ("logo_mode", NULL, NULL,
+				FALSE, G_PARAM_READWRITE));
+	g_object_class_install_property (object_class, PROP_POSITION,
+			g_param_spec_int64 ("position", NULL, NULL,
+				0, G_MAXINT64, 0, G_PARAM_READABLE));
+	g_object_class_install_property (object_class, PROP_STREAM_LENGTH,
+			g_param_spec_int64 ("stream_length", NULL, NULL,
+				0, G_MAXINT64, 0, G_PARAM_READABLE));
+	g_object_class_install_property (object_class, PROP_PLAYING,
+			g_param_spec_boolean ("playing", NULL, NULL,
+				FALSE, G_PARAM_READABLE));
+	g_object_class_install_property (object_class, PROP_SEEKABLE,
+			g_param_spec_boolean ("seekable", NULL, NULL,
+				FALSE, G_PARAM_READABLE));
+	g_object_class_install_property (object_class, PROP_SHOWCURSOR,
+			g_param_spec_boolean ("showcursor", NULL, NULL,
+				FALSE, G_PARAM_READWRITE));
+	g_object_class_install_property (object_class, PROP_MEDIADEV,
+			g_param_spec_string ("mediadev", NULL, NULL,
+				FALSE, G_PARAM_READWRITE));
+	g_object_class_install_property (object_class, PROP_SHOW_VISUALS,
+			g_param_spec_boolean ("showvisuals", NULL, NULL,
+				FALSE, G_PARAM_WRITABLE));
+
+	/* Signals */
+	bvw_table_signals[ERROR] =
+		g_signal_new ("error",
+				G_TYPE_FROM_CLASS (object_class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (BaconVideoWidgetClass, error),
+				NULL, NULL,
+				baconvideowidget_marshal_VOID__STRING_BOOLEAN_BOOLEAN,
+				G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_BOOLEAN,
+				G_TYPE_BOOLEAN);
+
+	bvw_table_signals[EOS] =
+		g_signal_new ("eos",
+				G_TYPE_FROM_CLASS (object_class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (BaconVideoWidgetClass, eos),
+				NULL, NULL,
+				g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+
+	bvw_table_signals[REDIRECT] =
+		g_signal_new ("got-redirect",
+				G_TYPE_FROM_CLASS (object_class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (BaconVideoWidgetClass, got_redirect),
+				NULL, NULL,
+				g_cclosure_marshal_VOID__STRING,
+				G_TYPE_NONE, 1, G_TYPE_STRING);
+
+	bvw_table_signals[GOT_METADATA] =
+		g_signal_new ("got-metadata",
+				G_TYPE_FROM_CLASS (object_class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (BaconVideoWidgetClass, got_metadata),
+				NULL, NULL,
+				g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+
+	bvw_table_signals[TITLE_CHANGE] =
+		g_signal_new ("title-change",
+				G_TYPE_FROM_CLASS (object_class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (BaconVideoWidgetClass, title_change),
+				NULL, NULL,
+				g_cclosure_marshal_VOID__STRING,
+				G_TYPE_NONE, 1, G_TYPE_STRING);
+
+	bvw_table_signals[CHANNELS_CHANGE] =
+		g_signal_new ("channels-change",
+				G_TYPE_FROM_CLASS (object_class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (BaconVideoWidgetClass, channels_change),
+				NULL, NULL,
+				g_cclosure_marshal_VOID__VOID,
+				G_TYPE_NONE, 0);
+
+	bvw_table_signals[TICK] =
+		g_signal_new ("tick",
+				G_TYPE_FROM_CLASS (object_class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (BaconVideoWidgetClass, tick),
+				NULL, NULL,
+				baconvideowidget_marshal_VOID__INT64_INT64_FLOAT_BOOLEAN,
+				G_TYPE_NONE, 4, G_TYPE_INT64, G_TYPE_INT64,
+				G_TYPE_FLOAT, G_TYPE_BOOLEAN);
+
+	bvw_table_signals[BUFFERING] =
+		g_signal_new ("buffering",
+				G_TYPE_FROM_CLASS (object_class),
+				G_SIGNAL_RUN_LAST,
+				G_STRUCT_OFFSET (BaconVideoWidgetClass, buffering),
+				NULL, NULL,
+				g_cclosure_marshal_VOID__INT,
+				G_TYPE_NONE, 1, G_TYPE_INT);
+}
+
+static void
+bacon_video_widget_init (BaconVideoWidget *bvw)
+{
+	g_return_if_fail (bvw != NULL);
+	g_return_if_fail (BACON_IS_VIDEO_WIDGET (bvw));
+
+	GTK_WIDGET_SET_FLAGS (GTK_WIDGET (bvw), GTK_CAN_FOCUS);
+	GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (bvw), GTK_DOUBLE_BUFFERED);
+
+	bvw->priv = g_new0 (BaconVideoWidgetPrivate, 1);
+	//FIXME do stuff
+}
+
+static void
+bacon_video_widget_finalize (GObject *object)
+{
+	BaconVideoWidget *bvw = (BaconVideoWidget *) object;
+
+	g_free (bvw->priv->mrl);
+#if 0
+
+	if (bvw->priv->gc)
+		g_object_unref (G_OBJECT (bvw->priv->gc));
+
+	if (bvw->priv->xine != NULL) {
+		xine_plugins_garbage_collector (bvw->priv->xine);
+		xine_exit (bvw->priv->xine);
+		bvw->priv->xine = NULL;
+	}
+	if (bvw->priv->cursor != NULL) {
+		gdk_cursor_unref (bvw->priv->cursor);
+		bvw->priv->cursor = NULL;
+	}
+	if (bvw->priv->logo_pixbuf != NULL) {
+		gdk_pixbuf_unref (bvw->priv->logo_pixbuf);
+		bvw->priv->logo_pixbuf = NULL;
+	}
+	g_free (bvw->priv->vis_name);
+	g_free (bvw->priv->mediadev);
+	g_object_unref (G_OBJECT (bvw->priv->gc));
+	g_free (bvw->priv->codecs_path);
+
+	g_list_foreach (bvw->priv->visuals, (GFunc) g_free, NULL);
+	g_list_free (bvw->priv->visuals);
+
+	g_idle_remove_by_data (bvw);
+	g_async_queue_unref (bvw->priv->queue);
+#endif
+	G_OBJECT_CLASS (parent_class)->finalize (object);
+
+	g_free (bvw->priv);
+}
+
+static struct poptOption xine_options[] = {
+	POPT_TABLEEND
+};
+
+struct poptOption *
+bacon_video_widget_get_popt_table (void)
+{
+	/* Xine backend does not need any options */
+	return (struct poptOption *) xine_options;
+}
+
+void
+bacon_video_widget_init_backend (int *argc, char ***argv)
+{
+  /* no-op */
+}
+
+GQuark
+bacon_video_widget_error_quark (void)
+{
+	static GQuark q = 0;
+	if (q == 0)
+		q = g_quark_from_static_string ("bvw-error-quark");
+	return q;
+}
+
+GtkWidget *
+bacon_video_widget_new (int width, int height,
+		BvwUseType type, GError **error)
+{
+	BaconVideoWidget *bvw;
+
+	if (type != BVW_USE_TYPE_METADATA) {
+		g_set_error (error, BVW_ERROR, BVW_ERROR_VIDEO_PLUGIN,
+				_("No video output is available. Make sure that the program is correctly installed."));
+		return NULL;
+	}
+
+	bvw = BACON_VIDEO_WIDGET (g_object_new
+			(bacon_video_widget_get_type (), NULL));
+	return GTK_WIDGET (bvw);
+}
+
+char *
+bacon_video_widget_get_backend_name (BaconVideoWidget *bvw)
+{
+	return NULL;
+#if 0
+	return g_strdup_printf ("xine-lib version %s",
+			xine_get_version_string ());
+#endif
+}
+
+gboolean
+bacon_video_widget_open_with_subtitle (BaconVideoWidget *bvw, const char *mrl,
+		const char *subtitle_uri, GError **error)
+{
+	g_return_val_if_fail (mrl != NULL, FALSE);
+	g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), FALSE);
+	g_return_val_if_fail (bvw->priv->mrl == NULL, FALSE);
+
+	return TRUE;
+}
+
+gboolean
+bacon_video_widget_play (BaconVideoWidget *bvw, GError **gerror)
+{
+	g_return_val_if_fail (bvw != NULL, -1);
+	g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), -1);
+
+	return TRUE;
+}
+
+gboolean
+bacon_video_widget_can_direct_seek (BaconVideoWidget *bvw)
+{
+	g_return_val_if_fail (bvw != NULL, FALSE);
+	g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), FALSE);
+
+	return FALSE;
+}
+
+gboolean bacon_video_widget_seek (BaconVideoWidget *bvw, float position,
+		GError **gerror)
+{
+	return TRUE;
+}
+
+gboolean bacon_video_widget_seek_time (BaconVideoWidget *bvw, gint64 time,
+		GError **gerror)
+{
+	return TRUE;
+}
+
+void
+bacon_video_widget_stop (BaconVideoWidget *bvw)
+{
+}
+
+void
+bacon_video_widget_close (BaconVideoWidget *bvw)
+{
+}
+
+/* Properties */
+static void
+bacon_video_widget_set_property (GObject *object, guint property_id,
+		const GValue *value, GParamSpec *pspec)
+{
+	BaconVideoWidget *bvw;
+
+	bvw = BACON_VIDEO_WIDGET (object);
+
+	switch (property_id)
+	{
+	case PROP_LOGO_MODE:
+		bacon_video_widget_set_logo_mode (bvw,
+				g_value_get_boolean (value));
+		break;
+	case PROP_SHOWCURSOR:
+		bacon_video_widget_set_show_cursor (bvw,
+				g_value_get_boolean (value));
+		break;
+	case PROP_MEDIADEV:
+		bacon_video_widget_set_media_device (bvw,
+				g_value_get_string (value));
+		break;
+	case PROP_SHOW_VISUALS:
+		bacon_video_widget_set_show_visuals (bvw,
+				g_value_get_boolean (value));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+static void
+bacon_video_widget_get_property (GObject *object, guint property_id,
+		GValue *value, GParamSpec *pspec)
+{
+	BaconVideoWidget *bvw;
+
+	bvw = BACON_VIDEO_WIDGET (object);
+
+	switch (property_id)
+	{
+	case PROP_LOGO_MODE:
+		g_value_set_boolean (value,
+				bacon_video_widget_get_logo_mode (bvw));
+		break;
+	case PROP_POSITION:
+		g_value_set_int64 (value, bacon_video_widget_get_position (bvw));
+		break;
+	case PROP_STREAM_LENGTH:
+		g_value_set_int64 (value,
+				bacon_video_widget_get_stream_length (bvw));
+		break;
+	case PROP_PLAYING:
+		g_value_set_boolean (value,
+				bacon_video_widget_is_playing (bvw));
+		break;
+	case PROP_SEEKABLE:
+		g_value_set_boolean (value,
+				bacon_video_widget_is_seekable (bvw));
+		break;
+	case PROP_SHOWCURSOR:
+		g_value_set_boolean (value,
+				bacon_video_widget_get_show_cursor (bvw));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+void
+bacon_video_widget_set_logo_mode (BaconVideoWidget *bvw, gboolean logo_mode)
+{
+}
+
+void
+bacon_video_widget_set_logo (BaconVideoWidget *bvw, char *filename)
+{
+}
+
+gboolean
+bacon_video_widget_get_logo_mode (BaconVideoWidget *bvw)
+{
+	return FALSE;
+}
+
+void
+bacon_video_widget_pause (BaconVideoWidget *bvw)
+{
+}
+
+float
+bacon_video_widget_get_position (BaconVideoWidget *bvw)
+{
+	return 0;
+}
+
+gboolean
+bacon_video_widget_can_set_volume (BaconVideoWidget *bvw)
+{
+	return FALSE;
+}
+
+void
+bacon_video_widget_set_volume (BaconVideoWidget *bvw, int volume)
+{
+}
+
+int
+bacon_video_widget_get_volume (BaconVideoWidget *bvw)
+{
+	return 0;
+}
+
+gboolean
+bacon_video_widget_fullscreen_mode_available (BaconVideoWidget *bvw,
+		TvOutType tvout) 
+{
+	return FALSE;
+}
+
+void
+bacon_video_widget_set_fullscreen (BaconVideoWidget *bvw, gboolean fullscreen)
+{
+}
+
+void
+bacon_video_widget_set_show_cursor (BaconVideoWidget *bvw,
+		gboolean show_cursor)
+{
+}
+
+gboolean
+bacon_video_widget_get_show_cursor (BaconVideoWidget *bvw)
+{
+	return FALSE;
+}
+
+void
+bacon_video_widget_set_media_device (BaconVideoWidget *bvw, const char *path)
+{
+}
+
+void
+bacon_video_widget_set_connection_speed (BaconVideoWidget *bvw, int speed)
+{
+}
+
+int
+bacon_video_widget_get_connection_speed (BaconVideoWidget *bvw)
+{
+	return 0;
+}
+
+void
+bacon_video_widget_set_deinterlacing (BaconVideoWidget *bvw,
+		gboolean deinterlace)
+{
+}
+
+gboolean
+bacon_video_widget_get_deinterlacing (BaconVideoWidget *bvw)
+{
+	return FALSE;
+}
+
+gboolean
+bacon_video_widget_set_tv_out (BaconVideoWidget *bvw, TvOutType tvout)
+{
+	return FALSE;
+}
+
+TvOutType
+bacon_video_widget_get_tv_out (BaconVideoWidget *bvw)
+{
+	return FALSE;
+}
+
+gboolean
+bacon_video_widget_set_show_visuals (BaconVideoWidget *bvw,
+		gboolean show_visuals)
+{
+	return TRUE;
+}
+
+GList *
+bacon_video_widget_get_visuals_list (BaconVideoWidget *bvw)
+{
+	return NULL;
+}
+
+gboolean
+bacon_video_widget_set_visuals (BaconVideoWidget *bvw, const char *name)
+{
+	return FALSE;
+}
+
+void
+bacon_video_widget_set_visuals_quality (BaconVideoWidget *bvw,
+		VisualsQuality quality)
+{
+}
+
+gboolean
+bacon_video_widget_get_auto_resize (BaconVideoWidget *bvw)
+{
+	return FALSE;
+}
+
+void
+bacon_video_widget_set_auto_resize (BaconVideoWidget *bvw,
+		gboolean auto_resize)
+{
+}
+
+gint64
+bacon_video_widget_get_current_time (BaconVideoWidget *bvw)
+{
+	return -1;
+}
+
+gint64
+bacon_video_widget_get_stream_length (BaconVideoWidget *bvw)
+{
+	return 0;
+}
+
+gboolean
+bacon_video_widget_is_playing (BaconVideoWidget *bvw)
+{
+	return 0;
+}
+
+gboolean
+bacon_video_widget_is_seekable (BaconVideoWidget *bvw)
+{
+	return FALSE;
+}
+
+gboolean
+bacon_video_widget_can_play (BaconVideoWidget *bvw, MediaType type)
+{
+	return FALSE;
+}
+
+char
+**bacon_video_widget_get_mrls (BaconVideoWidget *bvw, MediaType type)
+{
+	return NULL;
+}
+
+void
+bacon_video_widget_set_subtitle_font (BaconVideoWidget *bvw, const char *font)
+{
+}
+
+void
+bacon_video_widget_set_subtitle_encoding (BaconVideoWidget *bvw, const char *encoding)
+{
+}
+
+void
+bacon_video_widget_set_video_device (BaconVideoWidget *bvw, const char *path)
+{
+}
+
+void
+bacon_video_widget_set_aspect_ratio (BaconVideoWidget *bvw,
+		BaconVideoWidgetAspectRatio ratio)
+{
+}
+
+BaconVideoWidgetAspectRatio
+bacon_video_widget_get_aspect_ratio (BaconVideoWidget *bvw)
+{
+	return 0;
+}
+
+void
+bacon_video_widget_set_scale_ratio (BaconVideoWidget *bvw, gfloat ratio)
+{
+}
+
+gboolean
+bacon_video_widget_can_set_zoom (BaconVideoWidget *bvw)
+{
+	return FALSE;
+}
+
+void
+bacon_video_widget_set_zoom (BaconVideoWidget *bvw, int zoom)
+{
+}
+
+int
+bacon_video_widget_get_zoom (BaconVideoWidget *bvw)
+{
+	return 100;
+}
+
+int
+bacon_video_widget_get_video_property (BaconVideoWidget *bvw,
+		BaconVideoWidgetVideoProperty type)
+{
+	return 65535 / 2;
+}
+
+void
+bacon_video_widget_set_video_property (BaconVideoWidget *bvw,
+		BaconVideoWidgetVideoProperty type, int value)
+{
+}
+
+BaconVideoWidgetAudioOutType
+bacon_video_widget_get_audio_out_type (BaconVideoWidget *bvw)
+{
+	return BVW_AUDIO_SOUND_STEREO;
+}
+
+gboolean
+bacon_video_widget_set_audio_out_type (BaconVideoWidget *bvw,
+		BaconVideoWidgetAudioOutType type)
+{
+	return FALSE;
+}
+
+static void
+bacon_video_widget_get_metadata_string (BaconVideoWidget *bvw, BaconVideoWidgetMetadataType type,
+		GValue *value)
+{
+#if 0
+	const char *string = NULL;
+
+	g_value_init (value, G_TYPE_STRING);
+
+	if (bvw->priv->stream == NULL)
+	{
+		g_value_set_string (value, string);
+		return;
+	}
+
+	switch (type)
+	{
+	case BVW_INFO_TITLE:
+		string = xine_get_meta_info (bvw->priv->stream,
+				XINE_META_INFO_TITLE);
+		break;
+	case BVW_INFO_ARTIST:
+		string = xine_get_meta_info (bvw->priv->stream,
+				XINE_META_INFO_ARTIST);
+		break;
+	case BVW_INFO_ALBUM:
+		string = xine_get_meta_info (bvw->priv->stream,
+				XINE_META_INFO_ALBUM);
+		break;
+	case BVW_INFO_YEAR:
+		string = xine_get_meta_info (bvw->priv->stream,
+				XINE_META_INFO_YEAR);
+		break;
+	case BVW_INFO_VIDEO_CODEC:
+		string = xine_get_meta_info (bvw->priv->stream,
+				XINE_META_INFO_VIDEOCODEC);
+		break;
+	case BVW_INFO_AUDIO_CODEC:
+		string = xine_get_meta_info (bvw->priv->stream,
+				XINE_META_INFO_AUDIOCODEC);
+		break;
+	 case BVW_INFO_AUDIO_CHANNELS:
+		{
+		//FIXME xine-lib sucks at this, it gives the
+		//mode of the output, not the one of the file
+#if 0
+			int mode;
+
+			mode = xine_get_stream_info (bvw->priv->stream,
+					XINE_STREAM_INFO_AUDIO_MODE);
+			switch (mode) {
+#endif
+		}
+		break;
+	default:
+		g_assert_not_reached ();
+	}
+
+	if (string != NULL && string[0] == '\0')
+		string = NULL;
+
+	if (string != NULL)
+	{
+		if (g_utf8_validate (string, -1, NULL) == FALSE)
+		{
+			char *utf8;
+
+			g_warning ("Metadata for index %d not in UTF-8 for mrl '%s'", type, bvw->priv->mrl);
+			utf8 = g_locale_to_utf8 (string, -1, NULL, NULL, NULL);
+			g_value_set_string (value, utf8);
+			g_free (utf8);
+			return;
+		}
+	}
+
+	g_value_set_string (value, string);
+#endif
+	return;
+}
+
+static void
+bacon_video_widget_get_metadata_int (BaconVideoWidget *bvw,
+		BaconVideoWidgetMetadataType type, GValue *value)
+{
+#if 0
+	int integer = 0;
+
+	g_value_init (value, G_TYPE_INT);
+
+	if (bvw->priv->stream == NULL)
+	{
+		g_value_set_int (value, 0);
+		return;
+	}
+
+	switch (type)
+	{
+	case BVW_INFO_DURATION:
+		integer = bacon_video_widget_get_stream_length (bvw) / 1000;
+		break;
+	case BVW_INFO_DIMENSION_X:
+		integer = xine_get_stream_info (bvw->priv->stream,
+				XINE_STREAM_INFO_VIDEO_WIDTH);
+		break;
+	case BVW_INFO_DIMENSION_Y:
+		integer = xine_get_stream_info (bvw->priv->stream,
+				XINE_STREAM_INFO_VIDEO_HEIGHT);
+		break;
+	case BVW_INFO_FPS:
+		if (xine_get_stream_info (bvw->priv->stream,
+					XINE_STREAM_INFO_FRAME_DURATION) != 0)
+		{
+			integer = 90000 / xine_get_stream_info
+				(bvw->priv->stream,
+				 XINE_STREAM_INFO_FRAME_DURATION);
+		} else {
+			integer = 0;
+		}
+		break;
+	 case BVW_INFO_AUDIO_BITRATE:
+		integer = xine_get_stream_info (bvw->priv->stream,
+				XINE_STREAM_INFO_AUDIO_BITRATE) / 1000;
+		break;
+	 case BVW_INFO_VIDEO_BITRATE:
+		integer = xine_get_stream_info (bvw->priv->stream,
+				XINE_STREAM_INFO_VIDEO_BITRATE) / 1000;
+		break;
+	 case BVW_INFO_TRACK_NUMBER:
+		{
+			const char *string;
+			string = xine_get_meta_info (bvw->priv->stream,
+					XINE_META_INFO_TRACK_NUMBER);
+			if (string == NULL)
+				return;
+
+			integer = (int) g_ascii_strtod (string, NULL);
+		}
+		break;
+	 case BVW_INFO_AUDIO_SAMPLE_RATE:
+		integer = xine_get_stream_info (bvw->priv->stream,
+				XINE_STREAM_INFO_AUDIO_SAMPLERATE);
+		break;
+	 default:
+		g_assert_not_reached ();
+	 }
+
+	 g_value_set_int (value, integer);
+#endif
+	 return;
+}
+
+static void
+bacon_video_widget_get_metadata_bool (BaconVideoWidget *bvw,
+		BaconVideoWidgetMetadataType type, GValue *value)
+{
+#if 0
+	gboolean boolean = FALSE;
+
+	g_value_init (value, G_TYPE_BOOLEAN);
+
+	if (bvw->priv->stream == NULL)
+	{
+		g_value_set_boolean (value, FALSE);
+		return;
+	}
+
+	switch (type)
+	{
+	case BVW_INFO_HAS_VIDEO:
+		if (bvw->priv->logo_mode == FALSE)
+			boolean = xine_get_stream_info (bvw->priv->stream,
+					XINE_STREAM_INFO_HAS_VIDEO);
+		break;
+	case BVW_INFO_HAS_AUDIO:
+		if (bvw->priv->logo_mode == FALSE)
+			boolean = xine_get_stream_info (bvw->priv->stream,
+					XINE_STREAM_INFO_HAS_AUDIO);
+		break;
+	case BVW_INFO_STILL_IMAGE:
+		{
+			const char *layer;
+			layer = xine_get_meta_info (bvw->priv->stream,
+					XINE_META_INFO_SYSTEMLAYER);
+			if (strcmp (layer, "MNG") == 0 || strcmp (layer, "imagedmx") == 0)
+				boolean = TRUE;
+		}
+		break;
+	default:
+		g_assert_not_reached ();
+	}
+
+	g_value_set_boolean (value, boolean);
+#endif
+	return;
+}
+
+void
+bacon_video_widget_get_metadata (BaconVideoWidget *bvw,
+		BaconVideoWidgetMetadataType type, GValue *value)
+{
+	g_return_if_fail (bvw != NULL);
+	g_return_if_fail (BACON_IS_VIDEO_WIDGET (bvw));
+	g_return_if_fail (value != NULL);
+
+	switch (type)
+	{
+	case BVW_INFO_TITLE:
+	case BVW_INFO_ARTIST:
+	case BVW_INFO_ALBUM:
+	case BVW_INFO_YEAR:
+	case BVW_INFO_VIDEO_CODEC:
+	case BVW_INFO_AUDIO_CODEC:
+	case BVW_INFO_AUDIO_CHANNELS:
+		bacon_video_widget_get_metadata_string (bvw, type, value);
+		break;
+	case BVW_INFO_DURATION:
+	case BVW_INFO_DIMENSION_X:
+	case BVW_INFO_DIMENSION_Y:
+	case BVW_INFO_FPS:
+	case BVW_INFO_AUDIO_BITRATE:
+	case BVW_INFO_VIDEO_BITRATE:
+	case BVW_INFO_TRACK_NUMBER:
+	case BVW_INFO_AUDIO_SAMPLE_RATE:
+		bacon_video_widget_get_metadata_int (bvw, type, value);
+		break;
+	case BVW_INFO_HAS_VIDEO:
+	case BVW_INFO_HAS_AUDIO:
+	case BVW_INFO_STILL_IMAGE:
+		bacon_video_widget_get_metadata_bool (bvw, type, value);
+		break;
+	default:
+		g_assert_not_reached ();
+	}
+}
+
+GList
+*bacon_video_widget_get_languages (BaconVideoWidget *bvw)
+{
+	return NULL;
+}
+
+int
+bacon_video_widget_get_language (BaconVideoWidget *bvw)
+{
+	return -1;
+}
+
+void
+bacon_video_widget_set_language (BaconVideoWidget *bvw, int language)
+{
+}
+
+GList
+*bacon_video_widget_get_subtitles (BaconVideoWidget *bvw)
+{
+	return NULL;
+}
+
+int
+bacon_video_widget_get_subtitle (BaconVideoWidget *bvw)
+{
+	return -2;
+}
+
+void
+bacon_video_widget_set_subtitle (BaconVideoWidget *bvw, int subtitle)
+{
+}
+
+gboolean
+bacon_video_widget_has_next_track (BaconVideoWidget *bvw)
+{
+	return FALSE;
+}
+
+gboolean
+bacon_video_widget_has_previous_track (BaconVideoWidget *bvw)
+{
+	return FALSE;
+}
+
+gboolean
+bacon_video_widget_can_get_frames (BaconVideoWidget *bvw, GError **error)
+{
+	return FALSE;
+}
+
+GdkPixbuf *
+bacon_video_widget_get_current_frame (BaconVideoWidget *bvw)
+{
+	return NULL;
+}
Index: src/backend/bacon-video-widget-xine.c
===================================================================
RCS file: /cvs/gnome/totem/src/backend/bacon-video-widget-xine.c,v
retrieving revision 1.247
diff -u -p -r1.247 bacon-video-widget-xine.c
--- src/backend/bacon-video-widget-xine.c	30 Oct 2006 23:59:00 -0000	1.247
+++ src/backend/bacon-video-widget-xine.c	1 Nov 2006 18:54:25 -0000
@@ -3488,8 +3488,6 @@ bacon_video_widget_get_metadata_string (
 	}
 
 	g_value_set_string (value, string);
-
-	return;
 }
 
 static void
@@ -3558,8 +3556,6 @@ bacon_video_widget_get_metadata_int (Bac
 	 }
 
 	 g_value_set_int (value, integer);
-
-	 return;
 }
 
 static void
@@ -3602,8 +3598,6 @@ bacon_video_widget_get_metadata_bool (Ba
 	}
 
 	g_value_set_boolean (value, boolean);
-
-	return;
 }
 
 void
@@ -3644,8 +3638,6 @@ bacon_video_widget_get_metadata (BaconVi
 	default:
 		g_assert_not_reached ();
 	}
-
-	return;
 }
 
 GList
