From: Zhao Halley Date: Wed, 12 Sep 2012 09:05:29 +0000 (+0800) Subject: Add new object GstVaapiPostProcess for post-processing X-Git-Tag: accepted/2.0/20130321.180609~73 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a04373e4e780be06599701bf6fd679da8c05e87;p=profile%2Fivi%2Fgstreamer-vaapi.git Add new object GstVaapiPostProcess for post-processing separate some enum from gstvaapipostproc to gstvaapipostprocess --- diff --git a/gst-libs/gst/vaapi/Makefile.am b/gst-libs/gst/vaapi/Makefile.am index 8eb2235..a4d6e09 100644 --- a/gst-libs/gst/vaapi/Makefile.am +++ b/gst-libs/gst/vaapi/Makefile.am @@ -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 index 0000000..2f65064 --- /dev/null +++ b/gst-libs/gst/vaapi/gstvaapipostprocess.c @@ -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 index 0000000..323f3e7 --- /dev/null +++ b/gst-libs/gst/vaapi/gstvaapipostprocess.h @@ -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 +#include +#include +#include + +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 */ diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index bcd2522..2131263 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -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) { diff --git a/gst/vaapi/gstvaapipostproc.h b/gst/vaapi/gstvaapipostproc.h index 4ad4f70..137c4ea 100644 --- a/gst/vaapi/gstvaapipostproc.h +++ b/gst/vaapi/gstvaapipostproc.h @@ -27,6 +27,7 @@ #include #include #include +#include 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 >*/