OSDN Git Service

LinGui: refactor --enable-gst option
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 29 Jan 2011 22:13:18 +0000 (22:13 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 29 Jan 2011 22:13:18 +0000 (22:13 +0000)
change to --disable-gst and make it work for both mingw and linux

git-svn-id: svn://localhost/HandBrake/trunk@3774 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/configure.ac
gtk/module.defs
gtk/src/main.c
make/configure.py

index bda4d37..9f54347 100644 (file)
@@ -60,8 +60,8 @@ AC_ARG_ENABLE(dl,
        use_libdl=yes, use_libdl=no)
 
 AC_ARG_ENABLE(gst,
-       AS_HELP_STRING([--enable-gst], [enable gstreamer on Win32]),
-       w32_gst=yes, w32_gst=no)
+       AS_HELP_STRING([--disable-gst], [disable gstreamer (live preview)]),
+       gst_disable=yes, gst_disable=no)
 
 AC_ARG_ENABLE(update-checks,
        AS_HELP_STRING([--disable-update-checks], [disable update checks]),
@@ -86,20 +86,24 @@ AM_PROG_LIBTOOL
 
 case $host in
   *-*-mingw*)
-    if test "x$w32_gst" = "xyes" ; then
-               GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0"
-       else
+    if test "x$gst_disable" = "xyes" ; then
         GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gio-2.0"
+       else
+               GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0"
        fi
        mingw_flag=yes
     ;;
   *)
-       GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 libnotify gudev-1.0"
+    if test "x$gst_disable" = "xyes" ; then
+           GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gio-2.0 libnotify gudev-1.0"
+    else
+           GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 libnotify gudev-1.0"
+    fi
        mingw_flag=no
     ;;
 esac
 
-if test "x$w32_gst" = "xyes" -o  "x$mingw_flag" != "xyes" ; then
+if test "x$gst_disable" = "xno" ; then
        CXXFLAGS="$CXXFLAGS -D_ENABLE_GST"
        CFLAGS="$CFLAGS -D_ENABLE_GST"
 fi
index cc20a18..c37af41 100644 (file)
@@ -15,7 +15,7 @@ BUILD.out += $(GTK.out)
 ###############################################################################
 
 ifeq (1-mingw,$(BUILD.cross)-$(BUILD.system))
-GTK.CONFIGURE.extra += --host=$(BUILD.spec) 
+GTK.CONFIGURE.extra += --host=$(BUILD.spec) --disable-gst
 ifeq ($(HAS.dlfcn),1)
        GTK.CONFIGURE.extra += --enable-dl
 endif
@@ -25,3 +25,7 @@ ifeq (0,$(FEATURE.gtk.update.checks))
        GTK.CONFIGURE.extra += --disable-update-checks
 endif
 
+ifeq (0,$(FEATURE.gst))
+       GTK.CONFIGURE.extra += --disable-gst
+endif
+
index de995e9..72617eb 100644 (file)
 
 #include <gtk/gtk.h>
 
-#if !defined(_WIN32)
+#if defined(_ENABLE_GST)
 #include <gst/gst.h>
+#endif
+
+#if !defined(_WIN32)
 #include <libnotify/notify.h>
 #include <dbus/dbus-glib.h>
 #else
@@ -772,7 +775,7 @@ main (int argc, char *argv[])
        context = g_option_context_new ("- Rip and encode DVD or MPEG file");
        g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
        g_option_context_add_group (context, gtk_get_option_group (TRUE));
-#if !defined(_WIN32)
+#if defined(_ENABLE_GST)
        g_option_context_add_group (context, gst_init_get_option_group ());
 #endif
        g_option_context_parse (context, &argc, &argv, &error);
index c069fc3..f9d5f26 100644 (file)
@@ -1059,6 +1059,8 @@ def createCLI():
     grp.add_option( '--disable-gtk-update-checks', default=False, action='store_true', help=h )
     h = IfHost( 'enable GTK GUI (mingw)', '*-*-mingw*', none=optparse.SUPPRESS_HELP ).value
     grp.add_option( '--enable-gtk-mingw', default=False, action='store_true', help=h )
+    h = IfHost( 'disable gstreamer (live preview)', '*-*-linux*', none=optparse.SUPPRESS_HELP ).value
+    grp.add_option( '--disable-gst', default=False, action='store_true', help=h )
     h = IfHost( 'enable use of ffmpeg mpeg2 decoding', '*-*-*', none=optparse.SUPPRESS_HELP ).value
     grp.add_option( '--enable-ff-mpeg2', default=False, action='store_true', help=h )
 
@@ -1457,6 +1459,7 @@ int main ()
     doc.add( 'FEATURE.gtk',   int( not options.disable_gtk ))
     doc.add( 'FEATURE.gtk.update.checks',   int( not options.disable_gtk_update_checks ))
     doc.add( 'FEATURE.gtk.mingw',   int( options.enable_gtk_mingw ))
+    doc.add( 'FEATURE.gst',   int( not options.disable_gst ))
     doc.add( 'FEATURE.ff.mpeg2',   int( options.enable_ff_mpeg2 ))
     doc.add( 'FEATURE.xcode', int( not (Tools.xcodebuild.fail or options.disable_xcode or options.cross) ))