summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-07-24 14:31:25 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-07-24 16:13:31 +0200
commit8ef490a3dec18c8dbc770a0d25e4f80563bc613d (patch)
treebf356256d205de9ee9f42e05486a984ad543443e /gst
parent809a85433d73fb1fbb0f452c85b7d2ec369c81ab (diff)
videobuffer: drop deprecated functions.
Move video buffer creation routines to plugin elements. That exclusively uses *_typed_new*() variants.
Diffstat (limited to 'gst')
-rw-r--r--gst/vaapi/Makefile.am2
-rw-r--r--gst/vaapi/gstvaapidecode.c7
-rw-r--r--gst/vaapi/gstvaapidownload.c11
-rw-r--r--gst/vaapi/gstvaapipluginbuffer.c124
-rw-r--r--gst/vaapi/gstvaapipluginbuffer.h49
-rw-r--r--gst/vaapi/gstvaapipostproc.c3
-rw-r--r--gst/vaapi/gstvaapiupload.c11
7 files changed, 182 insertions, 25 deletions
diff --git a/gst/vaapi/Makefile.am b/gst/vaapi/Makefile.am
index 6a4175ad..e3c3ddb6 100644
--- a/gst/vaapi/Makefile.am
+++ b/gst/vaapi/Makefile.am
@@ -23,6 +23,7 @@ libgstvaapi_la_SOURCES = \
gstvaapi.c \
gstvaapidecode.c \
gstvaapidownload.c \
+ gstvaapipluginbuffer.c \
gstvaapipluginutil.c \
gstvaapipostproc.c \
gstvaapisink.c \
@@ -32,6 +33,7 @@ libgstvaapi_la_SOURCES = \
noinst_HEADERS = \
gstvaapidecode.h \
gstvaapidownload.h \
+ gstvaapipluginbuffer.h \
gstvaapipluginutil.h \
gstvaapipostproc.h \
gstvaapisink.h \
diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c
index b2f31135..6c303f9f 100644
--- a/gst/vaapi/gstvaapidecode.c
+++ b/gst/vaapi/gstvaapidecode.c
@@ -35,14 +35,9 @@
#include <gst/vaapi/gstvaapivideobuffer.h>
#include <gst/video/videocontext.h>
-#if USE_GLX
-#include <gst/vaapi/gstvaapivideobuffer_glx.h>
-#define gst_vaapi_video_buffer_new(display) \
- gst_vaapi_video_buffer_glx_new(GST_VAAPI_DISPLAY_GLX(display))
-#endif
-
#include "gstvaapidecode.h"
#include "gstvaapipluginutil.h"
+#include "gstvaapipluginbuffer.h"
#include <gst/vaapi/gstvaapidecoder_h264.h>
#include <gst/vaapi/gstvaapidecoder_jpeg.h>
diff --git a/gst/vaapi/gstvaapidownload.c b/gst/vaapi/gstvaapidownload.c
index 4908e52f..f3e9caa4 100644
--- a/gst/vaapi/gstvaapidownload.c
+++ b/gst/vaapi/gstvaapidownload.c
@@ -35,16 +35,9 @@
#include <gst/vaapi/gstvaapivideosink.h>
#include <gst/vaapi/gstvaapivideobuffer.h>
-#if USE_GLX
-#include <gst/vaapi/gstvaapivideobuffer_glx.h>
-#define gst_vaapi_video_buffer_new_from_pool(pool) \
- gst_vaapi_video_buffer_glx_new_from_pool(pool)
-#define gst_vaapi_video_buffer_new_from_buffer(buffer) \
- gst_vaapi_video_buffer_glx_new_from_buffer(buffer)
-#endif
-
-#include "gstvaapipluginutil.h"
#include "gstvaapidownload.h"
+#include "gstvaapipluginutil.h"
+#include "gstvaapipluginbuffer.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
new file mode 100644
index 00000000..225318e1
--- /dev/null
+++ b/gst/vaapi/gstvaapipluginbuffer.c
@@ -0,0 +1,124 @@
+/*
+ * gstvaapipluginbuffer.c - Private GStreamer/VA video buffers
+ *
+ * Copyright (C) 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
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <gst/vaapi/gstvaapivideobuffer.h>
+#include <gst/vaapi/gstvaapivideobuffer_priv.h>
+#if USE_GLX
+# include <gst/vaapi/gstvaapivideobuffer_glx.h>
+#endif
+#include "gstvaapipluginbuffer.h"
+
+static inline GType
+get_type(GstVaapiDisplay *display)
+{
+#if USE_GLX
+ if (GST_VAAPI_IS_DISPLAY_GLX(display))
+ return GST_VAAPI_TYPE_VIDEO_BUFFER_GLX;
+#endif
+ return GST_VAAPI_TYPE_VIDEO_BUFFER;
+}
+
+GstBuffer *
+gst_vaapi_video_buffer_new(GstVaapiDisplay *display)
+{
+ g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL);
+
+ return gst_vaapi_video_buffer_typed_new(get_type(display), display);
+}
+
+GstBuffer *
+gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool)
+{
+ GstVaapiDisplay *display;
+
+ g_return_val_if_fail(GST_VAAPI_IS_VIDEO_POOL(pool), NULL);
+
+ display = gst_vaapi_video_pool_get_display(pool);
+ if (!display)
+ return NULL;
+ return gst_vaapi_video_buffer_typed_new_from_pool(get_type(display), pool);
+}
+
+GstBuffer *
+gst_vaapi_video_buffer_new_from_buffer(GstBuffer *buffer)
+{
+ GstVaapiVideoBuffer *vbuffer;
+ GstVaapiDisplay *display;
+
+ g_return_val_if_fail(GST_VAAPI_IS_VIDEO_BUFFER(buffer), NULL);
+
+ vbuffer = GST_VAAPI_VIDEO_BUFFER(buffer);
+ display = gst_vaapi_video_buffer_get_display(vbuffer);
+ if (!display)
+ return NULL;
+
+ return gst_vaapi_video_buffer_typed_new_from_buffer(
+ get_type(display), buffer);
+}
+
+GstBuffer *
+gst_vaapi_video_buffer_new_with_image(GstVaapiImage *image)
+{
+ GstVaapiDisplay *display;
+
+ g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), NULL);
+
+ display = gst_vaapi_object_get_display(GST_VAAPI_OBJECT(image));
+ if (!display)
+ return NULL;
+
+ return gst_vaapi_video_buffer_typed_new_with_image(
+ get_type(display), image);
+}
+
+GstBuffer *
+gst_vaapi_video_buffer_new_with_surface(GstVaapiSurface *surface)
+{
+ GstVaapiDisplay *display;
+
+ g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), NULL);
+
+ display = gst_vaapi_object_get_display(GST_VAAPI_OBJECT(surface));
+ if (!display)
+ return NULL;
+
+ return gst_vaapi_video_buffer_typed_new_with_surface(
+ get_type(display), surface);
+}
+
+GstBuffer *
+gst_vaapi_video_buffer_new_with_surface_proxy(GstVaapiSurfaceProxy *proxy)
+{
+ GstVaapiDisplay *display;
+
+ g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), NULL);
+
+ display = gst_vaapi_object_get_display(GST_VAAPI_OBJECT(proxy));
+ if (!display)
+ return NULL;
+
+ return gst_vaapi_video_buffer_typed_new_with_surface_proxy(
+ get_type(display), proxy);
+}
diff --git a/gst/vaapi/gstvaapipluginbuffer.h b/gst/vaapi/gstvaapipluginbuffer.h
new file mode 100644
index 00000000..d6798d5d
--- /dev/null
+++ b/gst/vaapi/gstvaapipluginbuffer.h
@@ -0,0 +1,49 @@
+/*
+ * gstvaapipluginbuffer.h - Private GStreamer/VA video buffers
+ *
+ * Copyright (C) 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_PLUGIN_BUFFER_H
+#define GST_VAAPI_PLUGIN_BUFFER_H
+
+G_GNUC_INTERNAL
+GstBuffer *
+gst_vaapi_video_buffer_new(GstVaapiDisplay *display);
+
+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 */
diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c
index bfd18c0e..59bd1b3d 100644
--- a/gst/vaapi/gstvaapipostproc.c
+++ b/gst/vaapi/gstvaapipostproc.c
@@ -34,8 +34,9 @@
#include <gst/vaapi/gstvaapivideosink.h>
#include <gst/vaapi/gstvaapivideobuffer.h>
-#include "gstvaapipluginutil.h"
#include "gstvaapipostproc.h"
+#include "gstvaapipluginutil.h"
+#include "gstvaapipluginbuffer.h"
#define GST_PLUGIN_NAME "vaapipostproc"
#define GST_PLUGIN_DESC "A video postprocessing filter"
diff --git a/gst/vaapi/gstvaapiupload.c b/gst/vaapi/gstvaapiupload.c
index fac9a7dd..d66b21d5 100644
--- a/gst/vaapi/gstvaapiupload.c
+++ b/gst/vaapi/gstvaapiupload.c
@@ -36,16 +36,9 @@
#include <gst/vaapi/gstvaapivideosink.h>
#include <gst/vaapi/gstvaapivideobuffer.h>
-#if USE_GLX
-#include <gst/vaapi/gstvaapivideobuffer_glx.h>
-#define gst_vaapi_video_buffer_new_from_pool(pool) \
- gst_vaapi_video_buffer_glx_new_from_pool(pool)
-#define gst_vaapi_video_buffer_new_from_buffer(buffer) \
- gst_vaapi_video_buffer_glx_new_from_buffer(buffer)
-#endif
-
-#include "gstvaapipluginutil.h"
#include "gstvaapiupload.h"
+#include "gstvaapipluginutil.h"
+#include "gstvaapipluginbuffer.h"
#define GST_PLUGIN_NAME "vaapiupload"
#define GST_PLUGIN_DESC "A video to VA flow filter"