totem r6258 - in trunk: . browser-plugin src src/backend



Author: pwithnall
Date: Wed Apr 15 06:19:30 2009
New Revision: 6258
URL: http://svn.gnome.org/viewvc/totem?rev=6258&view=rev

Log:
2009-04-15  Philip Withnall  <philip tecnocode co uk>

	* browser-plugin/totem-plugin-viewer.c
	(totem_embedded_open_internal):
	* src/backend/bacon-video-widget-gst-0.10.c
	(bacon_video_widget_class_init), (bacon_video_widget_set_property),
	(bacon_video_widget_get_property), (bacon_video_widget_open),
	(bacon_video_widget_get_mrls):
	* src/backend/bacon-video-widget-xine.c
	(bacon_video_widget_class_init), (xine_try_error),
	(bacon_video_widget_open), (bacon_video_widget_set_property),
	(bacon_video_widget_get_property), (bacon_video_widget_get_mrls):
	* src/backend/bacon-video-widget.h:
	* src/backend/bvw-test.c (test_bvw_set_mrl):
	* src/totem-audio-preview.c (main):
	* src/totem-object.c (totem_action_load_media),
	(totem_action_set_mrl_with_warning), (on_got_redirect):
	* src/totem-properties-view.c (totem_properties_view_set_location):
	* src/totem-video-indexer.c (main):
	* src/totem-video-thumbnailer.c (main): Tidy up BaconVideoWidget,
	removing bacon_video_widget_open_with_subtitles in favour of just
	having _open with a mandatory subtitles parameter, renaming two
	badly-named properties, and renaming a badly-named enum member.
	(Helps: #577961)



Modified:
   trunk/ChangeLog
   trunk/browser-plugin/totem-plugin-viewer.c
   trunk/src/backend/bacon-video-widget-gst-0.10.c
   trunk/src/backend/bacon-video-widget-xine.c
   trunk/src/backend/bacon-video-widget.h
   trunk/src/backend/bvw-test.c
   trunk/src/totem-audio-preview.c
   trunk/src/totem-object.c
   trunk/src/totem-properties-view.c
   trunk/src/totem-video-indexer.c
   trunk/src/totem-video-thumbnailer.c

Modified: trunk/browser-plugin/totem-plugin-viewer.c
==============================================================================
--- trunk/browser-plugin/totem-plugin-viewer.c	(original)
+++ trunk/browser-plugin/totem-plugin-viewer.c	Wed Apr 15 06:19:30 2009
@@ -474,7 +474,7 @@
 
 	/* FIXME: remove |err| and rely on async on_error? */
 	g_message ("BEFORE _open");
-	retval = bacon_video_widget_open (emb->bvw, uri, &err);
+	retval = bacon_video_widget_open (emb->bvw, uri, NULL, &err);
 	g_message ("AFTER _open (ret: %d)", retval);
 	if (retval == FALSE)
 	{

Modified: trunk/src/backend/bacon-video-widget-gst-0.10.c
==============================================================================
--- trunk/src/backend/bacon-video-widget-gst-0.10.c	(original)
+++ trunk/src/backend/bacon-video-widget-gst-0.10.c	Wed Apr 15 06:19:30 2009
@@ -104,7 +104,7 @@
   PROP_STREAM_LENGTH,
   PROP_PLAYING,
   PROP_SEEKABLE,
-  PROP_SHOWCURSOR,
+  PROP_SHOW_CURSOR,
   PROP_SHOW_VISUALS,
   PROP_VOLUME
 };
@@ -972,12 +972,12 @@
 	                           g_param_spec_double ("volume", NULL, NULL,
 	                                                0.0, 1.0, 0.0,
 	                                                G_PARAM_READWRITE));
