summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-03-28 02:02:37 +0000
committerjstebbins <[email protected]>2015-03-28 02:02:37 +0000
commit3d87473c97540146822334e074d9b2f3ca5bbda8 (patch)
tree4d367c69cd9209bdd2a43c5aaf2d1684ea497408 /gtk
parent8d9f7c7afc46a934ec492bc0253d1bea2dd6defc (diff)
LinGui: refresh mingw build of gtk UI
Fixes a couple issues. adds qsv support. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7025 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/configure.ac31
-rw-r--r--gtk/module.defs7
-rw-r--r--gtk/src/callbacks.c4
-rw-r--r--gtk/src/main.c35
4 files changed, 60 insertions, 17 deletions
diff --git a/gtk/configure.ac b/gtk/configure.ac
index 33b76b38f..21a0cac07 100644
--- a/gtk/configure.ac
+++ b/gtk/configure.ac
@@ -56,6 +56,10 @@ AC_ARG_ENABLE(dl,
AS_HELP_STRING([--enable-dl], [enable libdl]),
use_libdl=yes, use_libdl=no)
+AC_ARG_ENABLE(pthread,
+ AS_HELP_STRING([--enable-pthread], [enable libpthread]),
+ use_libpthread=yes, use_libpthread=no)
+
AC_ARG_ENABLE(fdk-aac,
AS_HELP_STRING([--enable-fdk-aac], [enable fdk aac encoder]),
use_fdk_aac=yes, use_fdk_aac=no)
@@ -64,6 +68,10 @@ AC_ARG_ENABLE(x265,
AS_HELP_STRING([--enable-x265], [enable x265 encoder]),
use_x265=yes, use_x265=no)
+AC_ARG_ENABLE(qsv,
+ AS_HELP_STRING([--enable-qsv], [enable QSV encoder]),
+ use_qsv=yes, use_qsv=no)
+
AC_ARG_ENABLE(gst,
AS_HELP_STRING([--disable-gst], [disable gstreamer (live preview)]),
gst_disable=yes, gst_disable=no)
@@ -153,22 +161,19 @@ PKG_CHECK_MODULES(GHB, [$GHB_PACKAGES])
GHB_CFLAGS="$HBINC $GHB_CFLAGS"
-AC_PATH_PROG(BUILD_PKG_CONFIG, pkg-config, no)
-if test x"$BUILD_PKG_CONFIG" = x"no"; then
- AC_MSG_ERROR([You need to install pkg-config])
-fi
-
-GHB_TOOLS_CFLAGS=`$BUILD_PKG_CONFIG --cflags glib-2.0 gdk-pixbuf-2.0 gtk+-3.0 jansson`
-GHB_TOOLS_LIBS=`$BUILD_PKG_CONFIG --libs glib-2.0 gdk-pixbuf-2.0 jansson`
-
HB_LIBS="-lhandbrake -lavresample -lavformat -lavcodec -lavutil -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson"
case $host in
*-*-mingw*)
if test "x$use_libdl" = "xyes" ; then
- HB_LIBS+=" -ldl -lpthreadGC2"
+ HB_LIBS+=" -ldl"
fi
- HB_LIBS+=" -lpthreadGC2 -lregex"
+ if test "x$use_libpthread" = "xyes" ; then
+ HB_LIBS+=" -lpthread"
+ else
+ HB_LIBS+=" -lpthreadGC2"
+ fi
+ HB_LIBS+=" -lregex"
;;
*)
HB_LIBS+=" -ldl -lpthread"
@@ -183,9 +188,11 @@ if test "x$use_x265" = "xyes" ; then
HB_LIBS+=" -lx265"
fi
+if test "x$use_qsv" = "xyes" ; then
+ HB_LIBS+=" -lmfx"
+fi
+
AC_SUBST(HB_LIBS)
-AC_SUBST(GHB_TOOLS_CFLAGS)
-AC_SUBST(GHB_TOOLS_LIBS)
AC_SUBST(GHB_CFLAGS)
AC_SUBST(GHB_LIBS)
diff --git a/gtk/module.defs b/gtk/module.defs
index b203ff74e..78b80d071 100644
--- a/gtk/module.defs
+++ b/gtk/module.defs
@@ -19,6 +19,9 @@ GTK.CONFIGURE.extra += --host=$(BUILD.spec) --disable-gst
ifeq ($(HAS.dlfcn),1)
GTK.CONFIGURE.extra += --enable-dl
endif
+ifeq ($(HAS.pthread),1)
+ GTK.CONFIGURE.extra += --enable-pthread
+endif
endif
ifeq (0,$(FEATURE.gtk.update.checks))
@@ -36,3 +39,7 @@ endif
ifeq (1,$(FEATURE.x265))
GTK.CONFIGURE.extra += --enable-x265
endif
+
+ifeq (1,$(FEATURE.qsv))
+ GTK.CONFIGURE.extra += --enable-qsv
+endif
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 4fb885994..21d8f5c9f 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -623,7 +623,7 @@ set_destination_settings(signal_user_data_t *ud, GhbValue *settings)
time_t t = time(NULL);
lt = localtime(&t);
st[0] = 0;
- strftime(st, 6, "%R", lt);
+ strftime(st, 6, "%H:%M", lt);
g_string_append_printf(str, "%s", st);
p += strlen("{time}");
}
@@ -634,7 +634,7 @@ set_destination_settings(signal_user_data_t *ud, GhbValue *settings)
time_t t = time(NULL);
lt = localtime(&t);
dt[0] = 0;
- strftime(dt, 11, "%F", lt);
+ strftime(dt, 11, "%Y-%m-%d", lt);
g_string_append_printf(str, "%s", dt);
p += strlen("{date}");
}
diff --git a/gtk/src/main.c b/gtk/src/main.c
index d50dbc891..6895122df 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -632,15 +632,20 @@ IoRedirect(signal_user_data_t *ud)
// Set encoding to raw.
g_io_channel_set_encoding(ud->activity_log, NULL, NULL);
// redirect stderr to the writer end of the pipe
+
#if defined(_WIN32)
- _dup2(pfd[1], STDERR_FILENO);
- // Non-console windows apps do not have a stderr->_file assigned properly
- stderr->_file = STDERR_FILENO;
+ _dup2(pfd[1], _fileno(stderr));
#else
dup2(pfd[1], STDERR_FILENO);
#endif
setvbuf(stderr, NULL, _IONBF, 0);
+
+#if defined(_WIN32)
+ channel = g_io_channel_win32_new_fd(pfd[0]);
+#else
channel = g_io_channel_unix_new(pfd[0]);
+#endif
+
// I was getting an this error:
// "Invalid byte sequence in conversion input"
// Set disable encoding on the channel.
@@ -657,12 +662,16 @@ typedef struct
static gchar *dvd_device = NULL;
static gchar *arg_preset = NULL;
static gboolean ghb_debug = FALSE;
+static gboolean win32_console = FALSE;
static GOptionEntry entries[] =
{
{ "device", 'd', 0, G_OPTION_ARG_FILENAME, &dvd_device, N_("The device or file to encode"), NULL },
{ "preset", 'p', 0, G_OPTION_ARG_STRING, &arg_preset, N_("The preset values to use for encoding"), NULL },
{ "debug", 'x', 0, G_OPTION_ARG_NONE, &ghb_debug, N_("Spam a lot"), NULL },
+#if defined(_WIN32)
+ { "console",'c', 0, G_OPTION_ARG_NONE, &win32_console, N_("Open a console for debug output"), NULL },
+#endif
{ NULL }
};
@@ -813,6 +822,26 @@ main(int argc, char *argv[])
}
g_option_context_free(context);
+#if defined(_WIN32)
+ if (win32_console)
+ {
+ // Enable console logging
+ if(AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole()){
+ close(STDOUT_FILENO);
+ freopen("CONOUT$", "w", stdout);
+ close(STDERR_FILENO);
+ freopen("CONOUT$", "w", stderr);
+ }
+ }
+ else
+ {
+ // Non-console windows apps do not have a stderr->_file
+ // assigned properly
+ stderr->_file = STDERR_FILENO;
+ stdout->_file = STDOUT_FILENO;
+ }
+#endif
+
if (argc > 1 && dvd_device == NULL && argv[1][0] != '-')
{
dvd_device = argv[1];