3 * Copyright (C) 2009 Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
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.
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.
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., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #ifndef _GST_VDP_VIDEO_BUFFER_H_
22 #define _GST_VDP_VIDEO_BUFFER_H_
25 #include <gst/video/video.h>
27 #include "gstvdpbuffer.h"
28 #include "gstvdpdevice.h"
30 typedef struct _GstVdpVideoBuffer GstVdpVideoBuffer;
32 #define GST_TYPE_VDP_VIDEO_BUFFER (gst_vdp_video_buffer_get_type())
34 #define GST_IS_VDP_VIDEO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VDP_VIDEO_BUFFER))
35 #define GST_VDP_VIDEO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VDP_VIDEO_BUFFER, GstVdpVideoBuffer))
37 struct _GstVdpVideoBuffer {
38 GstVdpBuffer vdp_buffer;
41 VdpVideoSurface surface;
46 VdpChromaType chroma_type;
47 VdpYCbCrFormat format;
49 } GstVdpVideoBufferFormats;
51 static const VdpChromaType chroma_types[] =
52 { VDP_CHROMA_TYPE_420, VDP_CHROMA_TYPE_422, VDP_CHROMA_TYPE_444 };
54 static const GstVdpVideoBufferFormats formats[] = {
57 VDP_YCBCR_FORMAT_YV12,
58 GST_MAKE_FOURCC ('I', '4', '2', '0')
62 VDP_YCBCR_FORMAT_YV12,
63 GST_MAKE_FOURCC ('Y', 'V', '1', '2')
67 VDP_YCBCR_FORMAT_NV12,
68 GST_MAKE_FOURCC ('N', 'V', '1', '2')
72 VDP_YCBCR_FORMAT_UYVY,
73 GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y')
77 VDP_YCBCR_FORMAT_V8U8Y8A8,
78 GST_MAKE_FOURCC ('A', 'Y', 'U', 'V')
82 VDP_YCBCR_FORMAT_Y8U8V8A8,
83 GST_MAKE_FOURCC ('A', 'V', 'U', 'Y')
87 VDP_YCBCR_FORMAT_YUYV,
88 GST_MAKE_FOURCC ('Y', 'U', 'Y', '2')
92 GType gst_vdp_video_buffer_get_type (void);
94 GstVdpVideoBuffer *gst_vdp_video_buffer_new (GstVdpDevice * device, VdpChromaType chroma_type, gint width, gint height, GError **error);
96 GstCaps *gst_vdp_video_buffer_get_caps (gboolean filter, VdpChromaType chroma_type);
97 GstCaps *gst_vdp_video_buffer_get_allowed_caps (GstVdpDevice * device);
99 gboolean gst_vdp_video_buffer_calculate_size (guint32 fourcc, gint width, gint height, guint *size);
100 gboolean gst_vdp_video_buffer_download (GstVdpVideoBuffer *inbuf, GstBuffer *outbuf, guint32 fourcc, gint width, gint height);
101 gboolean gst_vdp_video_buffer_upload (GstVdpVideoBuffer *video_buf, GstBuffer *src_buf, guint fourcc, gint width, gint height);
103 #define GST_VDP_VIDEO_CAPS \
104 "video/x-vdpau-video, " \
105 "chroma-type = (int)[0,2], " \
106 "width = (int)[1,4096], " \
107 "height = (int)[1,4096]"