mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
plugins: drop gstvaapipluginbuffer.[ch] helper files.
Move all gst_vaapi_video_buffer_new*() helpers from gstvaapipluginbuffer.[ch] to gstvaapivideobuffer.[ch], and drop the obsolete files.
This commit is contained in:
parent
4cf44e3ad2
commit
63fedf6767
10 changed files with 83 additions and 155 deletions
|
@ -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 \
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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));
|
||||
}
|
|
@ -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 */
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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 *
|
||||
|
|
Loading…
Reference in a new issue