[Xfce4-commits] <parole:master> Provide a command line to be used to enable/disable xv, X Video support might be missing for some drivers.
Ali Abdallah
noreply at xfce.org
Thu Dec 3 12:40:05 CET 2009
Updating branch refs/heads/master
to de85198feca13b95de2e650738cfd0e4c9808450 (commit)
from 72c8879ed83aae9b9a488678ab07717fdf78c709 (commit)
commit de85198feca13b95de2e650738cfd0e4c9808450
Author: Ali Abdallah <aliov at xfce.org>
Date: Thu Dec 3 12:38:35 2009 +0100
Provide a command line to be used to enable/disable xv,
X Video support might be missing for some drivers.
common/Makefile.am | 7 ++++-
{src => common}/parole-rc-utils.c | 0
{src => common}/parole-rc-utils.h | 0
gst/parole-gst.c | 15 ++++++++++--
src/Makefile.am | 45 ++++++++++++++++--------------------
src/main.c | 22 ++++++++++++++++++
6 files changed, 59 insertions(+), 30 deletions(-)
diff --git a/common/Makefile.am b/common/Makefile.am
index 7aef2cf..bd51b3b 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -4,10 +4,13 @@ noinst_LTLIBRARIES = \
libparolecommon_la_SOURCES = \
parole-common.c \
- parole-common.h
+ parole-common.h \
+ parole-rc-utils.c \
+ parole-rc-utils.h
libparolecommon_la_CFLAGS = \
- $(GTK_CFLAGS)
+ $(GTK_CFLAGS) \
+ $(LIBXFCE4UTIL_CFLAGS)
libparolescreensaver_la_SOURCES = \
parole-screensaver.c \
diff --git a/src/parole-rc-utils.c b/common/parole-rc-utils.c
similarity index 100%
rename from src/parole-rc-utils.c
rename to common/parole-rc-utils.c
diff --git a/src/parole-rc-utils.h b/common/parole-rc-utils.h
similarity index 100%
rename from src/parole-rc-utils.h
rename to common/parole-rc-utils.h
diff --git a/gst/parole-gst.c b/gst/parole-gst.c
index a02d6d9..d946717 100644
--- a/gst/parole-gst.c
+++ b/gst/parole-gst.c
@@ -42,6 +42,7 @@
#include "parole-gst-iface.h"
#include "common/parole-common.h"
+#include "common/parole-rc-utils.h"
#include "gst-enum-types.h"
#include "gstmarshal.h"
@@ -1666,8 +1667,12 @@ parole_gst_constructed (GObject *object)
{
ParoleGst *gst;
+ gboolean enable_xv;
+
gst = PAROLE_GST (object);
+ enable_xv = parole_rc_read_entry_bool ("enable-xv", PAROLE_RC_GROUP_GENERAL, TRUE);
+
gst->priv->playbin = gst_element_factory_make ("playbin", "player");
if ( G_UNLIKELY (gst->priv->playbin == NULL) )
@@ -1678,12 +1683,16 @@ parole_gst_constructed (GObject *object)
g_error ("playbin load failed");
}
- gst->priv->video_sink = gst_element_factory_make ("xvimagesink", "video");
- gst->priv->xvimage_sink = TRUE;
+ if (enable_xv)
+ {
+ gst->priv->video_sink = gst_element_factory_make ("xvimagesink", "video");
+ gst->priv->xvimage_sink = TRUE;
+ }
+
if ( G_UNLIKELY (gst->priv->video_sink == NULL) )
{
gst->priv->xvimage_sink = FALSE;
- g_debug ("xvimagesink not found, trying to load ximagesink");
+ g_debug ("%s trying to load ximagesink", enable_xv ? "xvimagesink not found " : "xv disabled ");
gst->priv->video_sink = gst_element_factory_make ("ximagesink", "video");
if ( G_UNLIKELY (gst->priv->video_sink == NULL) )
diff --git a/src/Makefile.am b/src/Makefile.am
index 973ef3a..b2928a8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -30,52 +30,47 @@ GENERATED_FILES = \
org.parole.media.list.h \
org.parole.media.player.h
-NOINST_HFILES = \
- parole-player.h \
- parole-vis.h \
- parole-statusbar.h \
- parole-mediachooser.h \
- parole-conf.h \
- parole-conf-dialog.h \
- parole-rc-utils.h \
- parole-utils.h \
- parole-disc.h \
- parole-medialist.h \
- parole-plugins-manager.h \
- parole-module.h \
- parole-about.h \
- parole-builder.h \
- parole-subtitle-encoding.h \
- parole-open-location.h \
- parole-disc-menu.h \
- parole-session.h \
- parole-button.h \
- parole-plugin-player.h
-
parole_SOURCES = \
$(GENERATED_FILES) \
- $(NOINST_HFILES) \
main.c \
parole-player.c \
+ parole-player.h \
parole-vis.c \
+ parole-vis.h \
parole-statusbar.c \
+ parole-statusbar.h \
parole-medialist.c \
+ parole-medialist.h \
parole-mediachooser.c \
+ parole-mediachooser.h \
parole-conf.c \
+ parole-conf.h \
parole-conf-dialog.c \
+ parole-conf-dialog.h \
parole-disc.c \
- parole-rc-utils.c \
+ parole-disc.h \
parole-utils.c \
+ parole-utils.h \
parole-plugins-manager.c \
+ parole-plugins-manager.h \
parole-module.c \
+ parole-module.h \
parole-about.c \
+ parole-about.h \
parole-builder.c \
+ parole-builder.h \
parole-subtitle-encoding.c \
+ parole-subtitle-encoding.h \
parole-open-location.c \
+ parole-open-location.h \
parole-disc-menu.c \
+ parole-disc-menu.h \
parole-session.c \
+ parole-session.h \
parole-button.c \
- parole-plugin-player.c
+ parole-button.h \
+ parole-plugin-player.c \
+ parole-plugin-player.h
parole_LDADD = \
$(top_builddir)/parole/libparole.la \
diff --git a/src/main.c b/src/main.c
index 5f65b1e..28e9e9f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -46,6 +46,7 @@
#include "parole-session.h"
#include "parole-dbus.h"
#include "parole-builder.h"
+#include "parole-rc-utils.h"
static void G_GNUC_NORETURN
show_version (void)
@@ -160,6 +161,26 @@ parole_send_message (const gchar *message)
}
+static gboolean
+xv_option_given (const gchar *name, const gchar *value, gpointer data, GError **error)
+{
+ gboolean enabled = TRUE;
+
+ if ( !g_strcmp0 (value, "TRUE") || !g_strcmp0 (value, "true"))
+ enabled = TRUE;
+ else if (!g_strcmp0 (value, "FALSE") || !g_strcmp0 (value, "false"))
+ enabled = FALSE;
+ else
+ {
+ g_set_error (error, 0, 0, "%s %s : %s", name, _("Unknown argument "), value);
+ return FALSE;
+ }
+
+ parole_rc_write_entry_bool ("enable-xv", PAROLE_RC_GROUP_GENERAL, enabled);
+
+ exit (0);
+}
+
int main (int argc, char **argv)
{
ParolePlayer *player;
@@ -201,6 +222,7 @@ int main (int argc, char **argv)
{ "lower-volume", 'l', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &lower_volume, N_("Lower volume"), NULL },
{ "mute", 'm', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &mute, N_("Mute volume"), NULL },
{ "version", 'V', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &version, N_("Version information"), NULL },
+ { "xv", '\0', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_CALLBACK, (GOptionArgFunc) xv_option_given, N_("Enabled/Disable XV support"), NULL},
{ "sm-client-id", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &client_id, NULL, NULL },
{G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, N_("Media to play"), NULL},
{ NULL, },
More information about the Xfce4-commits
mailing list