<TITLE>GstVaapiVideoBuffer</TITLE>
GstVaapiVideoBuffer
GstVaapiVideoBufferClass
-gst_vaapi_video_buffer_new
-gst_vaapi_video_buffer_new_from_pool
-gst_vaapi_video_buffer_new_from_buffer
-gst_vaapi_video_buffer_new_with_image
-gst_vaapi_video_buffer_new_with_surface
-gst_vaapi_video_buffer_new_with_surface_proxy
+gst_vaapi_video_buffer_typed_new
+gst_vaapi_video_buffer_typed_new_from_pool
+gst_vaapi_video_buffer_typed_new_from_buffer
+gst_vaapi_video_buffer_typed_new_with_image
+gst_vaapi_video_buffer_typed_new_with_surface
+gst_vaapi_video_buffer_typed_new_with_surface_proxy
gst_vaapi_video_buffer_get_display
gst_vaapi_video_buffer_get_image
gst_vaapi_video_buffer_set_image
}
/**
- * gst_vaapi_video_buffer_new:
+ * gst_vaapi_video_buffer_typed_new:
* @display: a #GstVaapiDisplay
*
* Creates an empty #GstBuffer. The caller is responsible for completing
* the initialization of the buffer with the gst_vaapi_video_buffer_set_*()
* functions.
*
+ * This function shall only be called from within gstreamer-vaapi
+ * plugin elements.
+ *
* Return value: the newly allocated #GstBuffer, or %NULL or error
*/
GstBuffer *
return buffer;
}
-GstBuffer *
-gst_vaapi_video_buffer_new(GstVaapiDisplay *display)
-{
- return gst_vaapi_video_buffer_typed_new(
- GST_VAAPI_TYPE_VIDEO_BUFFER, display);
-}
-
/**
- * gst_vaapi_video_buffer_new_from_pool:
+ * gst_vaapi_video_buffer_typed_new_from_pool:
* @pool: a #GstVaapiVideoPool
*
* Creates a #GstBuffer with a video object allocated from a @pool.
return NULL;
}
-GstBuffer *
-gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool)
-{
- return gst_vaapi_video_buffer_typed_new_from_pool(
- GST_VAAPI_TYPE_VIDEO_BUFFER, pool);
-}
-
/**
- * gst_vaapi_video_buffer_new_from_buffer:
+ * gst_vaapi_video_buffer_typed_new_from_buffer:
* @buffer: a #GstBuffer
*
* Creates a #GstBuffer with video objects bound to @buffer video
* objects, if any.
*
+ * This function shall only be called from within gstreamer-vaapi
+ * plugin elements.
+ *
* Return value: the newly allocated #GstBuffer, or %NULL on error
*/
GstBuffer *
return GST_BUFFER(outbuf);
}
-GstBuffer *
-gst_vaapi_video_buffer_new_from_buffer(GstBuffer *buffer)
-{
- return gst_vaapi_video_buffer_typed_new_from_buffer(
- GST_VAAPI_TYPE_VIDEO_BUFFER, buffer);
-}
-
/**
- * gst_vaapi_video_buffer_new_with_image:
+ * gst_vaapi_video_buffer_typed_new_with_image:
* @image: a #GstVaapiImage
*
* Creates a #GstBuffer with the specified @image. The resulting
* buffer holds an additional reference to the @image.
*
+ * This function shall only be called from within gstreamer-vaapi
+ * plugin elements.
+ *
* Return value: the newly allocated #GstBuffer, or %NULL on error
*/
GstBuffer *
return GST_BUFFER(buffer);
}
-GstBuffer *
-gst_vaapi_video_buffer_new_with_image(GstVaapiImage *image)
-{
- return gst_vaapi_video_buffer_typed_new_with_image(
- GST_VAAPI_TYPE_VIDEO_BUFFER, image);
-}
-
/**
- * gst_vaapi_video_buffer_new_with_surface:
+ * gst_vaapi_video_buffer_typed_new_with_surface:
* @surface: a #GstVaapiSurface
*
* Creates a #GstBuffer with the specified @surface. The resulting
* buffer holds an additional reference to the @surface.
*
+ * This function shall only be called from within gstreamer-vaapi
+ * plugin elements.
+ *
* Return value: the newly allocated #GstBuffer, or %NULL on error
*/
GstBuffer *
return GST_BUFFER(buffer);
}
-GstBuffer *
-gst_vaapi_video_buffer_new_with_surface(GstVaapiSurface *surface)
-{
- return gst_vaapi_video_buffer_typed_new_with_surface(
- GST_VAAPI_TYPE_VIDEO_BUFFER, surface);
-}
-
/**
- * gst_vaapi_video_buffer_new_with_surface_proxy:
+ * gst_vaapi_video_buffer_typed_new_with_surface_proxy:
* @proxy: a #GstVaapiSurfaceProxy
*
* Creates a #GstBuffer with the specified surface @proxy. The
* resulting buffer holds an additional reference to the @proxy.
*
+ * This function shall only be called from within gstreamer-vaapi
+ * plugin elements.
+ *
* Return value: the newly allocated #GstBuffer, or %NULL on error
*/
GstBuffer *
return GST_BUFFER(buffer);
}
-GstBuffer *
-gst_vaapi_video_buffer_new_with_surface_proxy(GstVaapiSurfaceProxy *proxy)
-{
- return gst_vaapi_video_buffer_typed_new_with_surface_proxy(
- GST_VAAPI_TYPE_VIDEO_BUFFER, proxy);
-}
-
/**
* gst_vaapi_video_buffer_get_display:
* @buffer: a #GstVaapiVideoBuffer
GType
gst_vaapi_video_buffer_get_type(void) G_GNUC_CONST;
-/* Deprecated API. Client applications shall not use the following functions */
-#ifndef GST_VAAPI_DISABLE_DEPRECATED
-
-G_GNUC_DEPRECATED
-GstBuffer *
-gst_vaapi_video_buffer_new(GstVaapiDisplay *display);
-
-G_GNUC_DEPRECATED
-GstBuffer *
-gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool);
-
-G_GNUC_DEPRECATED
-GstBuffer *
-gst_vaapi_video_buffer_new_from_buffer(GstBuffer *buffer);
-
-G_GNUC_DEPRECATED
-GstBuffer *
-gst_vaapi_video_buffer_new_with_image(GstVaapiImage *image);
-
-G_GNUC_DEPRECATED
-GstBuffer *
-gst_vaapi_video_buffer_new_with_surface(GstVaapiSurface *surface);
-
-G_GNUC_DEPRECATED
-GstBuffer *
-gst_vaapi_video_buffer_new_with_surface_proxy(GstVaapiSurfaceProxy *proxy);
-
-#endif /* GST_VAAPI_DISABLE_DEPRECATED */
-
GstVaapiDisplay *
gst_vaapi_video_buffer_get_display(GstVaapiVideoBuffer *buffer);
gst_vaapi_video_buffer_glx_init(GstVaapiVideoBufferGLX *buffer)
{
}
-
-/**
- * gst_vaapi_video_buffer_glx_new:
- * @display: a #GstVaapiDisplayGLX
- *
- * Creates an empty #GstBuffer. The caller is responsible for completing
- * the initialization of the buffer with the gst_vaapi_video_buffer_set_*()
- * functions.
- *
- * Return value: the newly allocated #GstBuffer, or %NULL or error
- */
-GstBuffer *
-gst_vaapi_video_buffer_glx_new(GstVaapiDisplayGLX *display)
-{
- g_return_val_if_fail(GST_VAAPI_IS_DISPLAY_GLX(display), NULL);
-
- return gst_vaapi_video_buffer_typed_new(
- GST_VAAPI_TYPE_VIDEO_BUFFER_GLX, GST_VAAPI_DISPLAY_CAST(display));
-}
-
-/**
- * gst_vaapi_video_buffer_glx_new_from_pool:
- * @pool: a #GstVaapiVideoPool
- *
- * Creates a #GstBuffer with a video object allocated from a @pool.
- * Only #GstVaapiSurfacePool and #GstVaapiImagePool pools are supported.
- *
- * The buffer is destroyed through the last call to gst_buffer_unref()
- * and the video objects are pushed back to their respective pools.
- *
- * Return value: the newly allocated #GstBuffer, or %NULL on error
- */
-GstBuffer *
-gst_vaapi_video_buffer_glx_new_from_pool(GstVaapiVideoPool *pool)
-{
- return gst_vaapi_video_buffer_typed_new_from_pool(
- GST_VAAPI_TYPE_VIDEO_BUFFER_GLX, pool);
-}
-
-/**
- * gst_vaapi_video_buffer_glx_new_from_buffer:
- * @buffer: a #GstBuffer
- *
- * Creates a #GstBuffer with video objects bound to @buffer video
- * objects, if any.
- *
- * Return value: the newly allocated #GstBuffer, or %NULL on error
- */
-GstBuffer *
-gst_vaapi_video_buffer_glx_new_from_buffer(GstBuffer *buffer)
-{
- return gst_vaapi_video_buffer_typed_new_from_buffer(
- GST_VAAPI_TYPE_VIDEO_BUFFER_GLX, buffer);
-}
GType gst_vaapi_video_buffer_glx_get_type (void) G_GNUC_CONST;
-/* Deprecated API. Client applications shall not use the following functions */
-#ifndef GST_VAAPI_DISABLE_DEPRECATED
-
-G_GNUC_DEPRECATED
-GstBuffer *gst_vaapi_video_buffer_glx_new (GstVaapiDisplayGLX * display);
-
-G_GNUC_DEPRECATED
-GstBuffer *gst_vaapi_video_buffer_glx_new_from_pool (GstVaapiVideoPool * pool);
-
-G_GNUC_DEPRECATED
-GstBuffer *gst_vaapi_video_buffer_glx_new_from_buffer (GstBuffer * buffer);
-
-#endif /* GST_VAAPI_DISABLE_DEPRECATED */
-
G_END_DECLS
#endif /* GST_VAAPI_VIDEO_BUFFER_GLX_H */
gstvaapi.c \
gstvaapidecode.c \
gstvaapidownload.c \
+ gstvaapipluginbuffer.c \
gstvaapipluginutil.c \
gstvaapipostproc.c \
gstvaapisink.c \
noinst_HEADERS = \
gstvaapidecode.h \
gstvaapidownload.h \
+ gstvaapipluginbuffer.h \
gstvaapipluginutil.h \
gstvaapipostproc.h \
gstvaapisink.h \
#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>
#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"
--- /dev/null
+/*
+ * 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);
+}
--- /dev/null
+/*
+ * 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 */
#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"
#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"