[byzanz/wip/gstreamer1] Port to gstreamer-1.0



commit 1926418a65235ebf9e26f4a7c0b8a5ab03839b01
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Mar 19 03:40:58 2013 -0400

    Port to gstreamer-1.0

 configure.ac                 |    3 +--
 src/byzanzencoderflv.c       |    4 ++--
 src/byzanzencodergstreamer.c |   17 +++++++++--------
 src/byzanzencoderogv.c       |   10 +++++-----
 src/byzanzencoderwebm.c      |    8 ++++----
 5 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 65e4f9a..d819953 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,7 +67,6 @@ CAIRO_REQ="1.10"
 GTK_REQ="3.0.0"
 APPLET_REQ="2.91.91"
 XDAMAGE_REQ="1.0"
-GST_REQ="0.10.24"
 GIO_REQ="2.31"
 
 PKG_CHECK_MODULES(GTK, cairo >= $CAIRO_REQ gtk+-3.0 >= $GTK_REQ x11 gio-2.0 >= $GIO_REQ)
@@ -79,7 +78,7 @@ PKG_CHECK_MODULES(APPLET, $LIBPANEL_APPLET >= $APPLET_REQ)
 appletdir=`$PKG_CONFIG --variable=libpanel_applet_dir $LIBPANEL_APPLET`
 AC_SUBST(appletdir)
 
-PKG_CHECK_MODULES(GST, gstreamer-app-0.10 >= $GST_REQ gstreamer-0.10 >= $GST_REQ)
+PKG_CHECK_MODULES(GST, gstreamer-app-1.0 gstreamer-1.0)
 
 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
 AC_PATH_PROG(GCONFTOOL, gconftool-2)
diff --git a/src/byzanzencoderflv.c b/src/byzanzencoderflv.c
index fba8fcc..d62c75d 100644
--- a/src/byzanzencoderflv.c
+++ b/src/byzanzencoderflv.c
@@ -40,10 +40,10 @@ byzanz_encoder_flv_class_init (ByzanzEncoderFlvClass *klass)
   gtk_file_filter_add_pattern (encoder_class->filter, "*.flv");
 
   gstreamer_class->pipeline_string = 
-    "appsrc name=src ! ffmpegcolorspace ! ffenc_flashsv buffer-size=8388608 ! flvmux ! giostreamsink 
name=sink";
+    "appsrc name=src ! videoconvert ! ffenc_flashsv buffer-size=8388608 ! flvmux ! giostreamsink name=sink";
   gstreamer_class->audio_pipeline_string = 
     "autoaudiosrc name=audiosrc ! audioconvert ! audio/x-raw-int,width=16 ! queue ! flvmux name=muxer ! 
giostreamsink name=sink "
-    "appsrc name=src ! ffmpegcolorspace ! ffenc_flashsv buffer-size=8388608 ! muxer.";
+    "appsrc name=src ! videoconvert ! ffenc_flashsv buffer-size=8388608 ! muxer.";
 }
 
 static void
diff --git a/src/byzanzencodergstreamer.c b/src/byzanzencodergstreamer.c
index e8e9cf7..a1ba99c 100644
--- a/src/byzanzencodergstreamer.c
+++ b/src/byzanzencodergstreamer.c
@@ -24,7 +24,6 @@
 #include "byzanzencodergstreamer.h"
 
 #include <glib/gi18n-lib.h>
-#include <gst/app/gstappbuffer.h>
 #include <gst/video/video.h>
 
 #include "byzanzserialize.h"
@@ -87,12 +86,14 @@ byzanz_encoder_gstreamer_need_data (GstAppSrc *src, guint length, gpointer data)
   /* create a buffer and send it */
   /* FIXME: stride just works? */
   cairo_surface_reference (gst->surface);
-  buffer = gst_app_buffer_new (cairo_image_surface_get_data (gst->surface),
-      cairo_image_surface_get_stride (gst->surface) * cairo_image_surface_get_height (gst->surface),
-      (GstAppBufferFinalizeFunc) cairo_surface_destroy, gst->surface);
-  GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_READONLY);
+  buffer = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,
+                                        cairo_image_surface_get_data (gst->surface),
+                                        cairo_image_surface_get_stride (gst->surface) * 
cairo_image_surface_get_height (gst->surface),
+                                        0,
+                                        cairo_image_surface_get_stride (gst->surface) * 
cairo_image_surface_get_height (gst->surface),
+                                        gst->surface,
+                                        (GDestroyNotify) cairo_surface_destroy);
   GST_BUFFER_TIMESTAMP (buffer) = msecs * GST_MSECOND;
