[Pkg-gstreamer-commits] [gstreamer-vaapi] 11/176: vaapiencode: initial port to GStreamer 1.2.

Vincent Cheng vcheng at moszumanska.debian.org
Tue Jun 3 08:09:23 UTC 2014


This is an automated email from the git hooks/post-receive script.

vcheng pushed a commit to branch upstream
in repository gstreamer-vaapi.

commit 3e96f10cf29d0637cf2422552a94cafc7e8538f7
Author: Wind Yuan <feng.yuan at intel.com>
Date:   Thu Nov 7 17:42:21 2013 +0800

    vaapiencode: initial port to GStreamer 1.2.
    
    Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
---
 gst/vaapi/gstvaapiencode.c       | 26 ++++++++++++++++++++++++--
 gst/vaapi/gstvaapiencode_h264.c  |  6 ++++++
 gst/vaapi/gstvaapiencode_mpeg2.c |  7 +++++++
 3 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/gst/vaapi/gstvaapiencode.c b/gst/vaapi/gstvaapiencode.c
index b484db4..1c847b2 100644
--- a/gst/vaapi/gstvaapiencode.c
+++ b/gst/vaapi/gstvaapiencode.c
@@ -20,11 +20,11 @@
  */
 
 #include "gst/vaapi/sysdeps.h"
-#include <gst/video/videocontext.h>
 #include <gst/vaapi/gstvaapidisplay.h>
 #include <gst/vaapi/gstvaapiencoder_priv.h>
 #include <gst/vaapi/gstvaapiencoder_objects.h>
 #include "gstvaapiencode.h"
+#include "gstvaapivideocontext.h"
 #include "gstvaapipluginutil.h"
 #include "gstvaapivideometa.h"
 #include "gstvaapivideomemory.h"
@@ -67,6 +67,19 @@ gst_vaapiencode_implements_iface_init (GstImplementsInterfaceClass * iface)
 #endif
 
 /* context(display) interface */
+#if GST_CHECK_VERSION(1,1,0)
+static void
+gst_vaapiencode_set_context (GstElement * element, GstContext * context)
+{
+  GstVaapiEncode *const encode = GST_VAAPIENCODE (element);
+  GstVaapiDisplay *display = NULL;
+
+  if (gst_vaapi_video_context_get_display (context, &display)) {
+    GST_INFO_OBJECT (element, "set display %p", display);
+    gst_vaapi_display_replace (&encode->display, display);
+  }
+}
+#else
 static void
 gst_vaapiencode_set_video_context (GstVideoContext * context,
     const gchar * type, const GValue * value)
@@ -81,6 +94,7 @@ gst_video_context_interface_init (GstVideoContextInterface * iface)
 {
   iface->set_context = gst_vaapiencode_set_video_context;
 }
