annotate lib/libavcodec/vda.h @ 2174:5ca3251ea543

autosave continue
author Ritor1
date Tue, 21 Jan 2014 16:37:23 +0600
parents 992d2e6f907d
children
rev   line source
2134
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2 * VDA HW acceleration
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4 * copyright (c) 2011 Sebastien Zwickert
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
5 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
6 * This file is part of FFmpeg.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
7 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
8 * FFmpeg is free software; you can redistribute it and/or
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
9 * modify it under the terms of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
10 * License as published by the Free Software Foundation; either
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
11 * version 2.1 of the License, or (at your option) any later version.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
12 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
13 * FFmpeg is distributed in the hope that it will be useful,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
16 * Lesser General Public License for more details.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
17 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
19 * License along with FFmpeg; if not, write to the Free Software
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
21 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
22
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
23 #ifndef AVCODEC_VDA_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
24 #define AVCODEC_VDA_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
25
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
26 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
27 * @file
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
28 * @ingroup lavc_codec_hwaccel_vda
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
29 * Public libavcodec VDA header.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
30 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
31
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
32 #include <stdint.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
33
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
34 // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
35 // http://openradar.appspot.com/8026390
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
36 #undef __GNUC_STDC_INLINE__
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
37
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
38 #define Picture QuickdrawPicture
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
39 #include <VideoDecodeAcceleration/VDADecoder.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
40 #undef Picture
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
41
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
42 #include "libavcodec/version.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
43
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
44 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
45 * @defgroup lavc_codec_hwaccel_vda VDA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
46 * @ingroup lavc_codec_hwaccel
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
47 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
48 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
49 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
50
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
51 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
52 * This structure is used to provide the necessary configurations and data
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
53 * to the VDA FFmpeg HWAccel implementation.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
54 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
55 * The application must make it available as AVCodecContext.hwaccel_context.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
56 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
57 struct vda_context {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
58 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
59 * VDA decoder object.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
60 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
61 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
62 * - decoding: Set/Unset by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
63 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
64 VDADecoder decoder;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
65
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
66 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
67 * The Core Video pixel buffer that contains the current image data.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
68 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
69 * encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
70 * decoding: Set by libavcodec. Unset by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
71 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
72 CVPixelBufferRef cv_buffer;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
73
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
74 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
75 * Use the hardware decoder in synchronous mode.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
76 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
77 * encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
78 * decoding: Set by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
79 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
80 int use_sync_decoding;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
81
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
82 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
83 * The frame width.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
84 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
85 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
86 * - decoding: Set/Unset by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
87 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
88 int width;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
89
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
90 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
91 * The frame height.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
92 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
93 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
94 * - decoding: Set/Unset by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
95 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
96 int height;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
97
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
98 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
99 * The frame format.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
100 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
101 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
102 * - decoding: Set/Unset by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
103 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
104 int format;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
105
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
106 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
107 * The pixel format for output image buffers.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
108 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
109 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
110 * - decoding: Set/Unset by user.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
111 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
112 OSType cv_pix_fmt_type;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
113
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
114 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
115 * The current bitstream buffer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
116 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
117 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
118 * - decoding: Set/Unset by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
119 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
120 uint8_t *priv_bitstream;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
121
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
122 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
123 * The current size of the bitstream.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
124 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
125 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
126 * - decoding: Set/Unset by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
127 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
128 int priv_bitstream_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
129
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
130 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
131 * The reference size used for fast reallocation.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
132 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
133 * - encoding: unused
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
134 * - decoding: Set/Unset by libavcodec.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
135 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
136 int priv_allocated_size;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
137 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
138
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
139 /** Create the video decoder. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
140 int ff_vda_create_decoder(struct vda_context *vda_ctx,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
141 uint8_t *extradata,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
142 int extradata_size);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
143
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
144 /** Destroy the video decoder. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
145 int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
146
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
147 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
148 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
149 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
150
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
151 #endif /* AVCODEC_VDA_H */