plugins: drop gstvaapipluginbuffer.[ch] helper files.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 21 Mar 2013 16:17:53 +0000 (17:17 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 21 Mar 2013 17:16:14 +0000 (18:16 +0100)
Move all gst_vaapi_video_buffer_new*() helpers from gstvaapipluginbuffer.[ch]
to gstvaapivideobuffer.[ch], and drop the obsolete files.

gst/vaapi/Makefile.am
gst/vaapi/gstvaapidecode.c
gst/vaapi/gstvaapidownload.c
gst/vaapi/gstvaapipluginbuffer.c [deleted file]
gst/vaapi/gstvaapipluginbuffer.h [deleted file]
gst/vaapi/gstvaapipostproc.c
gst/vaapi/gstvaapiupload.c
gst/vaapi/gstvaapiuploader.c
gst/vaapi/gstvaapivideobuffer.c
gst/vaapi/gstvaapivideobuffer.h

index f12a43e..b2e442c 100644 (file)
@@ -33,7 +33,6 @@ libgstvaapi_source_c = \
        gstvaapi.c              \
        gstvaapidecode.c        \
        gstvaapidownload.c      \
-       gstvaapipluginbuffer.c  \
        gstvaapipluginutil.c    \
        gstvaapipostproc.c      \
        gstvaapisink.c          \
@@ -45,7 +44,6 @@ libgstvaapi_source_c = \
 libgstvaapi_source_h = \
        gstvaapidecode.h        \
        gstvaapidownload.h      \
-       gstvaapipluginbuffer.h  \
        gstvaapipluginutil.h    \
        gstvaapipostproc.h      \
        gstvaapisink.h          \
index 508a323..8d19182 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "gstvaapidecode.h"
 #include "gstvaapipluginutil.h"
-#include "gstvaapipluginbuffer.h"
+#include "gstvaapivideobuffer.h"
 
 #include <gst/vaapi/gstvaapidecoder_h264.h>
 #include <gst/vaapi/gstvaapidecoder_jpeg.h>
index 3000fd9..9bb032f 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "gstvaapidownload.h"
 #include "gstvaapipluginutil.h"
-#include "gstvaapipluginbuffer.h"
+#include "gstvaapivideobuffer.h"
 
 #define GST_PLUGIN_NAME "vaapidownload"
 #define GST_PLUGIN_DESC "A VA to video flow filter"
diff --git a/gst/vaapi/gstvaapipluginbuffer.c b/gst/vaapi/gstvaapipluginbuffer.c
deleted file mode 100644 (file)
index e24676e..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *  gstvaapipluginbuffer.c - Private GStreamer/VA video buffers
- *
- *  Copyright (C) 2012-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
- */
-
-#include "gst/vaapi/sysdeps.h"
-#include <gst/vaapi/gstvaapivideometa.h>
-#if USE_GLX
-# include "gstvaapivideoconverter_glx.h"
-#endif
-#include "gstvaapipluginbuffer.h"
-#include "gstvaapivideobuffer.h"
-
-static GFunc
-get_surface_converter(GstVaapiDisplay *display)
-{
-    GFunc func;
-
-    switch (gst_vaapi_display_get_display_type(display)) {
-#if USE_GLX
-    case GST_VAAPI_DISPLAY_TYPE_GLX:
-        func = (GFunc)gst_vaapi_video_converter_glx_new;
-        break;
-#endif
-    default:
-        func = NULL;
-        break;
-    }
-    return func;
-}
-
-static GstBuffer *
-get_buffer(GstVaapiVideoMeta *meta)
-{
-    GstBuffer *buffer;
-
-    if (!meta)
-        return NULL;
-
-    gst_vaapi_video_meta_set_surface_converter(meta,
-        get_surface_converter(gst_vaapi_video_meta_get_display(meta)));
-
-    buffer = gst_vaapi_video_buffer_new(meta);
-    gst_vaapi_video_meta_unref(meta);
-    return buffer;
-}
-
-GstBuffer *
-gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool)
-{
-    return get_buffer(gst_vaapi_video_meta_new_from_pool(pool));
-}
-
-GstBuffer *
-gst_vaapi_video_buffer_new_from_buffer(GstBuffer *buffer)
-{
-    GstVaapiVideoMeta * const meta = gst_buffer_get_vaapi_video_meta(buffer);
-
-    if (!meta)
-        return NULL;
-    return get_buffer(gst_vaapi_video_meta_ref(meta));
-}
-
-GstBuffer *
-gst_vaapi_video_buffer_new_with_image(GstVaapiImage *image)
-{
-    return get_buffer(gst_vaapi_video_meta_new_with_image(image));
-}
-
-GstBuffer *
-gst_vaapi_video_buffer_new_with_surface(GstVaapiSurface *surface)
-{
-    return get_buffer(gst_vaapi_video_meta_new_with_surface(surface));
-}
-
-GstBuffer *
-gst_vaapi_video_buffer_new_with_surface_proxy(GstVaapiSurfaceProxy *proxy)
-{
-    return get_buffer(gst_vaapi_video_meta_new_with_surface_proxy(proxy));
-}
diff --git a/gst/vaapi/gstvaapipluginbuffer.h b/gst/vaapi/gstvaapipluginbuffer.h
deleted file mode 100644 (file)
index d3a509f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  gstvaapipluginbuffer.h - Private GStreamer/VA video buffers
- *
- *  Copyright (C) 2012-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_PLUGIN_BUFFER_H
-#define GST_VAAPI_PLUGIN_BUFFER_H
-
-G_GNUC_INTERNAL
-GstBuffer *
-gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool);
-
-G_GNUC_INTERNAL
-GstBuffer *
-gst_vaapi_video_buffer_new_from_buffer(GstBuffer *buffer);
-
-G_GNUC_INTERNAL
-GstBuffer *
-gst_vaapi_video_buffer_new_with_image(GstVaapiImage *image);
-
-G_GNUC_INTERNAL
-GstBuffer *
-gst_vaapi_video_buffer_new_with_surface(GstVaapiSurface *surface);
-
-G_GNUC_INTERNAL
-GstBuffer *
-gst_vaapi_video_buffer_new_with_surface_proxy(GstVaapiSurfaceProxy *proxy);
-
-#endif /* GST_VAAPI_PLUGIN_BUFFER_H */
index b0ea884..e2f0e5c 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "gstvaapipostproc.h"
 #include "gstvaapipluginutil.h"
