-
Notifications
You must be signed in to change notification settings - Fork 433
Expand file tree
/
Copy pathavutil.pxd
More file actions
239 lines (208 loc) · 6.57 KB
/
avutil.pxd
File metadata and controls
239 lines (208 loc) · 6.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
from libc.stdint cimport int64_t, uint8_t, uint64_t, int32_t
cdef extern from "libavutil/display.h" nogil:
cdef double av_display_rotation_get(const int32_t matrix[9])
cdef extern from "libavutil/rational.h" nogil:
cdef int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
cdef extern from "libavutil/avutil.h" nogil:
cdef const char* av_version_info()
cdef int avutil_version()
cdef char* avutil_configuration()
cdef char* avutil_license()
cdef enum AVPictureType:
AV_PICTURE_TYPE_NONE
AV_PICTURE_TYPE_I
AV_PICTURE_TYPE_P
AV_PICTURE_TYPE_B
AV_PICTURE_TYPE_S
AV_PICTURE_TYPE_SI
AV_PICTURE_TYPE_SP
AV_PICTURE_TYPE_BI
cdef enum AVPixelFormat:
AV_PIX_FMT_NONE
AV_PIX_FMT_YUV420P
AV_PIX_FMT_RGBA
AV_PIX_FMT_RGB24
PIX_FMT_RGB24
PIX_FMT_RGBA
cdef enum AVColorSpace:
AVCOL_SPC_RGB
AVCOL_SPC_BT709
AVCOL_SPC_UNSPECIFIED
AVCOL_SPC_RESERVED
AVCOL_SPC_FCC
AVCOL_SPC_BT470BG
AVCOL_SPC_SMPTE170M
AVCOL_SPC_SMPTE240M
AVCOL_SPC_YCOCG
AVCOL_SPC_BT2020_NCL
AVCOL_SPC_BT2020_CL
AVCOL_SPC_NB
cdef enum AVColorRange:
AVCOL_RANGE_UNSPECIFIED
AVCOL_RANGE_MPEG
AVCOL_RANGE_JPEG
AVCOL_RANGE_NB
cdef enum AVColorPrimaries:
AVCOL_PRI_RESERVED0
AVCOL_PRI_BT709
AVCOL_PRI_UNSPECIFIED
AVCOL_PRI_RESERVED
AVCOL_PRI_BT470M
AVCOL_PRI_BT470BG
AVCOL_PRI_SMPTE170M
AVCOL_PRI_SMPTE240M
AVCOL_PRI_FILM
AVCOL_PRI_BT2020
AVCOL_PRI_SMPTE428
AVCOL_PRI_SMPTEST428_1
AVCOL_PRI_SMPTE431
AVCOL_PRI_SMPTE432
AVCOL_PRI_EBU3213
AVCOL_PRI_JEDEC_P22
AVCOL_PRI_NB
cdef enum AVColorTransferCharacteristic:
pass
cdef void* av_malloc(size_t size)
cdef void* av_mallocz(size_t size)
cdef void* av_realloc(void *ptr, size_t size)
cdef void av_free(void *ptr)
cdef void av_freep(void *ptr)
cdef int av_get_bytes_per_sample(AVSampleFormat sample_fmt)
cdef int av_samples_get_buffer_size(
int *linesize,
int nb_channels,
int nb_samples,
AVSampleFormat sample_fmt,
int align
)
ctypedef struct AVRational:
int num
int den
cdef int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
cdef int64_t av_rescale(int64_t a, int64_t b, int64_t c)
cdef const char* av_get_media_type_string(AVMediaType media_type)
cdef extern from "libavutil/pixdesc.h" nogil:
# See: http://ffmpeg.org/doxygen/trunk/structAVComponentDescriptor.html
cdef struct AVComponentDescriptor:
unsigned int plane
unsigned int step
unsigned int offset
unsigned int shift
unsigned int depth
cdef enum AVPixFmtFlags:
AV_PIX_FMT_FLAG_BE
AV_PIX_FMT_FLAG_PAL
AV_PIX_FMT_FLAG_BITSTREAM
AV_PIX_FMT_FLAG_PLANAR
AV_PIX_FMT_FLAG_RGB
AV_PIX_FMT_FLAG_BAYER
# See: http://ffmpeg.org/doxygen/trunk/structAVPixFmtDescriptor.html
cdef struct AVPixFmtDescriptor:
const char *name
uint8_t nb_components
uint8_t log2_chroma_w
uint8_t log2_chroma_h
uint8_t flags
AVComponentDescriptor comp[4]
cdef AVPixFmtDescriptor* av_pix_fmt_desc_get(AVPixelFormat pix_fmt)
cdef AVPixFmtDescriptor* av_pix_fmt_desc_next(AVPixFmtDescriptor *prev)
cdef char * av_get_pix_fmt_name(AVPixelFormat pix_fmt)
cdef AVPixelFormat av_get_pix_fmt(char* name)
int av_get_bits_per_pixel(AVPixFmtDescriptor *pixdesc)
int av_get_padded_bits_per_pixel(AVPixFmtDescriptor *pixdesc)
cdef extern from "libavutil/audio_fifo.h" nogil:
cdef struct AVAudioFifo:
pass
cdef void av_audio_fifo_free(AVAudioFifo *af)
cdef AVAudioFifo* av_audio_fifo_alloc(
AVSampleFormat sample_fmt, int channels, int nb_samples
)
cdef int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
cdef int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples)
cdef int av_audio_fifo_size(AVAudioFifo *af)
cdef extern from "stdarg.h" nogil:
ctypedef struct va_list:
pass
cdef extern from "libavutil/opt.h" nogil:
cdef enum AVOptionType:
AV_OPT_TYPE_FLAGS
AV_OPT_TYPE_INT
AV_OPT_TYPE_INT64
AV_OPT_TYPE_DOUBLE
AV_OPT_TYPE_FLOAT
AV_OPT_TYPE_STRING
AV_OPT_TYPE_RATIONAL
AV_OPT_TYPE_BINARY
AV_OPT_TYPE_DICT
AV_OPT_TYPE_UINT64
AV_OPT_TYPE_CONST
AV_OPT_TYPE_IMAGE_SIZE
AV_OPT_TYPE_PIXEL_FMT
AV_OPT_TYPE_SAMPLE_FMT
AV_OPT_TYPE_VIDEO_RATE
AV_OPT_TYPE_DURATION
AV_OPT_TYPE_COLOR
AV_OPT_TYPE_CHLAYOUT
AV_OPT_TYPE_BOOL
cdef struct AVOption_default_val:
int64_t i64
double dbl
const char *str
AVRational q
cdef enum:
AV_OPT_FLAG_ENCODING_PARAM
AV_OPT_FLAG_DECODING_PARAM
AV_OPT_FLAG_AUDIO_PARAM
AV_OPT_FLAG_VIDEO_PARAM
AV_OPT_FLAG_SUBTITLE_PARAM
AV_OPT_FLAG_EXPORT
AV_OPT_FLAG_READONLY
AV_OPT_FLAG_FILTERING_PARAM
cdef struct AVOption:
const char *name
const char *help
AVOptionType type
int offset
AVOption_default_val default_val
double min
double max
int flags
const char *unit
cdef extern from "libavutil/imgutils.h" nogil:
cdef int av_image_alloc(
uint8_t *pointers[4],
int linesizes[4],
int width,
int height,
AVPixelFormat pix_fmt,
int align
)
cdef int av_image_fill_pointers(
uint8_t *pointers[4],
AVPixelFormat pix_fmt,
int height,
uint8_t *ptr,
const int linesizes[4]
)
cdef extern from "libavutil/log.h" nogil:
cdef struct AVClass:
const char *class_name
const char *(*item_name)(void*) nogil
int parent_log_context_offset
const AVOption *option
cdef enum:
AV_LOG_QUIET
AV_LOG_PANIC
AV_LOG_FATAL
AV_LOG_ERROR
AV_LOG_WARNING
AV_LOG_INFO
AV_LOG_VERBOSE
AV_LOG_DEBUG
AV_LOG_TRACE
AV_LOG_MAX_OFFSET
void av_log(void *ptr, int level, const char *fmt, ...)
ctypedef void(*av_log_callback)(void *, int, const char *, va_list)
void av_log_default_callback(void *, int, const char *, va_list)
void av_log_set_callback (av_log_callback callback)
void av_log_set_level(int level)