+#endif
 
 G_DEFINE_TYPE_WITH_CODE (GstVaapiEncode,
     gst_vaapiencode, GST_TYPE_VIDEO_ENCODER,
@@ -88,8 +102,11 @@ G_DEFINE_TYPE_WITH_CODE (GstVaapiEncode,
     G_IMPLEMENT_INTERFACE (GST_TYPE_IMPLEMENTS_INTERFACE,
         gst_vaapiencode_implements_iface_init);
 #endif
+#if !GST_CHECK_VERSION(1,1,0)
     G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_CONTEXT,
-        gst_video_context_interface_init))
+        gst_video_context_interface_init)
+#endif
+    )
 
 static gboolean
 gst_vaapiencode_query (GstPad * pad, GstObject * parent,
@@ -739,6 +756,7 @@ static void
 gst_vaapiencode_class_init (GstVaapiEncodeClass * klass)
 {
   GObjectClass *const object_class = G_OBJECT_CLASS (klass);
+  GstElementClass *const element_class = GST_ELEMENT_CLASS (klass);
   GstVideoEncoderClass *const venc_class = GST_VIDEO_ENCODER_CLASS (klass);
 
   GST_DEBUG_CATEGORY_INIT (gst_vaapiencode_debug,
@@ -758,6 +776,10 @@ gst_vaapiencode_class_init (GstVaapiEncodeClass * klass)
 
   klass->allocate_buffer = gst_vaapiencode_default_allocate_buffer;
 
+#if GST_CHECK_VERSION(1,1,0)
+  element_class->set_context = GST_DEBUG_FUNCPTR (gst_vaapiencode_set_context);
+#endif
+
   /* Registering debug symbols for function pointers */
   GST_DEBUG_REGISTER_FUNCPTR (gst_vaapiencode_get_caps);
   GST_DEBUG_REGISTER_FUNCPTR (gst_vaapiencode_query);
diff --git a/gst/vaapi/gstvaapiencode_h264.c b/gst/vaapi/gstvaapiencode_h264.c
index 35f14ca..221cfbf 100644
--- a/gst/vaapi/gstvaapiencode_h264.c
+++ b/gst/vaapi/gstvaapiencode_h264.c
@@ -24,6 +24,7 @@
 
 #include "gstvaapiencode_h264.h"
 #include "gstvaapipluginutil.h"
+#include "gstvaapivideomemory.h"
 #include "gst/vaapi/gstvaapiencoder_h264.h"
 #include "gst/vaapi/gstvaapiencoder_h264_priv.h"
 #include "gst/vaapi/gstvaapidisplay.h"
@@ -38,9 +39,14 @@ GST_DEBUG_CATEGORY_STATIC (gst_vaapi_h264_encode_debug);
 #define GST_CAPS_CODEC(CODEC) CODEC "; "
 
 static const char gst_vaapiencode_h264_sink_caps_str[] =
+#if GST_CHECK_VERSION(1,1,0)
+  GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE,
+      "{ ENCODED, NV12, I420, YV12 }") ", "
+#else
   GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) ", "
   GST_CAPS_INTERLACED_FALSE "; "
   GST_VAAPI_SURFACE_CAPS ", "
+#endif
   GST_CAPS_INTERLACED_FALSE;
 
 static const char gst_vaapiencode_h264_src_caps_str[] =
diff --git a/gst/vaapi/gstvaapiencode_mpeg2.c b/gst/vaapi/gstvaapiencode_mpeg2.c
index 4f0a5e8..46f501f 100644
--- a/gst/vaapi/gstvaapiencode_mpeg2.c
+++ b/gst/vaapi/gstvaapiencode_mpeg2.c
@@ -24,6 +24,7 @@
 
 #include "gstvaapiencode_mpeg2.h"
 #include "gstvaapipluginutil.h"
+#include "gstvaapivideomemory.h"
 #include "gst/vaapi/gstvaapiencoder_mpeg2.h"
 #include "gst/vaapi/gstvaapiencoder_mpeg2_priv.h"
 #include "gst/vaapi/gstvaapidisplay.h"
@@ -38,8 +39,14 @@ GST_DEBUG_CATEGORY_STATIC (gst_vaapi_mpeg2_encode_debug);
 #define GST_CAPS_CODEC(CODEC) CODEC "; "
 
 static const char gst_vaapiencode_mpeg2_sink_caps_str[] =
+#if GST_CHECK_VERSION(1,1,0)
+  GST_VIDEO_CAPS_MAKE_WITH_FEATURES(GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE,
+      "{ ENCODED, NV12, I420, YV12 }") ", "
+  GST_CAPS_INTERLACED_FALSE;
+#else
   GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) "; "
   GST_VAAPI_SURFACE_CAPS;
+#endif
 
 static const char gst_vaapiencode_mpeg2_src_caps_str[] =
   GST_CAPS_CODEC ("video/mpeg,"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gstreamer/gstreamer-vaapi.git



More information about the Pkg-gstreamer-commits mailing list