4 * copyright (c) 2011 Sebastien Zwickert
6 * This file is part of Libav.
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.
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.
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
28 * @ingroup lavc_codec_hwaccel_vda
29 * Public libavcodec VDA header.
35 // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
36 // http://openradar.appspot.com/8026390
37 #undef __GNUC_STDC_INLINE__
39 #define Picture QuickdrawPicture
40 #include <VideoDecodeAcceleration/VDADecoder.h>
44 * @defgroup lavc_codec_hwaccel_vda VDA
45 * @ingroup lavc_codec_hwaccel
51 * This structure is used to store a decoded frame information and data.
53 typedef struct vda_frame {
55 * The PTS of the frame.
58 * - decoding: Set/Unset by libavcodec.
63 * The CoreVideo buffer that contains the decoded data.
66 * - decoding: Set/Unset by libavcodec.
68 CVPixelBufferRef cv_buffer;
71 * A pointer to the next frame.
74 * - decoding: Set/Unset by libavcodec.
76 struct vda_frame *next_frame;
80 * This structure is used to provide the necessary configurations and data
81 * to the VDA Libav HWAccel implementation.
83 * The application must make it available as AVCodecContext.hwaccel_context.
90 * - decoding: Set/Unset by libavcodec.
95 * VDA frames queue ordered by presentation timestamp.
98 * - decoding: Set/Unset by libavcodec.
103 * Mutex for locking queue operations.
106 * - decoding: Set/Unset by libavcodec.
108 pthread_mutex_t queue_mutex;
114 * - decoding: Set/Unset by user.
122 * - decoding: Set/Unset by user.
130 * - decoding: Set/Unset by user.
135 * The pixel format for output image buffers.
138 * - decoding: Set/Unset by user.
140 OSType cv_pix_fmt_type;
143 /** Create the video decoder. */
144 int ff_vda_create_decoder(struct vda_context *vda_ctx,
148 /** Destroy the video decoder. */
149 int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
151 /** Return the top frame of the queue. */
152 vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx);
154 /** Release the given frame. */
155 void ff_vda_release_vda_frame(vda_frame *frame);
161 #endif /* AVCODEC_VDA_H */