-#include "gstvaapipluginbuffer.h"
+#include "gstvaapivideobuffer.h"
 
 #define GST_PLUGIN_NAME "vaapipostproc"
 #define GST_PLUGIN_DESC "A video postprocessing filter"
index 4b4f7c9..9ac8d7a 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "gstvaapiupload.h"
 #include "gstvaapipluginutil.h"
-#include "gstvaapipluginbuffer.h"
+#include "gstvaapivideobuffer.h"
 
 #define GST_PLUGIN_NAME "vaapiupload"
 #define GST_PLUGIN_DESC "A video to VA flow filter"
index 4ee4af1..1c898d3 100644 (file)
@@ -29,7 +29,7 @@
 #include <gst/vaapi/gstvaapivideometa.h>
 
 #include "gstvaapiuploader.h"
-#include "gstvaapipluginbuffer.h"
+#include "gstvaapivideobuffer.h"
 
 #define GST_HELPER_NAME "vaapiupload"
 #define GST_HELPER_DESC "VA-API video uploader"
index f5945ed..27dd1fb 100644 (file)
@@ -28,6 +28,9 @@
 #include "gst/vaapi/sysdeps.h"
 #include <gst/video/gstsurfacebuffer.h>
 #include "gstvaapivideobuffer.h"
+#if USE_GLX
+# include "gstvaapivideoconverter_glx.h"
+#endif
 
 #define GST_VAAPI_TYPE_VIDEO_BUFFER \
     (gst_vaapi_video_buffer_get_type())
