Libav
vda.h
Go to the documentation of this file.
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 
32 #include "libavcodec/avcodec.h"
33 #include "libavcodec/version.h"
34 
35 #include <stdint.h>
36 
37 // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
38 // http://openradar.appspot.com/8026390
39 #undef __GNUC_STDC_INLINE__
40 
41 #define Picture QuickdrawPicture
42 #include <VideoDecodeAcceleration/VDADecoder.h>
43 #undef Picture
44 
58 struct vda_context {
65  VDADecoder decoder;
66 
73  CVPixelBufferRef cv_buffer;
74 
82 
89  int width;
90 
97  int height;
98 
105  int format;
106 
113  OSType cv_pix_fmt_type;
114 
119 
124 
129 };
130 
132 int ff_vda_create_decoder(struct vda_context *vda_ctx,
133  uint8_t *extradata,
134  int extradata_size);
135 
137 int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
138 
145 typedef struct AVVDAContext {
149  VDADecoder decoder;
150 
155  VDADecoderOutputCallback output_callback;
156 } AVVDAContext;
157 
172 
182 
190 
195 #endif /* AVCODEC_VDA_H */
void av_vda_default_free(AVCodecContext *avctx)
This function must be called to free the VDA context initialized with av_vda_default_init().
Definition: vda.c:69
int format
The frame format.
Definition: vda.h:105
OSType cv_pix_fmt_type
The pixel format for output image buffers.
Definition: vda.h:113
This struct holds all the information that needs to be passed between the caller and libavcodec for i...
Definition: vda.h:145
uint8_t
int width
The frame width.
Definition: vda.h:89
int av_vda_default_init(AVCodecContext *avctx)
This is a convenience function that creates and sets up the VDA context using an internal implementat...
Definition: vda.c:64
CVPixelBufferRef cv_buffer
The Core Video pixel buffer that contains the current image data.
Definition: vda.h:73
VDADecoder decoder
VDA decoder object.
Definition: vda.h:65
This structure is used to provide the necessary configurations and data to the VDA Libav HWAccel impl...
Definition: vda.h:58
VDADecoder decoder
VDA decoder object.
Definition: vda.h:149
VDADecoderOutputCallback output_callback
The output callback that must be passed to VDADecoderCreate.
Definition: vda.h:155
int ff_vda_destroy_decoder(struct vda_context *vda_ctx)
Destroy the video decoder.
Definition: vda_h264.c:231
main external API structure.
Definition: avcodec.h:1050
AVVDAContext * av_vda_alloc_context(void)
Allocate and initialize a VDA context.
Definition: vda.c:59
int use_sync_decoding
Use the hardware decoder in synchronous mode.
Definition: vda.h:81
uint8_t * priv_bitstream
unused
Definition: vda.h:118
int ff_vda_create_decoder(struct vda_context *vda_ctx, uint8_t *extradata, int extradata_size)
Create the video decoder.
Definition: vda_h264.c:147
int priv_allocated_size
unused
Definition: vda.h:128
int height
The frame height.
Definition: vda.h:97
int priv_bitstream_size
unused
Definition: vda.h:123