summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--browser-plugin/Makefile.am17
-rw-r--r--configure.in105
-rw-r--r--docs/reference/Makefile.am5
-rw-r--r--po/POTFILES.in2
-rw-r--r--src/Makefile.am69
-rw-r--r--src/backend/Makefile.am24
-rw-r--r--src/backend/bacon-video-widget.c1
-rw-r--r--src/backend/video-utils.c35
-rw-r--r--src/backend/video-utils.h2
-rw-r--r--src/gst/Makefile.am63
-rw-r--r--src/gst/totem-gst-helpers.c185
-rw-r--r--src/gst/totem-gst-helpers.h5
-rw-r--r--src/gst/totem-gst-pixbuf-helpers.c225
-rw-r--r--src/gst/totem-gst-pixbuf-helpers.h44
-rw-r--r--src/gst/totem-time-helpers.c63
-rw-r--r--src/gst/totem-time-helpers.h35
-rw-r--r--src/plugins/Makefile.plugins8
-rw-r--r--src/plugins/grilo/Makefile.am6
-rw-r--r--src/plugins/grilo/totem-grilo.c2
-rw-r--r--src/plugins/skipto/totem-skipto.c1
-rw-r--r--src/plugins/skipto/totem-time-entry.c2
-rw-r--r--src/properties/Makefile.am2
-rw-r--r--src/totem-statusbar.c2
-rw-r--r--src/totem-time-label.c2
-rw-r--r--src/totem-video-thumbnailer.c2
25 files changed, 511 insertions, 396 deletions
diff --git a/browser-plugin/Makefile.am b/browser-plugin/Makefile.am
index 831448cab..f03a61885 100644
--- a/browser-plugin/Makefile.am
+++ b/browser-plugin/Makefile.am
@@ -68,12 +68,12 @@ test_glow_button_SOURCES = \
totem-glow-button.h \
test-glow-button.c
-test_glow_button_LDADD = \
- $(DEPENDENCY_LIBS) \
+test_glow_button_LDADD = \
+ $(GLOW_BUTTON_LIBS) \
-lm
-test_glow_button_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
+test_glow_button_CFLAGS = \
+ $(GLOW_BUTTON_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CFLAGS)
@@ -98,19 +98,14 @@ totem_plugin_viewer_CPPFLAGS = \
$(AM_CPPFLAGS)
totem_plugin_viewer_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
+ $(PLUGIN_VIEWER_CFLAGS) \
$(WARN_CFLAGS) \
- $(DBUS_CFLAGS) \
- $(SN_CFLAGS) \
$(AM_CFLAGS)
totem_plugin_viewer_LDADD = \
$(top_builddir)/src/backend/libbaconvideowidget.la \
$(top_builddir)/src/libtotem_player.la \
- $(DEPENDENCY_LIBS) \
- $(SN_LIBS) \
- $(DBUS_LIBS) \
- $(X_LIBS)
+ $(PLUGIN_VIEWER_LIBS)
totem-plugin-viewer-interface.h: org_gnome_totem_PluginViewer.xml
$(DBUS_BIND) --prefix=totem_embedded --mode=glib-server $< > $@
diff --git a/configure.in b/configure.in
index f12301d6b..8223992a2 100644
--- a/configure.in
+++ b/configure.in
@@ -54,6 +54,7 @@ PYGOBJECT_REQS=2.90.3
GRILO_REQS=0.2.0
LIBXML_REQS=2.6.0
+# Used in the pkg-config file for plugins
AC_SUBST(GLIB_REQS)
AC_SUBST(GTK_REQS)
AC_SUBST(TOTEM_PLPARSER_REQS)
@@ -85,10 +86,9 @@ CLUTTER_REQS=1.6.8
CLUTTER_GST_REQS=1.5.5
CLUTTER_GTK_REQS=1.0.2
-HAVE_GSTREAMER=no
-
dnl Check for the required GStreamer versions for missing plugins
dnl installation, unless this has been disabled.
+MISSING_PLUGINS_MODULES=""
AC_MSG_CHECKING([whether to enable easy codec installation support])
AC_ARG_ENABLE([easy-codec-installation],
[
@@ -109,15 +109,22 @@ AC_ARG_ENABLE([easy-codec-installation],
AC_MSG_RESULT([$enable_easy_codec_installation])
if test "x$enable_easy_codec_installation" != "xno"; then
- PKG_CHECK_MODULES(MISSING_PLUGINS, gstreamer-pbutils-1.0,
+ MISSING_PLUGINS_MODULES="gstreamer-pbutils-1.0"
+ PKG_CHECK_MODULES(MISSING_PLUGINS, $MISSING_PLUGINS_MODULES,
[
AC_DEFINE([ENABLE_MISSING_PLUGIN_INSTALLATION], 1,
[Whether we can and want to do installation of missing plugins])
])
fi
-MM="gstreamer-1.0 >= $GST_REQS gstreamer-base-1.0 >= $GST_REQS gstreamer-plugins-base-1.0 >= $GST_PLUG_BASE_REQS gstreamer-tag-1.0 >= $GSTPLUG_REQS gstreamer-audio-1.0 gstreamer-video-1.0 clutter-1.0 >= $CLUTTER_REQS clutter-gst-2.0 >= $CLUTTER_GST_REQS clutter-gtk-1.0 gsettings-desktop-schemas"
-PKG_CHECK_MODULES(GST, $MM)
+# ================================================================
+# Backend requirements
+# ================================================================
+
+BACKEND_MODULES="gstreamer-1.0 >= $GST_REQS gstreamer-base-1.0 >= $GST_REQS gstreamer-plugins-base-1.0 >= $GST_PLUG_BASE_REQS $MISSING_PLUGINS_MODULES gstreamer-tag-1.0 >= $GSTPLUG_REQS gstreamer-audio-1.0 gstreamer-video-1.0 clutter-1.0 >= $CLUTTER_REQS clutter-gst-2.0 >= $CLUTTER_GST_REQS clutter-gtk-1.0 cairo gnome-icon-theme >= $GNOMEICON_REQS gsettings-desktop-schemas"
+
+PKG_CHECK_MODULES(BACKEND, $BACKEND_MODULES)
+PKG_CHECK_MODULES(BACKEND_TEST, $BACKEND_MODULES gtk+-3.0 >= $GTK_REQS)
dnl Check for required plugins
gst010_toolsdir=`$PKG_CONFIG --variable=toolsdir gstreamer-1.0`
@@ -234,65 +241,6 @@ AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
AM_CONDITIONAL([WITH_SMCLIENT_QUARTZ],[test "$with_smclient" = "quartz"])
-dnl Pkg-config checks
-
-PKG_CHECK_MODULES([DEPENDENCY],[
- glib-2.0 >= $GLIB_REQS
- gio-2.0 >= $GIO_REQS
- gtk+-3.0 >= $GTK_REQS
- gdk-x11-3.0 >= $GTK_REQS
- gmodule-2.0
- totem-plparser >= $TOTEM_PLPARSER_REQS
- gstreamer-tag-1.0 >= 0.10.26
- clutter-gtk-1.0 >= $CLUTTER_GTK_REQS
- cairo])
-
-PKG_CHECK_MODULES(MM, $MM)
-
-PKG_CHECK_MODULES([GTK],[gtk+-3.0 gthread-2.0])
-GTK_LIBS="$GTK_LIBS $EXTRA_BACKEND_LIBS"
-AC_SUBST(GTK_LIBS)
-
-AC_SUBST([EXTRA_BACKEND_LIBS])
-
-PKG_CHECK_EXISTS([
- $ISO_CODES
- gnome-icon-theme >= $GNOMEICON_REQS])
-
-dnl *************************
-dnl X11 related functionality
-dnl *************************
-have_x11=no
-gdk_targets=$(pkg-config --variable=targets gtk+-3.0)
-for gdk_target in $gdk_targets; do
- if test x$gdk_target = xx11; then
- AC_PATH_X
-
- have_x11=yes
-
- if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
- X_INCLUDES=-I`echo $x_includes | sed -e "s/:/ -I/g"`
- fi
- if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
- X_LIBRARIES=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
- fi
- CFLAGS="$X_INCLUDES $CFLAGS"
- LIBS="$X_LIBRARIES $LIBS"
-
- dnl Explicitely link against libX11 to avoid problems with crappy linkers
- X_LIBS="$X_LIBRARIES -lX11"
- AC_SUBST(X_LIBS)
-
- break
- fi
-done
-
-dnl ================================================================
-dnl Plugins support
-dnl ================================================================
-
-PKG_CHECK_MODULES(PEAS, libpeas-1.0 >= $PEAS_REQS)
-PKG_CHECK_MODULES(PEASGTK, libpeas-gtk-1.0 >= $PEAS_REQS)
# ================================================================
# Python plugins
@@ -309,6 +257,7 @@ AC_MSG_RESULT([$enable_python])
have_python=no
have_pygobject=no
+PYTHON_MODULES=""
# Test for the Python run time and PyGObject. Test for pylint as well, for `make check`.
if test "x$enable_python" != "xno"; then
@@ -317,17 +266,18 @@ if test "x$enable_python" != "xno"; then
have_python=no
fi
- PKG_CHECK_MODULES([PYGOBJECT],[pygobject-3.0 >= $PYGOBJECT_REQS],[have_pygobject=yes],[have_pygobject=no])
+ PYTHON_MODULES="pygobject-3.0 >= $PYGOBJECT_REQS"
+ PKG_CHECK_MODULES([PYGOBJECT],[$PYTHON_MODULES],[have_pygobject=yes],[have_pygobject=no])
AC_PATH_PROG([PYLINT], [pylint], [no])
fi
# Output the results of the Python checks
if test "x$have_python" != "xyes" -o "x$have_pygobject" != "xyes" -o "x$PYLINT" = "xno"; then
if test "x$enable_python" = "xyes"; then
- AC_MSG_ERROR([python >= $PYTHON_REQS, pygobject-3.0 >= $PYGOBJECT_REQS or pylint not found])
+ AC_MSG_ERROR([python >= $PYTHON_REQS, $PYTHON_MODULES or pylint not found])
elif test "x$enable_python" = "xautodetect"; then
enable_python=no
- AC_MSG_WARN([python >= $PYTHON_REQS, pygobject-3.0 >= $PYGOBJECT_REQS or pylint not found; disabling Python support])
+ AC_MSG_WARN([python >= $PYTHON_REQS, $PYTHON_MODULES or pylint not found; disabling Python support])
fi
elif test "x$enable_python" != "xno"; then
enable_python=yes
@@ -335,6 +285,19 @@ fi
AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
+# ================================================================
+# Player requirements
+#================================================================
+
+PKG_CHECK_MODULES(PLAYER, $BACKEND_MODULES glib-2.0 >= $GLIB_REQS gio-2.0 >= $GIO_REQS gtk+-3.0 >= $GTK_REQS gdk-x11-3.0 >= $GTK_REQS gmodule-2.0 totem-plparser >= $TOTEM_PLPARSER_REQS libpeas-1.0 >= $PEAS_REQS libpeas-gtk-1.0 >= $PEAS_REQS $PYTHON_MODULES)
+PKG_CHECK_MODULES(LIBPLAYER, glib-2.0 >= $GLIB_REQS gio-2.0 >= $GIO_REQS gtk+-3.0 >= $GTK_REQS gdk-x11-3.0 >= $GTK_REQS clutter-gtk-1.0)
+PKG_CHECK_MODULES(HELPER, gstreamer-1.0)
+PKG_CHECK_MODULES(TIME_HELPER, glib-2.0)
+PKG_CHECK_MODULES(PIXBUF_HELPER, gdk-pixbuf-2.0 gstreamer-tag-1.0 >= $GSTPLUG_REQS gstreamer-video-1.0)
+PKG_CHECK_MODULES(THUMBNAILER, gtk+-3.0 >= $GTK_REQS totem-plparser >= $TOTEM_PLPARSER_REQS gstreamer-tag-1.0 >= $GSTPLUG_REQS gstreamer-video-1.0)
+PKG_CHECK_MODULES(PREVIEW, gstreamer-1.0 >= $GST_REQS gio-2.0 >= $GIO_REQS gdk-pixbuf-2.0)
+PKG_CHECK_MODULES(PROPERTIES, gtk+-3.0 >= $GTK_REQS)
+
dnl ================================================================
dnl Vala plugins
dnl ================================================================
@@ -593,6 +556,9 @@ if test "$enable_browser_plugins" = "yes" ; then
if test "$have_no_rtti_flag" = "yes"; then
AM_CXXFLAGS="-fno-rtti $AM_CXXFLAGS"
fi
+
+ PKG_CHECK_MODULES(PLUGIN_VIEWER, $BACKEND_MODULES gtk+-3.0 >= $GTK_REQS totem-plparser >= $TOTEM_PLPARSER_REQS gdk-x11-3.0 >= $GTK_REQS dbus-glib-1 >= $DBUS_REQS)
+ PKG_CHECK_MODULES(GLOW_BUTTON, gtk+-3.0)
fi
AM_CONDITIONAL([ENABLE_BROWSER_PLUGINS], [test "$enable_browser_plugins" = "yes"])
@@ -654,7 +620,7 @@ AC_ARG_ENABLE(nautilus,
[ENABLE_NAUTILUS=yes]) dnl Default value
if test x$ENABLE_NAUTILUS = "xyes" ; then
- PKG_CHECK_MODULES(NAUTILUS, gtk+-3.0 gthread-2.0 libnautilus-extension,
+ PKG_CHECK_MODULES(NAUTILUS, gtk+-3.0 gthread-2.0 libnautilus-extension gstreamer-tag-1.0 >= $GSTPLUG_REQS $MISSING_PLUGINS_MODULES,
[HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
fi
@@ -663,9 +629,6 @@ AC_ARG_WITH(nautilusdir,
[ac_with_nautilusdir=$withval],
[ac_with_nautilusdir=""])
-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])
if test "${ac_with_nautilusdir}" = ""; then
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 67a4c88fe..cba3eee7d 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -138,11 +138,10 @@ GTKDOC_CFLAGS = \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/backend \
-I$(top_srcdir)/src/plugins \
- $(DEPENDENCY_CFLAGS) \
- $(PEAS_CFLAGS)
+ $(PLAYER_CFLAGS)
GTKDOC_LIBS = \
$(top_builddir)/src/libtotem.la \
- $(DEPENDENCY_LIBS)
+ $(PLAYER_LIBS)
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 88dce0e2e..69f947d9e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -11,8 +11,8 @@ data/totem.desktop.in.in.in
[type: gettext/glade]data/totem.ui
[type: gettext/glade]data/uri.ui
[type: gettext/glade]data/video-list.ui
+src/gst/totem-time-helpers.h
src/backend/bacon-video-widget.c
-src/backend/video-utils.c
src/eggdesktopfile.c
src/eggfileformatchooser.c
src/eggsmclient.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 793cc4851..1d54d7184 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,13 +46,16 @@ libtotem_player_la_SOURCES = \
totem-time-label.c \
totem-time-label.h
-libtotem_player_la_CPPFLAGS = \
+libtotem_player_la_CPPFLAGS = \
-DG_LOG_DOMAIN=\""Totem"\" \
$(AM_CPPFLAGS)
-libtotem_player_la_LIBADD = $(DEPENDENCY_LIBS)
-libtotem_player_la_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
+libtotem_player_la_LIBADD = \
+ $(PLAYER_LIBS) \
+ gst/libtotemtimehelpers.la
+libtotem_player_la_CFLAGS = \
+ $(LIBPLAYER_CFLAGS) \
+ -I$(srcdir)/gst/ \
$(AM_CFLAGS)
# Totem main library (used for main player; separate to allow gtk-doc to be used)
@@ -97,9 +100,7 @@ libtotem_la_CPPFLAGS = \
$(AM_CPPFLAGS)
libtotem_la_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
- $(PEAS_CFLAGS) \
- $(PEASGTK_CFLAGS) \
+ $(PLAYER_CFLAGS) \
$(AM_CFLAGS)
libtotem_la_LDFLAGS = \
@@ -110,9 +111,7 @@ libtotem_la_LDFLAGS = \
libtotem_la_LIBADD = \
libtotem_player.la \
backend/libbaconvideowidget.la \
- $(PEAS_LIBS) \
- $(PEASGTK_LIBS) \
- $(DEPENDENCY_LIBS)
+ $(PLAYER_LIBS)
if WITH_SMCLIENT
libtotem_la_SOURCES += \
@@ -170,16 +169,13 @@ totem_CPPFLAGS = \
-DG_LOG_DOMAIN=\""Totem"\" \
$(AM_CPPFLAGS)
-totem_CFLAGS = \
- $(PEAS_CFLAGS) \
- $(DEPENDENCY_CFLAGS) \
+totem_CFLAGS = \
+ $(PLAYER_CFLAGS) \
$(AM_CFLAGS)
-totem_LDADD = \
- libtotem.la \
- $(DEPENDENCY_LIBS) \
- $(X_LIBS) \
- $(PEAS_LIBS)
+totem_LDADD = \
+ libtotem.la \
+ $(PLAYER_LIBS)
# Totem video thumbnailer
totem_video_thumbnailer_SOURCES = \
@@ -191,13 +187,15 @@ totem_video_thumbnailer_CPPFLAGS = \
-DG_LOG_DOMAIN=\""TotemVideoThumbnailer"\" \
$(AM_CPPFLAGS)
-totem_video_thumbnailer_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
+totem_video_thumbnailer_CFLAGS = \
+ $(THUMBNAILER_CFLAGS) \
$(AM_CFLAGS)
-totem_video_thumbnailer_LDADD = \
- backend/libbaconvideowidget.la \
- $(DEPENDENCY_LIBS)
+totem_video_thumbnailer_LDADD = \
+ $(THUMBNAILER_LIBS) \
+ gst/libtotemgstpixbufhelpers.la \
+ gst/libtotemgsthelpers.la \
+ gst/libtotemtimehelpers.la
# Nautilus Property Page
if HAVE_NAUTILUS
@@ -215,20 +213,17 @@ libtotem_properties_page_la_CPPFLAGS = \
-DG_LOG_DOMAIN=\""TotemPropertiesPage"\"\
$(AM_CPPFLAGS)
-libtotem_properties_page_la_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
- $(NAUTILUS_CFLAGS) \
+libtotem_properties_page_la_CFLAGS = \
+ $(NAUTILUS_CFLAGS) \
$(AM_CFLAGS)
libtotem_properties_page_la_LDFLAGS = \
-export_dynamic -avoid-version -module -no-undefined \
$(AM_LDFLAGS)
-libtotem_properties_page_la_LIBADD = \
- backend/libbaconvideowidget.la \
+libtotem_properties_page_la_LIBADD = \
properties/libbaconvideowidgetproperties.la \
libtotem_player.la \
- $(DEPENDENCY_LIBS) \
$(NAUTILUS_LIBS)
noinst_PROGRAMS = test-properties-page
@@ -244,8 +239,7 @@ test_properties_page_CPPFLAGS = \
-I$(top_srcdir)/src/properties \
$(AM_CPPFLAGS)
-test_properties_page_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
+test_properties_page_CFLAGS = \
$(NAUTILUS_CFLAGS) \
$(AM_CFLAGS)
@@ -253,7 +247,6 @@ test_properties_page_LDADD = \
backend/libbaconvideowidget.la \
properties/libbaconvideowidgetproperties.la \
libtotem_player.la \
- $(DEPENDENCY_LIBS) \
$(NAUTILUS_LIBS)
endif # HAVE_NAUTILUS
@@ -269,14 +262,13 @@ totem_audio_preview_CPPFLAGS = \
-DG_LOG_DOMAIN=\""TotemAudioPreview"\" \
$(AM_CPPFLAGS)
-totem_audio_preview_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
+totem_audio_preview_CFLAGS = \
+ $(PREVIEW_CFLAGS) \
$(AM_CFLAGS)
totem_audio_preview_LDADD = \
gst/libtotemgsthelpers.la \
- backend/libbaconvideowidget.la \
- $(DEPENDENCY_LIBS)
+ $(PREVIEW_LIBS)
# Introspection
-include $(INTROSPECTION_MAKEFILE)
@@ -293,9 +285,8 @@ introspection_sources = $(INST_H_FILES) $(filter %.c,$(libtotem_player_la_SOURCE
Totem-1.0.gir: libtotem.la
Totem_1_0_gir_INCLUDES = GLib-2.0 GObject-2.0 Gtk-3.0 TotemPlParser-1.0
Totem_1_0_gir_SCANNERFLAGS = --c-include=totem.h --pkg-export=totem
-Totem_1_0_gir_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
- $(PEAS_CFLAGS) \
+Totem_1_0_gir_CFLAGS = \
+ $(PLAYER_CFLAGS) \
$(libtotem_la_CPPFLAGS)
Totem_1_0_gir_LIBS = libtotem.la
Totem_1_0_gir_FILES = $(introspection_sources)
diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index 60df37efe..8094242b6 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -11,14 +11,13 @@ bvw_test_CPPFLAGS = \
$(DISABLE_DEPRECATED) \
$(AM_CPPFLAGS)
-bvw_test_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
- $(MM_CFLAGS) \
+bvw_test_CFLAGS = \
+ $(BACKEND_CFLAGS) \
$(AM_CFLAGS)
-bvw_test_LDADD = \
+bvw_test_LDADD = \
libbaconvideowidget.la \
- $(DEPENDENCY_LIBS)
+ $(BACKEND_LIBS)
# Marshallers
BVW_MARSHAL_FILES = baconvideowidget-marshal.c baconvideowidget-marshal.h
@@ -70,17 +69,14 @@ libbaconvideowidget_la_CPPFLAGS = \
$(DISABLE_DEPRECATED) \
$(AM_CPPFLAGS)
-libbaconvideowidget_la_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
- $(MM_CFLAGS) \
- $(MISSING_PLUGINS_CFLAGS) \
+libbaconvideowidget_la_CFLAGS = \
+ $(BACKEND_CFLAGS) \
$(AM_CFLAGS)
-libbaconvideowidget_la_LIBADD = \
- $(top_builddir)/src/gst/libtotemgsthelpers.la \
- $(MM_LIBS) \
- $(X_LIBS) \
- $(MISSING_PLUGINS_LIBS) \
+libbaconvideowidget_la_LIBADD = \
+ $(top_builddir)/src/gst/libtotemgsthelpers.la \
+ $(top_builddir)/src/gst/libtotemgstpixbufhelpers.la \
+ $(BACKEND_LIBS) \
-lm
libbaconvideowidget_la_LDFLAGS= \
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index 7c1a676ae..17bd35423 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -84,6 +84,7 @@
#include <gdesktop-enums.h>
#include "totem-gst-helpers.h"
+#include "totem-gst-pixbuf-helpers.h"
#include "bacon-video-widget.h"
#include "bacon-video-widget-gst-missing-plugins.h"
#include "bacon-video-osd-actor.h"
diff --git a/src/backend/video-utils.c b/src/backend/video-utils.c
index fe0093de0..05cc31191 100644
--- a/src/backend/video-utils.c
+++ b/src/backend/video-utils.c
@@ -29,9 +29,6 @@
#include "video-utils.h"
-#include <glib/gi18n-lib.h>
-#include <libintl.h>
-
#include <gdk/gdk.h>
#include <stdlib.h>
#include <unistd.h>
@@ -60,38 +57,6 @@ totem_gdk_window_set_waiting_cursor (GdkWindow *window)
gdk_flush ();
}
-char *
-totem_time_to_string (gint64 msecs)
-{
- int sec, min, hour, _time;
-
- _time = (int) (msecs / 1000);
- sec = _time % 60;
- _time = _time - sec;
- min = (_time % (60*60)) / 60;
- _time = _time - (min * 60);
- hour = _time / (60*60);
-
- if (hour > 0)
- {
- /* hour:minutes:seconds */
- /* Translators: This is a time format, like "9:05:02" for 9
- * hours, 5 minutes, and 2 seconds. You may change ":" to
- * the separator that your locale uses or use "%Id" instead
- * of "%d" if your locale uses localized digits.
- */
- return g_strdup_printf (C_("long time format", "%d:%02d:%02d"), hour, min, sec);
- }
-
- /* minutes:seconds */
- /* Translators: This is a time format, like "5:02" for 5
- * minutes and 2 seconds. You may change ":" to the
- * separator that your locale uses or use "%Id" instead of
- * "%d" if your locale uses localized digits.
- */
- return g_strdup_printf (C_("short time format", "%d:%02d"), min, sec);
-}
-
static gboolean
totem_ratio_fits_screen_helper (GtkWidget *video_widget,
int new_w, int new_h,
diff --git a/src/backend/video-utils.h b/src/backend/video-utils.h
index eb3a14782..0ab73c27c 100644
--- a/src/backend/video-utils.h
+++ b/src/backend/video-utils.h
@@ -31,8 +31,6 @@
void totem_gdk_window_set_invisible_cursor (GdkWindow *window);
void totem_gdk_window_set_waiting_cursor (GdkWindow *window);
-char *totem_time_to_string (gint64 msecs);
-
gboolean totem_ratio_fits_screen (GtkWidget *widget,
int video_width,
int video_height,
diff --git a/src/gst/Makefile.am b/src/gst/Makefile.am
index c7cabfdb4..c5f11599b 100644
--- a/src/gst/Makefile.am
+++ b/src/gst/Makefile.am
@@ -1,27 +1,56 @@
-noinst_LTLIBRARIES = libtotemgsthelpers.la
+noinst_LTLIBRARIES = \
+ libtotemgsthelpers.la \
+ libtotemgstpixbufhelpers.la \
+ libtotemtimehelpers.la
-libtotemgsthelpers_la_SOURCES = \
- totem-gst-helpers.c \
+libtotemgsthelpers_la_SOURCES = \
+ totem-gst-helpers.c \
totem-gst-helpers.h
-libtotemgsthelpers_la_CPPFLAGS = \
- -D_REENTRANT \
- $(DISABLE_DEPRECATED) \
+libtotemgsthelpers_la_CPPFLAGS = \
+ -D_REENTRANT \
+ $(DISABLE_DEPRECATED) \
$(AM_CPPFLAGS)
-libtotemgsthelpers_la_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
- $(MM_CFLAGS) \
- $(MISSING_PLUGINS_CFLAGS) \
+libtotemgsthelpers_la_CFLAGS = \
+ $(HELPER_CFLAGS) \
$(AM_CFLAGS)
-libtotemgsthelpers_la_LIBADD = \
- $(MM_LIBS) \
- $(X_LIBS) \
- $(MISSING_PLUGINS_LIBS) \
- -lm
+libtotemgsthelpers_la_LIBADD = $(HELPER_LIBS)
+libtotemgsthelpers_la_LDFLAGS= -no-undefined
-libtotemgsthelpers_la_LDFLAGS= \
- -no-undefined
+libtotemgstpixbufhelpers_la_SOURCES = \
+ totem-gst-pixbuf-helpers.c \
+ totem-gst-pixbuf-helpers.h
+
+libtotemgstpixbufhelpers_la_CPPFLAGS = \
+ -D_REENTRANT \
+ $(DISABLE_DEPRECATED) \
+ $(AM_CPPFLAGS)
+
+libtotemgstpixbufhelpers_la_CFLAGS = \
+ $(PIXBUF_HELPER_CFLAGS) \
+ $(AM_CFLAGS)
+
+libtotemgstpixbufhelpers_la_LIBADD = $(PIXBUF_HELPER_LIBS)
+libtotemgstpixbufhelpers_la_LDFLAGS= -no-undefined
+
+libtotemtimehelpers_la_SOURCES = \
+ totem-time-helpers.c \
+ totem-time-helpers.h
+
+libtotemtimehelpers_la_CPPFLAGS = \
+ -D_REENTRANT \
+ $(DISABLE_DEPRECATED) \
+ $(AM_CPPFLAGS)
+
+libtotemtimehelpers_la_CFLAGS = \
+ $(TIME_HELPER_CFLAGS) \
+ $(AM_CFLAGS)
+
+libtotemtimehelpers_la_LIBADD = $(TIME_HELPER_LIBS)
+libtotemtimehelpers_la_LDFLAGS= -no-undefined
+
+EXTRA_DIST = totem-time-helpers.h
-include $(top_srcdir)/git.mk
diff --git a/src/gst/totem-gst-helpers.c b/src/gst/totem-gst-helpers.c
index 17b2f0565..62dde28ad 100644
--- a/src/gst/totem-gst-helpers.c
+++ b/src/gst/totem-gst-helpers.c
@@ -72,191 +72,6 @@ totem_gst_message_print (GstMessage *msg,
g_free (dbg);
}
-static void
-destroy_pixbuf (guchar *pix, gpointer data)
-{
- gst_sample_unref (GST_SAMPLE (data));
-}
-
-GdkPixbuf *
-totem_gst_playbin_get_frame (GstElement *play)
-{
- GstStructure *s;
- GstSample *sample = NULL;
- GdkPixbuf *pixbuf;
- GstCaps *to_caps, *sample_caps;
- gint outwidth = 0;
- gint outheight = 0;
- GstMemory *memory;
- GstMapInfo info;
-
- g_return_val_if_fail (play != NULL, NULL);
- g_return_val_if_fail (GST_IS_ELEMENT (play), NULL);
-
- /* our desired output format (RGB24) */
- to_caps = gst_caps_new_simple ("video/x-raw",
- "format", G_TYPE_STRING, "RGB",
- /* Note: we don't ask for a specific width/height here, so that
- * videoscale can adjust dimensions from a non-1/1 pixel aspect
- * ratio to a 1/1 pixel-aspect-ratio. We also don't ask for a
- * specific framerate, because the input framerate won't
- * necessarily match the output framerate if there's a deinterlacer
- * in the pipeline. */
- "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
- NULL);
-
- /* get frame */
- g_signal_emit_by_name (play, "convert-sample", to_caps, &sample);
- gst_caps_unref (to_caps);
-
- if (!sample) {
- GST_DEBUG ("Could not take screenshot: %s",
- "failed to retrieve or convert video frame");
- g_warning ("Could not take screenshot: %s",
- "failed to retrieve or convert video frame");
- return NULL;
- }
-
- sample_caps = gst_sample_get_caps (sample);
- if (!sample_caps) {
- GST_DEBUG ("Could not take screenshot: %s", "no caps on output buffer");
- g_warning ("Could not take screenshot: %s", "no caps on output buffer");
- return NULL;
- }
-
- GST_DEBUG ("frame caps: %" GST_PTR_FORMAT, sample_caps);
-
- s = gst_caps_get_structure (sample_caps, 0);
- gst_structure_get_int (s, "width", &outwidth);
- gst_structure_get_int (s, "height", &outheight);
- if (outwidth <= 0 || outheight <= 0)
- goto done;
-
- memory = gst_buffer_get_memory (gst_sample_get_buffer (sample), 0);
- gst_memory_map (memory, &info, GST_MAP_READ);
-
- /* create pixbuf from that - use our own destroy function */
- pixbuf = gdk_pixbuf_new_from_data (info.data,
- GDK_COLORSPACE_RGB, FALSE, 8, outwidth, outheight,
- GST_ROUND_UP_4 (outwidth * 3), destroy_pixbuf, sample);
-
- gst_memory_unmap (memory, &info);
-
-done:
- if (!pixbuf) {
- GST_DEBUG ("Could not take screenshot: %s", "could not create pixbuf");
- g_warning ("Could not take screenshot: %s", "could not create pixbuf");
- gst_sample_unref (sample);
- }
-
- return pixbuf;
-}
-
-static GdkPixbuf *
-totem_gst_buffer_to_pixbuf (GstBuffer *buffer)
-{
- GdkPixbufLoader *loader;
- GdkPixbuf *pixbuf = NULL;
- GError *err = NULL;
- GstMemory *memory;
- GstMapInfo info;
-
- memory = gst_buffer_get_memory (buffer, 0);
- if (!memory) {
- GST_WARNING("could not get memory for buffer");
- return NULL;
- }
-
- if (!gst_memory_map (memory, &info, GST_MAP_READ)) {
- GST_WARNING("could not map memory buffer");
- return NULL;
- }
-
- loader = gdk_pixbuf_loader_new ();
-
- if (gdk_pixbuf_loader_write (loader, info.data, info.size, &err) &&
- gdk_pixbuf_loader_close (loader, &err)) {
- pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
- if (pixbuf)
- g_object_ref (pixbuf);
- } else {
- GST_WARNING("could not convert tag image to pixbuf: %s", err->message);
- g_error_free (err);
- }
-
- g_object_unref (loader);
-
- gst_memory_unmap (memory, &info);
-
- return pixbuf;
-}
-
-static const GValue *
-totem_gst_tag_list_get_cover_real (GstTagList *tag_list)
-{
- const GValue *cover_value = NULL;
- guint i;
-
- for (i = 0; ; i++) {
- const GValue *value;
- GstSample *sample;
- const GstStructure *caps_struct;
- int type;
-
- value = gst_tag_list_get_value_index (tag_list,
- GST_TAG_IMAGE,
- i);
- if (value == NULL)
- break;
-
-
- sample = gst_value_get_sample (value);
- caps_struct = gst_sample_get_info (sample);
- gst_structure_get_enum (caps_struct,
- "image-type",
- GST_TYPE_TAG_IMAGE_TYPE,
- &type);
- if (type == GST_TAG_IMAGE_TYPE_UNDEFINED) {
- if (cover_value == NULL)
- cover_value = value;
- } else if (type == GST_TAG_IMAGE_TYPE_FRONT_COVER) {
- cover_value = value;
- break;
- }
- }
-
- return cover_value;
-}
-
-GdkPixbuf *
-totem_gst_tag_list_get_cover (GstTagList *tag_list)
-{
- const GValue *cover_value;
-
- g_return_val_if_fail (tag_list != NULL, FALSE);
-
- cover_value = totem_gst_tag_list_get_cover_real (tag_list);
- /* Fallback to preview */
- if (!cover_value) {
- cover_value = gst_tag_list_get_value_index (tag_list,
- GST_TAG_PREVIEW_IMAGE,
- 0);
- }
-
- if (cover_value) {
- GstBuffer *buffer;
- GstSample *sample;
- GdkPixbuf *pixbuf;
-
- sample = gst_value_get_sample (cover_value);
- buffer = gst_sample_get_buffer (sample);
- pixbuf = totem_gst_buffer_to_pixbuf (buffer);
- return pixbuf;
- }
-
- return NULL;
-}
-
/*
* vim: sw=2 ts=8 cindent noai bs=2
*/
diff --git a/src/gst/totem-gst-helpers.h b/src/gst/totem-gst-helpers.h
index 3e05b2743..5801eb5b6 100644
--- a/src/gst/totem-gst-helpers.h
+++ b/src/gst/totem-gst-helpers.h
@@ -31,7 +31,6 @@
#define GST_USE_UNSTABLE_API 1
#include <gst/gst.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
G_BEGIN_DECLS
@@ -53,10 +52,6 @@ void totem_gst_message_print (GstMessage *msg,
GstElement *play,
const char *filename);
-GdkPixbuf * totem_gst_playbin_get_frame (GstElement *play);
-
-GdkPixbuf * totem_gst_tag_list_get_cover (GstTagList *tag_list);
-
G_END_DECLS
#endif /* HAVE_TOTEM_GST_HELPERS_H */
diff --git a/src/gst/totem-gst-pixbuf-helpers.c b/src/gst/totem-gst-pixbuf-helpers.c
new file mode 100644
index 000000000..54ca32522
--- /dev/null
+++ b/src/gst/totem-gst-pixbuf-helpers.c
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) 2003-2007 the GStreamer project
+ * Julien Moutte <julien@moutte.net>
+ * Ronald Bultje <rbultje@ronald.bitfreak.net>
+ * Copyright (C) 2005-2008 Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ * Copyright © 2009 Christian Persch
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * The Totem project hereby grant permission for non-gpl compatible GStreamer
+ * plugins to be used and distributed together with GStreamer and Totem. This
+ * permission is above and beyond the permissions granted by the GPL license
+ * Totem is covered by.
+ *
+ * Monday 7th February 2005: Christian Schaller: Add exception clause.
+ * See license_change file for details.
+ *
+ */
+
+#include "totem-gst-pixbuf-helpers.h"
+
+#include <gst/tag/tag.h>
+#include <gst/video/video-format.h>
+
+static void
+destroy_pixbuf (guchar *pix, gpointer data)
+{
+ gst_sample_unref (GST_SAMPLE (data));
+}
+
+GdkPixbuf *
+totem_gst_playbin_get_frame (GstElement *play)
+{
+ GstStructure *s;
+ GstSample *sample = NULL;
+ GdkPixbuf *pixbuf;
+ GstCaps *to_caps, *sample_caps;
+ gint outwidth = 0;
+ gint outheight = 0;
+ GstMemory *memory;
+ GstMapInfo info;
+
+ g_return_val_if_fail (play != NULL, NULL);
+ g_return_val_if_fail (GST_IS_ELEMENT (play), NULL);
+
+ /* our desired output format (RGB24) */
+ to_caps = gst_caps_new_simple ("video/x-raw",
+ "format", G_TYPE_STRING, "RGB",
+ /* Note: we don't ask for a specific width/height here, so that
+ * videoscale can adjust dimensions from a non-1/1 pixel aspect
+ * ratio to a 1/1 pixel-aspect-ratio. We also don't ask for a
+ * specific framerate, because the input framerate won't
+ * necessarily match the output framerate if there's a deinterlacer
+ * in the pipeline. */
+ "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
+ NULL);
+
+ /* get frame */
+ g_signal_emit_by_name (play, "convert-sample", to_caps, &sample);
+ gst_caps_unref (to_caps);
+
+ if (!sample) {
+ GST_DEBUG ("Could not take screenshot: %s",
+ "failed to retrieve or convert video frame");
+ g_warning ("Could not take screenshot: %s",
+ "failed to retrieve or convert video frame");
+ return NULL;
+ }
+
+ sample_caps = gst_sample_get_caps (sample);
+ if (!sample_caps) {
+ GST_DEBUG ("Could not take screenshot: %s", "no caps on output buffer");
+ g_warning ("Could not take screenshot: %s", "no caps on output buffer");
+ return NULL;
+ }
+
+ GST_DEBUG ("frame caps: %" GST_PTR_FORMAT, sample_caps);
+
+ s = gst_caps_get_structure (sample_caps, 0);
+ gst_structure_get_int (s, "width", &outwidth);
+ gst_structure_get_int (s, "height", &outheight);
+ if (outwidth <= 0 || outheight <= 0)
+ goto done;
+
+ memory = gst_buffer_get_memory (gst_sample_get_buffer (sample), 0);
+ gst_memory_map (memory, &info, GST_MAP_READ);
+
+ /* create pixbuf from that - use our own destroy function */
+ pixbuf = gdk_pixbuf_new_from_data (info.data,
+ GDK_COLORSPACE_RGB, FALSE, 8, outwidth, outheight,
+ GST_ROUND_UP_4 (outwidth * 3), destroy_pixbuf, sample);
+
+ gst_memory_unmap (memory, &info);
+
+done:
+ if (!pixbuf) {
+ GST_DEBUG ("Could not take screenshot: %s", "could not create pixbuf");
+ g_warning ("Could not take screenshot: %s", "could not create pixbuf");
+ gst_sample_unref (sample);
+ }
+
+ return pixbuf;
+}
+
+static GdkPixbuf *
+totem_gst_buffer_to_pixbuf (GstBuffer *buffer)
+{
+ GdkPixbufLoader *loader;
+ GdkPixbuf *pixbuf = NULL;
+ GError *err = NULL;
+ GstMemory *memory;
+ GstMapInfo info;
+
+ memory = gst_buffer_get_memory (buffer, 0);
+ if (!memory) {
+ GST_WARNING("could not get memory for buffer");
+ return NULL;
+ }
+
+ if (!gst_memory_map (memory, &info, GST_MAP_READ)) {
+ GST_WARNING("could not map memory buffer");
+ return NULL;
+ }
+
+ loader = gdk_pixbuf_loader_new ();
+
+ if (gdk_pixbuf_loader_write (loader, info.data, info.size, &err) &&
+ gdk_pixbuf_loader_close (loader, &err)) {
+ pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+ if (pixbuf)
+ g_object_ref (pixbuf);
+ } else {
+ GST_WARNING("could not convert tag image to pixbuf: %s", err->message);
+ g_error_free (err);
+ }
+
+ g_object_unref (loader);
+
+ gst_memory_unmap (memory, &info);
+
+ return pixbuf;
+}
+
+static const GValue *
+totem_gst_tag_list_get_cover_real (GstTagList *tag_list)
+{
+ const GValue *cover_value = NULL;
+ guint i;
+
+ for (i = 0; ; i++) {
+ const GValue *value;
+ GstSample *sample;
+ const GstStructure *caps_struct;
+ int type;
+
+ value = gst_tag_list_get_value_index (tag_list,
+ GST_TAG_IMAGE,
+ i);
+ if (value == NULL)
+ break;
+
+
+ sample = gst_value_get_sample (value);
+ caps_struct = gst_sample_get_info (sample);
+ gst_structure_get_enum (caps_struct,
+ "image-type",
+ GST_TYPE_TAG_IMAGE_TYPE,
+ &type);
+ if (type == GST_TAG_IMAGE_TYPE_UNDEFINED) {
+ if (cover_value == NULL)
+ cover_value = value;
+ } else if (type == GST_TAG_IMAGE_TYPE_FRONT_COVER) {
+ cover_value = value;
+ break;
+ }
+ }
+
+ return cover_value;
+}
+
+GdkPixbuf *
+totem_gst_tag_list_get_cover (GstTagList *tag_list)
+{
+ const GValue *cover_value;
+
+ g_return_val_if_fail (tag_list != NULL, FALSE);
+
+ cover_value = totem_gst_tag_list_get_cover_real (tag_list);
+ /* Fallback to preview */
+ if (!cover_value) {
+ cover_value = gst_tag_list_get_value_index (tag_list,
+ GST_TAG_PREVIEW_IMAGE,
+ 0);
+ }
+
+ if (cover_value) {
+ GstBuffer *buffer;
+ GstSample *sample;
+ GdkPixbuf *pixbuf;
+
+ sample = gst_value_get_sample (cover_value);
+ buffer = gst_sample_get_buffer (sample);
+ pixbuf = totem_gst_buffer_to_pixbuf (buffer);
+ return pixbuf;
+ }
+
+ return NULL;
+}
+
+/*
+ * vim: sw=2 ts=8 cindent noai bs=2
+ */
diff --git a/src/gst/totem-gst-pixbuf-helpers.h b/src/gst/totem-gst-pixbuf-helpers.h
new file mode 100644
index 000000000..b2d12c6e6
--- /dev/null
+++ b/src/gst/totem-gst-pixbuf-helpers.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2001,2002,2003,2004,2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * The Totem project hereby grant permission for non-gpl compatible GStreamer
+ * plugins to be used and distributed together with GStreamer and Totem. This
+ * permission are above and beyond the permissions granted by the GPL license
+ * Totem is covered by.
+ *
+ * Monday 7th February 2005: Christian Schaller: Add exception clause.
+ * See license_change file for details.
+ *
+ */
+
+#ifndef HAVE_TOTEM_GST_PIXBUF_HELPERS_H
+#define HAVE_TOTEM_GST_PIXBUF_HELPERS_H
+
+#define GST_USE_UNSTABLE_API 1
+
+#include <gst/gst.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+G_BEGIN_DECLS
+
+GdkPixbuf * totem_gst_playbin_get_frame (GstElement *play);
+
+GdkPixbuf * totem_gst_tag_list_get_cover (GstTagList *tag_list);
+
+G_END_DECLS
+
+#endif /* HAVE_TOTEM_GST_PIXBUF_HELPERS_H */
diff --git a/src/gst/totem-time-helpers.c b/src/gst/totem-time-helpers.c
new file mode 100644
index 000000000..2089b4b32
--- /dev/null
+++ b/src/gst/totem-time-helpers.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright © 2002-2012 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * The Totem project hereby grant permission for non-gpl compatible GStreamer
+ * plugins to be used and distributed together with GStreamer and Totem. This
+ * permission is above and beyond the permissions granted by the GPL license
+ * Totem is covered by.
+ *
+ * Monday 7th February 2005: Christian Schaller: Add exception clause.
+ * See license_change file for details.
+ *
+ */
+
+#include <glib/gi18n.h>
+#include <libintl.h>
+
+#include "totem-time-helpers.h"
+
+char *
+totem_time_to_string (gint64 msecs)
+{
+ int sec, min, hour, _time;
+
+ _time = (int) (msecs / 1000);
+ sec = _time % 60;
+ _time = _time - sec;
+ min = (_time % (60*60)) / 60;
+ _time = _time - (min * 60);
+ hour = _time / (60*60);
+
+ if (hour > 0)
+ {
+ /* hour:minutes:seconds */
+ /* Translators: This is a time format, like "9:05:02" for 9
+ * hours, 5 minutes, and 2 seconds. You may change ":" to
+ * the separator that your locale uses or use "%Id" instead
+ * of "%d" if your locale uses localized digits.
+ */
+ return g_strdup_printf (C_("long time format", "%d:%02d:%02d"), hour, min, sec);
+ }
+
+ /* minutes:seconds */
+ /* Translators: This is a time format, like "5:02" for 5
+ * minutes and 2 seconds. You may change ":" to the
+ * separator that your locale uses or use "%Id" instead of
+ * "%d" if your locale uses localized digits.
+ */
+ return g_strdup_printf (C_("short time format", "%d:%02d"), min, sec);
+}
diff --git a/src/gst/totem-time-helpers.h b/src/gst/totem-time-helpers.h
new file mode 100644
index 000000000..fc3067edc
--- /dev/null
+++ b/src/gst/totem-time-helpers.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright © 2002-2012 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * The Totem project hereby grant permission for non-gpl compatible GStreamer
+ * plugins to be used and distributed together with GStreamer and Totem. This
+ * permission is above and beyond the permissions granted by the GPL license
+ * Totem is covered by.
+ *
+ * Monday 7th February 2005: Christian Schaller: Add exception clause.
+ * See license_change file for details.
+ *
+ */
+
+#ifndef _TOTEM_TIME_HELPERS_H_
+#define _TOTEM_TIME_HELPERS_H_
+
+#include <glib.h>
+
+char *totem_time_to_string (gint64 msecs);
+
+#endif /* _TOTEM_TIME_HELPERS_H_ */
diff --git a/src/plugins/Makefile.plugins b/src/plugins/Makefile.plugins
index aed2e7060..d76f218cb 100644
--- a/src/plugins/Makefile.plugins
+++ b/src/plugins/Makefile.plugins
@@ -12,11 +12,11 @@ AM_CPPFLAGS = \
$(DISABLE_DEPRECATED) \
-I$(top_srcdir)/ \
-I$(top_srcdir)/src \
- -I$(top_srcdir)/src/plugins
+ -I$(top_srcdir)/src/plugins \
+ -I$(top_srcdir)/src/gst
-plugin_cflags = \
- $(DEPENDENCY_CFLAGS) \
- $(PEAS_CFLAGS) \
+plugin_cflags = \
+ $(PLAYER_CFLAGS) \
$(WARN_CFLAGS)
plugin_ldflags = \
diff --git a/src/plugins/grilo/Makefile.am b/src/plugins/grilo/Makefile.am
index 5e660b66f..5a1f44c40 100644
--- a/src/plugins/grilo/Makefile.am
+++ b/src/plugins/grilo/Makefile.am
@@ -25,9 +25,9 @@ libgrilo_la_LIBADD = \
$(plugin_libadd) \
$(LIBGRILO_LIBS)
libgrilo_la_CFLAGS = \
- $(plugin_cflags) \
- $(LIBGRILO_CFLAGS) \
- -I $(top_srcdir)/src/backend
+ $(plugin_cflags) \
+ $(LIBGRILO_CFLAGS) \
+ -I $(top_srcdir)/src/gst/
-include $(top_srcdir)/git.mk
diff --git a/src/plugins/grilo/totem-grilo.c b/src/plugins/grilo/totem-grilo.c
index 89e90ebfe..4976b4467 100644
--- a/src/plugins/grilo/totem-grilo.c
+++ b/src/plugins/grilo/totem-grilo.c
@@ -44,7 +44,7 @@
#include <totem-dirs.h>
#include <totem.h>
-#include <video-utils.h>
+#include <totem-time-helpers.h>
#include "totem-search-entry.h"
diff --git a/src/plugins/skipto/totem-skipto.c b/src/plugins/skipto/totem-skipto.c
index c2d2a474d..e3ba487c5 100644
--- a/src/plugins/skipto/totem-skipto.c
+++ b/src/plugins/skipto/totem-skipto.c
@@ -40,7 +40,6 @@
#include "totem-dirs.h"
#include "totem-skipto.h"
#include "totem-uri.h"
-#include "backend/video-utils.h"
#include "backend/bacon-video-widget.h"
static void totem_skipto_dispose (GObject *object);
diff --git a/src/plugins/skipto/totem-time-entry.c b/src/plugins/skipto/totem-time-entry.c
index 547c30097..7b2e97b91 100644
--- a/src/plugins/skipto/totem-time-entry.c
+++ b/src/plugins/skipto/totem-time-entry.c
@@ -33,7 +33,7 @@
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
-#include "backend/video-utils.h"
+#include "totem-time-helpers.h"
#include "totem-time-entry.h"
static void dispose (GObject *object);
diff --git a/src/properties/Makefile.am b/src/properties/Makefile.am
index 209fcb87a..e95e71b92 100644
--- a/src/properties/Makefile.am
+++ b/src/properties/Makefile.am
@@ -10,7 +10,7 @@ libbaconvideowidgetproperties_la_CPPFLAGS = \
$(AM_CPPFLAGS)
libbaconvideowidgetproperties_la_CFLAGS = \
- $(DEPENDENCY_CFLAGS) \
+ $(PROPERTIES_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CFLAGS)
diff --git a/src/totem-statusbar.c b/src/totem-statusbar.c
index e8bd38b2e..e822f7eec 100644
--- a/src/totem-statusbar.c
+++ b/src/totem-statusbar.c
@@ -32,7 +32,7 @@
#include <gtk/gtk.h>
#include "totem-statusbar.h"
-#include "video-utils.h"
+#include "totem-time-helpers.h"
#define SPACING 4
#define NORMAL_CONTEXT "text"
diff --git a/src/totem-time-label.c b/src/totem-time-label.c
index 551cdf1b8..f1dc11f62 100644
--- a/src/totem-time-label.c
+++ b/src/totem-time-label.c
@@ -3,7 +3,7 @@
#include "totem-time-label.h"
#include <glib/gi18n.h>
-#include "video-utils.h"
+#include "totem-time-helpers.h"
struct _TotemTimeLabelPrivate {
gint64 time;
diff --git a/src/totem-video-thumbnailer.c b/src/totem-video-thumbnailer.c
index b40fe9a3b..657f1e2ea 100644
--- a/src/totem-video-thumbnailer.c
+++ b/src/totem-video-thumbnailer.c
@@ -46,6 +46,8 @@
#include <sys/stat.h>
#include "gst/totem-gst-helpers.h"
+#include "gst/totem-time-helpers.h"
+#include "gst/totem-gst-pixbuf-helpers.h"
#include "video-utils.h"
#include "totem-resources.h"