Add new object GstVaapiPostProcess for post-processing
authorZhao Halley <halley.zhao@intel.com>
Wed, 12 Sep 2012 09:05:29 +0000 (17:05 +0800)
committerZhong Cong <congx.zhong@intel.com>
Tue, 5 Feb 2013 07:37:09 +0000 (15:37 +0800)
separate some enum from gstvaapipostproc to gstvaapipostprocess

gst-libs/gst/vaapi/Makefile.am
gst-libs/gst/vaapi/gstvaapipostprocess.c [new file with mode: 0644]
gst-libs/gst/vaapi/gstvaapipostprocess.h [new file with mode: 0644]
gst/vaapi/gstvaapipostproc.c
gst/vaapi/gstvaapipostproc.h

index 8eb2235..a4d6e09 100644 (file)
@@ -67,6 +67,7 @@ libgstvaapi_source_c =                                \
        gstvaapivideobuffer.c                   \
        gstvaapivideopool.c                     \
        gstvaapiwindow.c                        \
+       gstvaapipostprocess.c                   \
        $(NULL)
 
 libgstvaapi_source_h =                         \
@@ -93,6 +94,7 @@ libgstvaapi_source_h =                                \
        gstvaapivideobuffer.h                   \
        gstvaapivideopool.h                     \
        gstvaapiwindow.h                        \
+       gstvaapipostprocess.h                   \
        $(NULL)
 
 libgstvaapi_source_priv_h =                    \
diff --git a/gst-libs/gst/vaapi/gstvaapipostprocess.c b/gst-libs/gst/vaapi/gstvaapipostprocess.c
new file mode 100644 (file)
index 0000000..2f65064
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ *  gstvaapiimage.c - VA post-processing abstraction
+ *
+ *  Copyright (C) 2010-2011 Splitted-Desktop Systems
+ *  Copyright (C) 2011-2012 Intel Corporation
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1
+ *  of the License, or (at your option) any later version.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301 USA
+ */
+
+/**
+ * SECTION:gstvaapipostprocess
+ * @short_description: VA post-processing abstraction
+ */
+#include "gstvaapipostprocess.h"
+GType
+gst_vaapi_deinterlace_method_get_type(void);
+
+GType
+gst_vaapi_deinterlace_method_get_type(void)
+{
+    static GType deinterlace_method_type = 0;
+
+    static const GEnumValue method_types[] = {
+        { GST_VAAPI_DEINTERLACE_METHOD_BOB,
+          "Bob deinterlacing", "bob" },
+#if 0
+        /* VA/VPP */
+        { GST_VAAPI_DEINTERLACE_METHOD_WEAVE,
+          "Weave deinterlacing", "weave" },
+        { GST_VAAPI_DEINTERLACE_METHOD_MOTION_ADAPTIVE,
+          "Motion adaptive deinterlacing", "motion-adaptive" },
+        { GST_VAAPI_DEINTERLACE_METHOD_MOTION_COMPENSATED,
+          "Motion compensated deinterlacing", "motion-compensated" },
+#endif
+        { 0, NULL, NULL },
+    };
+
+    if (!deinterlace_method_type) {
+        deinterlace_method_type =
+            g_enum_register_static("GstVaapiDeinterlaceMethod", method_types);
+    }
+    return deinterlace_method_type;
+}
+
diff --git a/gst-libs/gst/vaapi/gstvaapipostprocess.h b/gst-libs/gst/vaapi/gstvaapipostprocess.h
new file mode 100644 (file)
index 0000000..323f3e7
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ *  gstvaapipostprocess.h - VA post-processing abstraction
+ *
+ *  Copyright (C) 2010-2011 Splitted-Desktop Systems
+ *  Copyright (C) 2011-2012 Intel Corporation
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public License
+ *  as published by the Free Software Foundation; either version 2.1
+ *  of the License, or (at your option) any later version.
+ *
+ *  This library 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
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301 USA
+ */
+
+#ifndef GST_VAAPI_POSTPROCESS_H
+#define GST_VAAPI_POSTPROCESS_H
+
+#include <gst/gstbuffer.h>
+#include <gst/vaapi/gstvaapiobject.h>
+#include <gst/vaapi/gstvaapidisplay.h>
+#include <gst/vaapi/gstvaapisurface.h>
+
+G_BEGIN_DECLS
+
+typedef enum _GstVaapiDeinterlaceMethod         GstVaapiDeinterlaceMethod;
+
+enum {
+    PROP_0,
+
+    PROP_DEINTERLACE,
+    PROP_DEINTERLACE_MODE,
+    PROP_DEINTERLACE_METHOD,
+};
+
+typedef enum _GstVaapiDeinterlaceMethod         GstVaapiDeinterlaceMethod;
+
+/**
+ * GstVaapiDeinterlaceMethod:
+ * @GST_VAAPI_DEINTERLACE_METHOD_BOB: Basic bob deinterlacing algorithm.
+ * @GST_VAAPI_DEINTERLACE_METHOD_WEAVE: Weave deinterlacing algorithm.
+ * @GST_VAAPI_DEINTERLACE_METHOD_MOTION_ADAPTIVE: Motion adaptive deinterlacing algorithm.
+ * @GST_VAAPI_DEINTERLACE_METHOD_MOTION_COMPENSATED: Motion compensated deinterlacing algorithm.
+ */
+enum _GstVaapiDeinterlaceMethod {
+    GST_VAAPI_DEINTERLACE_METHOD_BOB = 1,
+    GST_VAAPI_DEINTERLACE_METHOD_WEAVE,
+    GST_VAAPI_DEINTERLACE_METHOD_MOTION_ADAPTIVE,
+    GST_VAAPI_DEINTERLACE_METHOD_MOTION_COMPENSATED,
+};
+#define DEFAULT_DEINTERLACE_METHOD      GST_VAAPI_DEINTERLACE_METHOD_BOB
+
+#define GST_VAAPI_TYPE_DEINTERLACE_METHOD \
+    gst_vaapi_deinterlace_method_get_type()
+
+G_END_DECLS
+
+#endif /* GST_VAAPI_POSTPROCESS_H */
index bcd2522..2131263 100644 (file)
@@ -90,15 +90,7 @@ G_DEFINE_TYPE_WITH_CODE(
     G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
                           gst_video_context_interface_init))
 