-  g_object_class_install_property (object_class, PROP_SHOWCURSOR,
-                                   g_param_spec_boolean ("showcursor", NULL,
+  g_object_class_install_property (object_class, PROP_SHOW_CURSOR,
+                                   g_param_spec_boolean ("show-cursor", NULL,
                                                          NULL, FALSE,
                                                          G_PARAM_READWRITE));
   g_object_class_install_property (object_class, PROP_SHOW_VISUALS,
-                                   g_param_spec_boolean ("showvisuals", NULL,
+                                   g_param_spec_boolean ("show-visuals", NULL,
                                                          NULL, FALSE,
                                                          G_PARAM_WRITABLE));
 
@@ -1945,7 +1945,7 @@
       bacon_video_widget_set_logo_mode (bvw,
       g_value_get_boolean (value));
       break;
-    case PROP_SHOWCURSOR:
+    case PROP_SHOW_CURSOR:
       bacon_video_widget_set_show_cursor (bvw,
       g_value_get_boolean (value));
       break;
@@ -1990,7 +1990,7 @@
       g_value_set_boolean (value,
       bacon_video_widget_is_seekable (bvw));
       break;
-    case PROP_SHOWCURSOR:
+    case PROP_SHOW_CURSOR:
       g_value_set_boolean (value,
       bacon_video_widget_get_show_cursor (bvw));
       break;
@@ -2618,8 +2618,8 @@
 }
 
 gboolean
-bacon_video_widget_open_with_subtitle (BaconVideoWidget * bvw,
-    const gchar * mrl, const gchar *subtitle_uri, GError ** error)
+bacon_video_widget_open (BaconVideoWidget * bvw,
+                         const gchar * mrl, const gchar *subtitle_uri, GError ** error)
 {
   GstMessage *err_msg = NULL;
   GFile *file;
@@ -4090,7 +4090,7 @@
       break;
     }
     case MEDIA_TYPE_CDDA:
-      g_set_error_literal (error, BVW_ERROR, BVW_ERROR_UNVALID_LOCATION,
+      g_set_error_literal (error, BVW_ERROR, BVW_ERROR_INVALID_LOCATION,
                            "XXX Do not use XXX");
       return NULL;
     default:

Modified: trunk/src/backend/bacon-video-widget-xine.c
==============================================================================
--- trunk/src/backend/bacon-video-widget-xine.c	(original)
+++ trunk/src/backend/bacon-video-widget-xine.c	Wed Apr 15 06:19:30 2009
@@ -105,7 +105,7 @@
 	PROP_STREAM_LENGTH,
 	PROP_PLAYING,
 	PROP_SEEKABLE,
-	PROP_SHOWCURSOR,
+	PROP_SHOW_CURSOR,
 	PROP_SHOW_VISUALS,
 	PROP_VOLUME
 };
@@ -341,11 +341,11 @@
 	                g_param_spec_double ("volume", NULL, NULL,
 	                        0.0, 1.0, 0.0,
 	                        G_PARAM_READWRITE));
-	g_object_class_install_property (object_class, PROP_SHOWCURSOR,
-			g_param_spec_boolean ("showcursor", NULL, NULL,
+	g_object_class_install_property (object_class, PROP_SHOW_CURSOR,
+			g_param_spec_boolean ("show-cursor", NULL, NULL,
 				FALSE, G_PARAM_READWRITE));
 	g_object_class_install_property (object_class, PROP_SHOW_VISUALS,
-			g_param_spec_boolean ("showvisuals", NULL, NULL,
+			g_param_spec_boolean ("show-visuals", NULL, NULL,
 				FALSE, G_PARAM_WRITABLE));
 
 	/* Signals */
@@ -1614,7 +1614,7 @@
                                      _("This movie is broken and can not be played further."));
 		break;
 	case XINE_ERROR_MALFORMED_MRL:
-		g_set_error_literal (error, BVW_ERROR, BVW_ERROR_UNVALID_LOCATION,
+		g_set_error_literal (error, BVW_ERROR, BVW_ERROR_INVALID_LOCATION,
                                      _("This location is not a valid one."));
 		break;
 	case XINE_ERROR_INPUT_FAILED:
@@ -2354,8 +2354,8 @@
 }
 
 gboolean
-bacon_video_widget_open_with_subtitle (BaconVideoWidget *bvw, const char *mrl,
-		const char *subtitle_uri, GError **error)
+bacon_video_widget_open (BaconVideoWidget *bvw, const char *mrl,
+			 const char *subtitle_uri, GError **error)
 {
 	int err;
 
@@ -2717,7 +2717,7 @@
 		bacon_video_widget_set_logo_mode (bvw,
 				g_value_get_boolean (value));
 		break;
-	case PROP_SHOWCURSOR:
+	case PROP_SHOW_CURSOR:
 		bacon_video_widget_set_show_cursor (bvw,
 				g_value_get_boolean (value));
 		break;
@@ -2762,7 +2762,7 @@
 		g_value_set_boolean (value,
 				bacon_video_widget_is_seekable (bvw));
 		break;
-	case PROP_SHOWCURSOR:
+	case PROP_SHOW_CURSOR:
 		g_value_set_boolean (value,
 				bacon_video_widget_get_show_cursor (bvw));
 		break;
@@ -3417,7 +3417,7 @@
 		entry_name = "media.dvb.adapter";
 		break;
 	case MEDIA_TYPE_CDDA:
-		g_set_error_literal (error, BVW_ERROR, BVW_ERROR_UNVALID_LOCATION,
+		g_set_error_literal (error, BVW_ERROR, BVW_ERROR_INVALID_LOCATION,
 			             "XXX Do not use XXX");
 		return NULL;
 	default:

Modified: trunk/src/backend/bacon-video-widget.h
==============================================================================
--- trunk/src/backend/bacon-video-widget.h	(original)
+++ trunk/src/backend/bacon-video-widget.h	Wed Apr 15 06:19:30 2009
@@ -86,7 +86,7 @@
 	BVW_ERROR_NETWORK_UNREACHABLE,
 	BVW_ERROR_CONNECTION_REFUSED,
 	/* Generic */
-	BVW_ERROR_UNVALID_LOCATION,
+	BVW_ERROR_INVALID_LOCATION,
 	BVW_ERROR_GENERIC,
 	BVW_ERROR_CODEC_NOT_HANDLED,
 	BVW_ERROR_AUDIO_ONLY,
@@ -116,8 +116,7 @@
 char *bacon_video_widget_get_backend_name (BaconVideoWidget *bvw);
 
 /* Actions */
-#define bacon_video_widget_open(bvw, mrl, error) bacon_video_widget_open_with_subtitle(bvw, mrl, NULL, error)
-gboolean bacon_video_widget_open_with_subtitle	 (BaconVideoWidget *bvw,
+gboolean bacon_video_widget_open		 (BaconVideoWidget *bvw,
 						  const char *mrl,
 						  const char *subtitle_uri,
 						  GError **error);

Modified: trunk/src/backend/bvw-test.c
==============================================================================
--- trunk/src/backend/bvw-test.c	(original)
+++ trunk/src/backend/bvw-test.c	Wed Apr 15 06:19:30 2009
@@ -16,7 +16,7 @@
 test_bvw_set_mrl (const char *path)
 {
 	mrl = g_strdup (path);
-	bacon_video_widget_open (BACON_VIDEO_WIDGET (bvw), mrl, NULL);
+	bacon_video_widget_open (BACON_VIDEO_WIDGET (bvw), mrl, NULL, NULL);
 }
 
 static void

Modified: trunk/src/totem-audio-preview.c
==============================================================================
--- trunk/src/totem-audio-preview.c	(original)
+++ trunk/src/totem-audio-preview.c	Wed Apr 15 06:19:30 2009
@@ -121,7 +121,7 @@
 	bvw = BACON_VIDEO_WIDGET (widget);
 
 	totem_resources_monitor_start (NULL, -1);
-	if (bacon_video_widget_open (bvw, path, &error) == FALSE) {
+	if (bacon_video_widget_open (bvw, path, NULL, &error) == FALSE) {
 		g_print ("Can't open %s: %s\n", path, error->message);
 		return 1;
 	}

Modified: trunk/src/totem-object.c
==============================================================================
--- trunk/src/totem-object.c	(original)
+++ trunk/src/totem-object.c	Wed Apr 15 06:19:30 2009
@@ -1175,7 +1175,7 @@
 			g_free (msg);
 			return FALSE;
 		/* Unsupported type (ie. CDDA) */
-		} else if (g_error_matches (error, BVW_ERROR, BVW_ERROR_UNVALID_LOCATION) != FALSE) {
+		} else if (g_error_matches (error, BVW_ERROR, BVW_ERROR_INVALID_LOCATION) != FALSE) {
 			msg = g_strdup_printf(_("Totem cannot play this type of media (%s) because it is not supported."), _(totem_cd_get_human_readable_name (type)));
 			totem_action_error (msg, _("Please insert another disc to play back."), totem);
 			g_free (msg);
@@ -1672,8 +1672,7 @@
 			autoload_sub = totem_uri_get_subtitle_uri (mrl);
 
 		totem_gdk_window_set_waiting_cursor (totem->win->window);
-		retval = bacon_video_widget_open_with_subtitle (totem->bvw, mrl,
-								subtitle ? subtitle : autoload_sub, &err);
+		retval = bacon_video_widget_open (totem->bvw, mrl, subtitle ? subtitle : autoload_sub, &err);
 		g_free (autoload_sub);
 		gdk_window_set_cursor (totem->win->window, NULL);
 		totem->mrl = g_strdup (mrl);
@@ -2309,7 +2308,7 @@
 	bacon_video_widget_close (totem->bvw);
 	totem_file_closed (totem);
 	totem_gdk_window_set_waiting_cursor (totem->win->window);
-	bacon_video_widget_open (totem->bvw, new_mrl ? new_mrl : mrl, NULL);
+	bacon_video_widget_open (totem->bvw, new_mrl ? new_mrl : mrl, NULL, NULL);
 	totem_file_opened (totem, new_mrl ? new_mrl : mrl);
 	gdk_window_set_cursor (totem->win->window, NULL);
 	bacon_video_widget_play (bvw, NULL);

Modified: trunk/src/totem-properties-view.c
==============================================================================
--- trunk/src/totem-properties-view.c	(original)
+++ trunk/src/totem-properties-view.c	Wed Apr 15 06:19:30 2009
@@ -176,7 +176,7 @@
 		bacon_video_widget_close (props->priv->bvw);
 		bacon_video_widget_properties_reset (props->priv->props);
 
-		if (bacon_video_widget_open (props->priv->bvw, location, &error) == FALSE) {
+		if (bacon_video_widget_open (props->priv->bvw, location, NULL, &error) == FALSE) {
 			g_warning ("Couldn't open %s: %s", location, error->message);
 			g_error_free (error);
 			return;

Modified: trunk/src/totem-video-indexer.c
==============================================================================
--- trunk/src/totem-video-indexer.c	(original)
+++ trunk/src/totem-video-indexer.c	Wed Apr 15 06:19:30 2009
@@ -204,7 +204,7 @@
 	path = filenames[0];
 	if (time_limit != FALSE)
 		totem_resources_monitor_start (path, 0);
-	if (bacon_video_widget_open (bvw, path, &error) == FALSE) {
+	if (bacon_video_widget_open (bvw, path, NULL, &error) == FALSE) {
 		g_print ("Can't open %s: %s\n", path, error->message);
 		return 1;
 	}

Modified: trunk/src/totem-video-thumbnailer.c
==============================================================================
--- trunk/src/totem-video-thumbnailer.c	(original)
+++ trunk/src/totem-video-thumbnailer.c	Wed Apr 15 06:19:30 2009
@@ -842,7 +842,7 @@
 
 	PROGRESS_DEBUG("About to open video file");
 
-	if (bacon_video_widget_open (bvw, input, &err) == FALSE) {
+	if (bacon_video_widget_open (bvw, input, NULL, &err) == FALSE) {
 		g_print ("totem-video-thumbnailer couldn't open file '%s'\n"
 				"Reason: %s.\n",
 				input, err->message);



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