gstreamer/subprojects/gstreamer-vaapi/gst/vaapi/gstvaapivideobuffer.c

89 lines
2.5 KiB
C
Raw Normal View History

2010-03-12 23:48:50 +00:00
/*
* gstvaapivideobuffer.c - Gstreamer/VA video buffer
2010-03-12 23:48:50 +00:00
*
* Copyright (C) 2010-2011 Splitted-Desktop Systems
* Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
* Copyright (C) 2011-2013 Intel Corporation
* Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2010-03-12 23:48:50 +00:00
*
2011-06-14 11:51:41 +00:00
* 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.
2010-03-12 23:48:50 +00:00
*
2011-06-14 11:51:41 +00:00
* This library is distributed in the hope that it will be useful,
2010-03-12 23:48:50 +00:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
2011-06-14 11:51:41 +00:00
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
2010-03-12 23:48:50 +00:00
*
2011-06-14 11:51:41 +00:00
* 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
2010-03-12 23:48:50 +00:00
*/
2010-03-19 16:41:52 +00:00
/**
2010-03-24 08:16:32 +00:00
* SECTION:gstvaapivideobuffer
* @short_description: VA video buffer for GStreamer
2016-10-27 09:06:06 +00:00
*
* This functions creates and decorates a #GstBuffer that is going to
* be used by VA base gstreamer elements.
2010-03-19 16:41:52 +00:00
*/
#include "gstcompat.h"
2010-03-12 23:48:50 +00:00
#include "gstvaapivideobuffer.h"
static GstBuffer *
new_vbuffer (GstVaapiVideoMeta * meta)
2010-04-29 21:56:10 +00:00
{
GstBuffer *buffer;
g_return_val_if_fail (meta != NULL, NULL);
buffer = gst_buffer_new ();
if (buffer)
gst_buffer_set_vaapi_video_meta (buffer, meta);
gst_vaapi_video_meta_unref (meta);
return buffer;
2010-03-12 23:48:50 +00:00
}
GstBuffer *
gst_vaapi_video_buffer_new (GstVaapiVideoMeta * meta)
{
g_return_val_if_fail (meta != NULL, NULL);
return new_vbuffer (gst_vaapi_video_meta_ref (meta));
}
GstBuffer *
gst_vaapi_video_buffer_new_empty (void)
{
return gst_buffer_new ();
}
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_proxy (GstVaapiSurfaceProxy * proxy)
{
return new_vbuffer (gst_vaapi_video_meta_new_with_surface_proxy (proxy));
}