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 
26 #include <pthread.h>
27 #include <stdint.h>
28 
29 // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
30 // http://openradar.appspot.com/8026390
31 #undef __GNUC_STDC_INLINE__
32 
33 #define Picture QuickdrawPicture
34 #include <VideoDecodeAcceleration/VDADecoder.h>
35 #undef Picture
36 
40 typedef struct vda_frame {
47  int64_t pts;
48 
55  CVPixelBufferRef cv_buffer;
56 
64 } vda_frame;
65 
72 struct vda_context {
79  VDADecoder decoder;
80 
88 
96 
103  int width;
104 
111  int height;
112 
119  int format;
120 
128 };
129 
131 int ff_vda_create_decoder(struct vda_context *vda_ctx,
132  uint8_t *extradata,
133  int extradata_size);
134 
136 int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
137 
139 vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx);
140 
143 
144 #endif /* AVCODEC_VDA_H */