4 * copyright (c) 2011 Sebastien Zwickert
6 * This file is part of FFmpeg.
8 * FFmpeg 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.
13 * FFmpeg 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.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 * @ingroup lavc_codec_hwaccel_vda
29 * Public libavcodec VDA header.
34 // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
35 // http://openradar.appspot.com/8026390
36 #undef __GNUC_STDC_INLINE__
38 #define Picture QuickdrawPicture
39 #include <VideoDecodeAcceleration/VDADecoder.h>
42 #include "libavcodec/version.h"
44 // extra flags not defined in VDADecoder.h
46 kVDADecodeInfo_Asynchronous = 1UL << 0,
47 kVDADecodeInfo_FrameDropped = 1UL << 1
51 * @defgroup lavc_codec_hwaccel_vda VDA
52 * @ingroup lavc_codec_hwaccel
58 * This structure is used to provide the necessary configurations and data
59 * to the VDA FFmpeg HWAccel implementation.
61 * The application must make it available as AVCodecContext.hwaccel_context.
68 * - decoding: Set/Unset by libavcodec.
73 * The Core Video pixel buffer that contains the current image data.
76 * decoding: Set by libavcodec. Unset by user.
78 CVPixelBufferRef cv_buffer;
81 * Use the hardware decoder in synchronous mode.
84 * decoding: Set by user.
86 int use_sync_decoding;
92 * - decoding: Set/Unset by user.
100 * - decoding: Set/Unset by user.
108 * - decoding: Set/Unset by user.
113 * The pixel format for output image buffers.
116 * - decoding: Set/Unset by user.
118 OSType cv_pix_fmt_type;
121 * The current bitstream buffer.
124 * - decoding: Set/Unset by libavcodec.
126 uint8_t *priv_bitstream;
129 * The current size of the bitstream.
132 * - decoding: Set/Unset by libavcodec.
134 int priv_bitstream_size;
137 * The reference size used for fast reallocation.
140 * - decoding: Set/Unset by libavcodec.
142 int priv_allocated_size;
145 * Use av_buffer to manage buffer.
146 * When the flag is set, the CVPixelBuffers returned by the decoder will
147 * be released automatically, so you have to retain them if necessary.
148 * Not setting this flag may cause memory leak.
151 * decoding: Set by user.
156 /** Create the video decoder. */
157 int ff_vda_create_decoder(struct vda_context *vda_ctx,
161 /** Destroy the video decoder. */
162 int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
168 #endif /* AVCODEC_VDA_H */