@@ -114,21 +117,73 @@ gst_vaapi_video_buffer_init(GstVaapiVideoBuffer *buffer)
 {
 }
 
-GstBuffer *
-gst_vaapi_video_buffer_new(GstVaapiVideoMeta *meta)
+static GFunc
+get_surface_converter(GstVaapiDisplay *display)
+{
+    GFunc func;
+
+    switch (gst_vaapi_display_get_display_type(display)) {
+#if USE_GLX
+    case GST_VAAPI_DISPLAY_TYPE_GLX:
+        func = (GFunc)gst_vaapi_video_converter_glx_new;
+        break;
+#endif
+    default:
+        func = NULL;
+        break;
+    }
+    return func;
+}
+
+static GstBuffer *
+new_vbuffer(GstVaapiVideoMeta *meta)
 {
     GstBuffer *buffer;
 
     g_return_val_if_fail(meta != NULL, NULL);
 
-    buffer = GST_BUFFER_CAST(gst_mini_object_new(GST_TYPE_SURFACE_BUFFER));
-    if (!buffer)
-        return NULL;
+    gst_vaapi_video_meta_set_surface_converter(meta,
+        get_surface_converter(gst_vaapi_video_meta_get_display(meta)));
 
-    gst_buffer_set_vaapi_video_meta(buffer, meta);
+    buffer = GST_BUFFER_CAST(gst_mini_object_new(GST_TYPE_SURFACE_BUFFER));
+    if (buffer)
+        gst_buffer_set_vaapi_video_meta(buffer, meta);
+    gst_vaapi_video_meta_unref(meta);
     return buffer;
 }
 
+GstBuffer *
+gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool)
+{
+    return new_vbuffer(gst_vaapi_video_meta_new_from_pool(pool));
+}
+
+GstBuffer *
+gst_vaapi_video_buffer_new_from_buffer(GstBuffer *buffer)
+{
+    GstVaapiVideoMeta * const meta = gst_buffer_get_vaapi_video_meta(buffer);
+
+    return meta ? new_vbuffer(gst_vaapi_video_meta_ref(meta)) : NULL;
+}
+
+GstBuffer *
+gst_vaapi_video_buffer_new_with_image(GstVaapiImage *image)
+{
+    return new_vbuffer(gst_vaapi_video_meta_new_with_image(image));
+}
+
+GstBuffer *
+gst_vaapi_video_buffer_new_with_surface(GstVaapiSurface *surface)
+{
+    return new_vbuffer(gst_vaapi_video_meta_new_with_surface(surface));
+}
+
+GstBuffer *
+gst_vaapi_video_buffer_new_with_surface_proxy(GstVaapiSurfaceProxy *proxy)
+{
+    return new_vbuffer(gst_vaapi_video_meta_new_with_surface_proxy(proxy));
+}
+
 GstVaapiVideoMeta *
 gst_vaapi_video_buffer_get_meta(GstVaapiVideoBuffer *buffer)
 {
index 52d6eb7..e658172 100644 (file)
@@ -31,7 +31,23 @@ typedef struct _GstVaapiVideoBuffer             GstVaapiVideoBuffer;
 
 G_GNUC_INTERNAL
 GstBuffer *
-gst_vaapi_video_buffer_new(GstVaapiVideoMeta *meta);
+gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool);
+
+G_GNUC_INTERNAL
+GstBuffer *
+gst_vaapi_video_buffer_new_from_buffer(GstBuffer *buffer);
+
+G_GNUC_INTERNAL
+GstBuffer *
+gst_vaapi_video_buffer_new_with_image(GstVaapiImage *image);
+
+G_GNUC_INTERNAL
+GstBuffer *
+gst_vaapi_video_buffer_new_with_surface(GstVaapiSurface *surface);
+
+G_GNUC_INTERNAL
+GstBuffer *
+gst_vaapi_video_buffer_new_with_surface_proxy(GstVaapiSurfaceProxy *proxy);
 
 G_GNUC_INTERNAL
 GstVaapiVideoMeta *