[snappy/0.11] Port to GStreamer 0.11
- From: Luis de Bethencourt <luisbg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [snappy/0.11] Port to GStreamer 0.11
- Date: Tue, 17 Jul 2012 11:08:54 +0000 (UTC)
commit 63735780b50ab491ee5427c213afbffd08dffbd8
Author: Tim-Philipp MÃller <tim muller collabora co uk>
Date: Tue Jul 17 12:06:27 2012 +0100
Port to GStreamer 0.11
configure.ac | 47 ++++++++++++++---------------------------------
src/Makefile.am | 4 ++--
src/gst_engine.c | 26 +++++++++++++-------------
src/gst_engine.h | 2 +-
4 files changed, 30 insertions(+), 49 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5776741..7638725 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,31 +32,21 @@ AC_LIBTOOL_WIN32_DLL
AC_CANONICAL_HOST
-GST_0_10_REQS=0.10.20
-GST_PBUTILS=0.10.30
-GST_INTERFACES=0.10.30
+# keep one single GST_REQ, core/base should be same versions anyway
+GST_REQ=0.11.92
CLUTTER_REQS=1.6.0
CLUTTER_GST_1_0_REQS=1.4.0
-CLUTTER_GST_0_10_REQS=0.10.0
-GLIB_REQ=2.10.0
-GIO_REQUIRED=2.24
-
-PKG_CHECK_MODULES([GSTREAMER_0_10], \
- [gstreamer-0.10 >= $GST_0_10_REQS
- gstreamer-base-0.10 >= $GST_0_10_REQS
- gstreamer-plugins-base-0.10 >= $GST_0_10_REQS])
-AC_SUBST(GSTREAMER_0_10_CFLAGS)
-AC_SUBST(GSTREAMER_0_10_LIBS)
-
-PKG_CHECK_MODULES([GST_PBUTILS],
- [gstreamer-pbutils-0.10 >= $GST_PBUTILS])
-AC_SUBST(GST_PBUTILS_CFLAGS)
-AC_SUBST(GST_PBUTILS_LIBS)
-
-PKG_CHECK_MODULES([GST_INTERFACES],
- [gstreamer-interfaces-0.10 >= $GST_INTERFACES])
-AC_SUBST(GST_INTERFACES_CFLAGS)
-AC_SUBST(GST_INTERFACES_LIBS)
+CLUTTER_GST_REQ=0.10.0
+GIO_REQ=2.32
+
+PKG_CHECK_MODULES([GST], \
+ [gstreamer-1.0 >= $GST_REQ
+ gstreamer-base-1.0 >= $GST_REQ
+ gstreamer-pbutils-1.0 >= $GST_REQ
+ gstreamer-video-1.0 >= $GST_REQ])
+GST_CFLAGS="-DGST_USE_UNSTABLE_API $GST_CFLAGS"
+AC_SUBST(GST_CFLAGS)
+AC_SUBST(GST_LIBS)
PKG_CHECK_MODULES([CLUTTER],
[clutter-1.0 >= $CLUTTER_REQS])
@@ -69,19 +59,10 @@ PKG_CHECK_MODULES([CLUTTER_GST],
HAVE_CLUTTER_GST_1_0="yes"
], HAVE_CLUTTER_GST_1_0="no")
-if test "x$HAVE_CLUTTER_GST_1_0" = "xno"; then
- dnl If we don't have clutter-gst-1.0, then check for clutter-gst-0.10
- PKG_CHECK_MODULES(CLUTTER_GST_0_10,
- [clutter-gst-0.10 >= $CLUTTER_GST_0_10_REQS])
- CLUTTER_GST_CFLAGS="\$(CLUTTER_GST_0_10_CFLAGS)"
- CLUTTER_GST_LIBS="\$(CLUTTER_GST_0_10_LIBS)"
-fi
AC_SUBST(CLUTTER_GST_CFLAGS)
AC_SUBST(CLUTTER_GST_LIBS)
-AC_SUBST([GLIB_REQ])
-
-PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQUIRED)
+PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQ)
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)
diff --git a/src/Makefile.am b/src/Makefile.am
index b72ec47..16f0edd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,7 +20,7 @@ CLEANFILES =
bin_PROGRAMS = snappy
snappy_SOURCES = $(c_sources)
-snappy_CFLAGS = $(CLUTTER_CFLAGS) $(GSTREAMER_0_10_CFLAGS) $(GST_PBUTILS_CFLAGS) $(GST_INTERFACES_CFLAGS) $(CLUTTER_GST_CFLAGS) $(GIO_CFLAGS) $(XTEST_CFLAGS) -DSNAPPY_DATA_DIR="\"$(pkgdatadir)\""
-snappy_LDADD = $(CLUTTER_LIBS) $(GSTREAMER_0_10_LIBS) $(GST_PBUTILS_LIBS) $(GST_INTERFACES_LIBS) $(CLUTTER_GST_LIBS) $(GIO_LIBS) $(XTEST_LIBS)
+snappy_CFLAGS = $(CLUTTER_CFLAGS) $(GST_CFLAGS) $(CLUTTER_GST_CFLAGS) $(GIO_CFLAGS) $(XTEST_CFLAGS) -DSNAPPY_DATA_DIR="\"$(pkgdatadir)\""
+snappy_LDADD = $(CLUTTER_LIBS) $(GST_LIBS) $(CLUTTER_GST_LIBS) $(GIO_LIBS) $(XTEST_LIBS)
noinst_HEADERS = $(public_headers)
diff --git a/src/gst_engine.c b/src/gst_engine.c
index 8437e99..9dc8d51 100644
--- a/src/gst_engine.c
+++ b/src/gst_engine.c
@@ -23,6 +23,7 @@
#include <clutter-gst/clutter-gst.h>
#include <gst/pbutils/pbutils.h>
#include <string.h>
+#include <sys/stat.h> /* for S_IRUSR | S_IWUSR | S_IXUSR */
#include "user_interface.h"
#include "gst_engine.h"
@@ -33,7 +34,7 @@
#define RECENTLY_VIEWED_MAX 50
-// GstPlayFlags flags from playbin2. It is the policy of GStreamer to
+// GstPlayFlags flags from playbin. It is the policy of GStreamer to
// not publicly expose element-specific enums. That's why this
// GstPlayFlags enum has been copied here.
typedef enum
@@ -46,7 +47,9 @@ typedef enum
GST_PLAY_FLAG_NATIVE_AUDIO = 0x00000020,
GST_PLAY_FLAG_NATIVE_VIDEO = 0x00000040,
GST_PLAY_FLAG_DOWNLOAD = 0x00000080,
- GST_PLAY_FLAG_BUFFERING = 0x000000100
+ GST_PLAY_FLAG_BUFFERING = 0x000000100,
+ GST_PLAY_FLAG_DEINTERLACE = 0x000000200,
+ GST_PLAY_FLAG_SOFT_COLORBALANCE = 0x000000400
} GstPlayFlags;
// Declaration of static functions
@@ -674,14 +677,14 @@ engine_init (GstEngine * engine, GstElement * sink)
GST_DEBUG_CATEGORY_INIT (_snappy_gst_debug, "snappy", 0,
"snappy media player");
- /* Make playbin2 element */
- engine->player = gst_element_factory_make ("playbin2", "playbin2");
+ /* Make playbin element */
+ engine->player = gst_element_factory_make ("playbin", "playbin");
if (engine->player == NULL) {
g_print ("ERROR: Failed to create playbin element\n");
return FALSE;
}
- /* Set Clutter texture as playbin2's videos sink */
+ /* Set Clutter texture as playbin's videos sink */
engine->sink = sink;
g_object_set (G_OBJECT (engine->player), "video-sink", engine->sink, NULL);
engine->bus = gst_pipeline_get_bus (GST_PIPELINE (engine->player));
@@ -716,7 +719,7 @@ engine_load_uri (GstEngine * engine, gchar * uri)
void
engine_open_uri (GstEngine * engine, gchar * uri)
{
- /* Need to set back to Ready state so Playbin2 loads uri */
+ /* Need to set back to Ready state so Playbin loads uri */
engine->uri = uri;
g_print ("Open uri: %s\n", uri);
@@ -819,8 +822,7 @@ frame_stepping (GstEngine * engine, gboolean foward)
/* Change of direction needed */
engine->direction_foward = foward;
- fmt = GST_FORMAT_TIME;
- ok = gst_element_query_position (engine->player, &fmt, &pos);
+ ok = gst_element_query_position (engine->player, GST_FORMAT_TIME, &pos);
gst_element_get_state (engine->player, NULL, NULL, GST_SECOND);
if (foward)
@@ -897,9 +899,8 @@ query_position (GstEngine * engine)
{
gboolean ok;
gint64 position;
- GstFormat fmt = GST_FORMAT_TIME;
- ok = gst_element_query_position (engine->player, &fmt, &position);
+ ok = gst_element_query_position (engine->player, GST_FORMAT_TIME, &position);
if (!ok)
position = 0;
@@ -948,11 +949,10 @@ gboolean
update_media_duration (GstEngine * engine)
{
gboolean success = FALSE;
- GstFormat fmt = GST_FORMAT_TIME;
- if (gst_element_query_duration (engine->player, &fmt,
+ if (gst_element_query_duration (engine->player, GST_FORMAT_TIME,
&engine->media_duration)) {
- if (engine->media_duration != -1 && fmt == GST_FORMAT_TIME) {
+ if (engine->media_duration != -1) {
success = TRUE;
} else {
GST_DEBUG ("Could not get media's duration");
diff --git a/src/gst_engine.h b/src/gst_engine.h
index b90963f..ba098ab 100644
--- a/src/gst_engine.h
+++ b/src/gst_engine.h
@@ -26,7 +26,7 @@
#include <gst/gst.h>
/* GStreamer Interfaces */
-#include <gst/interfaces/navigation.h>
+#include <gst/video/navigation.h>
G_BEGIN_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]