1 /*
2  * GStreamer
3  * Copyright (C) 2009 Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef _GST_VDP_OUTPUT_BUFFER_H_
22 #define _GST_VDP_OUTPUT_BUFFER_H_
23 
24 #include <gst/gst.h>
25 
26 #include "gstvdpdevice.h"
27 
28 GType gst_vdpau_output_meta_api_get_type (void);
29 
30 const GstMetaInfo * gst_vdpau_output_meta_get_info (void);
31 
32 #define GST_VDPAU_OUTPUT_META_GET(buf) ((GstVdpauMeta *)gst_buffer_get_meta(buf,gst_vdpau_output_meta_api_get_type()))
33 #define GST_VDPAU_OUTPUT_META_ADD(buf) ((GstVdpauMeta *)gst_buffer_add_meta(buf,gst_vdpau_output_meta_get_info(),NULL))
34 
35 struct _GstVdpauOutputMeta {
36   GstMeta meta;
37 
38   /* FIXME : Check we actually need all of this */
39   GstVdpDevice *device;
40   VdpRGBAFormat rgba_format;
41   gint width, height;
42 
43   VdpOutputSurface surface;
44 };
45 
46 #if 0
47 /* FIXME : Replace with GST_VIDEO_FORMAT... and GST_VIDEO_CHROMA_... */
48 GstCaps *gst_vdp_output_buffer_get_template_caps (void);
49 GstCaps *gst_vdp_output_buffer_get_allowed_caps (GstVdpDevice *device);
50 gboolean gst_vdp_caps_to_rgba_format (GstCaps *caps, VdpRGBAFormat *rgba_format);
51 
52 gboolean gst_vdp_output_buffer_calculate_size (GstVdpOutputBuffer *output_buf, guint *size);
53 /* FIXME : Replace with map/unmap  */
54 gboolean gst_vdp_output_buffer_download (GstVdpOutputBuffer *output_buf, GstBuffer *outbuf, GError **error);
55 
56 #define GST_VDP_OUTPUT_CAPS \
57   "video/x-vdpau-output, " \
58   "rgba-format = (int)[0,4], " \
59   "width = (int)[1,8192], " \
60   "height = (int)[1,8192]"
61 #endif
62 #endif
63