2 * gstvaapivideobuffer.c - Gstreamer/VA video buffer
4 * Copyright (C) 2010-2011 Splitted-Desktop Systems
5 * Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
6 * Copyright (C) 2011-2013 Intel Corporation
7 * Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA
26 * SECTION:gstvaapivideobuffer
27 * @short_description: VA video buffer for GStreamer
29 * This functions creates and decorates a #GstBuffer that is going to
30 * be used by VA base gstreamer elements.
33 #include "gstcompat.h"
34 #include "gstvaapivideobuffer.h"
37 new_vbuffer (GstVaapiVideoMeta * meta)
41 g_return_val_if_fail (meta != NULL, NULL);
43 buffer = gst_buffer_new ();
45 gst_buffer_set_vaapi_video_meta (buffer, meta);
46 gst_vaapi_video_meta_unref (meta);
51 gst_vaapi_video_buffer_new (GstVaapiVideoMeta * meta)
53 g_return_val_if_fail (meta != NULL, NULL);
55 return new_vbuffer (gst_vaapi_video_meta_ref (meta));
59 gst_vaapi_video_buffer_new_empty (void)
61 return gst_buffer_new ();
65 gst_vaapi_video_buffer_new_from_pool (GstVaapiVideoPool * pool)
67 return new_vbuffer (gst_vaapi_video_meta_new_from_pool (pool));
71 gst_vaapi_video_buffer_new_from_buffer (GstBuffer * buffer)
73 GstVaapiVideoMeta *const meta = gst_buffer_get_vaapi_video_meta (buffer);
75 return meta ? new_vbuffer (gst_vaapi_video_meta_ref (meta)) : NULL;
79 gst_vaapi_video_buffer_new_with_image (GstVaapiImage * image)
81 return new_vbuffer (gst_vaapi_video_meta_new_with_image (image));
85 gst_vaapi_video_buffer_new_with_surface_proxy (GstVaapiSurfaceProxy * proxy)
87 return new_vbuffer (gst_vaapi_video_meta_new_with_surface_proxy (proxy));