-enum {
-    PROP_0,
-
-    PROP_DEINTERLACE_MODE,
-    PROP_DEINTERLACE_METHOD,
-};
-
 #define DEFAULT_DEINTERLACE_MODE        GST_VAAPI_DEINTERLACE_MODE_AUTO
-#define DEFAULT_DEINTERLACE_METHOD      GST_VAAPI_DEINTERLACE_METHOD_BOB
 
 #define GST_VAAPI_TYPE_DEINTERLACE_MODE \
     gst_vaapi_deinterlace_mode_get_type()
@@ -125,36 +117,6 @@ gst_vaapi_deinterlace_mode_get_type(void)
     return deinterlace_mode_type;
 }
 
-#define GST_VAAPI_TYPE_DEINTERLACE_METHOD \
-    gst_vaapi_deinterlace_method_get_type()
-
-static GType
-gst_vaapi_deinterlace_method_get_type(void)
-{
-    static GType deinterlace_method_type = 0;
-
-    static const GEnumValue method_types[] = {
-        { GST_VAAPI_DEINTERLACE_METHOD_BOB,
-          "Bob deinterlacing", "bob" },
-#if 0
-        /* VA/VPP */
-        { GST_VAAPI_DEINTERLACE_METHOD_WEAVE,
-          "Weave deinterlacing", "weave" },
-        { GST_VAAPI_DEINTERLACE_METHOD_MOTION_ADAPTIVE,
-          "Motion adaptive deinterlacing", "motion-adaptive" },
-        { GST_VAAPI_DEINTERLACE_METHOD_MOTION_COMPENSATED,
-          "Motion compensated deinterlacing", "motion-compensated" },
-#endif
-        { 0, NULL, NULL },
-    };
-
-    if (!deinterlace_method_type) {
-        deinterlace_method_type =
-            g_enum_register_static("GstVaapiDeinterlaceMethod", method_types);
-    }
-    return deinterlace_method_type;
-}
-
 static inline GstVaapiPostproc *
 get_vaapipostproc_from_pad(GstPad *pad)
 {
index 4ad4f70..137c4ea 100644 (file)
@@ -27,6 +27,7 @@
 #include <gst/vaapi/gstvaapisurface.h>
 #include <gst/vaapi/gstvaapisurfacepool.h>
 #include <gst/vaapi/gstvaapivideobuffer.h>
+#include <gst/vaapi/gstvaapipostprocess.h>
 
 G_BEGIN_DECLS
 
@@ -57,31 +58,19 @@ G_BEGIN_DECLS
 typedef struct _GstVaapiPostproc                GstVaapiPostproc;
 typedef struct _GstVaapiPostprocClass           GstVaapiPostprocClass;
 
+typedef enum _GstVaapiDeinterlaceMode           GstVaapiDeinterlaceMode;
+
 /**
  * GstVaapiDeinterlaceMode:
  * @GST_VAAPI_DEINTERLACE_MODE_AUTO: Auto detect needs for deinterlacing.
  * @GST_VAAPI_DEINTERLACE_MODE_INTERLACED: Force deinterlacing.
  * @GST_VAAPI_DEINTERLACE_MODE_DISABLED: Never perform deinterlacing.
  */
-typedef enum {
+enum _GstVaapiDeinterlaceMode {
     GST_VAAPI_DEINTERLACE_MODE_AUTO = 0,
     GST_VAAPI_DEINTERLACE_MODE_INTERLACED,
     GST_VAAPI_DEINTERLACE_MODE_DISABLED,
-} GstVaapiDeinterlaceMode;
-
-/**
- * GstVaapiDeinterlaceMethod:
- * @GST_VAAPI_DEINTERLACE_METHOD_BOB: Basic bob deinterlacing algorithm.
- * @GST_VAAPI_DEINTERLACE_METHOD_WEAVE: Weave deinterlacing algorithm.
- * @GST_VAAPI_DEINTERLACE_METHOD_MOTION_ADAPTIVE: Motion adaptive deinterlacing algorithm.
- * @GST_VAAPI_DEINTERLACE_METHOD_MOTION_COMPENSATED: Motion compensated deinterlacing algorithm.
- */
-typedef enum {
-    GST_VAAPI_DEINTERLACE_METHOD_BOB = 1,
-    GST_VAAPI_DEINTERLACE_METHOD_WEAVE,
-    GST_VAAPI_DEINTERLACE_METHOD_MOTION_ADAPTIVE,
-    GST_VAAPI_DEINTERLACE_METHOD_MOTION_COMPENSATED,
-} GstVaapiDeinterlaceMethod;
+};
 
 struct _GstVaapiPostproc {
     /*< private >*/