From 4cf44e3ad28d5c9f80769784dfc2ff8cefdab976 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Thu, 21 Mar 2013 17:06:43 +0100 Subject: [PATCH] plugins: integrate GstVaapiVideoBuffer from libgstvaapi. Move GstVaapiVideoBuffer from core libgstvaapi decoding library to the actual plugin elements. That's only useful there. --- docs/reference/libs/libs-sections.txt | 17 ----- docs/reference/libs/libs.core.types | 1 - gst-libs/gst/vaapi/Makefile.am | 2 - gst-libs/gst/vaapi/gstvaapivideobuffer.h | 91 ----------------------- gst/vaapi/Makefile.am | 2 + gst/vaapi/gstvaapidownload.h | 1 - gst/vaapi/gstvaapipluginbuffer.c | 2 +- gst/vaapi/gstvaapipostproc.h | 1 - {gst-libs/gst => gst}/vaapi/gstvaapivideobuffer.c | 74 ++++++++++++------ gst/vaapi/gstvaapivideobuffer.h | 42 +++++++++++ gst/vaapi/gstvaapivideoconverter_glx.h | 1 + 11 files changed, 99 insertions(+), 135 deletions(-) delete mode 100644 gst-libs/gst/vaapi/gstvaapivideobuffer.h rename {gst-libs/gst => gst}/vaapi/gstvaapivideobuffer.c (62%) create mode 100644 gst/vaapi/gstvaapivideobuffer.h diff --git a/docs/reference/libs/libs-sections.txt b/docs/reference/libs/libs-sections.txt index 11c742f..71e1ab9 100644 --- a/docs/reference/libs/libs-sections.txt +++ b/docs/reference/libs/libs-sections.txt @@ -172,23 +172,6 @@ GST_VAAPI_IMAGE_POOL_GET_CLASS
-gstvaapivideobuffer -GstVaapiVideoBuffer -GstVaapiVideoBuffer -GstVaapiVideoBufferClass -gst_vaapi_video_buffer_new -gst_vaapi_video_buffer_get_meta - -GST_VAAPI_VIDEO_BUFFER -GST_VAAPI_IS_VIDEO_BUFFER -GST_VAAPI_TYPE_VIDEO_BUFFER -gst_vaapi_video_buffer_get_type -GST_VAAPI_VIDEO_BUFFER_CLASS -GST_VAAPI_IS_VIDEO_BUFFER_CLASS -GST_VAAPI_VIDEO_BUFFER_GET_CLASS -
- -
gstvaapivideometa GstVaapiVideoMeta gst_vaapi_video_meta_new diff --git a/docs/reference/libs/libs.core.types b/docs/reference/libs/libs.core.types index b4ce7da..97954cf 100644 --- a/docs/reference/libs/libs.core.types +++ b/docs/reference/libs/libs.core.types @@ -7,6 +7,5 @@ gst_vaapi_object_get_type gst_vaapi_subpicture_get_type gst_vaapi_surface_get_type gst_vaapi_surface_pool_get_type -gst_vaapi_video_buffer_get_type gst_vaapi_video_pool_get_type gst_vaapi_window_get_type diff --git a/gst-libs/gst/vaapi/Makefile.am b/gst-libs/gst/vaapi/Makefile.am index 68bb260..90ec07b 100644 --- a/gst-libs/gst/vaapi/Makefile.am +++ b/gst-libs/gst/vaapi/Makefile.am @@ -68,7 +68,6 @@ libgstvaapi_source_c = \ gstvaapisurfaceproxy.c \ gstvaapiutils.c \ gstvaapivalue.c \ - gstvaapivideobuffer.c \ gstvaapivideometa.c \ gstvaapivideopool.c \ gstvaapiwindow.c \ @@ -95,7 +94,6 @@ libgstvaapi_source_h = \ gstvaapisurfaceproxy.h \ gstvaapitypes.h \ gstvaapivalue.h \ - gstvaapivideobuffer.h \ gstvaapivideometa.h \ gstvaapivideopool.h \ gstvaapiwindow.h \ diff --git a/gst-libs/gst/vaapi/gstvaapivideobuffer.h b/gst-libs/gst/vaapi/gstvaapivideobuffer.h deleted file mode 100644 index adc88d0..0000000 --- a/gst-libs/gst/vaapi/gstvaapivideobuffer.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * gstvaapivideobuffer.h - Gstreamer/VA video buffer - * - * Copyright (C) 2010-2011 Splitted-Desktop Systems - * Copyright (C) 2011-2013 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_VIDEO_BUFFER_H -#define GST_VAAPI_VIDEO_BUFFER_H - -#include -#include - -G_BEGIN_DECLS - -#define GST_VAAPI_TYPE_VIDEO_BUFFER \ - (gst_vaapi_video_buffer_get_type()) - -#define GST_VAAPI_VIDEO_BUFFER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - GST_VAAPI_TYPE_VIDEO_BUFFER, \ - GstVaapiVideoBuffer)) - -#define GST_VAAPI_VIDEO_BUFFER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), \ - GST_VAAPI_TYPE_VIDEO_BUFFER, \ - GstVaapiVideoBufferClass)) - -#define GST_VAAPI_IS_VIDEO_BUFFER(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_VIDEO_BUFFER)) - -#define GST_VAAPI_IS_VIDEO_BUFFER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_VIDEO_BUFFER)) - -#define GST_VAAPI_VIDEO_BUFFER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj), \ - GST_VAAPI_TYPE_VIDEO_BUFFER, \ - GstVaapiVideoBufferClass)) - -typedef struct _GstVaapiVideoBuffer GstVaapiVideoBuffer; -typedef struct _GstVaapiVideoBufferClass GstVaapiVideoBufferClass; - -/** - * GstVaapiVideoBuffer: - * - * A #GstBuffer holding video objects (#GstVaapiSurface and #GstVaapiImage). - */ -struct _GstVaapiVideoBuffer { - /*< private >*/ - GstSurfaceBuffer parent_instance; - - GstVaapiVideoMeta *meta; -}; - -/** - * GstVaapiVideoBufferClass: - * - * A #GstBuffer holding video objects - */ -struct _GstVaapiVideoBufferClass { - /*< private >*/ - GstSurfaceBufferClass parent_class; -}; - -GType -gst_vaapi_video_buffer_get_type(void) G_GNUC_CONST; - -GstBuffer * -gst_vaapi_video_buffer_new(GstVaapiVideoMeta *meta); - -GstVaapiVideoMeta * -gst_vaapi_video_buffer_get_meta(GstVaapiVideoBuffer *buffer); - -G_END_DECLS - -#endif /* GST_VAAPI_VIDEO_BUFFER_H */ diff --git a/gst/vaapi/Makefile.am b/gst/vaapi/Makefile.am index 67b95fb..f12a43e 100644 --- a/gst/vaapi/Makefile.am +++ b/gst/vaapi/Makefile.am @@ -39,6 +39,7 @@ libgstvaapi_source_c = \ gstvaapisink.c \ gstvaapiupload.c \ gstvaapiuploader.c \ + gstvaapivideobuffer.c \ $(NULL) libgstvaapi_source_h = \ @@ -50,6 +51,7 @@ libgstvaapi_source_h = \ gstvaapisink.h \ gstvaapiupload.h \ gstvaapiuploader.h \ + gstvaapivideobuffer.h \ $(NULL) if USE_GLX diff --git a/gst/vaapi/gstvaapidownload.h b/gst/vaapi/gstvaapidownload.h index 7a594c4..28b58e7 100644 --- a/gst/vaapi/gstvaapidownload.h +++ b/gst/vaapi/gstvaapidownload.h @@ -28,7 +28,6 @@ #include #include #include -#include G_BEGIN_DECLS diff --git a/gst/vaapi/gstvaapipluginbuffer.c b/gst/vaapi/gstvaapipluginbuffer.c index 766978f..e24676e 100644 --- a/gst/vaapi/gstvaapipluginbuffer.c +++ b/gst/vaapi/gstvaapipluginbuffer.c @@ -21,11 +21,11 @@ #include "gst/vaapi/sysdeps.h" #include -#include #if USE_GLX # include "gstvaapivideoconverter_glx.h" #endif #include "gstvaapipluginbuffer.h" +#include "gstvaapivideobuffer.h" static GFunc get_surface_converter(GstVaapiDisplay *display) diff --git a/gst/vaapi/gstvaapipostproc.h b/gst/vaapi/gstvaapipostproc.h index 4ad4f70..e983a31 100644 --- a/gst/vaapi/gstvaapipostproc.h +++ b/gst/vaapi/gstvaapipostproc.h @@ -26,7 +26,6 @@ #include #include #include -#include G_BEGIN_DECLS diff --git a/gst-libs/gst/vaapi/gstvaapivideobuffer.c b/gst/vaapi/gstvaapivideobuffer.c similarity index 62% rename from gst-libs/gst/vaapi/gstvaapivideobuffer.c rename to gst/vaapi/gstvaapivideobuffer.c index afb173c..f5945ed 100644 --- a/gst-libs/gst/vaapi/gstvaapivideobuffer.c +++ b/gst/vaapi/gstvaapivideobuffer.c @@ -1,5 +1,5 @@ /* - * gstvaapivideobuffer.c - Gst VA video buffer + * gstvaapivideobuffer.c - Gstreamer/VA video buffer * * Copyright (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2011-2013 Intel Corporation @@ -25,11 +25,60 @@ * @short_description: VA video buffer for GStreamer */ -#include "sysdeps.h" +#include "gst/vaapi/sysdeps.h" +#include #include "gstvaapivideobuffer.h" -#define DEBUG 1 -#include "gstvaapidebug.h" +#define GST_VAAPI_TYPE_VIDEO_BUFFER \ + (gst_vaapi_video_buffer_get_type()) + +#define GST_VAAPI_VIDEO_BUFFER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + GST_VAAPI_TYPE_VIDEO_BUFFER, \ + GstVaapiVideoBuffer)) + +#define GST_VAAPI_VIDEO_BUFFER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), \ + GST_VAAPI_TYPE_VIDEO_BUFFER, \ + GstVaapiVideoBufferClass)) + +#define GST_VAAPI_IS_VIDEO_BUFFER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_VIDEO_BUFFER)) + +#define GST_VAAPI_IS_VIDEO_BUFFER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_VIDEO_BUFFER)) + +#define GST_VAAPI_VIDEO_BUFFER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), \ + GST_VAAPI_TYPE_VIDEO_BUFFER, \ + GstVaapiVideoBufferClass)) + +typedef struct _GstVaapiVideoBufferClass GstVaapiVideoBufferClass; + +/** + * GstVaapiVideoBuffer: + * + * A #GstBuffer holding video objects (#GstVaapiSurface and #GstVaapiImage). + */ +struct _GstVaapiVideoBuffer { + /*< private >*/ + GstSurfaceBuffer parent_instance; + + GstVaapiVideoMeta *meta; +}; + +/** + * GstVaapiVideoBufferClass: + * + * A #GstBuffer holding video objects + */ +struct _GstVaapiVideoBufferClass { + /*< private >*/ + GstSurfaceBufferClass parent_class; +}; + +GType +gst_vaapi_video_buffer_get_type(void) G_GNUC_CONST; G_DEFINE_TYPE(GstVaapiVideoBuffer, gst_vaapi_video_buffer, @@ -65,14 +114,6 @@ gst_vaapi_video_buffer_init(GstVaapiVideoBuffer *buffer) { } -/** - * gst_vaapi_video_buffer_new: - * @meta: a #GstVaapiVideoMeta - * - * Creates a #GstBuffer that holds video @meta information. - * - * Return value: the newly allocated #GstBuffer, or %NULL or error - */ GstBuffer * gst_vaapi_video_buffer_new(GstVaapiVideoMeta *meta) { @@ -88,15 +129,6 @@ gst_vaapi_video_buffer_new(GstVaapiVideoMeta *meta) return buffer; } -/** - * gst_vaapi_video_buffer_get_meta: - * @buffer: a #GstVaapiVideoBuffer - * - * Returns the #GstVaapiVideoMeta associated to this @buffer. - * - * Return value: the #GstVaapiVideoMeta bound to the @buffer, or %NULL - * if none was found - */ GstVaapiVideoMeta * gst_vaapi_video_buffer_get_meta(GstVaapiVideoBuffer *buffer) { diff --git a/gst/vaapi/gstvaapivideobuffer.h b/gst/vaapi/gstvaapivideobuffer.h new file mode 100644 index 0000000..52d6eb7 --- /dev/null +++ b/gst/vaapi/gstvaapivideobuffer.h @@ -0,0 +1,42 @@ +/* + * gstvaapivideobuffer.h - Gstreamer/VA video buffer + * + * Copyright (C) 2010-2011 Splitted-Desktop Systems + * Copyright (C) 2011-2013 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_VIDEO_BUFFER_H +#define GST_VAAPI_VIDEO_BUFFER_H + +#include + +G_BEGIN_DECLS + +typedef struct _GstVaapiVideoBuffer GstVaapiVideoBuffer; + +G_GNUC_INTERNAL +GstBuffer * +gst_vaapi_video_buffer_new(GstVaapiVideoMeta *meta); + +G_GNUC_INTERNAL +GstVaapiVideoMeta * +gst_vaapi_video_buffer_get_meta(GstVaapiVideoBuffer *buffer); + +G_END_DECLS + +#endif /* GST_VAAPI_VIDEO_BUFFER_H */ diff --git a/gst/vaapi/gstvaapivideoconverter_glx.h b/gst/vaapi/gstvaapivideoconverter_glx.h index 70e2edf..97aa655 100644 --- a/gst/vaapi/gstvaapivideoconverter_glx.h +++ b/gst/vaapi/gstvaapivideoconverter_glx.h @@ -25,6 +25,7 @@ #define GST_VAAPI_VIDEO_CONVERTER_GLX_H #include +#include "gstvaapivideobuffer.h" G_BEGIN_DECLS -- 2.7.4