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 FFmpeg.
7  *
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.
12  *
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.
17  *
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
21  */
22 
23 #ifndef AVCODEC_VDA_H
24 #define AVCODEC_VDA_H
25 
26 /**
27  * @file
28  * @ingroup lavc_codec_hwaccel_vda
29  * Public libavcodec VDA header.
30  */
31 
32 #include <stdint.h>
33 
34 // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
35 // http://openradar.appspot.com/8026390
36 #undef __GNUC_STDC_INLINE__
37 
38 #define Picture QuickdrawPicture
39 #include <VideoDecodeAcceleration/VDADecoder.h>
40 #undef Picture
41 
42 #include "libavcodec/version.h"
43 
44 /**
45  * @defgroup lavc_codec_hwaccel_vda VDA
46  * @ingroup lavc_codec_hwaccel
47  *
48  * @{
49  */
50 
51 /**
52  * This structure is used to provide the necessary configurations and data
53  * to the VDA FFmpeg HWAccel implementation.
54  *
55  * The application must make it available as AVCodecContext.hwaccel_context.
56  */
57 struct vda_context {
58  /**
59  * VDA decoder object.
60  *
61  * - encoding: unused
62  * - decoding: Set/Unset by libavcodec.
63  */
64  VDADecoder decoder;
65 
66  /**
67  * The Core Video pixel buffer that contains the current image data.
68  *
69  * encoding: unused
70  * decoding: Set by libavcodec. Unset by user.
71  */
72  CVPixelBufferRef cv_buffer;
73 
74  /**
75  * Use the hardware decoder in synchronous mode.
76  *
77  * encoding: unused
78  * decoding: Set by user.
79  */
81 
82  /**
83  * The frame width.
84  *
85  * - encoding: unused
86  * - decoding: Set/Unset by user.
87  */
88  int width;
89 
90  /**
91  * The frame height.
92  *
93  * - encoding: unused
94  * - decoding: Set/Unset by user.
95  */
96  int height;
97 
98  /**
99  * The frame format.
100  *
101  * - encoding: unused
102  * - decoding: Set/Unset by user.
103  */
104  int format;
105 
106  /**
107  * The pixel format for output image buffers.
108  *
109  * - encoding: unused
110  * - decoding: Set/Unset by user.
111  */
113 
114  /**
115  * The current bitstream buffer.
116  *
117  * - encoding: unused
118  * - decoding: Set/Unset by libavcodec.
119  */
121 
122  /**
123  * The current size of the bitstream.
124  *
125  * - encoding: unused
126  * - decoding: Set/Unset by libavcodec.
127  */
129 
130  /**
131  * The reference size used for fast reallocation.
132  *
133  * - encoding: unused
134  * - decoding: Set/Unset by libavcodec.
135  */
137 };
138 
139 /** Create the video decoder. */
140 int ff_vda_create_decoder(struct vda_context *vda_ctx,
141  uint8_t *extradata,
142  int extradata_size);
143 
144 /** Destroy the video decoder. */
145 int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
146 
147 /**
148  * @}
149  */
150 
151 #endif /* AVCODEC_VDA_H */
int format
The frame format.
Definition: vda.h:104
OSType cv_pix_fmt_type
The pixel format for output image buffers.
Definition: vda.h:112
uint8_t
int width
The frame width.
Definition: vda.h:88
CVPixelBufferRef cv_buffer
The Core Video pixel buffer that contains the current image data.
Definition: vda.h:72
Libavcodec version macros.
VDADecoder decoder
VDA decoder object.
Definition: vda.h:64
This structure is used to provide the necessary configurations and data to the VDA FFmpeg HWAccel imp...
Definition: vda.h:57
int ff_vda_destroy_decoder(struct vda_context *vda_ctx)
Destroy the video decoder.
Definition: vda_h264.c:217
int use_sync_decoding
Use the hardware decoder in synchronous mode.
Definition: vda.h:80
uint8_t * priv_bitstream
The current bitstream buffer.
Definition: vda.h:120
int ff_vda_create_decoder(struct vda_context *vda_ctx, uint8_t *extradata, int extradata_size)
Create the video decoder.
Definition: vda_h264.c:130
int priv_allocated_size
The reference size used for fast reallocation.
Definition: vda.h:136
int height
The frame height.
Definition: vda.h:96
int priv_bitstream_size
The current size of the bitstream.
Definition: vda.h:128