Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
libavcodec
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/version.h
"
33
34
#if FF_API_VDA_ASYNC
35
#include <pthread.h>
36
#endif
37
38
#include <stdint.h>
39
40
// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
41
// http://openradar.appspot.com/8026390
42
#undef __GNUC_STDC_INLINE__
43
44
#define Picture QuickdrawPicture
45
#include <VideoDecodeAcceleration/VDADecoder.h>
46
#undef Picture
47
55
#if FF_API_VDA_ASYNC
56
61
typedef
struct
vda_frame {
68
int64_t pts;
69
76
CVPixelBufferRef cv_buffer;
77
84
struct
vda_frame *next_frame;
85
} vda_frame;
86
#endif
87
94
struct
vda_context
{
101
VDADecoder
decoder
;
102
109
CVPixelBufferRef
cv_buffer
;
110
117
int
use_sync_decoding
;
118
119
#if FF_API_VDA_ASYNC
120
128
vda_frame *queue;
129
138
pthread_mutex_t
queue_mutex;
139
#endif
140
147
int
width
;
148
155
int
height
;
156
163
int
format
;
164
171
OSType
cv_pix_fmt_type
;
172
176
uint8_t
*
priv_bitstream
;
177
181
int
priv_bitstream_size
;
182
186
int
priv_allocated_size
;
187
};
188
190
int
ff_vda_create_decoder
(
struct
vda_context
*vda_ctx,
191
uint8_t
*extradata,
192
int
extradata_size);
193
195
int
ff_vda_destroy_decoder
(
struct
vda_context
*vda_ctx);
196
197
#if FF_API_VDA_ASYNC
198
203
vda_frame *ff_vda_queue_pop(
struct
vda_context
*vda_ctx);
204
210
void
ff_vda_release_vda_frame(vda_frame *frame);
211
#endif
212
217
#endif
/* AVCODEC_VDA_H */