-  gst_buffer_set_caps (buffer, gst->caps);
   gst_app_src_push_buffer (gst->src, buffer);
 }
 
@@ -145,9 +146,9 @@ byzanz_encoder_gstreamer_run (ByzanzEncoder * encoder,
   g_object_unref (sink);
 
 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
-  gstreamer->caps = gst_caps_from_string (GST_VIDEO_CAPS_BGRx);
+  gstreamer->caps = gst_caps_from_string (GST_VIDEO_CAPS_MAKE ("BGRx"));
 #elif G_BYTE_ORDER == G_BIG_ENDIAN
-  gstreamer->caps = gst_caps_from_string (GST_VIDEO_CAPS_xRGB);
+  gstreamer->caps = gst_caps_from_string (GST_VIDEO_CAPS_MAKE ("xRGB"));
 #else
 #error "Please add the Cairo caps format here"
 #endif
diff --git a/src/byzanzencoderogv.c b/src/byzanzencoderogv.c
index f834b77..70d3e1f 100644
--- a/src/byzanzencoderogv.c
+++ b/src/byzanzencoderogv.c
@@ -41,12 +41,12 @@ byzanz_encoder_ogv_class_init (ByzanzEncoderOgvClass *klass)
   gtk_file_filter_add_pattern (encoder_class->filter, "*.ogg");
 
   gstreamer_class->pipeline_string = 
-    "appsrc name=src ! ffmpegcolorspace ! videorate ! "
-    "video/x-raw-yuv,framerate=25/1 ! theoraenc ! oggmux ! giostreamsink name=sink";
+    "appsrc name=src ! videoconvert ! "
+    "video/x-raw,format=Y444,framerate=25/1 ! theoraenc ! oggmux ! giostreamsink name=sink";
   gstreamer_class->audio_pipeline_string = 
-    "autoaudiosrc name=audiosrc ! audioconvert ! vorbisenc ! queue ! oggmux name=muxer ! giostreamsink 
name=sink "
-    "appsrc name=src ! ffmpegcolorspace ! videorate ! "
-    "video/x-raw-yuv,framerate=25/1 ! theoraenc ! queue ! muxer.";
+    "autoaudiosrc name=audiosrc ! audioconvert ! queue ! oggmux name=muxer ! giostreamsink name=sink "
+    "appsrc name=src ! videoconvert ! videorate ! "
+    "video/x-raw,format=Y444,framerate=25/1 ! theoraenc ! queue ! muxer.";
 }
 
 static void
diff --git a/src/byzanzencoderwebm.c b/src/byzanzencoderwebm.c
index bb6215e..156318a 100644
--- a/src/byzanzencoderwebm.c
+++ b/src/byzanzencoderwebm.c
@@ -40,12 +40,12 @@ byzanz_encoder_webm_class_init (ByzanzEncoderWebmClass *klass)
   gtk_file_filter_add_pattern (encoder_class->filter, "*.webm");
 
   gstreamer_class->pipeline_string = 
-    "appsrc name=src ! ffmpegcolorspace ! videorate ! "
-    "video/x-raw-yuv,framerate=25/1 ! vp8enc ! webmmux ! giostreamsink name=sink";
+    "appsrc name=src ! videoconvert ! videorate ! "
+    "video/x-raw,format=Y444,framerate=25/1 ! vp8enc ! webmmux ! giostreamsink name=sink";
   gstreamer_class->audio_pipeline_string = 
     "autoaudiosrc name=audiosrc ! audioconvert ! vorbisenc ! queue ! webmmux name=muxer ! giostreamsink 
name=sink "
-    "appsrc name=src ! ffmpegcolorspace ! videorate ! "
-    "video/x-raw-yuv,framerate=25/1 ! vp8enc ! queue ! muxer.";
+    "appsrc name=src ! videoconvert ! videorate ! "
+    "video/x-raw,format=Y444,framerate=25/1 ! vp8enc ! queue ! muxer.";
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]