vda: use hwaccel private data for internal bitstream buffer
[libav.git] / libavcodec / vda.h
CommitLineData
ac3dbb4d
SZ
1/*
2 * VDA HW acceleration
3 *
4 * copyright (c) 2011 Sebastien Zwickert
5 *
6 * This file is part of Libav.
7 *
8 * Libav is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * Libav is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with Libav; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#ifndef AVCODEC_VDA_H
24#define AVCODEC_VDA_H
25
7c59b5c2
AK
26/**
27 * @file
28 * @ingroup lavc_codec_hwaccel_vda
29 * Public libavcodec VDA header.
30 */
31
3c379706
SZ
32#include "libavcodec/version.h"
33
ac3dbb4d
SZ
34#include <stdint.h>
35
36// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
37// http://openradar.appspot.com/8026390
38#undef __GNUC_STDC_INLINE__
39
40#define Picture QuickdrawPicture
41#include <VideoDecodeAcceleration/VDADecoder.h>
42#undef Picture
43
44/**
7c59b5c2
AK
45 * @defgroup lavc_codec_hwaccel_vda VDA
46 * @ingroup lavc_codec_hwaccel
47 *
48 * @{
49 */
50
ac3dbb4d
SZ
51/**
52 * This structure is used to provide the necessary configurations and data
53 * to the VDA Libav HWAccel implementation.
54 *
55 * The application must make it available as AVCodecContext.hwaccel_context.
56 */
57struct vda_context {
58 /**
063910f5
SZ
59 * VDA decoder object.
60 *
61 * - encoding: unused
62 * - decoding: Set/Unset by libavcodec.
63 */
ac3dbb4d
SZ
64 VDADecoder decoder;
65
66 /**
063910f5
SZ
67 * The Core Video pixel buffer that contains the current image data.
68 *
69 * encoding: unused
70 * decoding: Set by libavcodec. Unset by user.
71 */
3c379706
SZ
72 CVPixelBufferRef cv_buffer;
73
74 /**
063910f5
SZ
75 * Use the hardware decoder in synchronous mode.
76 *
77 * encoding: unused
78 * decoding: Set by user.
79 */
3c379706
SZ
80 int use_sync_decoding;
81
ac3dbb4d 82 /**
063910f5
SZ
83 * The frame width.
84 *
85 * - encoding: unused
86 * - decoding: Set/Unset by user.
87 */
ac3dbb4d
SZ
88 int width;
89
90 /**
063910f5
SZ
91 * The frame height.
92 *
93 * - encoding: unused
94 * - decoding: Set/Unset by user.
95 */
ac3dbb4d
SZ
96 int height;
97
98 /**
063910f5
SZ
99 * The frame format.
100 *
101 * - encoding: unused
102 * - decoding: Set/Unset by user.
103 */
ac3dbb4d
SZ
104 int format;
105
106 /**
063910f5
SZ
107 * The pixel format for output image buffers.
108 *
109 * - encoding: unused
110 * - decoding: Set/Unset by user.
111 */
ac3dbb4d 112 OSType cv_pix_fmt_type;
cfc680ab
SZ
113
114 /**
31a46750 115 * unused
063910f5 116 */
cfc680ab
SZ
117 uint8_t *priv_bitstream;
118
119 /**
31a46750 120 * unused
063910f5 121 */
cfc680ab
SZ
122 int priv_bitstream_size;
123
124 /**
31a46750 125 * unused
063910f5 126 */
cfc680ab 127 int priv_allocated_size;
ac3dbb4d
SZ
128};
129
130/** Create the video decoder. */
131int ff_vda_create_decoder(struct vda_context *vda_ctx,
132 uint8_t *extradata,
133 int extradata_size);
134
135/** Destroy the video decoder. */
136int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
137
7c59b5c2
AK
138/**
139 * @}
140 */
141
ac3dbb4d 142#endif /* AVCODEC_VDA_H */