gstvaapi.c \
gstvaapidecode.c \
gstvaapidownload.c \
- gstvaapipluginbuffer.c \
gstvaapipluginutil.c \
gstvaapipostproc.c \
gstvaapisink.c \
libgstvaapi_source_h = \
gstvaapidecode.h \
gstvaapidownload.h \
- gstvaapipluginbuffer.h \
gstvaapipluginutil.h \
gstvaapipostproc.h \
gstvaapisink.h \
#include "gstvaapidecode.h"
#include "gstvaapipluginutil.h"
-#include "gstvaapipluginbuffer.h"
+#include "gstvaapivideobuffer.h"
#include <gst/vaapi/gstvaapidecoder_h264.h>
#include <gst/vaapi/gstvaapidecoder_jpeg.h>
#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"
+++ /dev/null
-/*
- * 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));
-}
+++ /dev/null
-/*
- * 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 */
#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"
#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"
#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"
#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())
{
}
-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)
{
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 *