1 /* Generated by Cython 0.29.21 */
2
3 /* BEGIN: Cython Metadata
4 {
5 "distutils": {
6 "depends": [
7 "/opt/hostedtoolcache/Python/3.7.9/x64/include/python3.7m/Python.h",
8 "/tmp/vendor/include/libavcodec/avcodec.h",
9 "/tmp/vendor/include/libavdevice/avdevice.h",
10 "/tmp/vendor/include/libavfilter/avfilter.h",
11 "/tmp/vendor/include/libavfilter/buffersink.h",
12 "/tmp/vendor/include/libavfilter/buffersrc.h",
13 "/tmp/vendor/include/libavformat/avformat.h",
14 "/tmp/vendor/include/libavutil/audio_fifo.h",
15 "/tmp/vendor/include/libavutil/avutil.h",
16 "/tmp/vendor/include/libavutil/channel_layout.h",
17 "/tmp/vendor/include/libavutil/dict.h",
18 "/tmp/vendor/include/libavutil/error.h",
19 "/tmp/vendor/include/libavutil/frame.h",
20 "/tmp/vendor/include/libavutil/imgutils.h",
21 "/tmp/vendor/include/libavutil/log.h",
22 "/tmp/vendor/include/libavutil/mathematics.h",
23 "/tmp/vendor/include/libavutil/motion_vector.h",
24 "/tmp/vendor/include/libavutil/opt.h",
25 "/tmp/vendor/include/libavutil/pixdesc.h",
26 "/tmp/vendor/include/libavutil/rational.h",
27 "/tmp/vendor/include/libavutil/samplefmt.h",
28 "/tmp/vendor/include/libswresample/swresample.h",
29 "/tmp/vendor/include/libswscale/swscale.h",
30 "build/temp.linux-x86_64-3.7/include/pyav/config.h"
31 ],
32 "include_dirs": [
33 "/tmp/vendor/include",
34 "build/temp.linux-x86_64-3.7/include",
35 "/opt/hostedtoolcache/Python/3.7.9/x64/include/python3.7m",
36 "include"
37 ],
38 "libraries": [
39 "avutil",
40 "avcodec",
41 "avdevice",
42 "swscale",
43 "swresample",
44 "avformat",
45 "avfilter"
46 ],
47 "library_dirs": [
48 "/opt/hostedtoolcache/Python/3.7.9/x64/lib",
49 "/tmp/vendor/lib"
50 ],
51 "name": "av.codec.codec",
52 "sources": [
53 "av/codec/codec.pyx"
54 ]
55 },
56 "module_name": "av.codec.codec"
57 }
58 END: Cython Metadata */
59
60 #define PY_SSIZE_T_CLEAN
61 #include "Python.h"
62 #ifndef Py_PYTHON_H
63 #error Python headers needed to compile C extensions, please install development version of Python.
64 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
65 #error Cython requires Python 2.6+ or Python 3.3+.
66 #else
67 #define CYTHON_ABI "0_29_21"
68 #define CYTHON_HEX_VERSION 0x001D15F0
69 #define CYTHON_FUTURE_DIVISION 0
70 #include <stddef.h>
71 #ifndef offsetof
72 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
73 #endif
74 #if !defined(WIN32) && !defined(MS_WINDOWS)
75 #ifndef __stdcall
76 #define __stdcall
77 #endif
78 #ifndef __cdecl
79 #define __cdecl
80 #endif
81 #ifndef __fastcall
82 #define __fastcall
83 #endif
84 #endif
85 #ifndef DL_IMPORT
86 #define DL_IMPORT(t) t
87 #endif
88 #ifndef DL_EXPORT
89 #define DL_EXPORT(t) t
90 #endif
91 #define __PYX_COMMA ,
92 #ifndef HAVE_LONG_LONG
93 #if PY_VERSION_HEX >= 0x02070000
94 #define HAVE_LONG_LONG
95 #endif
96 #endif
97 #ifndef PY_LONG_LONG
98 #define PY_LONG_LONG LONG_LONG
99 #endif
100 #ifndef Py_HUGE_VAL
101 #define Py_HUGE_VAL HUGE_VAL
102 #endif
103 #ifdef PYPY_VERSION
104 #define CYTHON_COMPILING_IN_PYPY 1
105 #define CYTHON_COMPILING_IN_PYSTON 0
106 #define CYTHON_COMPILING_IN_CPYTHON 0
107 #undef CYTHON_USE_TYPE_SLOTS
108 #define CYTHON_USE_TYPE_SLOTS 0
109 #undef CYTHON_USE_PYTYPE_LOOKUP
110 #define CYTHON_USE_PYTYPE_LOOKUP 0
111 #if PY_VERSION_HEX < 0x03050000
112 #undef CYTHON_USE_ASYNC_SLOTS
113 #define CYTHON_USE_ASYNC_SLOTS 0
114 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
115 #define CYTHON_USE_ASYNC_SLOTS 1
116 #endif
117 #undef CYTHON_USE_PYLIST_INTERNALS
118 #define CYTHON_USE_PYLIST_INTERNALS 0
119 #undef CYTHON_USE_UNICODE_INTERNALS
120 #define CYTHON_USE_UNICODE_INTERNALS 0
121 #undef CYTHON_USE_UNICODE_WRITER
122 #define CYTHON_USE_UNICODE_WRITER 0
123 #undef CYTHON_USE_PYLONG_INTERNALS
124 #define CYTHON_USE_PYLONG_INTERNALS 0
125 #undef CYTHON_AVOID_BORROWED_REFS
126 #define CYTHON_AVOID_BORROWED_REFS 1
127 #undef CYTHON_ASSUME_SAFE_MACROS
128 #define CYTHON_ASSUME_SAFE_MACROS 0
129 #undef CYTHON_UNPACK_METHODS
130 #define CYTHON_UNPACK_METHODS 0
131 #undef CYTHON_FAST_THREAD_STATE
132 #define CYTHON_FAST_THREAD_STATE 0
133 #undef CYTHON_FAST_PYCALL
134 #define CYTHON_FAST_PYCALL 0
135 #undef CYTHON_PEP489_MULTI_PHASE_INIT
136 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
137 #undef CYTHON_USE_TP_FINALIZE
138 #define CYTHON_USE_TP_FINALIZE 0
139 #undef CYTHON_USE_DICT_VERSIONS
140 #define CYTHON_USE_DICT_VERSIONS 0
141 #undef CYTHON_USE_EXC_INFO_STACK
142 #define CYTHON_USE_EXC_INFO_STACK 0
143 #elif defined(PYSTON_VERSION)
144 #define CYTHON_COMPILING_IN_PYPY 0
145 #define CYTHON_COMPILING_IN_PYSTON 1
146 #define CYTHON_COMPILING_IN_CPYTHON 0
147 #ifndef CYTHON_USE_TYPE_SLOTS
148 #define CYTHON_USE_TYPE_SLOTS 1
149 #endif
150 #undef CYTHON_USE_PYTYPE_LOOKUP
151 #define CYTHON_USE_PYTYPE_LOOKUP 0
152 #undef CYTHON_USE_ASYNC_SLOTS
153 #define CYTHON_USE_ASYNC_SLOTS 0
154 #undef CYTHON_USE_PYLIST_INTERNALS
155 #define CYTHON_USE_PYLIST_INTERNALS 0
156 #ifndef CYTHON_USE_UNICODE_INTERNALS
157 #define CYTHON_USE_UNICODE_INTERNALS 1
158 #endif
159 #undef CYTHON_USE_UNICODE_WRITER
160 #define CYTHON_USE_UNICODE_WRITER 0
161 #undef CYTHON_USE_PYLONG_INTERNALS
162 #define CYTHON_USE_PYLONG_INTERNALS 0
163 #ifndef CYTHON_AVOID_BORROWED_REFS
164 #define CYTHON_AVOID_BORROWED_REFS 0
165 #endif
166 #ifndef CYTHON_ASSUME_SAFE_MACROS
167 #define CYTHON_ASSUME_SAFE_MACROS 1
168 #endif
169 #ifndef CYTHON_UNPACK_METHODS
170 #define CYTHON_UNPACK_METHODS 1
171 #endif
172 #undef CYTHON_FAST_THREAD_STATE
173 #define CYTHON_FAST_THREAD_STATE 0
174 #undef CYTHON_FAST_PYCALL
175 #define CYTHON_FAST_PYCALL 0
176 #undef CYTHON_PEP489_MULTI_PHASE_INIT
177 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
178 #undef CYTHON_USE_TP_FINALIZE
179 #define CYTHON_USE_TP_FINALIZE 0
180 #undef CYTHON_USE_DICT_VERSIONS
181 #define CYTHON_USE_DICT_VERSIONS 0
182 #undef CYTHON_USE_EXC_INFO_STACK
183 #define CYTHON_USE_EXC_INFO_STACK 0
184 #else
185 #define CYTHON_COMPILING_IN_PYPY 0
186 #define CYTHON_COMPILING_IN_PYSTON 0
187 #define CYTHON_COMPILING_IN_CPYTHON 1
188 #ifndef CYTHON_USE_TYPE_SLOTS
189 #define CYTHON_USE_TYPE_SLOTS 1
190 #endif
191 #if PY_VERSION_HEX < 0x02070000
192 #undef CYTHON_USE_PYTYPE_LOOKUP
193 #define CYTHON_USE_PYTYPE_LOOKUP 0
194 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
195 #define CYTHON_USE_PYTYPE_LOOKUP 1
196 #endif
197 #if PY_MAJOR_VERSION < 3
198 #undef CYTHON_USE_ASYNC_SLOTS
199 #define CYTHON_USE_ASYNC_SLOTS 0
200 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
201 #define CYTHON_USE_ASYNC_SLOTS 1
202 #endif
203 #if PY_VERSION_HEX < 0x02070000
204 #undef CYTHON_USE_PYLONG_INTERNALS
205 #define CYTHON_USE_PYLONG_INTERNALS 0
206 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
207 #define CYTHON_USE_PYLONG_INTERNALS 1
208 #endif
209 #ifndef CYTHON_USE_PYLIST_INTERNALS
210 #define CYTHON_USE_PYLIST_INTERNALS 1
211 #endif
212 #ifndef CYTHON_USE_UNICODE_INTERNALS
213 #define CYTHON_USE_UNICODE_INTERNALS 1
214 #endif
215 #if PY_VERSION_HEX < 0x030300F0
216 #undef CYTHON_USE_UNICODE_WRITER
217 #define CYTHON_USE_UNICODE_WRITER 0
218 #elif !defined(CYTHON_USE_UNICODE_WRITER)
219 #define CYTHON_USE_UNICODE_WRITER 1
220 #endif
221 #ifndef CYTHON_AVOID_BORROWED_REFS
222 #define CYTHON_AVOID_BORROWED_REFS 0
223 #endif
224 #ifndef CYTHON_ASSUME_SAFE_MACROS
225 #define CYTHON_ASSUME_SAFE_MACROS 1
226 #endif
227 #ifndef CYTHON_UNPACK_METHODS
228 #define CYTHON_UNPACK_METHODS 1
229 #endif
230 #ifndef CYTHON_FAST_THREAD_STATE
231 #define CYTHON_FAST_THREAD_STATE 1
232 #endif
233 #ifndef CYTHON_FAST_PYCALL
234 #define CYTHON_FAST_PYCALL 1
235 #endif
236 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
237 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
238 #endif
239 #ifndef CYTHON_USE_TP_FINALIZE
240 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
241 #endif
242 #ifndef CYTHON_USE_DICT_VERSIONS
243 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
244 #endif
245 #ifndef CYTHON_USE_EXC_INFO_STACK
246 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
247 #endif
248 #endif
249 #if !defined(CYTHON_FAST_PYCCALL)
250 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
251 #endif
252 #if CYTHON_USE_PYLONG_INTERNALS
253 #include "longintrepr.h"
254 #undef SHIFT
255 #undef BASE
256 #undef MASK
257 #ifdef SIZEOF_VOID_P
258 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
259 #endif
260 #endif
261 #ifndef __has_attribute
262 #define __has_attribute(x) 0
263 #endif
264 #ifndef __has_cpp_attribute
265 #define __has_cpp_attribute(x) 0
266 #endif
267 #ifndef CYTHON_RESTRICT
268 #if defined(__GNUC__)
269 #define CYTHON_RESTRICT __restrict__
270 #elif defined(_MSC_VER) && _MSC_VER >= 1400
271 #define CYTHON_RESTRICT __restrict
272 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
273 #define CYTHON_RESTRICT restrict
274 #else
275 #define CYTHON_RESTRICT
276 #endif
277 #endif
278 #ifndef CYTHON_UNUSED
279 # if defined(__GNUC__)
280 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
281 # define CYTHON_UNUSED __attribute__ ((__unused__))
282 # else
283 # define CYTHON_UNUSED
284 # endif
285 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
286 # define CYTHON_UNUSED __attribute__ ((__unused__))
287 # else
288 # define CYTHON_UNUSED
289 # endif
290 #endif
291 #ifndef CYTHON_MAYBE_UNUSED_VAR
292 # if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)293 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
294 # else
295 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
296 # endif
297 #endif
298 #ifndef CYTHON_NCP_UNUSED
299 # if CYTHON_COMPILING_IN_CPYTHON
300 # define CYTHON_NCP_UNUSED
301 # else
302 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
303 # endif
304 #endif
305 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
306 #ifdef _MSC_VER
307 #ifndef _MSC_STDINT_H_
308 #if _MSC_VER < 1300
309 typedef unsigned char uint8_t;
310 typedef unsigned int uint32_t;
311 #else
312 typedef unsigned __int8 uint8_t;
313 typedef unsigned __int32 uint32_t;
314 #endif
315 #endif
316 #else
317 #include <stdint.h>
318 #endif
319 #ifndef CYTHON_FALLTHROUGH
320 #if defined(__cplusplus) && __cplusplus >= 201103L
321 #if __has_cpp_attribute(fallthrough)
322 #define CYTHON_FALLTHROUGH [[fallthrough]]
323 #elif __has_cpp_attribute(clang::fallthrough)
324 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
325 #elif __has_cpp_attribute(gnu::fallthrough)
326 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
327 #endif
328 #endif
329 #ifndef CYTHON_FALLTHROUGH
330 #if __has_attribute(fallthrough)
331 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
332 #else
333 #define CYTHON_FALLTHROUGH
334 #endif
335 #endif
336 #if defined(__clang__ ) && defined(__apple_build_version__)
337 #if __apple_build_version__ < 7000000
338 #undef CYTHON_FALLTHROUGH
339 #define CYTHON_FALLTHROUGH
340 #endif
341 #endif
342 #endif
343
344 #ifndef CYTHON_INLINE
345 #if defined(__clang__)
346 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
347 #elif defined(__GNUC__)
348 #define CYTHON_INLINE __inline__
349 #elif defined(_MSC_VER)
350 #define CYTHON_INLINE __inline
351 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
352 #define CYTHON_INLINE inline
353 #else
354 #define CYTHON_INLINE
355 #endif
356 #endif
357
358 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
359 #define Py_OptimizeFlag 0
360 #endif
361 #define __PYX_BUILD_PY_SSIZE_T "n"
362 #define CYTHON_FORMAT_SSIZE_T "z"
363 #if PY_MAJOR_VERSION < 3
364 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
365 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
366 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
367 #define __Pyx_DefaultClassType PyClass_Type
368 #else
369 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
370 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
371 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
372 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
373 #else
374 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
375 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
376 #endif
377 #define __Pyx_DefaultClassType PyType_Type
378 #endif
379 #ifndef Py_TPFLAGS_CHECKTYPES
380 #define Py_TPFLAGS_CHECKTYPES 0
381 #endif
382 #ifndef Py_TPFLAGS_HAVE_INDEX
383 #define Py_TPFLAGS_HAVE_INDEX 0
384 #endif
385 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
386 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
387 #endif
388 #ifndef Py_TPFLAGS_HAVE_FINALIZE
389 #define Py_TPFLAGS_HAVE_FINALIZE 0
390 #endif
391 #ifndef METH_STACKLESS
392 #define METH_STACKLESS 0
393 #endif
394 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
395 #ifndef METH_FASTCALL
396 #define METH_FASTCALL 0x80
397 #endif
398 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
399 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
400 Py_ssize_t nargs, PyObject *kwnames);
401 #else
402 #define __Pyx_PyCFunctionFast _PyCFunctionFast
403 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
404 #endif
405 #if CYTHON_FAST_PYCCALL
406 #define __Pyx_PyFastCFunction_Check(func)\
407 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
408 #else
409 #define __Pyx_PyFastCFunction_Check(func) 0
410 #endif
411 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
412 #define PyObject_Malloc(s) PyMem_Malloc(s)
413 #define PyObject_Free(p) PyMem_Free(p)
414 #define PyObject_Realloc(p) PyMem_Realloc(p)
415 #endif
416 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
417 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
418 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
419 #define PyMem_RawFree(p) PyMem_Free(p)
420 #endif
421 #if CYTHON_COMPILING_IN_PYSTON
422 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
423 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
424 #else
425 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
426 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
427 #endif
428 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
429 #define __Pyx_PyThreadState_Current PyThreadState_GET()
430 #elif PY_VERSION_HEX >= 0x03060000
431 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
432 #elif PY_VERSION_HEX >= 0x03000000
433 #define __Pyx_PyThreadState_Current PyThreadState_GET()
434 #else
435 #define __Pyx_PyThreadState_Current _PyThreadState_Current
436 #endif
437 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
438 #include "pythread.h"
439 #define Py_tss_NEEDS_INIT 0
440 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)441 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
442 *key = PyThread_create_key();
443 return 0;
444 }
PyThread_tss_alloc(void)445 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
446 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
447 *key = Py_tss_NEEDS_INIT;
448 return key;
449 }
PyThread_tss_free(Py_tss_t * key)450 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
451 PyObject_Free(key);
452 }
PyThread_tss_is_created(Py_tss_t * key)453 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
454 return *key != Py_tss_NEEDS_INIT;
455 }
PyThread_tss_delete(Py_tss_t * key)456 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
457 PyThread_delete_key(*key);
458 *key = Py_tss_NEEDS_INIT;
459 }
PyThread_tss_set(Py_tss_t * key,void * value)460 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
461 return PyThread_set_key_value(*key, value);
462 }
PyThread_tss_get(Py_tss_t * key)463 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
464 return PyThread_get_key_value(*key);
465 }
466 #endif
467 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
468 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
469 #else
470 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
471 #endif
472 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
473 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
474 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
475 #else
476 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
477 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
478 #endif
479 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
480 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
481 #else
482 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
483 #endif
484 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
485 #define CYTHON_PEP393_ENABLED 1
486 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
487 0 : _PyUnicode_Ready((PyObject *)(op)))
488 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
489 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
490 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
491 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
492 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
493 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
494 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
495 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
496 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
497 #else
498 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
499 #endif
500 #else
501 #define CYTHON_PEP393_ENABLED 0
502 #define PyUnicode_1BYTE_KIND 1
503 #define PyUnicode_2BYTE_KIND 2
504 #define PyUnicode_4BYTE_KIND 4
505 #define __Pyx_PyUnicode_READY(op) (0)
506 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
507 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
508 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
509 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
510 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
511 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
512 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
513 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
514 #endif
515 #if CYTHON_COMPILING_IN_PYPY
516 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
517 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
518 #else
519 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
520 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
521 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
522 #endif
523 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
524 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
525 #endif
526 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
527 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
528 #endif
529 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
530 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
531 #endif
532 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
533 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
534 #if PY_MAJOR_VERSION >= 3
535 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
536 #else
537 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
538 #endif
539 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
540 #define PyObject_ASCII(o) PyObject_Repr(o)
541 #endif
542 #if PY_MAJOR_VERSION >= 3
543 #define PyBaseString_Type PyUnicode_Type
544 #define PyStringObject PyUnicodeObject
545 #define PyString_Type PyUnicode_Type
546 #define PyString_Check PyUnicode_Check
547 #define PyString_CheckExact PyUnicode_CheckExact
548 #ifndef PyObject_Unicode
549 #define PyObject_Unicode PyObject_Str
550 #endif
551 #endif
552 #if PY_MAJOR_VERSION >= 3
553 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
554 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
555 #else
556 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
557 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
558 #endif
559 #ifndef PySet_CheckExact
560 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
561 #endif
562 #if PY_VERSION_HEX >= 0x030900A4
563 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
564 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
565 #else
566 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
567 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
568 #endif
569 #if CYTHON_ASSUME_SAFE_MACROS
570 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
571 #else
572 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
573 #endif
574 #if PY_MAJOR_VERSION >= 3
575 #define PyIntObject PyLongObject
576 #define PyInt_Type PyLong_Type
577 #define PyInt_Check(op) PyLong_Check(op)
578 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
579 #define PyInt_FromString PyLong_FromString
580 #define PyInt_FromUnicode PyLong_FromUnicode
581 #define PyInt_FromLong PyLong_FromLong
582 #define PyInt_FromSize_t PyLong_FromSize_t
583 #define PyInt_FromSsize_t PyLong_FromSsize_t
584 #define PyInt_AsLong PyLong_AsLong
585 #define PyInt_AS_LONG PyLong_AS_LONG
586 #define PyInt_AsSsize_t PyLong_AsSsize_t
587 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
588 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
589 #define PyNumber_Int PyNumber_Long
590 #endif
591 #if PY_MAJOR_VERSION >= 3
592 #define PyBoolObject PyLongObject
593 #endif
594 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
595 #ifndef PyUnicode_InternFromString
596 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
597 #endif
598 #endif
599 #if PY_VERSION_HEX < 0x030200A4
600 typedef long Py_hash_t;
601 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
602 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
603 #else
604 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
605 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
606 #endif
607 #if PY_MAJOR_VERSION >= 3
608 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
609 #else
610 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
611 #endif
612 #if CYTHON_USE_ASYNC_SLOTS
613 #if PY_VERSION_HEX >= 0x030500B1
614 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
615 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
616 #else
617 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
618 #endif
619 #else
620 #define __Pyx_PyType_AsAsync(obj) NULL
621 #endif
622 #ifndef __Pyx_PyAsyncMethodsStruct
623 typedef struct {
624 unaryfunc am_await;
625 unaryfunc am_aiter;
626 unaryfunc am_anext;
627 } __Pyx_PyAsyncMethodsStruct;
628 #endif
629
630 #if defined(WIN32) || defined(MS_WINDOWS)
631 #define _USE_MATH_DEFINES
632 #endif
633 #include <math.h>
634 #ifdef NAN
635 #define __PYX_NAN() ((float) NAN)
636 #else
__PYX_NAN()637 static CYTHON_INLINE float __PYX_NAN() {
638 float value;
639 memset(&value, 0xFF, sizeof(value));
640 return value;
641 }
642 #endif
643 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
644 #define __Pyx_truncl trunc
645 #else
646 #define __Pyx_truncl truncl
647 #endif
648
649 #define __PYX_MARK_ERR_POS(f_index, lineno) \
650 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
651 #define __PYX_ERR(f_index, lineno, Ln_error) \
652 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
653
654 #ifndef __PYX_EXTERN_C
655 #ifdef __cplusplus
656 #define __PYX_EXTERN_C extern "C"
657 #else
658 #define __PYX_EXTERN_C extern
659 #endif
660 #endif
661
662 #define __PYX_HAVE__av__codec__codec
663 #define __PYX_HAVE_API__av__codec__codec
664 /* Early includes */
665 #include "pyav/config.h"
666 #include <stdint.h>
667 #include "libavutil/mathematics.h"
668 #include "libavutil/rational.h"
669 #include "libavutil/avutil.h"
670 #include "libavutil/pixdesc.h"
671 #include "libavutil/channel_layout.h"
672 #include "libavutil/audio_fifo.h"
673 #include "stdarg.h"
674 #include "libavutil/opt.h"
675 #include "libavutil/imgutils.h"
676 #include "libavutil/log.h"
677 #include "libavutil/dict.h"
678 #include "libavutil/error.h"
679 #include "libavutil/frame.h"
680 #include "libavutil/samplefmt.h"
681 #include "libavutil/motion_vector.h"
682 #include "libavcodec/avcodec.h"
683 #include "libavdevice/avdevice.h"
684 #include "libavformat/avformat.h"
685 #include "libswresample/swresample.h"
686 #include "libswscale/swscale.h"
687 #include "libavfilter/avfilter.h"
688 #include "libavfilter/buffersink.h"
689 #include "libavfilter/buffersrc.h"
690 #include "stdio.h"
691 #ifdef _OPENMP
692 #include <omp.h>
693 #endif /* _OPENMP */
694
695 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
696 #define CYTHON_WITHOUT_ASSERTIONS
697 #endif
698
699 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
700 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
701
702 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 1
703 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
704 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
705 #define __PYX_DEFAULT_STRING_ENCODING "ascii"
706 #define __Pyx_PyObject_FromString __Pyx_PyStr_FromString
707 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyStr_FromStringAndSize
708 #define __Pyx_uchar_cast(c) ((unsigned char)c)
709 #define __Pyx_long_cast(x) ((long)x)
710 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
711 (sizeof(type) < sizeof(Py_ssize_t)) ||\
712 (sizeof(type) > sizeof(Py_ssize_t) &&\
713 likely(v < (type)PY_SSIZE_T_MAX ||\
714 v == (type)PY_SSIZE_T_MAX) &&\
715 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
716 v == (type)PY_SSIZE_T_MIN))) ||\
717 (sizeof(type) == sizeof(Py_ssize_t) &&\
718 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
719 v == (type)PY_SSIZE_T_MAX))) )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)720 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
721 return (size_t) i < (size_t) limit;
722 }
723 #if defined (__cplusplus) && __cplusplus >= 201103L
724 #include <cstdlib>
725 #define __Pyx_sst_abs(value) std::abs(value)
726 #elif SIZEOF_INT >= SIZEOF_SIZE_T
727 #define __Pyx_sst_abs(value) abs(value)
728 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
729 #define __Pyx_sst_abs(value) labs(value)
730 #elif defined (_MSC_VER)
731 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
732 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
733 #define __Pyx_sst_abs(value) llabs(value)
734 #elif defined (__GNUC__)
735 #define __Pyx_sst_abs(value) __builtin_llabs(value)
736 #else
737 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
738 #endif
739 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
740 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
741 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
742 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
743 #define __Pyx_PyBytes_FromString PyBytes_FromString
744 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
745 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
746 #if PY_MAJOR_VERSION < 3
747 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
748 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
749 #else
750 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
751 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
752 #endif
753 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
754 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
755 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
756 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
757 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
758 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
759 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
760 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
761 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
762 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
763 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
764 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
765 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
766 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
767 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
768 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)769 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
770 const Py_UNICODE *u_end = u;
771 while (*u_end++) ;
772 return (size_t)(u_end - u - 1);
773 }
774 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
775 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
776 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
777 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
778 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
779 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
780 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
781 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
782 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
783 #define __Pyx_PySequence_Tuple(obj)\
784 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
785 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
786 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
787 #if CYTHON_ASSUME_SAFE_MACROS
788 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
789 #else
790 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
791 #endif
792 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
793 #if PY_MAJOR_VERSION >= 3
794 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
795 #else
796 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
797 #endif
798 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
799 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
800 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)801 static int __Pyx_init_sys_getdefaultencoding_params(void) {
802 PyObject* sys;
803 PyObject* default_encoding = NULL;
804 PyObject* ascii_chars_u = NULL;
805 PyObject* ascii_chars_b = NULL;
806 const char* default_encoding_c;
807 sys = PyImport_ImportModule("sys");
808 if (!sys) goto bad;
809 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
810 Py_DECREF(sys);
811 if (!default_encoding) goto bad;
812 default_encoding_c = PyBytes_AsString(default_encoding);
813 if (!default_encoding_c) goto bad;
814 if (strcmp(default_encoding_c, "ascii") == 0) {
815 __Pyx_sys_getdefaultencoding_not_ascii = 0;
816 } else {
817 char ascii_chars[128];
818 int c;
819 for (c = 0; c < 128; c++) {
820 ascii_chars[c] = c;
821 }
822 __Pyx_sys_getdefaultencoding_not_ascii = 1;
823 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
824 if (!ascii_chars_u) goto bad;
825 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
826 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
827 PyErr_Format(
828 PyExc_ValueError,
829 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
830 default_encoding_c);
831 goto bad;
832 }
833 Py_DECREF(ascii_chars_u);
834 Py_DECREF(ascii_chars_b);
835 }
836 Py_DECREF(default_encoding);
837 return 0;
838 bad:
839 Py_XDECREF(default_encoding);
840 Py_XDECREF(ascii_chars_u);
841 Py_XDECREF(ascii_chars_b);
842 return -1;
843 }
844 #endif
845 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
846 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
847 #else
848 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
849 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
850 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)851 static int __Pyx_init_sys_getdefaultencoding_params(void) {
852 PyObject* sys;
853 PyObject* default_encoding = NULL;
854 char* default_encoding_c;
855 sys = PyImport_ImportModule("sys");
856 if (!sys) goto bad;
857 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
858 Py_DECREF(sys);
859 if (!default_encoding) goto bad;
860 default_encoding_c = PyBytes_AsString(default_encoding);
861 if (!default_encoding_c) goto bad;
862 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
863 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
864 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
865 Py_DECREF(default_encoding);
866 return 0;
867 bad:
868 Py_XDECREF(default_encoding);
869 return -1;
870 }
871 #endif
872 #endif
873
874
875 /* Test for GCC > 2.95 */
876 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
877 #define likely(x) __builtin_expect(!!(x), 1)
878 #define unlikely(x) __builtin_expect(!!(x), 0)
879 #else /* !__GNUC__ or GCC < 2.95 */
880 #define likely(x) (x)
881 #define unlikely(x) (x)
882 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)883 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
884
885 static PyObject *__pyx_m = NULL;
886 static PyObject *__pyx_d;
887 static PyObject *__pyx_b;
888 static PyObject *__pyx_cython_runtime = NULL;
889 static PyObject *__pyx_empty_tuple;
890 static PyObject *__pyx_empty_bytes;
891 static PyObject *__pyx_empty_unicode;
892 static int __pyx_lineno;
893 static int __pyx_clineno = 0;
894 static const char * __pyx_cfilenm= __FILE__;
895 static const char *__pyx_filename;
896
897
898 static const char *__pyx_f[] = {
899 "av/codec/codec.pyx",
900 "stringsource",
901 "av/codec/codec.pxd",
902 "av/audio/format.pxd",
903 "av/descriptor.pxd",
904 "av/video/format.pxd",
905 };
906
907 /*--- Type declarations ---*/
908 struct __pyx_obj_2av_5audio_6format_AudioFormat;
909 struct __pyx_obj_2av_10descriptor_Descriptor;
910 struct __pyx_obj_2av_5video_6format_VideoFormat;
911 struct __pyx_obj_2av_5video_6format_VideoFormatComponent;
912 struct __pyx_obj_2av_5codec_5codec_Codec;
913 struct __pyx_opt_args_2av_4enum_define_enum;
914
915 /* "av/enum.pxd":2
916 * cpdef define_enum(
917 * name, module, items, # <<<<<<<<<<<<<<
918 * bint is_flags=*
919 * )
920 */
921 struct __pyx_opt_args_2av_4enum_define_enum {
922 int __pyx_n;
923 int is_flags;
924 };
925 struct __pyx_opt_args_2av_5video_6format_11VideoFormat_chroma_width;
926 struct __pyx_opt_args_2av_5video_6format_11VideoFormat_chroma_height;
927
928 /* "av/video/format.pxd":14
929 * cdef _init(self, lib.AVPixelFormat pix_fmt, unsigned int width, unsigned int height)
930 *
931 * cpdef chroma_width(self, int luma_width=?) # <<<<<<<<<<<<<<
932 * cpdef chroma_height(self, int luma_height=?)
933 *
934 */
935 struct __pyx_opt_args_2av_5video_6format_11VideoFormat_chroma_width {
936 int __pyx_n;
937 int luma_width;
938 };
939
940 /* "av/video/format.pxd":15
941 *
942 * cpdef chroma_width(self, int luma_width=?)
943 * cpdef chroma_height(self, int luma_height=?) # <<<<<<<<<<<<<<
944 *
945 *
946 */
947 struct __pyx_opt_args_2av_5video_6format_11VideoFormat_chroma_height {
948 int __pyx_n;
949 int luma_height;
950 };
951 struct __pyx_opt_args_2av_5codec_5codec_5Codec__init;
952
953 /* "av/codec/codec.pxd":10
954 * cdef readonly bint is_encoder
955 *
956 * cdef _init(self, name=?) # <<<<<<<<<<<<<<
957 *
958 *
959 */
960 struct __pyx_opt_args_2av_5codec_5codec_5Codec__init {
961 int __pyx_n;
962 PyObject *name;
963 };
964
965 /* "av/audio/format.pxd":4
966 *
967 *
968 * cdef class AudioFormat(object): # <<<<<<<<<<<<<<
969 *
970 * cdef lib.AVSampleFormat sample_fmt
971 */
972 struct __pyx_obj_2av_5audio_6format_AudioFormat {
973 PyObject_HEAD
974 struct __pyx_vtabstruct_2av_5audio_6format_AudioFormat *__pyx_vtab;
975 enum AVSampleFormat sample_fmt;
976 };
977
978
979 /* "av/descriptor.pxd":4
980 *
981 *
982 * cdef class Descriptor(object): # <<<<<<<<<<<<<<
983 *
984 * # These are present as:
985 */
986 struct __pyx_obj_2av_10descriptor_Descriptor {
987 PyObject_HEAD
988 struct AVClass const *ptr;
989 PyObject *_options;
990 };
991
992
993 /* "av/video/format.pxd":4
994 *
995 *
996 * cdef class VideoFormat(object): # <<<<<<<<<<<<<<
997 *
998 * cdef lib.AVPixelFormat pix_fmt
999 */
1000 struct __pyx_obj_2av_5video_6format_VideoFormat {
1001 PyObject_HEAD
1002 struct __pyx_vtabstruct_2av_5video_6format_VideoFormat *__pyx_vtab;
1003 enum AVPixelFormat pix_fmt;
1004 struct AVPixFmtDescriptor const *ptr;
1005 unsigned int width;
1006 unsigned int height;
1007 PyObject *components;
1008 };
1009
1010
1011 /* "av/video/format.pxd":18
1012 *
1013 *
1014 * cdef class VideoFormatComponent(object): # <<<<<<<<<<<<<<
1015 *
1016 * cdef VideoFormat format
1017 */
1018 struct __pyx_obj_2av_5video_6format_VideoFormatComponent {
1019 PyObject_HEAD
1020 struct __pyx_obj_2av_5video_6format_VideoFormat *format;
1021 unsigned int index;
1022 struct AVComponentDescriptor const *ptr;
1023 };
1024
1025
1026 /* "av/codec/codec.pxd":4
1027 *
1028 *
1029 * cdef class Codec(object): # <<<<<<<<<<<<<<
1030 *
1031 * cdef const lib.AVCodec *ptr
1032 */
1033 struct __pyx_obj_2av_5codec_5codec_Codec {
1034 PyObject_HEAD
1035 struct __pyx_vtabstruct_2av_5codec_5codec_Codec *__pyx_vtab;
1036 struct AVCodec const *ptr;
1037 struct AVCodecDescriptor const *desc;
1038 int is_encoder;
1039 };
1040
1041
1042
1043 /* "av/audio/format.pxd":4
1044 *
1045 *
1046 * cdef class AudioFormat(object): # <<<<<<<<<<<<<<
1047 *
1048 * cdef lib.AVSampleFormat sample_fmt
1049 */
1050
1051 struct __pyx_vtabstruct_2av_5audio_6format_AudioFormat {
1052 PyObject *(*_init)(struct __pyx_obj_2av_5audio_6format_AudioFormat *, enum AVSampleFormat);
1053 };
1054 static struct __pyx_vtabstruct_2av_5audio_6format_AudioFormat *__pyx_vtabptr_2av_5audio_6format_AudioFormat;
1055
1056
1057 /* "av/video/format.pxd":4
1058 *
1059 *
1060 * cdef class VideoFormat(object): # <<<<<<<<<<<<<<
1061 *
1062 * cdef lib.AVPixelFormat pix_fmt
1063 */
1064
1065 struct __pyx_vtabstruct_2av_5video_6format_VideoFormat {
1066 PyObject *(*_init)(struct __pyx_obj_2av_5video_6format_VideoFormat *, enum AVPixelFormat, unsigned int, unsigned int);
1067 PyObject *(*chroma_width)(struct __pyx_obj_2av_5video_6format_VideoFormat *, int __pyx_skip_dispatch, struct __pyx_opt_args_2av_5video_6format_11VideoFormat_chroma_width *__pyx_optional_args);
1068 PyObject *(*chroma_height)(struct __pyx_obj_2av_5video_6format_VideoFormat *, int __pyx_skip_dispatch, struct __pyx_opt_args_2av_5video_6format_11VideoFormat_chroma_height *__pyx_optional_args);
1069 };
1070 static struct __pyx_vtabstruct_2av_5video_6format_VideoFormat *__pyx_vtabptr_2av_5video_6format_VideoFormat;
1071
1072
1073 /* "av/codec/codec.pyx":140
1074 *
1075 *
1076 * cdef class Codec(object): # <<<<<<<<<<<<<<
1077 *
1078 * """Codec(name, mode='r')
1079 */
1080
1081 struct __pyx_vtabstruct_2av_5codec_5codec_Codec {
1082 PyObject *(*_init)(struct __pyx_obj_2av_5codec_5codec_Codec *, struct __pyx_opt_args_2av_5codec_5codec_5Codec__init *__pyx_optional_args);
1083 };
1084 static struct __pyx_vtabstruct_2av_5codec_5codec_Codec *__pyx_vtabptr_2av_5codec_5codec_Codec;
1085
1086 /* --- Runtime support code (head) --- */
1087 /* Refnanny.proto */
1088 #ifndef CYTHON_REFNANNY
1089 #define CYTHON_REFNANNY 0
1090 #endif
1091 #if CYTHON_REFNANNY
1092 typedef struct {
1093 void (*INCREF)(void*, PyObject*, int);
1094 void (*DECREF)(void*, PyObject*, int);
1095 void (*GOTREF)(void*, PyObject*, int);
1096 void (*GIVEREF)(void*, PyObject*, int);
1097 void* (*SetupContext)(const char*, int, const char*);
1098 void (*FinishContext)(void**);
1099 } __Pyx_RefNannyAPIStruct;
1100 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1101 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1102 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1103 #ifdef WITH_THREAD
1104 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1105 if (acquire_gil) {\
1106 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1107 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1108 PyGILState_Release(__pyx_gilstate_save);\
1109 } else {\
1110 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1111 }
1112 #else
1113 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1114 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1115 #endif
1116 #define __Pyx_RefNannyFinishContext()\
1117 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1118 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1119 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1120 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1121 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1122 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1123 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1124 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1125 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1126 #else
1127 #define __Pyx_RefNannyDeclarations
1128 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1129 #define __Pyx_RefNannyFinishContext()
1130 #define __Pyx_INCREF(r) Py_INCREF(r)
1131 #define __Pyx_DECREF(r) Py_DECREF(r)
1132 #define __Pyx_GOTREF(r)
1133 #define __Pyx_GIVEREF(r)
1134 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1135 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1136 #define __Pyx_XGOTREF(r)
1137 #define __Pyx_XGIVEREF(r)
1138 #endif
1139 #define __Pyx_XDECREF_SET(r, v) do {\
1140 PyObject *tmp = (PyObject *) r;\
1141 r = v; __Pyx_XDECREF(tmp);\
1142 } while (0)
1143 #define __Pyx_DECREF_SET(r, v) do {\
1144 PyObject *tmp = (PyObject *) r;\
1145 r = v; __Pyx_DECREF(tmp);\
1146 } while (0)
1147 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1148 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1149
1150 /* PyObjectGetAttrStr.proto */
1151 #if CYTHON_USE_TYPE_SLOTS
1152 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1153 #else
1154 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1155 #endif
1156
1157 /* GetBuiltinName.proto */
1158 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1159
1160 /* PyCFunctionFastCall.proto */
1161 #if CYTHON_FAST_PYCCALL
1162 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1163 #else
1164 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1165 #endif
1166
1167 /* PyFunctionFastCall.proto */
1168 #if CYTHON_FAST_PYCALL
1169 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1170 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1171 #if 1 || PY_VERSION_HEX < 0x030600B1
1172 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1173 #else
1174 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1175 #endif
1176 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1177 (sizeof(char [1 - 2*!(cond)]) - 1)
1178 #ifndef Py_MEMBER_SIZE
1179 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1180 #endif
1181 static size_t __pyx_pyframe_localsplus_offset = 0;
1182 #include "frameobject.h"
1183 #define __Pxy_PyFrame_Initialize_Offsets()\
1184 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1185 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1186 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1187 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1188 #endif
1189
1190 /* PyObjectCall.proto */
1191 #if CYTHON_COMPILING_IN_CPYTHON
1192 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1193 #else
1194 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1195 #endif
1196
1197 /* PyObjectCallMethO.proto */
1198 #if CYTHON_COMPILING_IN_CPYTHON
1199 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1200 #endif
1201
1202 /* PyObjectCallOneArg.proto */
1203 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1204
1205 /* RaiseDoubleKeywords.proto */
1206 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1207
1208 /* ParseKeywords.proto */
1209 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1210 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1211 const char* function_name);
1212
1213 /* RaiseArgTupleInvalid.proto */
1214 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1215 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1216
1217 /* IncludeStringH.proto */
1218 #include <string.h>
1219
1220 /* BytesEquals.proto */
1221 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1222
1223 /* UnicodeEquals.proto */
1224 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1225
1226 /* StrEquals.proto */
1227 #if PY_MAJOR_VERSION >= 3
1228 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1229 #else
1230 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1231 #endif
1232
1233 /* PyThreadStateGet.proto */
1234 #if CYTHON_FAST_THREAD_STATE
1235 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1236 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1237 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1238 #else
1239 #define __Pyx_PyThreadState_declare
1240 #define __Pyx_PyThreadState_assign
1241 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1242 #endif
1243
1244 /* PyErrFetchRestore.proto */
1245 #if CYTHON_FAST_THREAD_STATE
1246 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1247 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1248 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1249 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1250 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1251 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1252 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1253 #if CYTHON_COMPILING_IN_CPYTHON
1254 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1255 #else
1256 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1257 #endif
1258 #else
1259 #define __Pyx_PyErr_Clear() PyErr_Clear()
1260 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1261 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1262 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1263 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1264 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1265 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1266 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1267 #endif
1268
1269 /* RaiseException.proto */
1270 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1271
1272 /* PyDictVersioning.proto */
1273 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1274 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1275 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1276 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1277 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1278 (cache_var) = (value);
1279 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1280 static PY_UINT64_T __pyx_dict_version = 0;\
1281 static PyObject *__pyx_dict_cached_value = NULL;\
1282 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1283 (VAR) = __pyx_dict_cached_value;\
1284 } else {\
1285 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1286 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1287 }\
1288 }
1289 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1290 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1291 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1292 #else
1293 #define __PYX_GET_DICT_VERSION(dict) (0)
1294 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1295 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1296 #endif
1297
1298 /* GetModuleGlobalName.proto */
1299 #if CYTHON_USE_DICT_VERSIONS
1300 #define __Pyx_GetModuleGlobalName(var, name) {\
1301 static PY_UINT64_T __pyx_dict_version = 0;\
1302 static PyObject *__pyx_dict_cached_value = NULL;\
1303 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1304 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1305 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1306 }
1307 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1308 PY_UINT64_T __pyx_dict_version;\
1309 PyObject *__pyx_dict_cached_value;\
1310 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1311 }
1312 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1313 #else
1314 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1315 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1316 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1317 #endif
1318
1319 /* PyObjectCall2Args.proto */
1320 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1321
1322 /* Import.proto */
1323 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1324
1325 /* ImportFrom.proto */
1326 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1327
1328 /* ListAppend.proto */
1329 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1330 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1331 PyListObject* L = (PyListObject*) list;
1332 Py_ssize_t len = Py_SIZE(list);
1333 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1334 Py_INCREF(x);
1335 PyList_SET_ITEM(list, len, x);
1336 __Pyx_SET_SIZE(list, len + 1);
1337 return 0;
1338 }
1339 return PyList_Append(list, x);
1340 }
1341 #else
1342 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1343 #endif
1344
1345 /* GetTopmostException.proto */
1346 #if CYTHON_USE_EXC_INFO_STACK
1347 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1348 #endif
1349
1350 /* SaveResetException.proto */
1351 #if CYTHON_FAST_THREAD_STATE
1352 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1353 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1354 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1355 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1356 #else
1357 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1358 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1359 #endif
1360
1361 /* PyErrExceptionMatches.proto */
1362 #if CYTHON_FAST_THREAD_STATE
1363 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1364 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1365 #else
1366 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1367 #endif
1368
1369 /* GetException.proto */
1370 #if CYTHON_FAST_THREAD_STATE
1371 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1372 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1373 #else
1374 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1375 #endif
1376
1377 /* GetItemInt.proto */
1378 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1379 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1380 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1381 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1382 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1383 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1384 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1385 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1386 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1387 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1388 int wraparound, int boundscheck);
1389 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1390 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1391 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1392 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1393 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1394 int wraparound, int boundscheck);
1395 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1396 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1397 int is_list, int wraparound, int boundscheck);
1398
1399 /* ObjectGetItem.proto */
1400 #if CYTHON_USE_TYPE_SLOTS
1401 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1402 #else
1403 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1404 #endif
1405
1406 /* PyObjectCallNoArg.proto */
1407 #if CYTHON_COMPILING_IN_CPYTHON
1408 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1409 #else
1410 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1411 #endif
1412
1413 /* PyObject_GenericGetAttrNoDict.proto */
1414 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1415 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1416 #else
1417 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1418 #endif
1419
1420 /* PyObject_GenericGetAttr.proto */
1421 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1422 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1423 #else
1424 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1425 #endif
1426
1427 /* SetVTable.proto */
1428 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1429
1430 /* PyObjectGetAttrStrNoError.proto */
1431 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1432
1433 /* SetupReduce.proto */
1434 static int __Pyx_setup_reduce(PyObject* type_obj);
1435
1436 /* TypeImport.proto */
1437 #ifndef __PYX_HAVE_RT_ImportType_proto
1438 #define __PYX_HAVE_RT_ImportType_proto
1439 enum __Pyx_ImportType_CheckSize {
1440 __Pyx_ImportType_CheckSize_Error = 0,
1441 __Pyx_ImportType_CheckSize_Warn = 1,
1442 __Pyx_ImportType_CheckSize_Ignore = 2
1443 };
1444 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1445 #endif
1446
1447 /* GetVTable.proto */
1448 static void* __Pyx_GetVtable(PyObject *dict);
1449
1450 /* CalculateMetaclass.proto */
1451 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1452
1453 /* Py3ClassCreate.proto */
1454 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1455 PyObject *mkw, PyObject *modname, PyObject *doc);
1456 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1457 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1458
1459 /* GetNameInClass.proto */
1460 #define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name)
1461 static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);
1462
1463 /* CLineInTraceback.proto */
1464 #ifdef CYTHON_CLINE_IN_TRACEBACK
1465 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1466 #else
1467 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1468 #endif
1469
1470 /* CodeObjectCache.proto */
1471 typedef struct {
1472 PyCodeObject* code_object;
1473 int code_line;
1474 } __Pyx_CodeObjectCacheEntry;
1475 struct __Pyx_CodeObjectCache {
1476 int count;
1477 int max_count;
1478 __Pyx_CodeObjectCacheEntry* entries;
1479 };
1480 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1481 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1482 static PyCodeObject *__pyx_find_code_object(int code_line);
1483 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1484
1485 /* AddTraceback.proto */
1486 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1487 int py_line, const char *filename);
1488
1489 /* CIntToPy.proto */
1490 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1491
1492 /* CIntToPy.proto */
1493 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__AVCodecID(enum AVCodecID value);
1494
1495 static PyObject* __pyx_convert__to_py_AVRational(AVRational s);
1496 /* Print.proto */
1497 static int __Pyx_Print(PyObject*, PyObject *, int);
1498 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
1499 static PyObject* __pyx_print = 0;
1500 static PyObject* __pyx_print_kwargs = 0;
1501 #endif
1502
1503 /* CIntToPy.proto */
1504 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1505
1506 /* PrintOne.proto */
1507 static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
1508
1509 /* CIntFromPy.proto */
1510 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1511
1512 /* CIntFromPy.proto */
1513 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1514
1515 /* FastTypeChecks.proto */
1516 #if CYTHON_COMPILING_IN_CPYTHON
1517 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1518 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1519 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1520 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1521 #else
1522 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1523 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1524 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1525 #endif
1526 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1527
1528 /* CheckBinaryVersion.proto */
1529 static int __Pyx_check_binary_version(void);
1530
1531 /* FunctionExport.proto */
1532 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
1533
1534 /* FunctionImport.proto */
1535 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
1536
1537 /* InitStrings.proto */
1538 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1539
1540 static PyObject *__pyx_f_2av_5codec_5codec_5Codec__init(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self, struct __pyx_opt_args_2av_5codec_5codec_5Codec__init *__pyx_optional_args); /* proto*/
1541
1542 /* Module declarations from 'libc.stdint' */
1543
1544 /* Module declarations from 'libav' */
1545
1546 /* Module declarations from 'av.audio.format' */
1547 static PyTypeObject *__pyx_ptype_2av_5audio_6format_AudioFormat = 0;
1548 static struct __pyx_obj_2av_5audio_6format_AudioFormat *(*__pyx_f_2av_5audio_6format_get_audio_format)(enum AVSampleFormat); /*proto*/
1549
1550 /* Module declarations from 'av.descriptor' */
1551 static PyTypeObject *__pyx_ptype_2av_10descriptor_Descriptor = 0;
1552 static struct __pyx_obj_2av_10descriptor_Descriptor *(*__pyx_f_2av_10descriptor_wrap_avclass)(struct AVClass const *); /*proto*/
1553
1554 /* Module declarations from 'av.enum' */
1555 static PyObject *(*__pyx_f_2av_4enum_define_enum)(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_2av_4enum_define_enum *__pyx_optional_args); /*proto*/
1556
1557 /* Module declarations from 'av.utils' */
1558 static PyObject *(*__pyx_f_2av_5utils_avrational_to_fraction)(AVRational const *); /*proto*/
1559 static PyObject *(*__pyx_f_2av_5utils_flag_in_bitfield)(uint64_t, uint64_t); /*proto*/
1560
1561 /* Module declarations from 'av.video.format' */
1562 static PyTypeObject *__pyx_ptype_2av_5video_6format_VideoFormat = 0;
1563 static PyTypeObject *__pyx_ptype_2av_5video_6format_VideoFormatComponent = 0;
1564 static struct __pyx_obj_2av_5video_6format_VideoFormat *(*__pyx_f_2av_5video_6format_get_video_format)(enum AVPixelFormat, unsigned int, unsigned int); /*proto*/
1565
1566 /* Module declarations from 'av.codec.codec' */
1567 static PyTypeObject *__pyx_ptype_2av_5codec_5codec_Codec = 0;
1568 static PyObject *__pyx_v_2av_5codec_5codec__cinit_sentinel = 0;
1569 static PyObject *__pyx_f_2av_5codec_5codec_get_codec_names(void); /*proto*/
1570 #define __Pyx_MODULE_NAME "av.codec.codec"
1571 extern int __pyx_module_is_main_av__codec__codec;
1572 int __pyx_module_is_main_av__codec__codec = 0;
1573
1574 /* Implementation of 'av.codec.codec' */
1575 static PyObject *__pyx_builtin_object;
1576 static PyObject *__pyx_builtin_ValueError;
1577 static PyObject *__pyx_builtin_RuntimeError;
1578 static PyObject *__pyx_builtin_TypeError;
1579 static const char __pyx_k_D[] = ".D";
1580 static const char __pyx_k_E[] = ".E";
1581 static const char __pyx_k_I[] = ".I";
1582 static const char __pyx_k_L[] = ".L";
1583 static const char __pyx_k_S[] = ".S";
1584 static const char __pyx_k_e[] = "e";
1585 static const char __pyx_k_r[] = "r";
1586 static const char __pyx_k_w[] = "w";
1587 static const char __pyx_k__2[] = "";
1588 static const char __pyx_k_DR1[] = "DR1";
1589 static const char __pyx_k_den[] = "den";
1590 static const char __pyx_k_doc[] = "__doc__";
1591 static const char __pyx_k_dr1[] = "dr1";
1592 static const char __pyx_k_end[] = "end";
1593 static const char __pyx_k_num[] = "num";
1594 static const char __pyx_k_NONE[] = "NONE";
1595 static const char __pyx_k_file[] = "file";
1596 static const char __pyx_k_main[] = "__main__";
1597 static const char __pyx_k_mode[] = "mode";
1598 static const char __pyx_k_name[] = "name";
1599 static const char __pyx_k_test[] = "__test__";
1600 static const char __pyx_k_type[] = "type";
1601 static const char __pyx_k_Codec[] = "Codec";
1602 static const char __pyx_k_DELAY[] = "DELAY";
1603 static const char __pyx_k_LOSSY[] = "LOSSY";
1604 static const char __pyx_k_codec[] = "codec";
1605 static const char __pyx_k_delay[] = "delay";
1606 static const char __pyx_k_denum[] = "denum";
1607 static const char __pyx_k_lossy[] = "lossy";
1608 static const char __pyx_k_print[] = "print";
1609 static const char __pyx_k_upper[] = "upper";
1610 static const char __pyx_k_HYBRID[] = "HYBRID";
1611 static const char __pyx_k_create[] = "create";
1612 static const char __pyx_k_hybrid[] = "hybrid";
1613 static const char __pyx_k_import[] = "__import__";
1614 static const char __pyx_k_module[] = "__module__";
1615 static const char __pyx_k_name_2[] = "__name__";
1616 static const char __pyx_k_object[] = "object";
1617 static const char __pyx_k_reduce[] = "__reduce__";
1618 static const char __pyx_k_HWACCEL[] = "HWACCEL";
1619 static const char __pyx_k_REORDER[] = "REORDER";
1620 static const char __pyx_k_context[] = "context";
1621 static const char __pyx_k_d_codec[] = "d_codec";
1622 static const char __pyx_k_e_codec[] = "e_codec";
1623 static const char __pyx_k_hwaccel[] = "hwaccel";
1624 static const char __pyx_k_prepare[] = "__prepare__";
1625 static const char __pyx_k_reorder[] = "reorder";
1626 static const char __pyx_k_HARDWARE[] = "HARDWARE";
1627 static const char __pyx_k_LOSSLESS[] = "LOSSLESS";
1628 static const char __pyx_k_TEXT_SUB[] = "TEXT_SUB";
1629 static const char __pyx_k_av_codec[] = "av.codec";
1630 static const char __pyx_k_getstate[] = "__getstate__";
1631 static const char __pyx_k_hardware[] = "hardware";
1632 static const char __pyx_k_lossless[] = "lossless";
1633 static const char __pyx_k_property[] = "property";
1634 static const char __pyx_k_qualname[] = "__qualname__";
1635 static const char __pyx_k_setstate[] = "__setstate__";
1636 static const char __pyx_k_text_sub[] = "text_sub";
1637 static const char __pyx_k_SUBFRAMES[] = "SUBFRAMES";
1638 static const char __pyx_k_TRUNCATED[] = "TRUNCATED";
1639 static const char __pyx_k_TypeError[] = "TypeError";
1640 static const char __pyx_k_long_name[] = "long_name";
1641 static const char __pyx_k_metaclass[] = "__metaclass__";
1642 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
1643 static const char __pyx_k_subframes[] = "subframes";
1644 static const char __pyx_k_truncated[] = "truncated";
1645 static const char __pyx_k_BITMAP_SUB[] = "BITMAP_SUB";
1646 static const char __pyx_k_INTRA_ONLY[] = "INTRA_ONLY";
1647 static const char __pyx_k_Properties[] = "Properties";
1648 static const char __pyx_k_ValueError[] = "ValueError";
1649 static const char __pyx_k_bitmap_sub[] = "bitmap_sub";
1650 static const char __pyx_k_intra_only[] = "intra_only";
1651 static const char __pyx_k_properties[] = "properties";
1652 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
1653 static const char __pyx_k_18s_ERROR_s[] = "...... %-18s ERROR: %s";
1654 static const char __pyx_k_dump_codecs[] = "dump_codecs";
1655 static const char __pyx_k_AUTO_THREADS[] = "AUTO_THREADS";
1656 static const char __pyx_k_CHANNEL_CONF[] = "CHANNEL_CONF";
1657 static const char __pyx_k_Capabilities[] = "Capabilities";
1658 static const char __pyx_k_CodecContext[] = "CodecContext";
1659 static const char __pyx_k_EXPERIMENTAL[] = "EXPERIMENTAL";
1660 static const char __pyx_k_PARAM_CHANGE[] = "PARAM_CHANGE";
1661 static const char __pyx_k_RuntimeError[] = "RuntimeError";
1662 static const char __pyx_k_auto_threads[] = "auto_threads";
1663 static const char __pyx_k_capabilities[] = "capabilities";
1664 static const char __pyx_k_channel_conf[] = "channel_conf";
1665 static const char __pyx_k_experimental[] = "experimental";
1666 static const char __pyx_k_param_change[] = "param_change";
1667 static const char __pyx_k_AVOID_PROBING[] = "AVOID_PROBING";
1668 static const char __pyx_k_FRAME_THREADS[] = "FRAME_THREADS";
1669 static const char __pyx_k_HWACCEL_VDPAU[] = "HWACCEL_VDPAU";
1670 static const char __pyx_k_NEG_LINESIZES[] = "NEG_LINESIZES";
1671 static const char __pyx_k_SLICE_THREADS[] = "SLICE_THREADS";
1672 static const char __pyx_k_avoid_probing[] = "avoid_probing";
1673 static const char __pyx_k_flag_property[] = "flag_property";
1674 static const char __pyx_k_frame_threads[] = "frame_threads";
1675 static const char __pyx_k_hwaccel_vdpau[] = "hwaccel_vdpau";
1676 static const char __pyx_k_neg_linesizes[] = "neg_linesizes";
1677 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
1678 static const char __pyx_k_slice_threads[] = "slice_threads";
1679 static const char __pyx_k_av_codec_codec[] = "av.codec.codec";
1680 static const char __pyx_k_DRAW_HORIZ_BAND[] = "DRAW_HORIZ_BAND";
1681 static const char __pyx_k_draw_horiz_band[] = "draw_horiz_band";
1682 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
1683 static const char __pyx_k_SMALL_LAST_FRAME[] = "SMALL_LAST_FRAME";
1684 static const char __pyx_k_codec_descriptor[] = "codec_descriptor";
1685 static const char __pyx_k_codecs_available[] = "codecs_available";
1686 static const char __pyx_k_small_last_frame[] = "small_last_frame";
1687 static const char __pyx_k_Codec_is_lossless[] = "Codec is lossless.";
1688 static const char __pyx_k_UnknownCodecError[] = "UnknownCodecError";
1689 static const char __pyx_k_s_s_s_s_s_s_18s_s[] = " %s%s%s%s%s%s %-18s %s";
1690 static const char __pyx_k_av_codec_codec_pyx[] = "av/codec/codec.pyx";
1691 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1692 static const char __pyx_k_Codec_is_intra_only[] = "Codec is intra only.";
1693 static const char __pyx_k_VARIABLE_FRAME_SIZE[] = "VARIABLE_FRAME_SIZE";
1694 static const char __pyx_k_variable_frame_size[] = "variable_frame_size";
1695 static const char __pyx_k_ENCODER_REORDERED_OPAQUE[] = "ENCODER_REORDERED_OPAQUE";
1696 static const char __pyx_k_encoder_reordered_opaque[] = "encoder_reordered_opaque";
1697 static const char __pyx_k_No_codec_descriptor_for_r[] = "No codec descriptor for %r.";
1698 static const char __pyx_k_Invalid_mode_must_be_r_or_w[] = "Invalid mode; must be \"r\" or \"w\".";
1699 static const char __pyx_k_s_is_both_encoder_and_decoder[] = "%s is both encoder and decoder.";
1700 static const char __pyx_k_Codec_supports_frame_reordering[] = "Codec supports frame reordering. That is, the coded order (the order in which\n the encoded packets are output by the encoders / stored / input to the\n decoders) may be different from the presentation order of the corresponding\n frames.\n\n For codecs that do not have this property set, PTS and DTS should always be\n equal.";
1701 static const char __pyx_k_Decoder_can_use_draw_horiz_band[] = "Decoder can use draw_horiz_band callback.";
1702 static const char __pyx_k_Found_codec_does_not_match_mode[] = "Found codec does not match mode.";
1703 static const char __pyx_k_Audio_encoder_supports_receiving[] = "Audio encoder supports receiving a different number of samples in each call.";
1704 static const char __pyx_k_Codec_can_be_fed_a_final_frame_w[] = "Codec can be fed a final frame with a smaller size.\n This can be used to prevent truncation of the last audio samples.";
1705 static const char __pyx_k_Codec_can_output_multiple_frames[] = "Codec can output multiple frames per AVPacket\n Normally demuxers return one frame at a time, demuxers which do not do\n are connected to a parser to split what they return into proper frames.\n This flag is reserved to the very rare category of codecs which have a\n bitstream that cannot be split into frames without timeconsuming\n operations like full decoding. Demuxers carrying such bitstreams thus\n may return multiple frames in a packet. This has many disadvantages like\n prohibiting stream copy in many cases thus it should only be considered\n as a last resort.";
1706 static const char __pyx_k_Codec_is_backed_by_a_hardware_im[] = "Codec is backed by a hardware implementation. Typically used to\n identify a non-hwaccel hardware decoder. For information about hwaccels, use\n avcodec_get_hw_config() instead.";
1707 static const char __pyx_k_Codec_is_experimental_and_is_thu[] = "Codec is experimental and is thus avoided in favor of non experimental\n encoders";
1708 static const char __pyx_k_Codec_is_potentially_backed_by_a[] = "Codec is potentially backed by a hardware implementation, but not\n necessarily. This is used instead of AV_CODEC_CAP_HARDWARE, if the\n implementation provides some sort of internal fallback.";
1709 static const char __pyx_k_Codec_should_fill_in_channel_con[] = "Codec should fill in channel configuration and samplerate instead of container";
1710 static const char __pyx_k_Codec_supports_avctx_thread_coun[] = "Codec supports avctx->thread_count == 0 (auto).";
1711 static const char __pyx_k_Codec_supports_changed_parameter[] = "Codec supports changed parameters at any point.";
1712 static const char __pyx_k_Codec_supports_frame_level_multi[] = "Codec supports frame-level multithreading";
1713 static const char __pyx_k_Codec_supports_lossless_compress[] = "Codec supports lossless compression. Audio and video codecs only.";
1714 static const char __pyx_k_Codec_supports_lossy_compression[] = "Codec supports lossy compression. Audio and video codecs only.\n\n Note: A codec may support both lossy and lossless\n compression modes.";
1715 static const char __pyx_k_Codec_supports_slice_based_or_pa[] = "Codec supports slice-based (or partition-based) multithreading.";
1716 static const char __pyx_k_Codec_uses_get_buffer_for_alloca[] = "Codec uses get_buffer() for allocating buffers and supports custom allocators.\n If not set, it might not use get_buffer() at all or use operations that\n assume the buffer was allocated by avcodec_default_get_buffer.";
1717 static const char __pyx_k_Codec_uses_only_intra_compressio[] = "Codec uses only intra compression.\n Video and audio codecs only.";
1718 static const char __pyx_k_Codecs_D_Decoding_supported_E_En[] = "Codecs:\n D..... = Decoding supported\n .E.... = Encoding supported\n ..V... = Video codec\n ..A... = Audio codec\n ..S... = Subtitle codec\n ...I.. = Intra frame-only codec\n ....L. = Lossy compression\n .....S = Lossless compression\n ------";
1719 static const char __pyx_k_Decoder_is_not_a_preferred_choic[] = "Decoder is not a preferred choice for probing.\n This indicates that the decoder is not a good choice for probing.\n It could for example be an expensive to spin up hardware decoder,\n or it could simply not provide a lot of useful information about\n the stream.\n A decoder marked with this flag should only be used as last resort\n choice for probing.";
1720 static const char __pyx_k_Encoder_or_decoder_requires_flus[] = "Encoder or decoder requires flushing with NULL input at the end in order to\n give the complete and correct output.\n\n NOTE: If this flag is not set, the codec is guaranteed to never be fed with\n with NULL data. The user can still send NULL data to the public encode\n or decode function, but libavcodec will not pass it along to the codec\n unless this flag is set.\n\n Decoders:\n The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,\n avpkt->size=0 at the end to get the delayed data until the decoder no longer\n returns frames.\n\n Encoders:\n The encoder needs to be fed with NULL data at the end of encoding until the\n encoder no longer returns data.\n\n NOTE: For encoders implementing the AVCodec.encode2() function, setting this\n flag also means that the encoder must set the pts and duration for\n each output packet. If this flag is not set, the pts and duration will\n be determined by libavcodec from the input frame.";
1721 static const char __pyx_k_Subtitle_codec_is_bitmap_based_D[] = "Subtitle codec is bitmap based\n Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field.";
1722 static const char __pyx_k_Subtitle_codec_is_text_based_Dec[] = "Subtitle codec is text based.\n Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field.";
1723 static const char __pyx_k_This_codec_takes_the_reordered_o[] = "This codec takes the reordered_opaque field from input AVFrames\n and returns it in the corresponding field in AVCodecContext after\n encoding.";
1724 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
1725 static PyObject *__pyx_kp_s_18s_ERROR_s;
1726 static PyObject *__pyx_n_s_AUTO_THREADS;
1727 static PyObject *__pyx_n_s_AVOID_PROBING;
1728 static PyObject *__pyx_kp_s_Audio_encoder_supports_receiving;
1729 static PyObject *__pyx_n_s_BITMAP_SUB;
1730 static PyObject *__pyx_n_s_CHANNEL_CONF;
1731 static PyObject *__pyx_n_s_Capabilities;
1732 static PyObject *__pyx_n_s_Codec;
1733 static PyObject *__pyx_n_s_CodecContext;
1734 static PyObject *__pyx_kp_s_Codec_can_be_fed_a_final_frame_w;
1735 static PyObject *__pyx_kp_s_Codec_can_output_multiple_frames;
1736 static PyObject *__pyx_kp_s_Codec_is_backed_by_a_hardware_im;
1737 static PyObject *__pyx_kp_s_Codec_is_experimental_and_is_thu;
1738 static PyObject *__pyx_kp_s_Codec_is_intra_only;
1739 static PyObject *__pyx_kp_s_Codec_is_lossless;
1740 static PyObject *__pyx_kp_s_Codec_is_potentially_backed_by_a;
1741 static PyObject *__pyx_kp_s_Codec_should_fill_in_channel_con;
1742 static PyObject *__pyx_kp_s_Codec_supports_avctx_thread_coun;
1743 static PyObject *__pyx_kp_s_Codec_supports_changed_parameter;
1744 static PyObject *__pyx_kp_s_Codec_supports_frame_level_multi;
1745 static PyObject *__pyx_kp_s_Codec_supports_frame_reordering;
1746 static PyObject *__pyx_kp_s_Codec_supports_lossless_compress;
1747 static PyObject *__pyx_kp_s_Codec_supports_lossy_compression;
1748 static PyObject *__pyx_kp_s_Codec_supports_slice_based_or_pa;
1749 static PyObject *__pyx_kp_s_Codec_uses_get_buffer_for_alloca;
1750 static PyObject *__pyx_kp_s_Codec_uses_only_intra_compressio;
1751 static PyObject *__pyx_kp_s_Codecs_D_Decoding_supported_E_En;
1752 static PyObject *__pyx_kp_s_D;
1753 static PyObject *__pyx_n_s_DELAY;
1754 static PyObject *__pyx_n_s_DR1;
1755 static PyObject *__pyx_n_s_DRAW_HORIZ_BAND;
1756 static PyObject *__pyx_kp_s_Decoder_can_use_draw_horiz_band;
1757 static PyObject *__pyx_kp_s_Decoder_is_not_a_preferred_choic;
1758 static PyObject *__pyx_kp_s_E;
1759 static PyObject *__pyx_n_s_ENCODER_REORDERED_OPAQUE;
1760 static PyObject *__pyx_n_s_EXPERIMENTAL;
1761 static PyObject *__pyx_kp_s_Encoder_or_decoder_requires_flus;
1762 static PyObject *__pyx_n_s_FRAME_THREADS;
1763 static PyObject *__pyx_kp_s_Found_codec_does_not_match_mode;
1764 static PyObject *__pyx_n_s_HARDWARE;
1765 static PyObject *__pyx_n_s_HWACCEL;
1766 static PyObject *__pyx_n_s_HWACCEL_VDPAU;
1767 static PyObject *__pyx_n_s_HYBRID;
1768 static PyObject *__pyx_kp_s_I;
1769 static PyObject *__pyx_n_s_INTRA_ONLY;
1770 static PyObject *__pyx_kp_s_Invalid_mode_must_be_r_or_w;
1771 static PyObject *__pyx_kp_s_L;
1772 static PyObject *__pyx_n_s_LOSSLESS;
1773 static PyObject *__pyx_n_s_LOSSY;
1774 static PyObject *__pyx_n_s_NEG_LINESIZES;
1775 static PyObject *__pyx_n_s_NONE;
1776 static PyObject *__pyx_kp_s_No_codec_descriptor_for_r;
1777 static PyObject *__pyx_n_s_PARAM_CHANGE;
1778 static PyObject *__pyx_n_s_Properties;
1779 static PyObject *__pyx_n_s_REORDER;
1780 static PyObject *__pyx_n_s_RuntimeError;
1781 static PyObject *__pyx_kp_s_S;
1782 static PyObject *__pyx_n_s_SLICE_THREADS;
1783 static PyObject *__pyx_n_s_SMALL_LAST_FRAME;
1784 static PyObject *__pyx_n_s_SUBFRAMES;
1785 static PyObject *__pyx_kp_s_Subtitle_codec_is_bitmap_based_D;
1786 static PyObject *__pyx_kp_s_Subtitle_codec_is_text_based_Dec;
1787 static PyObject *__pyx_n_s_TEXT_SUB;
1788 static PyObject *__pyx_n_s_TRUNCATED;
1789 static PyObject *__pyx_kp_s_This_codec_takes_the_reordered_o;
1790 static PyObject *__pyx_n_s_TypeError;
1791 static PyObject *__pyx_n_s_UnknownCodecError;
1792 static PyObject *__pyx_n_s_VARIABLE_FRAME_SIZE;
1793 static PyObject *__pyx_n_s_ValueError;
1794 static PyObject *__pyx_kp_s__2;
1795 static PyObject *__pyx_n_s_auto_threads;
1796 static PyObject *__pyx_kp_s_av_codec;
1797 static PyObject *__pyx_n_s_av_codec_codec;
1798 static PyObject *__pyx_kp_s_av_codec_codec_pyx;
1799 static PyObject *__pyx_n_s_avoid_probing;
1800 static PyObject *__pyx_n_s_bitmap_sub;
1801 static PyObject *__pyx_n_s_capabilities;
1802 static PyObject *__pyx_n_s_channel_conf;
1803 static PyObject *__pyx_n_s_cline_in_traceback;
1804 static PyObject *__pyx_n_s_codec;
1805 static PyObject *__pyx_n_s_codec_descriptor;
1806 static PyObject *__pyx_n_s_codecs_available;
1807 static PyObject *__pyx_n_s_context;
1808 static PyObject *__pyx_n_s_create;
1809 static PyObject *__pyx_n_s_d_codec;
1810 static PyObject *__pyx_n_s_delay;
1811 static PyObject *__pyx_n_s_den;
1812 static PyObject *__pyx_n_s_denum;
1813 static PyObject *__pyx_n_s_doc;
1814 static PyObject *__pyx_n_s_dr1;
1815 static PyObject *__pyx_n_s_draw_horiz_band;
1816 static PyObject *__pyx_n_s_dump_codecs;
1817 static PyObject *__pyx_n_s_e;
1818 static PyObject *__pyx_n_s_e_codec;
1819 static PyObject *__pyx_n_s_encoder_reordered_opaque;
1820 static PyObject *__pyx_n_s_end;
1821 static PyObject *__pyx_n_s_experimental;
1822 static PyObject *__pyx_n_s_file;
1823 static PyObject *__pyx_n_s_flag_property;
1824 static PyObject *__pyx_n_s_frame_threads;
1825 static PyObject *__pyx_n_s_getstate;
1826 static PyObject *__pyx_n_s_hardware;
1827 static PyObject *__pyx_n_s_hwaccel;
1828 static PyObject *__pyx_n_s_hwaccel_vdpau;
1829 static PyObject *__pyx_n_s_hybrid;
1830 static PyObject *__pyx_n_s_import;
1831 static PyObject *__pyx_n_s_intra_only;
1832 static PyObject *__pyx_n_s_long_name;
1833 static PyObject *__pyx_n_s_lossless;
1834 static PyObject *__pyx_n_s_lossy;
1835 static PyObject *__pyx_n_s_main;
1836 static PyObject *__pyx_n_s_metaclass;
1837 static PyObject *__pyx_n_s_mode;
1838 static PyObject *__pyx_n_s_module;
1839 static PyObject *__pyx_n_s_name;
1840 static PyObject *__pyx_n_s_name_2;
1841 static PyObject *__pyx_n_s_neg_linesizes;
1842 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
1843 static PyObject *__pyx_n_s_num;
1844 static PyObject *__pyx_n_s_object;
1845 static PyObject *__pyx_n_s_param_change;
1846 static PyObject *__pyx_n_s_prepare;
1847 static PyObject *__pyx_n_s_print;
1848 static PyObject *__pyx_n_s_properties;
1849 static PyObject *__pyx_n_s_property;
1850 static PyObject *__pyx_n_s_pyx_vtable;
1851 static PyObject *__pyx_n_s_qualname;
1852 static PyObject *__pyx_n_s_r;
1853 static PyObject *__pyx_n_s_reduce;
1854 static PyObject *__pyx_n_s_reduce_cython;
1855 static PyObject *__pyx_n_s_reduce_ex;
1856 static PyObject *__pyx_n_s_reorder;
1857 static PyObject *__pyx_kp_s_s_is_both_encoder_and_decoder;
1858 static PyObject *__pyx_kp_s_s_s_s_s_s_s_18s_s;
1859 static PyObject *__pyx_n_s_setstate;
1860 static PyObject *__pyx_n_s_setstate_cython;
1861 static PyObject *__pyx_n_s_slice_threads;
1862 static PyObject *__pyx_n_s_small_last_frame;
1863 static PyObject *__pyx_n_s_subframes;
1864 static PyObject *__pyx_n_s_test;
1865 static PyObject *__pyx_n_s_text_sub;
1866 static PyObject *__pyx_n_s_truncated;
1867 static PyObject *__pyx_n_s_type;
1868 static PyObject *__pyx_n_s_upper;
1869 static PyObject *__pyx_n_s_variable_frame_size;
1870 static PyObject *__pyx_n_s_w;
1871 static int __pyx_pf_2av_5codec_5codec_5Codec___cinit__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode); /* proto */
1872 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_2create(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1873 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_10is_decoder___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1874 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_10descriptor___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1875 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_4name___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1876 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_9long_name___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1877 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_4type___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1878 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_2id___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1879 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_11frame_rates___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1880 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_11audio_rates___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1881 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_13video_formats___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1882 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_13audio_formats___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1883 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_4properties(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1884 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_6capabilities(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1885 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_10is_encoder___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1886 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self); /* proto */
1887 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1888 static PyObject *__pyx_pf_2av_5codec_5codec_dump_codecs(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
1889 static PyObject *__pyx_tp_new_2av_5codec_5codec_Codec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1890 static PyObject *__pyx_int_0;
1891 static PyObject *__pyx_int_16;
1892 static PyObject *__pyx_int_128;
1893 static PyObject *__pyx_int_2048;
1894 static PyObject *__pyx_int_1048576;
1895 static PyObject *__pyx_tuple_;
1896 static PyObject *__pyx_tuple__3;
1897 static PyObject *__pyx_tuple__4;
1898 static PyObject *__pyx_tuple__5;
1899 static PyObject *__pyx_tuple__6;
1900 static PyObject *__pyx_tuple__7;
1901 static PyObject *__pyx_tuple__8;
1902 static PyObject *__pyx_tuple__9;
1903 static PyObject *__pyx_tuple__10;
1904 static PyObject *__pyx_tuple__11;
1905 static PyObject *__pyx_codeobj__12;
1906 /* Late includes */
1907
1908 /* "av/codec/codec.pyx":11
1909 *
1910 *
1911 * cdef Codec wrap_codec(const lib.AVCodec *ptr): # <<<<<<<<<<<<<<
1912 * cdef Codec codec = Codec(_cinit_sentinel)
1913 * codec.ptr = ptr
1914 */
1915
__pyx_f_2av_5codec_5codec_wrap_codec(struct AVCodec const * __pyx_v_ptr)1916 static struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_f_2av_5codec_5codec_wrap_codec(struct AVCodec const *__pyx_v_ptr) {
1917 struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_codec = 0;
1918 struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_r = NULL;
1919 __Pyx_RefNannyDeclarations
1920 PyObject *__pyx_t_1 = NULL;
1921 int __pyx_lineno = 0;
1922 const char *__pyx_filename = NULL;
1923 int __pyx_clineno = 0;
1924 __Pyx_RefNannySetupContext("wrap_codec", 0);
1925
1926 /* "av/codec/codec.pyx":12
1927 *
1928 * cdef Codec wrap_codec(const lib.AVCodec *ptr):
1929 * cdef Codec codec = Codec(_cinit_sentinel) # <<<<<<<<<<<<<<
1930 * codec.ptr = ptr
1931 * codec.is_encoder = lib.av_codec_is_encoder(ptr)
1932 */
1933 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec), __pyx_v_2av_5codec_5codec__cinit_sentinel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
1934 __Pyx_GOTREF(__pyx_t_1);
1935 __pyx_v_codec = ((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_t_1);
1936 __pyx_t_1 = 0;
1937
1938 /* "av/codec/codec.pyx":13
1939 * cdef Codec wrap_codec(const lib.AVCodec *ptr):
1940 * cdef Codec codec = Codec(_cinit_sentinel)
1941 * codec.ptr = ptr # <<<<<<<<<<<<<<
1942 * codec.is_encoder = lib.av_codec_is_encoder(ptr)
1943 * codec._init()
1944 */
1945 __pyx_v_codec->ptr = __pyx_v_ptr;
1946
1947 /* "av/codec/codec.pyx":14
1948 * cdef Codec codec = Codec(_cinit_sentinel)
1949 * codec.ptr = ptr
1950 * codec.is_encoder = lib.av_codec_is_encoder(ptr) # <<<<<<<<<<<<<<
1951 * codec._init()
1952 * return codec
1953 */
1954 __pyx_v_codec->is_encoder = av_codec_is_encoder(__pyx_v_ptr);
1955
1956 /* "av/codec/codec.pyx":15
1957 * codec.ptr = ptr
1958 * codec.is_encoder = lib.av_codec_is_encoder(ptr)
1959 * codec._init() # <<<<<<<<<<<<<<
1960 * return codec
1961 *
1962 */
1963 __pyx_t_1 = ((struct __pyx_vtabstruct_2av_5codec_5codec_Codec *)__pyx_v_codec->__pyx_vtab)->_init(__pyx_v_codec, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
1964 __Pyx_GOTREF(__pyx_t_1);
1965 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1966
1967 /* "av/codec/codec.pyx":16
1968 * codec.is_encoder = lib.av_codec_is_encoder(ptr)
1969 * codec._init()
1970 * return codec # <<<<<<<<<<<<<<
1971 *
1972 *
1973 */
1974 __Pyx_XDECREF(((PyObject *)__pyx_r));
1975 __Pyx_INCREF(((PyObject *)__pyx_v_codec));
1976 __pyx_r = __pyx_v_codec;
1977 goto __pyx_L0;
1978
1979 /* "av/codec/codec.pyx":11
1980 *
1981 *
1982 * cdef Codec wrap_codec(const lib.AVCodec *ptr): # <<<<<<<<<<<<<<
1983 * cdef Codec codec = Codec(_cinit_sentinel)
1984 * codec.ptr = ptr
1985 */
1986
1987 /* function exit code */
1988 __pyx_L1_error:;
1989 __Pyx_XDECREF(__pyx_t_1);
1990 __Pyx_AddTraceback("av.codec.codec.wrap_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
1991 __pyx_r = 0;
1992 __pyx_L0:;
1993 __Pyx_XDECREF((PyObject *)__pyx_v_codec);
1994 __Pyx_XGIVEREF((PyObject *)__pyx_r);
1995 __Pyx_RefNannyFinishContext();
1996 return __pyx_r;
1997 }
1998
1999 /* "av/codec/codec.pyx":162
2000 * """
2001 *
2002 * def __cinit__(self, name, mode='r'): # <<<<<<<<<<<<<<
2003 *
2004 * if name is _cinit_sentinel:
2005 */
2006
2007 /* Python wrapper */
2008 static int __pyx_pw_2av_5codec_5codec_5Codec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2009 static int __pyx_pw_2av_5codec_5codec_5Codec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2010 PyObject *__pyx_v_name = 0;
2011 PyObject *__pyx_v_mode = 0;
2012 int __pyx_lineno = 0;
2013 const char *__pyx_filename = NULL;
2014 int __pyx_clineno = 0;
2015 int __pyx_r;
2016 __Pyx_RefNannyDeclarations
2017 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2018 {
2019 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,0};
2020 PyObject* values[2] = {0,0};
2021 values[1] = ((PyObject *)__pyx_n_s_r);
2022 if (unlikely(__pyx_kwds)) {
2023 Py_ssize_t kw_args;
2024 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2025 switch (pos_args) {
2026 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2027 CYTHON_FALLTHROUGH;
2028 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2029 CYTHON_FALLTHROUGH;
2030 case 0: break;
2031 default: goto __pyx_L5_argtuple_error;
2032 }
2033 kw_args = PyDict_Size(__pyx_kwds);
2034 switch (pos_args) {
2035 case 0:
2036 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
2037 else goto __pyx_L5_argtuple_error;
2038 CYTHON_FALLTHROUGH;
2039 case 1:
2040 if (kw_args > 0) {
2041 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
2042 if (value) { values[1] = value; kw_args--; }
2043 }
2044 }
2045 if (unlikely(kw_args > 0)) {
2046 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 162, __pyx_L3_error)
2047 }
2048 } else {
2049 switch (PyTuple_GET_SIZE(__pyx_args)) {
2050 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2051 CYTHON_FALLTHROUGH;
2052 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2053 break;
2054 default: goto __pyx_L5_argtuple_error;
2055 }
2056 }
2057 __pyx_v_name = values[0];
2058 __pyx_v_mode = values[1];
2059 }
2060 goto __pyx_L4_argument_unpacking_done;
2061 __pyx_L5_argtuple_error:;
2062 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 162, __pyx_L3_error)
2063 __pyx_L3_error:;
2064 __Pyx_AddTraceback("av.codec.codec.Codec.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2065 __Pyx_RefNannyFinishContext();
2066 return -1;
2067 __pyx_L4_argument_unpacking_done:;
2068 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec___cinit__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self), __pyx_v_name, __pyx_v_mode);
2069
2070 /* function exit code */
2071 __Pyx_RefNannyFinishContext();
2072 return __pyx_r;
2073 }
2074
__pyx_pf_2av_5codec_5codec_5Codec___cinit__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self,PyObject * __pyx_v_name,PyObject * __pyx_v_mode)2075 static int __pyx_pf_2av_5codec_5codec_5Codec___cinit__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode) {
2076 int __pyx_r;
2077 __Pyx_RefNannyDeclarations
2078 int __pyx_t_1;
2079 int __pyx_t_2;
2080 char *__pyx_t_3;
2081 PyObject *__pyx_t_4 = NULL;
2082 PyObject *__pyx_t_5 = NULL;
2083 struct __pyx_opt_args_2av_5codec_5codec_5Codec__init __pyx_t_6;
2084 PyObject *__pyx_t_7 = NULL;
2085 int __pyx_lineno = 0;
2086 const char *__pyx_filename = NULL;
2087 int __pyx_clineno = 0;
2088 __Pyx_RefNannySetupContext("__cinit__", 0);
2089
2090 /* "av/codec/codec.pyx":164
2091 * def __cinit__(self, name, mode='r'):
2092 *
2093 * if name is _cinit_sentinel: # <<<<<<<<<<<<<<
2094 * return
2095 *
2096 */
2097 __pyx_t_1 = (__pyx_v_name == __pyx_v_2av_5codec_5codec__cinit_sentinel);
2098 __pyx_t_2 = (__pyx_t_1 != 0);
2099 if (__pyx_t_2) {
2100
2101 /* "av/codec/codec.pyx":165
2102 *
2103 * if name is _cinit_sentinel:
2104 * return # <<<<<<<<<<<<<<
2105 *
2106 * if mode == 'w':
2107 */
2108 __pyx_r = 0;
2109 goto __pyx_L0;
2110
2111 /* "av/codec/codec.pyx":164
2112 * def __cinit__(self, name, mode='r'):
2113 *
2114 * if name is _cinit_sentinel: # <<<<<<<<<<<<<<
2115 * return
2116 *
2117 */
2118 }
2119
2120 /* "av/codec/codec.pyx":167
2121 * return
2122 *
2123 * if mode == 'w': # <<<<<<<<<<<<<<
2124 * self.ptr = lib.avcodec_find_encoder_by_name(name)
2125 * if not self.ptr:
2126 */
2127 __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 167, __pyx_L1_error)
2128 if (__pyx_t_2) {
2129
2130 /* "av/codec/codec.pyx":168
2131 *
2132 * if mode == 'w':
2133 * self.ptr = lib.avcodec_find_encoder_by_name(name) # <<<<<<<<<<<<<<
2134 * if not self.ptr:
2135 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2136 */
2137 __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
2138 __pyx_v_self->ptr = avcodec_find_encoder_by_name(__pyx_t_3);
2139
2140 /* "av/codec/codec.pyx":169
2141 * if mode == 'w':
2142 * self.ptr = lib.avcodec_find_encoder_by_name(name)
2143 * if not self.ptr: # <<<<<<<<<<<<<<
2144 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2145 * if self.desc:
2146 */
2147 __pyx_t_2 = ((!(__pyx_v_self->ptr != 0)) != 0);
2148 if (__pyx_t_2) {
2149
2150 /* "av/codec/codec.pyx":170
2151 * self.ptr = lib.avcodec_find_encoder_by_name(name)
2152 * if not self.ptr:
2153 * self.desc = lib.avcodec_descriptor_get_by_name(name) # <<<<<<<<<<<<<<
2154 * if self.desc:
2155 * self.ptr = lib.avcodec_find_encoder(self.desc.id)
2156 */
2157 __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error)
2158 __pyx_v_self->desc = avcodec_descriptor_get_by_name(__pyx_t_3);
2159
2160 /* "av/codec/codec.pyx":171
2161 * if not self.ptr:
2162 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2163 * if self.desc: # <<<<<<<<<<<<<<
2164 * self.ptr = lib.avcodec_find_encoder(self.desc.id)
2165 *
2166 */
2167 __pyx_t_2 = (__pyx_v_self->desc != 0);
2168 if (__pyx_t_2) {
2169
2170 /* "av/codec/codec.pyx":172
2171 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2172 * if self.desc:
2173 * self.ptr = lib.avcodec_find_encoder(self.desc.id) # <<<<<<<<<<<<<<
2174 *
2175 * elif mode == 'r':
2176 */
2177 __pyx_v_self->ptr = avcodec_find_encoder(__pyx_v_self->desc->id);
2178
2179 /* "av/codec/codec.pyx":171
2180 * if not self.ptr:
2181 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2182 * if self.desc: # <<<<<<<<<<<<<<
2183 * self.ptr = lib.avcodec_find_encoder(self.desc.id)
2184 *
2185 */
2186 }
2187
2188 /* "av/codec/codec.pyx":169
2189 * if mode == 'w':
2190 * self.ptr = lib.avcodec_find_encoder_by_name(name)
2191 * if not self.ptr: # <<<<<<<<<<<<<<
2192 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2193 * if self.desc:
2194 */
2195 }
2196
2197 /* "av/codec/codec.pyx":167
2198 * return
2199 *
2200 * if mode == 'w': # <<<<<<<<<<<<<<
2201 * self.ptr = lib.avcodec_find_encoder_by_name(name)
2202 * if not self.ptr:
2203 */
2204 goto __pyx_L4;
2205 }
2206
2207 /* "av/codec/codec.pyx":174
2208 * self.ptr = lib.avcodec_find_encoder(self.desc.id)
2209 *
2210 * elif mode == 'r': # <<<<<<<<<<<<<<
2211 * self.ptr = lib.avcodec_find_decoder_by_name(name)
2212 * if not self.ptr:
2213 */
2214 __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 174, __pyx_L1_error)
2215 if (likely(__pyx_t_2)) {
2216
2217 /* "av/codec/codec.pyx":175
2218 *
2219 * elif mode == 'r':
2220 * self.ptr = lib.avcodec_find_decoder_by_name(name) # <<<<<<<<<<<<<<
2221 * if not self.ptr:
2222 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2223 */
2224 __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
2225 __pyx_v_self->ptr = avcodec_find_decoder_by_name(__pyx_t_3);
2226
2227 /* "av/codec/codec.pyx":176
2228 * elif mode == 'r':
2229 * self.ptr = lib.avcodec_find_decoder_by_name(name)
2230 * if not self.ptr: # <<<<<<<<<<<<<<
2231 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2232 * if self.desc:
2233 */
2234 __pyx_t_2 = ((!(__pyx_v_self->ptr != 0)) != 0);
2235 if (__pyx_t_2) {
2236
2237 /* "av/codec/codec.pyx":177
2238 * self.ptr = lib.avcodec_find_decoder_by_name(name)
2239 * if not self.ptr:
2240 * self.desc = lib.avcodec_descriptor_get_by_name(name) # <<<<<<<<<<<<<<
2241 * if self.desc:
2242 * self.ptr = lib.avcodec_find_decoder(self.desc.id)
2243 */
2244 __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error)
2245 __pyx_v_self->desc = avcodec_descriptor_get_by_name(__pyx_t_3);
2246
2247 /* "av/codec/codec.pyx":178
2248 * if not self.ptr:
2249 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2250 * if self.desc: # <<<<<<<<<<<<<<
2251 * self.ptr = lib.avcodec_find_decoder(self.desc.id)
2252 *
2253 */
2254 __pyx_t_2 = (__pyx_v_self->desc != 0);
2255 if (__pyx_t_2) {
2256
2257 /* "av/codec/codec.pyx":179
2258 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2259 * if self.desc:
2260 * self.ptr = lib.avcodec_find_decoder(self.desc.id) # <<<<<<<<<<<<<<
2261 *
2262 * else:
2263 */
2264 __pyx_v_self->ptr = avcodec_find_decoder(__pyx_v_self->desc->id);
2265
2266 /* "av/codec/codec.pyx":178
2267 * if not self.ptr:
2268 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2269 * if self.desc: # <<<<<<<<<<<<<<
2270 * self.ptr = lib.avcodec_find_decoder(self.desc.id)
2271 *
2272 */
2273 }
2274
2275 /* "av/codec/codec.pyx":176
2276 * elif mode == 'r':
2277 * self.ptr = lib.avcodec_find_decoder_by_name(name)
2278 * if not self.ptr: # <<<<<<<<<<<<<<
2279 * self.desc = lib.avcodec_descriptor_get_by_name(name)
2280 * if self.desc:
2281 */
2282 }
2283
2284 /* "av/codec/codec.pyx":174
2285 * self.ptr = lib.avcodec_find_encoder(self.desc.id)
2286 *
2287 * elif mode == 'r': # <<<<<<<<<<<<<<
2288 * self.ptr = lib.avcodec_find_decoder_by_name(name)
2289 * if not self.ptr:
2290 */
2291 goto __pyx_L4;
2292 }
2293
2294 /* "av/codec/codec.pyx":182
2295 *
2296 * else:
2297 * raise ValueError('Invalid mode; must be "r" or "w".', mode) # <<<<<<<<<<<<<<
2298 *
2299 * self._init(name)
2300 */
2301 /*else*/ {
2302 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
2303 __Pyx_GOTREF(__pyx_t_4);
2304 __Pyx_INCREF(__pyx_kp_s_Invalid_mode_must_be_r_or_w);
2305 __Pyx_GIVEREF(__pyx_kp_s_Invalid_mode_must_be_r_or_w);
2306 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_Invalid_mode_must_be_r_or_w);
2307 __Pyx_INCREF(__pyx_v_mode);
2308 __Pyx_GIVEREF(__pyx_v_mode);
2309 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_mode);
2310 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error)
2311 __Pyx_GOTREF(__pyx_t_5);
2312 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2313 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
2314 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2315 __PYX_ERR(0, 182, __pyx_L1_error)
2316 }
2317 __pyx_L4:;
2318
2319 /* "av/codec/codec.pyx":184
2320 * raise ValueError('Invalid mode; must be "r" or "w".', mode)
2321 *
2322 * self._init(name) # <<<<<<<<<<<<<<
2323 *
2324 * # Sanity check.
2325 */
2326 __pyx_t_6.__pyx_n = 1;
2327 __pyx_t_6.name = __pyx_v_name;
2328 __pyx_t_5 = ((struct __pyx_vtabstruct_2av_5codec_5codec_Codec *)__pyx_v_self->__pyx_vtab)->_init(__pyx_v_self, &__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
2329 __Pyx_GOTREF(__pyx_t_5);
2330 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2331
2332 /* "av/codec/codec.pyx":187
2333 *
2334 * # Sanity check.
2335 * if (mode == 'w') != self.is_encoder: # <<<<<<<<<<<<<<
2336 * raise RuntimeError("Found codec does not match mode.", name, mode)
2337 *
2338 */
2339 __pyx_t_5 = PyObject_RichCompare(__pyx_v_mode, __pyx_n_s_w, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error)
2340 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->is_encoder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
2341 __Pyx_GOTREF(__pyx_t_4);
2342 __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __pyx_L1_error)
2343 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2344 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2345 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
2346 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2347 if (unlikely(__pyx_t_2)) {
2348
2349 /* "av/codec/codec.pyx":188
2350 * # Sanity check.
2351 * if (mode == 'w') != self.is_encoder:
2352 * raise RuntimeError("Found codec does not match mode.", name, mode) # <<<<<<<<<<<<<<
2353 *
2354 * cdef _init(self, name=None):
2355 */
2356 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error)
2357 __Pyx_GOTREF(__pyx_t_7);
2358 __Pyx_INCREF(__pyx_kp_s_Found_codec_does_not_match_mode);
2359 __Pyx_GIVEREF(__pyx_kp_s_Found_codec_does_not_match_mode);
2360 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_Found_codec_does_not_match_mode);
2361 __Pyx_INCREF(__pyx_v_name);
2362 __Pyx_GIVEREF(__pyx_v_name);
2363 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_name);
2364 __Pyx_INCREF(__pyx_v_mode);
2365 __Pyx_GIVEREF(__pyx_v_mode);
2366 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_mode);
2367 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
2368 __Pyx_GOTREF(__pyx_t_4);
2369 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2370 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
2371 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2372 __PYX_ERR(0, 188, __pyx_L1_error)
2373
2374 /* "av/codec/codec.pyx":187
2375 *
2376 * # Sanity check.
2377 * if (mode == 'w') != self.is_encoder: # <<<<<<<<<<<<<<
2378 * raise RuntimeError("Found codec does not match mode.", name, mode)
2379 *
2380 */
2381 }
2382
2383 /* "av/codec/codec.pyx":162
2384 * """
2385 *
2386 * def __cinit__(self, name, mode='r'): # <<<<<<<<<<<<<<
2387 *
2388 * if name is _cinit_sentinel:
2389 */
2390
2391 /* function exit code */
2392 __pyx_r = 0;
2393 goto __pyx_L0;
2394 __pyx_L1_error:;
2395 __Pyx_XDECREF(__pyx_t_4);
2396 __Pyx_XDECREF(__pyx_t_5);
2397 __Pyx_XDECREF(__pyx_t_7);
2398 __Pyx_AddTraceback("av.codec.codec.Codec.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2399 __pyx_r = -1;
2400 __pyx_L0:;
2401 __Pyx_RefNannyFinishContext();
2402 return __pyx_r;
2403 }
2404
2405 /* "av/codec/codec.pyx":190
2406 * raise RuntimeError("Found codec does not match mode.", name, mode)
2407 *
2408 * cdef _init(self, name=None): # <<<<<<<<<<<<<<
2409 *
2410 * if not self.ptr:
2411 */
2412
__pyx_f_2av_5codec_5codec_5Codec__init(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self,struct __pyx_opt_args_2av_5codec_5codec_5Codec__init * __pyx_optional_args)2413 static PyObject *__pyx_f_2av_5codec_5codec_5Codec__init(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self, struct __pyx_opt_args_2av_5codec_5codec_5Codec__init *__pyx_optional_args) {
2414 PyObject *__pyx_v_name = ((PyObject *)Py_None);
2415 PyObject *__pyx_r = NULL;
2416 __Pyx_RefNannyDeclarations
2417 int __pyx_t_1;
2418 PyObject *__pyx_t_2 = NULL;
2419 PyObject *__pyx_t_3 = NULL;
2420 PyObject *__pyx_t_4 = NULL;
2421 int __pyx_t_5;
2422 int __pyx_lineno = 0;
2423 const char *__pyx_filename = NULL;
2424 int __pyx_clineno = 0;
2425 __Pyx_RefNannySetupContext("_init", 0);
2426 if (__pyx_optional_args) {
2427 if (__pyx_optional_args->__pyx_n > 0) {
2428 __pyx_v_name = __pyx_optional_args->name;
2429 }
2430 }
2431
2432 /* "av/codec/codec.pyx":192
2433 * cdef _init(self, name=None):
2434 *
2435 * if not self.ptr: # <<<<<<<<<<<<<<
2436 * raise UnknownCodecError(name)
2437 *
2438 */
2439 __pyx_t_1 = ((!(__pyx_v_self->ptr != 0)) != 0);
2440 if (unlikely(__pyx_t_1)) {
2441
2442 /* "av/codec/codec.pyx":193
2443 *
2444 * if not self.ptr:
2445 * raise UnknownCodecError(name) # <<<<<<<<<<<<<<
2446 *
2447 * if not self.desc:
2448 */
2449 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UnknownCodecError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
2450 __Pyx_GOTREF(__pyx_t_3);
2451 __pyx_t_4 = NULL;
2452 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2453 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2454 if (likely(__pyx_t_4)) {
2455 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2456 __Pyx_INCREF(__pyx_t_4);
2457 __Pyx_INCREF(function);
2458 __Pyx_DECREF_SET(__pyx_t_3, function);
2459 }
2460 }
2461 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name);
2462 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2463 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
2464 __Pyx_GOTREF(__pyx_t_2);
2465 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2466 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
2467 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2468 __PYX_ERR(0, 193, __pyx_L1_error)
2469
2470 /* "av/codec/codec.pyx":192
2471 * cdef _init(self, name=None):
2472 *
2473 * if not self.ptr: # <<<<<<<<<<<<<<
2474 * raise UnknownCodecError(name)
2475 *
2476 */
2477 }
2478
2479 /* "av/codec/codec.pyx":195
2480 * raise UnknownCodecError(name)
2481 *
2482 * if not self.desc: # <<<<<<<<<<<<<<
2483 * self.desc = lib.avcodec_descriptor_get(self.ptr.id)
2484 * if not self.desc:
2485 */
2486 __pyx_t_1 = ((!(__pyx_v_self->desc != 0)) != 0);
2487 if (__pyx_t_1) {
2488
2489 /* "av/codec/codec.pyx":196
2490 *
2491 * if not self.desc:
2492 * self.desc = lib.avcodec_descriptor_get(self.ptr.id) # <<<<<<<<<<<<<<
2493 * if not self.desc:
2494 * raise RuntimeError('No codec descriptor for %r.' % name)
2495 */
2496 __pyx_v_self->desc = avcodec_descriptor_get(__pyx_v_self->ptr->id);
2497
2498 /* "av/codec/codec.pyx":197
2499 * if not self.desc:
2500 * self.desc = lib.avcodec_descriptor_get(self.ptr.id)
2501 * if not self.desc: # <<<<<<<<<<<<<<
2502 * raise RuntimeError('No codec descriptor for %r.' % name)
2503 *
2504 */
2505 __pyx_t_1 = ((!(__pyx_v_self->desc != 0)) != 0);
2506 if (unlikely(__pyx_t_1)) {
2507
2508 /* "av/codec/codec.pyx":198
2509 * self.desc = lib.avcodec_descriptor_get(self.ptr.id)
2510 * if not self.desc:
2511 * raise RuntimeError('No codec descriptor for %r.' % name) # <<<<<<<<<<<<<<
2512 *
2513 * self.is_encoder = lib.av_codec_is_encoder(self.ptr)
2514 */
2515 __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_No_codec_descriptor_for_r, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
2516 __Pyx_GOTREF(__pyx_t_2);
2517 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
2518 __Pyx_GOTREF(__pyx_t_3);
2519 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2520 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2521 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2522 __PYX_ERR(0, 198, __pyx_L1_error)
2523
2524 /* "av/codec/codec.pyx":197
2525 * if not self.desc:
2526 * self.desc = lib.avcodec_descriptor_get(self.ptr.id)
2527 * if not self.desc: # <<<<<<<<<<<<<<
2528 * raise RuntimeError('No codec descriptor for %r.' % name)
2529 *
2530 */
2531 }
2532
2533 /* "av/codec/codec.pyx":195
2534 * raise UnknownCodecError(name)
2535 *
2536 * if not self.desc: # <<<<<<<<<<<<<<
2537 * self.desc = lib.avcodec_descriptor_get(self.ptr.id)
2538 * if not self.desc:
2539 */
2540 }
2541
2542 /* "av/codec/codec.pyx":200
2543 * raise RuntimeError('No codec descriptor for %r.' % name)
2544 *
2545 * self.is_encoder = lib.av_codec_is_encoder(self.ptr) # <<<<<<<<<<<<<<
2546 *
2547 * # Sanity check.
2548 */
2549 __pyx_v_self->is_encoder = av_codec_is_encoder(__pyx_v_self->ptr);
2550
2551 /* "av/codec/codec.pyx":203
2552 *
2553 * # Sanity check.
2554 * if self.is_encoder and lib.av_codec_is_decoder(self.ptr): # <<<<<<<<<<<<<<
2555 * raise RuntimeError('%s is both encoder and decoder.')
2556 *
2557 */
2558 __pyx_t_5 = (__pyx_v_self->is_encoder != 0);
2559 if (__pyx_t_5) {
2560 } else {
2561 __pyx_t_1 = __pyx_t_5;
2562 goto __pyx_L7_bool_binop_done;
2563 }
2564 __pyx_t_5 = (av_codec_is_decoder(__pyx_v_self->ptr) != 0);
2565 __pyx_t_1 = __pyx_t_5;
2566 __pyx_L7_bool_binop_done:;
2567 if (unlikely(__pyx_t_1)) {
2568
2569 /* "av/codec/codec.pyx":204
2570 * # Sanity check.
2571 * if self.is_encoder and lib.av_codec_is_decoder(self.ptr):
2572 * raise RuntimeError('%s is both encoder and decoder.') # <<<<<<<<<<<<<<
2573 *
2574 * def create(self):
2575 */
2576 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
2577 __Pyx_GOTREF(__pyx_t_3);
2578 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2579 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2580 __PYX_ERR(0, 204, __pyx_L1_error)
2581
2582 /* "av/codec/codec.pyx":203
2583 *
2584 * # Sanity check.
2585 * if self.is_encoder and lib.av_codec_is_decoder(self.ptr): # <<<<<<<<<<<<<<
2586 * raise RuntimeError('%s is both encoder and decoder.')
2587 *
2588 */
2589 }
2590
2591 /* "av/codec/codec.pyx":190
2592 * raise RuntimeError("Found codec does not match mode.", name, mode)
2593 *
2594 * cdef _init(self, name=None): # <<<<<<<<<<<<<<
2595 *
2596 * if not self.ptr:
2597 */
2598
2599 /* function exit code */
2600 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2601 goto __pyx_L0;
2602 __pyx_L1_error:;
2603 __Pyx_XDECREF(__pyx_t_2);
2604 __Pyx_XDECREF(__pyx_t_3);
2605 __Pyx_XDECREF(__pyx_t_4);
2606 __Pyx_AddTraceback("av.codec.codec.Codec._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
2607 __pyx_r = 0;
2608 __pyx_L0:;
2609 __Pyx_XGIVEREF(__pyx_r);
2610 __Pyx_RefNannyFinishContext();
2611 return __pyx_r;
2612 }
2613
2614 /* "av/codec/codec.pyx":206
2615 * raise RuntimeError('%s is both encoder and decoder.')
2616 *
2617 * def create(self): # <<<<<<<<<<<<<<
2618 * """Create a :class:`.CodecContext` for this codec."""
2619 * from .context import CodecContext
2620 */
2621
2622 /* Python wrapper */
2623 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_3create(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2624 static char __pyx_doc_2av_5codec_5codec_5Codec_2create[] = "Codec.create()\nCreate a :class:`.CodecContext` for this codec.";
__pyx_pw_2av_5codec_5codec_5Codec_3create(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)2625 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_3create(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2626 PyObject *__pyx_r = 0;
2627 __Pyx_RefNannyDeclarations
2628 __Pyx_RefNannySetupContext("create (wrapper)", 0);
2629 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_2create(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
2630
2631 /* function exit code */
2632 __Pyx_RefNannyFinishContext();
2633 return __pyx_r;
2634 }
2635
__pyx_pf_2av_5codec_5codec_5Codec_2create(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)2636 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_2create(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
2637 PyObject *__pyx_v_CodecContext = NULL;
2638 PyObject *__pyx_r = NULL;
2639 __Pyx_RefNannyDeclarations
2640 PyObject *__pyx_t_1 = NULL;
2641 PyObject *__pyx_t_2 = NULL;
2642 PyObject *__pyx_t_3 = NULL;
2643 int __pyx_lineno = 0;
2644 const char *__pyx_filename = NULL;
2645 int __pyx_clineno = 0;
2646 __Pyx_RefNannySetupContext("create", 0);
2647
2648 /* "av/codec/codec.pyx":208
2649 * def create(self):
2650 * """Create a :class:`.CodecContext` for this codec."""
2651 * from .context import CodecContext # <<<<<<<<<<<<<<
2652 * return CodecContext.create(self)
2653 *
2654 */
2655 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
2656 __Pyx_GOTREF(__pyx_t_1);
2657 __Pyx_INCREF(__pyx_n_s_CodecContext);
2658 __Pyx_GIVEREF(__pyx_n_s_CodecContext);
2659 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_CodecContext);
2660 __pyx_t_2 = __Pyx_Import(__pyx_n_s_context, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
2661 __Pyx_GOTREF(__pyx_t_2);
2662 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2663 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CodecContext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
2664 __Pyx_GOTREF(__pyx_t_1);
2665 __Pyx_INCREF(__pyx_t_1);
2666 __pyx_v_CodecContext = __pyx_t_1;
2667 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2668 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2669
2670 /* "av/codec/codec.pyx":209
2671 * """Create a :class:`.CodecContext` for this codec."""
2672 * from .context import CodecContext
2673 * return CodecContext.create(self) # <<<<<<<<<<<<<<
2674 *
2675 * property is_decoder:
2676 */
2677 __Pyx_XDECREF(__pyx_r);
2678 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_CodecContext, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
2679 __Pyx_GOTREF(__pyx_t_1);
2680 __pyx_t_3 = NULL;
2681 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
2682 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
2683 if (likely(__pyx_t_3)) {
2684 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
2685 __Pyx_INCREF(__pyx_t_3);
2686 __Pyx_INCREF(function);
2687 __Pyx_DECREF_SET(__pyx_t_1, function);
2688 }
2689 }
2690 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_self));
2691 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2692 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
2693 __Pyx_GOTREF(__pyx_t_2);
2694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2695 __pyx_r = __pyx_t_2;
2696 __pyx_t_2 = 0;
2697 goto __pyx_L0;
2698
2699 /* "av/codec/codec.pyx":206
2700 * raise RuntimeError('%s is both encoder and decoder.')
2701 *
2702 * def create(self): # <<<<<<<<<<<<<<
2703 * """Create a :class:`.CodecContext` for this codec."""
2704 * from .context import CodecContext
2705 */
2706
2707 /* function exit code */
2708 __pyx_L1_error:;
2709 __Pyx_XDECREF(__pyx_t_1);
2710 __Pyx_XDECREF(__pyx_t_2);
2711 __Pyx_XDECREF(__pyx_t_3);
2712 __Pyx_AddTraceback("av.codec.codec.Codec.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
2713 __pyx_r = NULL;
2714 __pyx_L0:;
2715 __Pyx_XDECREF(__pyx_v_CodecContext);
2716 __Pyx_XGIVEREF(__pyx_r);
2717 __Pyx_RefNannyFinishContext();
2718 return __pyx_r;
2719 }
2720
2721 /* "av/codec/codec.pyx":212
2722 *
2723 * property is_decoder:
2724 * def __get__(self): # <<<<<<<<<<<<<<
2725 * return not self.is_encoder
2726 *
2727 */
2728
2729 /* Python wrapper */
2730 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_10is_decoder_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_10is_decoder_1__get__(PyObject * __pyx_v_self)2731 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_10is_decoder_1__get__(PyObject *__pyx_v_self) {
2732 PyObject *__pyx_r = 0;
2733 __Pyx_RefNannyDeclarations
2734 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2735 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_10is_decoder___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
2736
2737 /* function exit code */
2738 __Pyx_RefNannyFinishContext();
2739 return __pyx_r;
2740 }
2741
__pyx_pf_2av_5codec_5codec_5Codec_10is_decoder___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)2742 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_10is_decoder___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
2743 PyObject *__pyx_r = NULL;
2744 __Pyx_RefNannyDeclarations
2745 PyObject *__pyx_t_1 = NULL;
2746 int __pyx_lineno = 0;
2747 const char *__pyx_filename = NULL;
2748 int __pyx_clineno = 0;
2749 __Pyx_RefNannySetupContext("__get__", 0);
2750
2751 /* "av/codec/codec.pyx":213
2752 * property is_decoder:
2753 * def __get__(self):
2754 * return not self.is_encoder # <<<<<<<<<<<<<<
2755 *
2756 * property descriptor:
2757 */
2758 __Pyx_XDECREF(__pyx_r);
2759 __pyx_t_1 = __Pyx_PyBool_FromLong((!(__pyx_v_self->is_encoder != 0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
2760 __Pyx_GOTREF(__pyx_t_1);
2761 __pyx_r = __pyx_t_1;
2762 __pyx_t_1 = 0;
2763 goto __pyx_L0;
2764
2765 /* "av/codec/codec.pyx":212
2766 *
2767 * property is_decoder:
2768 * def __get__(self): # <<<<<<<<<<<<<<
2769 * return not self.is_encoder
2770 *
2771 */
2772
2773 /* function exit code */
2774 __pyx_L1_error:;
2775 __Pyx_XDECREF(__pyx_t_1);
2776 __Pyx_AddTraceback("av.codec.codec.Codec.is_decoder.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2777 __pyx_r = NULL;
2778 __pyx_L0:;
2779 __Pyx_XGIVEREF(__pyx_r);
2780 __Pyx_RefNannyFinishContext();
2781 return __pyx_r;
2782 }
2783
2784 /* "av/codec/codec.pyx":216
2785 *
2786 * property descriptor:
2787 * def __get__(self): return wrap_avclass(self.ptr.priv_class) # <<<<<<<<<<<<<<
2788 *
2789 * property name:
2790 */
2791
2792 /* Python wrapper */
2793 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_10descriptor_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_10descriptor_1__get__(PyObject * __pyx_v_self)2794 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_10descriptor_1__get__(PyObject *__pyx_v_self) {
2795 PyObject *__pyx_r = 0;
2796 __Pyx_RefNannyDeclarations
2797 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2798 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_10descriptor___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
2799
2800 /* function exit code */
2801 __Pyx_RefNannyFinishContext();
2802 return __pyx_r;
2803 }
2804
__pyx_pf_2av_5codec_5codec_5Codec_10descriptor___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)2805 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_10descriptor___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
2806 PyObject *__pyx_r = NULL;
2807 __Pyx_RefNannyDeclarations
2808 PyObject *__pyx_t_1 = NULL;
2809 int __pyx_lineno = 0;
2810 const char *__pyx_filename = NULL;
2811 int __pyx_clineno = 0;
2812 __Pyx_RefNannySetupContext("__get__", 0);
2813 __Pyx_XDECREF(__pyx_r);
2814 __pyx_t_1 = ((PyObject *)__pyx_f_2av_10descriptor_wrap_avclass(__pyx_v_self->ptr->priv_class)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
2815 __Pyx_GOTREF(__pyx_t_1);
2816 __pyx_r = __pyx_t_1;
2817 __pyx_t_1 = 0;
2818 goto __pyx_L0;
2819
2820 /* function exit code */
2821 __pyx_L1_error:;
2822 __Pyx_XDECREF(__pyx_t_1);
2823 __Pyx_AddTraceback("av.codec.codec.Codec.descriptor.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2824 __pyx_r = NULL;
2825 __pyx_L0:;
2826 __Pyx_XGIVEREF(__pyx_r);
2827 __Pyx_RefNannyFinishContext();
2828 return __pyx_r;
2829 }
2830
2831 /* "av/codec/codec.pyx":219
2832 *
2833 * property name:
2834 * def __get__(self): return self.ptr.name or '' # <<<<<<<<<<<<<<
2835 * property long_name:
2836 * def __get__(self): return self.ptr.long_name or ''
2837 */
2838
2839 /* Python wrapper */
2840 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_4name_1__get__(PyObject * __pyx_v_self)2841 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_4name_1__get__(PyObject *__pyx_v_self) {
2842 PyObject *__pyx_r = 0;
2843 __Pyx_RefNannyDeclarations
2844 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2845 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_4name___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
2846
2847 /* function exit code */
2848 __Pyx_RefNannyFinishContext();
2849 return __pyx_r;
2850 }
2851
__pyx_pf_2av_5codec_5codec_5Codec_4name___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)2852 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_4name___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
2853 PyObject *__pyx_r = NULL;
2854 __Pyx_RefNannyDeclarations
2855 PyObject *__pyx_t_1 = NULL;
2856 PyObject *__pyx_t_2 = NULL;
2857 int __pyx_lineno = 0;
2858 const char *__pyx_filename = NULL;
2859 int __pyx_clineno = 0;
2860 __Pyx_RefNannySetupContext("__get__", 0);
2861 __Pyx_XDECREF(__pyx_r);
2862 if (!__pyx_v_self->ptr->name) {
2863 } else {
2864 __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_self->ptr->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
2865 __Pyx_GOTREF(__pyx_t_2);
2866 __pyx_t_1 = __pyx_t_2;
2867 __pyx_t_2 = 0;
2868 goto __pyx_L3_bool_binop_done;
2869 }
2870 __Pyx_INCREF(__pyx_kp_s__2);
2871 __pyx_t_1 = __pyx_kp_s__2;
2872 __pyx_L3_bool_binop_done:;
2873 __pyx_r = __pyx_t_1;
2874 __pyx_t_1 = 0;
2875 goto __pyx_L0;
2876
2877 /* function exit code */
2878 __pyx_L1_error:;
2879 __Pyx_XDECREF(__pyx_t_1);
2880 __Pyx_XDECREF(__pyx_t_2);
2881 __Pyx_AddTraceback("av.codec.codec.Codec.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2882 __pyx_r = NULL;
2883 __pyx_L0:;
2884 __Pyx_XGIVEREF(__pyx_r);
2885 __Pyx_RefNannyFinishContext();
2886 return __pyx_r;
2887 }
2888
2889 /* "av/codec/codec.pyx":221
2890 * def __get__(self): return self.ptr.name or ''
2891 * property long_name:
2892 * def __get__(self): return self.ptr.long_name or '' # <<<<<<<<<<<<<<
2893 *
2894 * @property
2895 */
2896
2897 /* Python wrapper */
2898 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_9long_name_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_9long_name_1__get__(PyObject * __pyx_v_self)2899 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_9long_name_1__get__(PyObject *__pyx_v_self) {
2900 PyObject *__pyx_r = 0;
2901 __Pyx_RefNannyDeclarations
2902 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2903 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_9long_name___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
2904
2905 /* function exit code */
2906 __Pyx_RefNannyFinishContext();
2907 return __pyx_r;
2908 }
2909
__pyx_pf_2av_5codec_5codec_5Codec_9long_name___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)2910 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_9long_name___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
2911 PyObject *__pyx_r = NULL;
2912 __Pyx_RefNannyDeclarations
2913 PyObject *__pyx_t_1 = NULL;
2914 PyObject *__pyx_t_2 = NULL;
2915 int __pyx_lineno = 0;
2916 const char *__pyx_filename = NULL;
2917 int __pyx_clineno = 0;
2918 __Pyx_RefNannySetupContext("__get__", 0);
2919 __Pyx_XDECREF(__pyx_r);
2920 if (!__pyx_v_self->ptr->long_name) {
2921 } else {
2922 __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_self->ptr->long_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
2923 __Pyx_GOTREF(__pyx_t_2);
2924 __pyx_t_1 = __pyx_t_2;
2925 __pyx_t_2 = 0;
2926 goto __pyx_L3_bool_binop_done;
2927 }
2928 __Pyx_INCREF(__pyx_kp_s__2);
2929 __pyx_t_1 = __pyx_kp_s__2;
2930 __pyx_L3_bool_binop_done:;
2931 __pyx_r = __pyx_t_1;
2932 __pyx_t_1 = 0;
2933 goto __pyx_L0;
2934
2935 /* function exit code */
2936 __pyx_L1_error:;
2937 __Pyx_XDECREF(__pyx_t_1);
2938 __Pyx_XDECREF(__pyx_t_2);
2939 __Pyx_AddTraceback("av.codec.codec.Codec.long_name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2940 __pyx_r = NULL;
2941 __pyx_L0:;
2942 __Pyx_XGIVEREF(__pyx_r);
2943 __Pyx_RefNannyFinishContext();
2944 return __pyx_r;
2945 }
2946
2947 /* "av/codec/codec.pyx":224
2948 *
2949 * @property
2950 * def type(self): # <<<<<<<<<<<<<<
2951 * """
2952 * The media type of this codec.
2953 */
2954
2955 /* Python wrapper */
2956 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_4type_1__get__(PyObject * __pyx_v_self)2957 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_4type_1__get__(PyObject *__pyx_v_self) {
2958 PyObject *__pyx_r = 0;
2959 __Pyx_RefNannyDeclarations
2960 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2961 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_4type___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
2962
2963 /* function exit code */
2964 __Pyx_RefNannyFinishContext();
2965 return __pyx_r;
2966 }
2967
__pyx_pf_2av_5codec_5codec_5Codec_4type___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)2968 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_4type___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
2969 PyObject *__pyx_r = NULL;
2970 __Pyx_RefNannyDeclarations
2971 PyObject *__pyx_t_1 = NULL;
2972 int __pyx_lineno = 0;
2973 const char *__pyx_filename = NULL;
2974 int __pyx_clineno = 0;
2975 __Pyx_RefNannySetupContext("__get__", 0);
2976
2977 /* "av/codec/codec.pyx":231
2978 *
2979 * """
2980 * return lib.av_get_media_type_string(self.ptr.type) # <<<<<<<<<<<<<<
2981 *
2982 * property id:
2983 */
2984 __Pyx_XDECREF(__pyx_r);
2985 __pyx_t_1 = __Pyx_PyStr_FromString(av_get_media_type_string(__pyx_v_self->ptr->type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
2986 __Pyx_GOTREF(__pyx_t_1);
2987 __pyx_r = __pyx_t_1;
2988 __pyx_t_1 = 0;
2989 goto __pyx_L0;
2990
2991 /* "av/codec/codec.pyx":224
2992 *
2993 * @property
2994 * def type(self): # <<<<<<<<<<<<<<
2995 * """
2996 * The media type of this codec.
2997 */
2998
2999 /* function exit code */
3000 __pyx_L1_error:;
3001 __Pyx_XDECREF(__pyx_t_1);
3002 __Pyx_AddTraceback("av.codec.codec.Codec.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3003 __pyx_r = NULL;
3004 __pyx_L0:;
3005 __Pyx_XGIVEREF(__pyx_r);
3006 __Pyx_RefNannyFinishContext();
3007 return __pyx_r;
3008 }
3009
3010 /* "av/codec/codec.pyx":234
3011 *
3012 * property id:
3013 * def __get__(self): return self.ptr.id # <<<<<<<<<<<<<<
3014 *
3015 * @property
3016 */
3017
3018 /* Python wrapper */
3019 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_2id_1__get__(PyObject * __pyx_v_self)3020 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_2id_1__get__(PyObject *__pyx_v_self) {
3021 PyObject *__pyx_r = 0;
3022 __Pyx_RefNannyDeclarations
3023 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3024 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_2id___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
3025
3026 /* function exit code */
3027 __Pyx_RefNannyFinishContext();
3028 return __pyx_r;
3029 }
3030
__pyx_pf_2av_5codec_5codec_5Codec_2id___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)3031 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_2id___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
3032 PyObject *__pyx_r = NULL;
3033 __Pyx_RefNannyDeclarations
3034 PyObject *__pyx_t_1 = NULL;
3035 int __pyx_lineno = 0;
3036 const char *__pyx_filename = NULL;
3037 int __pyx_clineno = 0;
3038 __Pyx_RefNannySetupContext("__get__", 0);
3039 __Pyx_XDECREF(__pyx_r);
3040 __pyx_t_1 = __Pyx_PyInt_From_enum__AVCodecID(__pyx_v_self->ptr->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
3041 __Pyx_GOTREF(__pyx_t_1);
3042 __pyx_r = __pyx_t_1;
3043 __pyx_t_1 = 0;
3044 goto __pyx_L0;
3045
3046 /* function exit code */
3047 __pyx_L1_error:;
3048 __Pyx_XDECREF(__pyx_t_1);
3049 __Pyx_AddTraceback("av.codec.codec.Codec.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3050 __pyx_r = NULL;
3051 __pyx_L0:;
3052 __Pyx_XGIVEREF(__pyx_r);
3053 __Pyx_RefNannyFinishContext();
3054 return __pyx_r;
3055 }
3056
3057 /* "av/codec/codec.pyx":237
3058 *
3059 * @property
3060 * def frame_rates(self): # <<<<<<<<<<<<<<
3061 * """A list of supported frame rates (:class:`fractions.Fraction`), or ``None``."""
3062 * if not self.ptr.supported_framerates:
3063 */
3064
3065 /* Python wrapper */
3066 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_11frame_rates_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_11frame_rates_1__get__(PyObject * __pyx_v_self)3067 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_11frame_rates_1__get__(PyObject *__pyx_v_self) {
3068 PyObject *__pyx_r = 0;
3069 __Pyx_RefNannyDeclarations
3070 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3071 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_11frame_rates___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
3072
3073 /* function exit code */
3074 __Pyx_RefNannyFinishContext();
3075 return __pyx_r;
3076 }
3077
__pyx_pf_2av_5codec_5codec_5Codec_11frame_rates___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)3078 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_11frame_rates___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
3079 PyObject *__pyx_v_ret = NULL;
3080 int __pyx_v_i;
3081 PyObject *__pyx_r = NULL;
3082 __Pyx_RefNannyDeclarations
3083 int __pyx_t_1;
3084 PyObject *__pyx_t_2 = NULL;
3085 PyObject *__pyx_t_3 = NULL;
3086 int __pyx_t_4;
3087 int __pyx_lineno = 0;
3088 const char *__pyx_filename = NULL;
3089 int __pyx_clineno = 0;
3090 __Pyx_RefNannySetupContext("__get__", 0);
3091
3092 /* "av/codec/codec.pyx":239
3093 * def frame_rates(self):
3094 * """A list of supported frame rates (:class:`fractions.Fraction`), or ``None``."""
3095 * if not self.ptr.supported_framerates: # <<<<<<<<<<<<<<
3096 * return
3097 *
3098 */
3099 __pyx_t_1 = ((!(__pyx_v_self->ptr->supported_framerates != 0)) != 0);
3100 if (__pyx_t_1) {
3101
3102 /* "av/codec/codec.pyx":240
3103 * """A list of supported frame rates (:class:`fractions.Fraction`), or ``None``."""
3104 * if not self.ptr.supported_framerates:
3105 * return # <<<<<<<<<<<<<<
3106 *
3107 * ret = []
3108 */
3109 __Pyx_XDECREF(__pyx_r);
3110 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3111 goto __pyx_L0;
3112
3113 /* "av/codec/codec.pyx":239
3114 * def frame_rates(self):
3115 * """A list of supported frame rates (:class:`fractions.Fraction`), or ``None``."""
3116 * if not self.ptr.supported_framerates: # <<<<<<<<<<<<<<
3117 * return
3118 *
3119 */
3120 }
3121
3122 /* "av/codec/codec.pyx":242
3123 * return
3124 *
3125 * ret = [] # <<<<<<<<<<<<<<
3126 * cdef int i = 0
3127 * while self.ptr.supported_framerates[i].denum:
3128 */
3129 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
3130 __Pyx_GOTREF(__pyx_t_2);
3131 __pyx_v_ret = ((PyObject*)__pyx_t_2);
3132 __pyx_t_2 = 0;
3133
3134 /* "av/codec/codec.pyx":243
3135 *
3136 * ret = []
3137 * cdef int i = 0 # <<<<<<<<<<<<<<
3138 * while self.ptr.supported_framerates[i].denum:
3139 * ret.append(avrational_to_fraction(&self.ptr.supported_framerates[i]))
3140 */
3141 __pyx_v_i = 0;
3142
3143 /* "av/codec/codec.pyx":244
3144 * ret = []
3145 * cdef int i = 0
3146 * while self.ptr.supported_framerates[i].denum: # <<<<<<<<<<<<<<
3147 * ret.append(avrational_to_fraction(&self.ptr.supported_framerates[i]))
3148 * i += 1
3149 */
3150 while (1) {
3151 __pyx_t_2 = __pyx_convert__to_py_AVRational((__pyx_v_self->ptr->supported_framerates[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
3152 __Pyx_GOTREF(__pyx_t_2);
3153 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_denum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
3154 __Pyx_GOTREF(__pyx_t_3);
3155 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3156 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
3157 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3158 if (!__pyx_t_1) break;
3159
3160 /* "av/codec/codec.pyx":245
3161 * cdef int i = 0
3162 * while self.ptr.supported_framerates[i].denum:
3163 * ret.append(avrational_to_fraction(&self.ptr.supported_framerates[i])) # <<<<<<<<<<<<<<
3164 * i += 1
3165 * return ret
3166 */
3167 __pyx_t_3 = __pyx_f_2av_5utils_avrational_to_fraction((&(__pyx_v_self->ptr->supported_framerates[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
3168 __Pyx_GOTREF(__pyx_t_3);
3169 __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 245, __pyx_L1_error)
3170 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3171
3172 /* "av/codec/codec.pyx":246
3173 * while self.ptr.supported_framerates[i].denum:
3174 * ret.append(avrational_to_fraction(&self.ptr.supported_framerates[i]))
3175 * i += 1 # <<<<<<<<<<<<<<
3176 * return ret
3177 *
3178 */
3179 __pyx_v_i = (__pyx_v_i + 1);
3180 }
3181
3182 /* "av/codec/codec.pyx":247
3183 * ret.append(avrational_to_fraction(&self.ptr.supported_framerates[i]))
3184 * i += 1
3185 * return ret # <<<<<<<<<<<<<<
3186 *
3187 * @property
3188 */
3189 __Pyx_XDECREF(__pyx_r);
3190 __Pyx_INCREF(__pyx_v_ret);
3191 __pyx_r = __pyx_v_ret;
3192 goto __pyx_L0;
3193
3194 /* "av/codec/codec.pyx":237
3195 *
3196 * @property
3197 * def frame_rates(self): # <<<<<<<<<<<<<<
3198 * """A list of supported frame rates (:class:`fractions.Fraction`), or ``None``."""
3199 * if not self.ptr.supported_framerates:
3200 */
3201
3202 /* function exit code */
3203 __pyx_L1_error:;
3204 __Pyx_XDECREF(__pyx_t_2);
3205 __Pyx_XDECREF(__pyx_t_3);
3206 __Pyx_AddTraceback("av.codec.codec.Codec.frame_rates.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3207 __pyx_r = NULL;
3208 __pyx_L0:;
3209 __Pyx_XDECREF(__pyx_v_ret);
3210 __Pyx_XGIVEREF(__pyx_r);
3211 __Pyx_RefNannyFinishContext();
3212 return __pyx_r;
3213 }
3214
3215 /* "av/codec/codec.pyx":250
3216 *
3217 * @property
3218 * def audio_rates(self): # <<<<<<<<<<<<<<
3219 * """A list of supported audio sample rates (``int``), or ``None``."""
3220 * if not self.ptr.supported_samplerates:
3221 */
3222
3223 /* Python wrapper */
3224 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_11audio_rates_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_11audio_rates_1__get__(PyObject * __pyx_v_self)3225 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_11audio_rates_1__get__(PyObject *__pyx_v_self) {
3226 PyObject *__pyx_r = 0;
3227 __Pyx_RefNannyDeclarations
3228 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3229 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_11audio_rates___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
3230
3231 /* function exit code */
3232 __Pyx_RefNannyFinishContext();
3233 return __pyx_r;
3234 }
3235
__pyx_pf_2av_5codec_5codec_5Codec_11audio_rates___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)3236 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_11audio_rates___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
3237 PyObject *__pyx_v_ret = NULL;
3238 int __pyx_v_i;
3239 PyObject *__pyx_r = NULL;
3240 __Pyx_RefNannyDeclarations
3241 int __pyx_t_1;
3242 PyObject *__pyx_t_2 = NULL;
3243 int __pyx_t_3;
3244 int __pyx_lineno = 0;
3245 const char *__pyx_filename = NULL;
3246 int __pyx_clineno = 0;
3247 __Pyx_RefNannySetupContext("__get__", 0);
3248
3249 /* "av/codec/codec.pyx":252
3250 * def audio_rates(self):
3251 * """A list of supported audio sample rates (``int``), or ``None``."""
3252 * if not self.ptr.supported_samplerates: # <<<<<<<<<<<<<<
3253 * return
3254 *
3255 */
3256 __pyx_t_1 = ((!(__pyx_v_self->ptr->supported_samplerates != 0)) != 0);
3257 if (__pyx_t_1) {
3258
3259 /* "av/codec/codec.pyx":253
3260 * """A list of supported audio sample rates (``int``), or ``None``."""
3261 * if not self.ptr.supported_samplerates:
3262 * return # <<<<<<<<<<<<<<
3263 *
3264 * ret = []
3265 */
3266 __Pyx_XDECREF(__pyx_r);
3267 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3268 goto __pyx_L0;
3269
3270 /* "av/codec/codec.pyx":252
3271 * def audio_rates(self):
3272 * """A list of supported audio sample rates (``int``), or ``None``."""
3273 * if not self.ptr.supported_samplerates: # <<<<<<<<<<<<<<
3274 * return
3275 *
3276 */
3277 }
3278
3279 /* "av/codec/codec.pyx":255
3280 * return
3281 *
3282 * ret = [] # <<<<<<<<<<<<<<
3283 * cdef int i = 0
3284 * while self.ptr.supported_samplerates[i]:
3285 */
3286 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
3287 __Pyx_GOTREF(__pyx_t_2);
3288 __pyx_v_ret = ((PyObject*)__pyx_t_2);
3289 __pyx_t_2 = 0;
3290
3291 /* "av/codec/codec.pyx":256
3292 *
3293 * ret = []
3294 * cdef int i = 0 # <<<<<<<<<<<<<<
3295 * while self.ptr.supported_samplerates[i]:
3296 * ret.append(self.ptr.supported_samplerates[i])
3297 */
3298 __pyx_v_i = 0;
3299
3300 /* "av/codec/codec.pyx":257
3301 * ret = []
3302 * cdef int i = 0
3303 * while self.ptr.supported_samplerates[i]: # <<<<<<<<<<<<<<
3304 * ret.append(self.ptr.supported_samplerates[i])
3305 * i += 1
3306 */
3307 while (1) {
3308 __pyx_t_1 = ((__pyx_v_self->ptr->supported_samplerates[__pyx_v_i]) != 0);
3309 if (!__pyx_t_1) break;
3310
3311 /* "av/codec/codec.pyx":258
3312 * cdef int i = 0
3313 * while self.ptr.supported_samplerates[i]:
3314 * ret.append(self.ptr.supported_samplerates[i]) # <<<<<<<<<<<<<<
3315 * i += 1
3316 * return ret
3317 */
3318 __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->ptr->supported_samplerates[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
3319 __Pyx_GOTREF(__pyx_t_2);
3320 __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 258, __pyx_L1_error)
3321 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3322
3323 /* "av/codec/codec.pyx":259
3324 * while self.ptr.supported_samplerates[i]:
3325 * ret.append(self.ptr.supported_samplerates[i])
3326 * i += 1 # <<<<<<<<<<<<<<
3327 * return ret
3328 *
3329 */
3330 __pyx_v_i = (__pyx_v_i + 1);
3331 }
3332
3333 /* "av/codec/codec.pyx":260
3334 * ret.append(self.ptr.supported_samplerates[i])
3335 * i += 1
3336 * return ret # <<<<<<<<<<<<<<
3337 *
3338 * @property
3339 */
3340 __Pyx_XDECREF(__pyx_r);
3341 __Pyx_INCREF(__pyx_v_ret);
3342 __pyx_r = __pyx_v_ret;
3343 goto __pyx_L0;
3344
3345 /* "av/codec/codec.pyx":250
3346 *
3347 * @property
3348 * def audio_rates(self): # <<<<<<<<<<<<<<
3349 * """A list of supported audio sample rates (``int``), or ``None``."""
3350 * if not self.ptr.supported_samplerates:
3351 */
3352
3353 /* function exit code */
3354 __pyx_L1_error:;
3355 __Pyx_XDECREF(__pyx_t_2);
3356 __Pyx_AddTraceback("av.codec.codec.Codec.audio_rates.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3357 __pyx_r = NULL;
3358 __pyx_L0:;
3359 __Pyx_XDECREF(__pyx_v_ret);
3360 __Pyx_XGIVEREF(__pyx_r);
3361 __Pyx_RefNannyFinishContext();
3362 return __pyx_r;
3363 }
3364
3365 /* "av/codec/codec.pyx":263
3366 *
3367 * @property
3368 * def video_formats(self): # <<<<<<<<<<<<<<
3369 * """A list of supported :class:`.VideoFormat`, or ``None``."""
3370 * if not self.ptr.pix_fmts:
3371 */
3372
3373 /* Python wrapper */
3374 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_13video_formats_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_13video_formats_1__get__(PyObject * __pyx_v_self)3375 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_13video_formats_1__get__(PyObject *__pyx_v_self) {
3376 PyObject *__pyx_r = 0;
3377 __Pyx_RefNannyDeclarations
3378 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3379 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_13video_formats___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
3380
3381 /* function exit code */
3382 __Pyx_RefNannyFinishContext();
3383 return __pyx_r;
3384 }
3385
__pyx_pf_2av_5codec_5codec_5Codec_13video_formats___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)3386 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_13video_formats___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
3387 PyObject *__pyx_v_ret = NULL;
3388 int __pyx_v_i;
3389 PyObject *__pyx_r = NULL;
3390 __Pyx_RefNannyDeclarations
3391 int __pyx_t_1;
3392 PyObject *__pyx_t_2 = NULL;
3393 int __pyx_t_3;
3394 int __pyx_lineno = 0;
3395 const char *__pyx_filename = NULL;
3396 int __pyx_clineno = 0;
3397 __Pyx_RefNannySetupContext("__get__", 0);
3398
3399 /* "av/codec/codec.pyx":265
3400 * def video_formats(self):
3401 * """A list of supported :class:`.VideoFormat`, or ``None``."""
3402 * if not self.ptr.pix_fmts: # <<<<<<<<<<<<<<
3403 * return
3404 *
3405 */
3406 __pyx_t_1 = ((!(__pyx_v_self->ptr->pix_fmts != 0)) != 0);
3407 if (__pyx_t_1) {
3408
3409 /* "av/codec/codec.pyx":266
3410 * """A list of supported :class:`.VideoFormat`, or ``None``."""
3411 * if not self.ptr.pix_fmts:
3412 * return # <<<<<<<<<<<<<<
3413 *
3414 * ret = []
3415 */
3416 __Pyx_XDECREF(__pyx_r);
3417 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3418 goto __pyx_L0;
3419
3420 /* "av/codec/codec.pyx":265
3421 * def video_formats(self):
3422 * """A list of supported :class:`.VideoFormat`, or ``None``."""
3423 * if not self.ptr.pix_fmts: # <<<<<<<<<<<<<<
3424 * return
3425 *
3426 */
3427 }
3428
3429 /* "av/codec/codec.pyx":268
3430 * return
3431 *
3432 * ret = [] # <<<<<<<<<<<<<<
3433 * cdef int i = 0
3434 * while self.ptr.pix_fmts[i] != -1:
3435 */
3436 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
3437 __Pyx_GOTREF(__pyx_t_2);
3438 __pyx_v_ret = ((PyObject*)__pyx_t_2);
3439 __pyx_t_2 = 0;
3440
3441 /* "av/codec/codec.pyx":269
3442 *
3443 * ret = []
3444 * cdef int i = 0 # <<<<<<<<<<<<<<
3445 * while self.ptr.pix_fmts[i] != -1:
3446 * ret.append(get_video_format(self.ptr.pix_fmts[i], 0, 0))
3447 */
3448 __pyx_v_i = 0;
3449
3450 /* "av/codec/codec.pyx":270
3451 * ret = []
3452 * cdef int i = 0
3453 * while self.ptr.pix_fmts[i] != -1: # <<<<<<<<<<<<<<
3454 * ret.append(get_video_format(self.ptr.pix_fmts[i], 0, 0))
3455 * i += 1
3456 */
3457 while (1) {
3458 __pyx_t_1 = (((__pyx_v_self->ptr->pix_fmts[__pyx_v_i]) != -1L) != 0);
3459 if (!__pyx_t_1) break;
3460
3461 /* "av/codec/codec.pyx":271
3462 * cdef int i = 0
3463 * while self.ptr.pix_fmts[i] != -1:
3464 * ret.append(get_video_format(self.ptr.pix_fmts[i], 0, 0)) # <<<<<<<<<<<<<<
3465 * i += 1
3466 * return ret
3467 */
3468 __pyx_t_2 = ((PyObject *)__pyx_f_2av_5video_6format_get_video_format((__pyx_v_self->ptr->pix_fmts[__pyx_v_i]), 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error)
3469 __Pyx_GOTREF(__pyx_t_2);
3470 __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 271, __pyx_L1_error)
3471 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3472
3473 /* "av/codec/codec.pyx":272
3474 * while self.ptr.pix_fmts[i] != -1:
3475 * ret.append(get_video_format(self.ptr.pix_fmts[i], 0, 0))
3476 * i += 1 # <<<<<<<<<<<<<<
3477 * return ret
3478 *
3479 */
3480 __pyx_v_i = (__pyx_v_i + 1);
3481 }
3482
3483 /* "av/codec/codec.pyx":273
3484 * ret.append(get_video_format(self.ptr.pix_fmts[i], 0, 0))
3485 * i += 1
3486 * return ret # <<<<<<<<<<<<<<
3487 *
3488 * @property
3489 */
3490 __Pyx_XDECREF(__pyx_r);
3491 __Pyx_INCREF(__pyx_v_ret);
3492 __pyx_r = __pyx_v_ret;
3493 goto __pyx_L0;
3494
3495 /* "av/codec/codec.pyx":263
3496 *
3497 * @property
3498 * def video_formats(self): # <<<<<<<<<<<<<<
3499 * """A list of supported :class:`.VideoFormat`, or ``None``."""
3500 * if not self.ptr.pix_fmts:
3501 */
3502
3503 /* function exit code */
3504 __pyx_L1_error:;
3505 __Pyx_XDECREF(__pyx_t_2);
3506 __Pyx_AddTraceback("av.codec.codec.Codec.video_formats.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3507 __pyx_r = NULL;
3508 __pyx_L0:;
3509 __Pyx_XDECREF(__pyx_v_ret);
3510 __Pyx_XGIVEREF(__pyx_r);
3511 __Pyx_RefNannyFinishContext();
3512 return __pyx_r;
3513 }
3514
3515 /* "av/codec/codec.pyx":276
3516 *
3517 * @property
3518 * def audio_formats(self): # <<<<<<<<<<<<<<
3519 * """A list of supported :class:`.AudioFormat`, or ``None``."""
3520 * if not self.ptr.sample_fmts:
3521 */
3522
3523 /* Python wrapper */
3524 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_13audio_formats_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_13audio_formats_1__get__(PyObject * __pyx_v_self)3525 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_13audio_formats_1__get__(PyObject *__pyx_v_self) {
3526 PyObject *__pyx_r = 0;
3527 __Pyx_RefNannyDeclarations
3528 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3529 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_13audio_formats___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
3530
3531 /* function exit code */
3532 __Pyx_RefNannyFinishContext();
3533 return __pyx_r;
3534 }
3535
__pyx_pf_2av_5codec_5codec_5Codec_13audio_formats___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)3536 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_13audio_formats___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
3537 PyObject *__pyx_v_ret = NULL;
3538 int __pyx_v_i;
3539 PyObject *__pyx_r = NULL;
3540 __Pyx_RefNannyDeclarations
3541 int __pyx_t_1;
3542 PyObject *__pyx_t_2 = NULL;
3543 int __pyx_t_3;
3544 int __pyx_lineno = 0;
3545 const char *__pyx_filename = NULL;
3546 int __pyx_clineno = 0;
3547 __Pyx_RefNannySetupContext("__get__", 0);
3548
3549 /* "av/codec/codec.pyx":278
3550 * def audio_formats(self):
3551 * """A list of supported :class:`.AudioFormat`, or ``None``."""
3552 * if not self.ptr.sample_fmts: # <<<<<<<<<<<<<<
3553 * return
3554 *
3555 */
3556 __pyx_t_1 = ((!(__pyx_v_self->ptr->sample_fmts != 0)) != 0);
3557 if (__pyx_t_1) {
3558
3559 /* "av/codec/codec.pyx":279
3560 * """A list of supported :class:`.AudioFormat`, or ``None``."""
3561 * if not self.ptr.sample_fmts:
3562 * return # <<<<<<<<<<<<<<
3563 *
3564 * ret = []
3565 */
3566 __Pyx_XDECREF(__pyx_r);
3567 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3568 goto __pyx_L0;
3569
3570 /* "av/codec/codec.pyx":278
3571 * def audio_formats(self):
3572 * """A list of supported :class:`.AudioFormat`, or ``None``."""
3573 * if not self.ptr.sample_fmts: # <<<<<<<<<<<<<<
3574 * return
3575 *
3576 */
3577 }
3578
3579 /* "av/codec/codec.pyx":281
3580 * return
3581 *
3582 * ret = [] # <<<<<<<<<<<<<<
3583 * cdef int i = 0
3584 * while self.ptr.sample_fmts[i] != -1:
3585 */
3586 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
3587 __Pyx_GOTREF(__pyx_t_2);
3588 __pyx_v_ret = ((PyObject*)__pyx_t_2);
3589 __pyx_t_2 = 0;
3590
3591 /* "av/codec/codec.pyx":282
3592 *
3593 * ret = []
3594 * cdef int i = 0 # <<<<<<<<<<<<<<
3595 * while self.ptr.sample_fmts[i] != -1:
3596 * ret.append(get_audio_format(self.ptr.sample_fmts[i]))
3597 */
3598 __pyx_v_i = 0;
3599
3600 /* "av/codec/codec.pyx":283
3601 * ret = []
3602 * cdef int i = 0
3603 * while self.ptr.sample_fmts[i] != -1: # <<<<<<<<<<<<<<
3604 * ret.append(get_audio_format(self.ptr.sample_fmts[i]))
3605 * i += 1
3606 */
3607 while (1) {
3608 __pyx_t_1 = (((__pyx_v_self->ptr->sample_fmts[__pyx_v_i]) != -1L) != 0);
3609 if (!__pyx_t_1) break;
3610
3611 /* "av/codec/codec.pyx":284
3612 * cdef int i = 0
3613 * while self.ptr.sample_fmts[i] != -1:
3614 * ret.append(get_audio_format(self.ptr.sample_fmts[i])) # <<<<<<<<<<<<<<
3615 * i += 1
3616 * return ret
3617 */
3618 __pyx_t_2 = ((PyObject *)__pyx_f_2av_5audio_6format_get_audio_format((__pyx_v_self->ptr->sample_fmts[__pyx_v_i]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
3619 __Pyx_GOTREF(__pyx_t_2);
3620 __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 284, __pyx_L1_error)
3621 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3622
3623 /* "av/codec/codec.pyx":285
3624 * while self.ptr.sample_fmts[i] != -1:
3625 * ret.append(get_audio_format(self.ptr.sample_fmts[i]))
3626 * i += 1 # <<<<<<<<<<<<<<
3627 * return ret
3628 *
3629 */
3630 __pyx_v_i = (__pyx_v_i + 1);
3631 }
3632
3633 /* "av/codec/codec.pyx":286
3634 * ret.append(get_audio_format(self.ptr.sample_fmts[i]))
3635 * i += 1
3636 * return ret # <<<<<<<<<<<<<<
3637 *
3638 * # NOTE: there are some overlaps, which we defer to how `ffmpeg -codecs`
3639 */
3640 __Pyx_XDECREF(__pyx_r);
3641 __Pyx_INCREF(__pyx_v_ret);
3642 __pyx_r = __pyx_v_ret;
3643 goto __pyx_L0;
3644
3645 /* "av/codec/codec.pyx":276
3646 *
3647 * @property
3648 * def audio_formats(self): # <<<<<<<<<<<<<<
3649 * """A list of supported :class:`.AudioFormat`, or ``None``."""
3650 * if not self.ptr.sample_fmts:
3651 */
3652
3653 /* function exit code */
3654 __pyx_L1_error:;
3655 __Pyx_XDECREF(__pyx_t_2);
3656 __Pyx_AddTraceback("av.codec.codec.Codec.audio_formats.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3657 __pyx_r = NULL;
3658 __pyx_L0:;
3659 __Pyx_XDECREF(__pyx_v_ret);
3660 __Pyx_XGIVEREF(__pyx_r);
3661 __Pyx_RefNannyFinishContext();
3662 return __pyx_r;
3663 }
3664
3665 /* "av/codec/codec.pyx":293
3666 *
3667 * @Properties.property
3668 * def properties(self): # <<<<<<<<<<<<<<
3669 * """Flag property of :class:`.Properties`"""
3670 * return self.desc.props
3671 */
3672
3673 /* Python wrapper */
3674 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_5properties(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3675 static char __pyx_doc_2av_5codec_5codec_5Codec_4properties[] = "Codec.properties()\nFlag property of :class:`.Properties`";
__pyx_pw_2av_5codec_5codec_5Codec_5properties(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3676 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_5properties(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3677 PyObject *__pyx_r = 0;
3678 __Pyx_RefNannyDeclarations
3679 __Pyx_RefNannySetupContext("properties (wrapper)", 0);
3680 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_4properties(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
3681
3682 /* function exit code */
3683 __Pyx_RefNannyFinishContext();
3684 return __pyx_r;
3685 }
3686
__pyx_pf_2av_5codec_5codec_5Codec_4properties(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)3687 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_4properties(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
3688 PyObject *__pyx_r = NULL;
3689 __Pyx_RefNannyDeclarations
3690 PyObject *__pyx_t_1 = NULL;
3691 int __pyx_lineno = 0;
3692 const char *__pyx_filename = NULL;
3693 int __pyx_clineno = 0;
3694 __Pyx_RefNannySetupContext("properties", 0);
3695
3696 /* "av/codec/codec.pyx":295
3697 * def properties(self):
3698 * """Flag property of :class:`.Properties`"""
3699 * return self.desc.props # <<<<<<<<<<<<<<
3700 *
3701 * intra_only = properties.flag_property('INTRA_ONLY')
3702 */
3703 __Pyx_XDECREF(__pyx_r);
3704 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->desc->props); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error)
3705 __Pyx_GOTREF(__pyx_t_1);
3706 __pyx_r = __pyx_t_1;
3707 __pyx_t_1 = 0;
3708 goto __pyx_L0;
3709
3710 /* "av/codec/codec.pyx":293
3711 *
3712 * @Properties.property
3713 * def properties(self): # <<<<<<<<<<<<<<
3714 * """Flag property of :class:`.Properties`"""
3715 * return self.desc.props
3716 */
3717
3718 /* function exit code */
3719 __pyx_L1_error:;
3720 __Pyx_XDECREF(__pyx_t_1);
3721 __Pyx_AddTraceback("av.codec.codec.Codec.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
3722 __pyx_r = NULL;
3723 __pyx_L0:;
3724 __Pyx_XGIVEREF(__pyx_r);
3725 __Pyx_RefNannyFinishContext();
3726 return __pyx_r;
3727 }
3728
3729 /* "av/codec/codec.pyx":305
3730 *
3731 * @Capabilities.property
3732 * def capabilities(self): # <<<<<<<<<<<<<<
3733 * """Flag property of :class:`.Capabilities`"""
3734 * return self.ptr.capabilities
3735 */
3736
3737 /* Python wrapper */
3738 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_7capabilities(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3739 static char __pyx_doc_2av_5codec_5codec_5Codec_6capabilities[] = "Codec.capabilities()\nFlag property of :class:`.Capabilities`";
__pyx_pw_2av_5codec_5codec_5Codec_7capabilities(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3740 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_7capabilities(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3741 PyObject *__pyx_r = 0;
3742 __Pyx_RefNannyDeclarations
3743 __Pyx_RefNannySetupContext("capabilities (wrapper)", 0);
3744 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_6capabilities(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
3745
3746 /* function exit code */
3747 __Pyx_RefNannyFinishContext();
3748 return __pyx_r;
3749 }
3750
__pyx_pf_2av_5codec_5codec_5Codec_6capabilities(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)3751 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_6capabilities(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
3752 PyObject *__pyx_r = NULL;
3753 __Pyx_RefNannyDeclarations
3754 PyObject *__pyx_t_1 = NULL;
3755 int __pyx_lineno = 0;
3756 const char *__pyx_filename = NULL;
3757 int __pyx_clineno = 0;
3758 __Pyx_RefNannySetupContext("capabilities", 0);
3759
3760 /* "av/codec/codec.pyx":307
3761 * def capabilities(self):
3762 * """Flag property of :class:`.Capabilities`"""
3763 * return self.ptr.capabilities # <<<<<<<<<<<<<<
3764 *
3765 * draw_horiz_band = capabilities.flag_property('DRAW_HORIZ_BAND')
3766 */
3767 __Pyx_XDECREF(__pyx_r);
3768 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->ptr->capabilities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
3769 __Pyx_GOTREF(__pyx_t_1);
3770 __pyx_r = __pyx_t_1;
3771 __pyx_t_1 = 0;
3772 goto __pyx_L0;
3773
3774 /* "av/codec/codec.pyx":305
3775 *
3776 * @Capabilities.property
3777 * def capabilities(self): # <<<<<<<<<<<<<<
3778 * """Flag property of :class:`.Capabilities`"""
3779 * return self.ptr.capabilities
3780 */
3781
3782 /* function exit code */
3783 __pyx_L1_error:;
3784 __Pyx_XDECREF(__pyx_t_1);
3785 __Pyx_AddTraceback("av.codec.codec.Codec.capabilities", __pyx_clineno, __pyx_lineno, __pyx_filename);
3786 __pyx_r = NULL;
3787 __pyx_L0:;
3788 __Pyx_XGIVEREF(__pyx_r);
3789 __Pyx_RefNannyFinishContext();
3790 return __pyx_r;
3791 }
3792
3793 /* "av/codec/codec.pxd":8
3794 * cdef const lib.AVCodec *ptr
3795 * cdef const lib.AVCodecDescriptor *desc
3796 * cdef readonly bint is_encoder # <<<<<<<<<<<<<<
3797 *
3798 * cdef _init(self, name=?)
3799 */
3800
3801 /* Python wrapper */
3802 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_10is_encoder_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_5codec_5codec_5Codec_10is_encoder_1__get__(PyObject * __pyx_v_self)3803 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_10is_encoder_1__get__(PyObject *__pyx_v_self) {
3804 PyObject *__pyx_r = 0;
3805 __Pyx_RefNannyDeclarations
3806 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3807 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_10is_encoder___get__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
3808
3809 /* function exit code */
3810 __Pyx_RefNannyFinishContext();
3811 return __pyx_r;
3812 }
3813
__pyx_pf_2av_5codec_5codec_5Codec_10is_encoder___get__(struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)3814 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_10is_encoder___get__(struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
3815 PyObject *__pyx_r = NULL;
3816 __Pyx_RefNannyDeclarations
3817 PyObject *__pyx_t_1 = NULL;
3818 int __pyx_lineno = 0;
3819 const char *__pyx_filename = NULL;
3820 int __pyx_clineno = 0;
3821 __Pyx_RefNannySetupContext("__get__", 0);
3822 __Pyx_XDECREF(__pyx_r);
3823 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_encoder); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3824 __Pyx_GOTREF(__pyx_t_1);
3825 __pyx_r = __pyx_t_1;
3826 __pyx_t_1 = 0;
3827 goto __pyx_L0;
3828
3829 /* function exit code */
3830 __pyx_L1_error:;
3831 __Pyx_XDECREF(__pyx_t_1);
3832 __Pyx_AddTraceback("av.codec.codec.Codec.is_encoder.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3833 __pyx_r = NULL;
3834 __pyx_L0:;
3835 __Pyx_XGIVEREF(__pyx_r);
3836 __Pyx_RefNannyFinishContext();
3837 return __pyx_r;
3838 }
3839
3840 /* "(tree fragment)":1
3841 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3842 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3843 * def __setstate_cython__(self, __pyx_state):
3844 */
3845
3846 /* Python wrapper */
3847 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3848 static char __pyx_doc_2av_5codec_5codec_5Codec_8__reduce_cython__[] = "Codec.__reduce_cython__()";
__pyx_pw_2av_5codec_5codec_5Codec_9__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3849 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3850 PyObject *__pyx_r = 0;
3851 __Pyx_RefNannyDeclarations
3852 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3853 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_8__reduce_cython__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self));
3854
3855 /* function exit code */
3856 __Pyx_RefNannyFinishContext();
3857 return __pyx_r;
3858 }
3859
__pyx_pf_2av_5codec_5codec_5Codec_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self)3860 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self) {
3861 PyObject *__pyx_r = NULL;
3862 __Pyx_RefNannyDeclarations
3863 PyObject *__pyx_t_1 = NULL;
3864 int __pyx_lineno = 0;
3865 const char *__pyx_filename = NULL;
3866 int __pyx_clineno = 0;
3867 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3868
3869 /* "(tree fragment)":2
3870 * def __reduce_cython__(self):
3871 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3872 * def __setstate_cython__(self, __pyx_state):
3873 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3874 */
3875 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3876 __Pyx_GOTREF(__pyx_t_1);
3877 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3878 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3879 __PYX_ERR(1, 2, __pyx_L1_error)
3880
3881 /* "(tree fragment)":1
3882 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3883 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3884 * def __setstate_cython__(self, __pyx_state):
3885 */
3886
3887 /* function exit code */
3888 __pyx_L1_error:;
3889 __Pyx_XDECREF(__pyx_t_1);
3890 __Pyx_AddTraceback("av.codec.codec.Codec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3891 __pyx_r = NULL;
3892 __Pyx_XGIVEREF(__pyx_r);
3893 __Pyx_RefNannyFinishContext();
3894 return __pyx_r;
3895 }
3896
3897 /* "(tree fragment)":3
3898 * def __reduce_cython__(self):
3899 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3900 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3901 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3902 */
3903
3904 /* Python wrapper */
3905 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3906 static char __pyx_doc_2av_5codec_5codec_5Codec_10__setstate_cython__[] = "Codec.__setstate_cython__(__pyx_state)";
__pyx_pw_2av_5codec_5codec_5Codec_11__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)3907 static PyObject *__pyx_pw_2av_5codec_5codec_5Codec_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3908 PyObject *__pyx_r = 0;
3909 __Pyx_RefNannyDeclarations
3910 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3911 __pyx_r = __pyx_pf_2av_5codec_5codec_5Codec_10__setstate_cython__(((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3912
3913 /* function exit code */
3914 __Pyx_RefNannyFinishContext();
3915 return __pyx_r;
3916 }
3917
__pyx_pf_2av_5codec_5codec_5Codec_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_5codec_5codec_Codec * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)3918 static PyObject *__pyx_pf_2av_5codec_5codec_5Codec_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3919 PyObject *__pyx_r = NULL;
3920 __Pyx_RefNannyDeclarations
3921 PyObject *__pyx_t_1 = NULL;
3922 int __pyx_lineno = 0;
3923 const char *__pyx_filename = NULL;
3924 int __pyx_clineno = 0;
3925 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3926
3927 /* "(tree fragment)":4
3928 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3929 * def __setstate_cython__(self, __pyx_state):
3930 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3931 */
3932 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3933 __Pyx_GOTREF(__pyx_t_1);
3934 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3935 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3936 __PYX_ERR(1, 4, __pyx_L1_error)
3937
3938 /* "(tree fragment)":3
3939 * def __reduce_cython__(self):
3940 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3941 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3942 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3943 */
3944
3945 /* function exit code */
3946 __pyx_L1_error:;
3947 __Pyx_XDECREF(__pyx_t_1);
3948 __Pyx_AddTraceback("av.codec.codec.Codec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3949 __pyx_r = NULL;
3950 __Pyx_XGIVEREF(__pyx_r);
3951 __Pyx_RefNannyFinishContext();
3952 return __pyx_r;
3953 }
3954
3955 /* "av/codec/codec.pyx":333
3956 *
3957 *
3958 * cdef get_codec_names(): # <<<<<<<<<<<<<<
3959 * names = set()
3960 * cdef const lib.AVCodec *ptr
3961 */
3962
__pyx_f_2av_5codec_5codec_get_codec_names(void)3963 static PyObject *__pyx_f_2av_5codec_5codec_get_codec_names(void) {
3964 PyObject *__pyx_v_names = NULL;
3965 struct AVCodec const *__pyx_v_ptr;
3966 void *__pyx_v_opaque;
3967 PyObject *__pyx_r = NULL;
3968 __Pyx_RefNannyDeclarations
3969 PyObject *__pyx_t_1 = NULL;
3970 int __pyx_t_2;
3971 int __pyx_t_3;
3972 int __pyx_lineno = 0;
3973 const char *__pyx_filename = NULL;
3974 int __pyx_clineno = 0;
3975 __Pyx_RefNannySetupContext("get_codec_names", 0);
3976
3977 /* "av/codec/codec.pyx":334
3978 *
3979 * cdef get_codec_names():
3980 * names = set() # <<<<<<<<<<<<<<
3981 * cdef const lib.AVCodec *ptr
3982 * cdef void *opaque = NULL
3983 */
3984 __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
3985 __Pyx_GOTREF(__pyx_t_1);
3986 __pyx_v_names = ((PyObject*)__pyx_t_1);
3987 __pyx_t_1 = 0;
3988
3989 /* "av/codec/codec.pyx":336
3990 * names = set()
3991 * cdef const lib.AVCodec *ptr
3992 * cdef void *opaque = NULL # <<<<<<<<<<<<<<
3993 * while True:
3994 * ptr = lib.av_codec_iterate(&opaque)
3995 */
3996 __pyx_v_opaque = NULL;
3997
3998 /* "av/codec/codec.pyx":337
3999 * cdef const lib.AVCodec *ptr
4000 * cdef void *opaque = NULL
4001 * while True: # <<<<<<<<<<<<<<
4002 * ptr = lib.av_codec_iterate(&opaque)
4003 * if ptr:
4004 */
4005 while (1) {
4006
4007 /* "av/codec/codec.pyx":338
4008 * cdef void *opaque = NULL
4009 * while True:
4010 * ptr = lib.av_codec_iterate(&opaque) # <<<<<<<<<<<<<<
4011 * if ptr:
4012 * names.add(ptr.name)
4013 */
4014 __pyx_v_ptr = av_codec_iterate((&__pyx_v_opaque));
4015
4016 /* "av/codec/codec.pyx":339
4017 * while True:
4018 * ptr = lib.av_codec_iterate(&opaque)
4019 * if ptr: # <<<<<<<<<<<<<<
4020 * names.add(ptr.name)
4021 * else:
4022 */
4023 __pyx_t_2 = (__pyx_v_ptr != 0);
4024 if (__pyx_t_2) {
4025
4026 /* "av/codec/codec.pyx":340
4027 * ptr = lib.av_codec_iterate(&opaque)
4028 * if ptr:
4029 * names.add(ptr.name) # <<<<<<<<<<<<<<
4030 * else:
4031 * break
4032 */
4033 __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_ptr->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error)
4034 __Pyx_GOTREF(__pyx_t_1);
4035 __pyx_t_3 = PySet_Add(__pyx_v_names, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 340, __pyx_L1_error)
4036 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4037
4038 /* "av/codec/codec.pyx":339
4039 * while True:
4040 * ptr = lib.av_codec_iterate(&opaque)
4041 * if ptr: # <<<<<<<<<<<<<<
4042 * names.add(ptr.name)
4043 * else:
4044 */
4045 goto __pyx_L5;
4046 }
4047
4048 /* "av/codec/codec.pyx":342
4049 * names.add(ptr.name)
4050 * else:
4051 * break # <<<<<<<<<<<<<<
4052 * return names
4053 *
4054 */
4055 /*else*/ {
4056 goto __pyx_L4_break;
4057 }
4058 __pyx_L5:;
4059 }
4060 __pyx_L4_break:;
4061
4062 /* "av/codec/codec.pyx":343
4063 * else:
4064 * break
4065 * return names # <<<<<<<<<<<<<<
4066 *
4067 * codecs_available = get_codec_names()
4068 */
4069 __Pyx_XDECREF(__pyx_r);
4070 __Pyx_INCREF(__pyx_v_names);
4071 __pyx_r = __pyx_v_names;
4072 goto __pyx_L0;
4073
4074 /* "av/codec/codec.pyx":333
4075 *
4076 *
4077 * cdef get_codec_names(): # <<<<<<<<<<<<<<
4078 * names = set()
4079 * cdef const lib.AVCodec *ptr
4080 */
4081
4082 /* function exit code */
4083 __pyx_L1_error:;
4084 __Pyx_XDECREF(__pyx_t_1);
4085 __Pyx_AddTraceback("av.codec.codec.get_codec_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
4086 __pyx_r = 0;
4087 __pyx_L0:;
4088 __Pyx_XDECREF(__pyx_v_names);
4089 __Pyx_XGIVEREF(__pyx_r);
4090 __Pyx_RefNannyFinishContext();
4091 return __pyx_r;
4092 }
4093
4094 /* "av/codec/codec.pyx":351
4095 *
4096 *
4097 * def dump_codecs(): # <<<<<<<<<<<<<<
4098 * """Print information about availible codecs."""
4099 *
4100 */
4101
4102 /* Python wrapper */
4103 static PyObject *__pyx_pw_2av_5codec_5codec_1dump_codecs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4104 static char __pyx_doc_2av_5codec_5codec_dump_codecs[] = "dump_codecs()\nPrint information about availible codecs.";
4105 static PyMethodDef __pyx_mdef_2av_5codec_5codec_1dump_codecs = {"dump_codecs", (PyCFunction)__pyx_pw_2av_5codec_5codec_1dump_codecs, METH_NOARGS, __pyx_doc_2av_5codec_5codec_dump_codecs};
__pyx_pw_2av_5codec_5codec_1dump_codecs(PyObject * __pyx_self,CYTHON_UNUSED PyObject * unused)4106 static PyObject *__pyx_pw_2av_5codec_5codec_1dump_codecs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
4107 PyObject *__pyx_r = 0;
4108 __Pyx_RefNannyDeclarations
4109 __Pyx_RefNannySetupContext("dump_codecs (wrapper)", 0);
4110 __pyx_r = __pyx_pf_2av_5codec_5codec_dump_codecs(__pyx_self);
4111
4112 /* function exit code */
4113 __Pyx_RefNannyFinishContext();
4114 return __pyx_r;
4115 }
4116
__pyx_pf_2av_5codec_5codec_dump_codecs(CYTHON_UNUSED PyObject * __pyx_self)4117 static PyObject *__pyx_pf_2av_5codec_5codec_dump_codecs(CYTHON_UNUSED PyObject *__pyx_self) {
4118 PyObject *__pyx_v_name = NULL;
4119 struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_e_codec = NULL;
4120 struct __pyx_obj_2av_5codec_5codec_Codec *__pyx_v_d_codec = NULL;
4121 PyObject *__pyx_v_codec = NULL;
4122 PyObject *__pyx_v_e = NULL;
4123 PyObject *__pyx_r = NULL;
4124 __Pyx_RefNannyDeclarations
4125 PyObject *__pyx_t_1 = NULL;
4126 PyObject *__pyx_t_2 = NULL;
4127 PyObject *__pyx_t_3 = NULL;
4128 int __pyx_t_4;
4129 Py_ssize_t __pyx_t_5;
4130 PyObject *__pyx_t_6 = NULL;
4131 PyObject *__pyx_t_7 = NULL;
4132 PyObject *__pyx_t_8 = NULL;
4133 int __pyx_t_9;
4134 PyObject *__pyx_t_10 = NULL;
4135 int __pyx_t_11;
4136 PyObject *__pyx_t_12 = NULL;
4137 PyObject *__pyx_t_13 = NULL;
4138 PyObject *__pyx_t_14 = NULL;
4139 PyObject *__pyx_t_15 = NULL;
4140 PyObject *__pyx_t_16 = NULL;
4141 PyObject *__pyx_t_17 = NULL;
4142 int __pyx_lineno = 0;
4143 const char *__pyx_filename = NULL;
4144 int __pyx_clineno = 0;
4145 __Pyx_RefNannySetupContext("dump_codecs", 0);
4146
4147 /* "av/codec/codec.pyx":354
4148 * """Print information about availible codecs."""
4149 *
4150 * print '''Codecs: # <<<<<<<<<<<<<<
4151 * D..... = Decoding supported
4152 * .E.... = Encoding supported
4153 */
4154 if (__Pyx_PrintOne(0, __pyx_kp_s_Codecs_D_Decoding_supported_E_En) < 0) __PYX_ERR(0, 354, __pyx_L1_error)
4155
4156 /* "av/codec/codec.pyx":365
4157 * ------'''
4158 *
4159 * for name in sorted(codecs_available): # <<<<<<<<<<<<<<
4160 *
4161 * try:
4162 */
4163 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_codecs_available); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
4164 __Pyx_GOTREF(__pyx_t_2);
4165 __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
4166 __Pyx_GOTREF(__pyx_t_3);
4167 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4168 __pyx_t_1 = ((PyObject*)__pyx_t_3);
4169 __pyx_t_3 = 0;
4170 __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 365, __pyx_L1_error)
4171 if (unlikely(__pyx_t_1 == Py_None)) {
4172 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
4173 __PYX_ERR(0, 365, __pyx_L1_error)
4174 }
4175 __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
4176 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4177 for (;;) {
4178 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
4179 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4180 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
4181 #else
4182 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
4183 __Pyx_GOTREF(__pyx_t_1);
4184 #endif
4185 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
4186 __pyx_t_1 = 0;
4187
4188 /* "av/codec/codec.pyx":367
4189 * for name in sorted(codecs_available):
4190 *
4191 * try: # <<<<<<<<<<<<<<
4192 * e_codec = Codec(name, 'w')
4193 * except ValueError:
4194 */
4195 {
4196 __Pyx_PyThreadState_declare
4197 __Pyx_PyThreadState_assign
4198 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
4199 __Pyx_XGOTREF(__pyx_t_6);
4200 __Pyx_XGOTREF(__pyx_t_7);
4201 __Pyx_XGOTREF(__pyx_t_8);
4202 /*try:*/ {
4203
4204 /* "av/codec/codec.pyx":368
4205 *
4206 * try:
4207 * e_codec = Codec(name, 'w') # <<<<<<<<<<<<<<
4208 * except ValueError:
4209 * e_codec = None
4210 */
4211 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L5_error)
4212 __Pyx_GOTREF(__pyx_t_1);
4213 __Pyx_INCREF(__pyx_v_name);
4214 __Pyx_GIVEREF(__pyx_v_name);
4215 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_name);
4216 __Pyx_INCREF(__pyx_n_s_w);
4217 __Pyx_GIVEREF(__pyx_n_s_w);
4218 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_w);
4219 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L5_error)
4220 __Pyx_GOTREF(__pyx_t_2);
4221 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4222 __Pyx_XDECREF_SET(__pyx_v_e_codec, ((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_t_2));
4223 __pyx_t_2 = 0;
4224
4225 /* "av/codec/codec.pyx":367
4226 * for name in sorted(codecs_available):
4227 *
4228 * try: # <<<<<<<<<<<<<<
4229 * e_codec = Codec(name, 'w')
4230 * except ValueError:
4231 */
4232 }
4233 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4234 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4235 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4236 goto __pyx_L12_try_end;
4237 __pyx_L5_error:;
4238 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4239 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4240
4241 /* "av/codec/codec.pyx":369
4242 * try:
4243 * e_codec = Codec(name, 'w')
4244 * except ValueError: # <<<<<<<<<<<<<<
4245 * e_codec = None
4246 *
4247 */
4248 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
4249 if (__pyx_t_9) {
4250 __Pyx_AddTraceback("av.codec.codec.dump_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
4251 if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_10) < 0) __PYX_ERR(0, 369, __pyx_L7_except_error)
4252 __Pyx_GOTREF(__pyx_t_2);
4253 __Pyx_GOTREF(__pyx_t_1);
4254 __Pyx_GOTREF(__pyx_t_10);
4255
4256 /* "av/codec/codec.pyx":370
4257 * e_codec = Codec(name, 'w')
4258 * except ValueError:
4259 * e_codec = None # <<<<<<<<<<<<<<
4260 *
4261 * try:
4262 */
4263 __Pyx_INCREF(Py_None);
4264 __Pyx_XDECREF_SET(__pyx_v_e_codec, ((struct __pyx_obj_2av_5codec_5codec_Codec *)Py_None));
4265 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4266 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4267 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4268 goto __pyx_L6_exception_handled;
4269 }
4270 goto __pyx_L7_except_error;
4271 __pyx_L7_except_error:;
4272
4273 /* "av/codec/codec.pyx":367
4274 * for name in sorted(codecs_available):
4275 *
4276 * try: # <<<<<<<<<<<<<<
4277 * e_codec = Codec(name, 'w')
4278 * except ValueError:
4279 */
4280 __Pyx_XGIVEREF(__pyx_t_6);
4281 __Pyx_XGIVEREF(__pyx_t_7);
4282 __Pyx_XGIVEREF(__pyx_t_8);
4283 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
4284 goto __pyx_L1_error;
4285 __pyx_L6_exception_handled:;
4286 __Pyx_XGIVEREF(__pyx_t_6);
4287 __Pyx_XGIVEREF(__pyx_t_7);
4288 __Pyx_XGIVEREF(__pyx_t_8);
4289 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
4290 __pyx_L12_try_end:;
4291 }
4292
4293 /* "av/codec/codec.pyx":372
4294 * e_codec = None
4295 *
4296 * try: # <<<<<<<<<<<<<<
4297 * d_codec = Codec(name, 'r')
4298 * except ValueError:
4299 */
4300 {
4301 __Pyx_PyThreadState_declare
4302 __Pyx_PyThreadState_assign
4303 __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
4304 __Pyx_XGOTREF(__pyx_t_8);
4305 __Pyx_XGOTREF(__pyx_t_7);
4306 __Pyx_XGOTREF(__pyx_t_6);
4307 /*try:*/ {
4308
4309 /* "av/codec/codec.pyx":373
4310 *
4311 * try:
4312 * d_codec = Codec(name, 'r') # <<<<<<<<<<<<<<
4313 * except ValueError:
4314 * d_codec = None
4315 */
4316 __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 373, __pyx_L15_error)
4317 __Pyx_GOTREF(__pyx_t_10);
4318 __Pyx_INCREF(__pyx_v_name);
4319 __Pyx_GIVEREF(__pyx_v_name);
4320 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_name);
4321 __Pyx_INCREF(__pyx_n_s_r);
4322 __Pyx_GIVEREF(__pyx_n_s_r);
4323 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_r);
4324 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec), __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L15_error)
4325 __Pyx_GOTREF(__pyx_t_1);
4326 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4327 __Pyx_XDECREF_SET(__pyx_v_d_codec, ((struct __pyx_obj_2av_5codec_5codec_Codec *)__pyx_t_1));
4328 __pyx_t_1 = 0;
4329
4330 /* "av/codec/codec.pyx":372
4331 * e_codec = None
4332 *
4333 * try: # <<<<<<<<<<<<<<
4334 * d_codec = Codec(name, 'r')
4335 * except ValueError:
4336 */
4337 }
4338 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4339 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4340 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4341 goto __pyx_L22_try_end;
4342 __pyx_L15_error:;
4343 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4344 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4345 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4346
4347 /* "av/codec/codec.pyx":374
4348 * try:
4349 * d_codec = Codec(name, 'r')
4350 * except ValueError: # <<<<<<<<<<<<<<
4351 * d_codec = None
4352 *
4353 */
4354 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
4355 if (__pyx_t_9) {
4356 __Pyx_AddTraceback("av.codec.codec.dump_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
4357 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_10, &__pyx_t_2) < 0) __PYX_ERR(0, 374, __pyx_L17_except_error)
4358 __Pyx_GOTREF(__pyx_t_1);
4359 __Pyx_GOTREF(__pyx_t_10);
4360 __Pyx_GOTREF(__pyx_t_2);
4361
4362 /* "av/codec/codec.pyx":375
4363 * d_codec = Codec(name, 'r')
4364 * except ValueError:
4365 * d_codec = None # <<<<<<<<<<<<<<
4366 *
4367 * # TODO: Assert these always have the same properties.
4368 */
4369 __Pyx_INCREF(Py_None);
4370 __Pyx_XDECREF_SET(__pyx_v_d_codec, ((struct __pyx_obj_2av_5codec_5codec_Codec *)Py_None));
4371 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4372 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4373 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4374 goto __pyx_L16_exception_handled;
4375 }
4376 goto __pyx_L17_except_error;
4377 __pyx_L17_except_error:;
4378
4379 /* "av/codec/codec.pyx":372
4380 * e_codec = None
4381 *
4382 * try: # <<<<<<<<<<<<<<
4383 * d_codec = Codec(name, 'r')
4384 * except ValueError:
4385 */
4386 __Pyx_XGIVEREF(__pyx_t_8);
4387 __Pyx_XGIVEREF(__pyx_t_7);
4388 __Pyx_XGIVEREF(__pyx_t_6);
4389 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
4390 goto __pyx_L1_error;
4391 __pyx_L16_exception_handled:;
4392 __Pyx_XGIVEREF(__pyx_t_8);
4393 __Pyx_XGIVEREF(__pyx_t_7);
4394 __Pyx_XGIVEREF(__pyx_t_6);
4395 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_6);
4396 __pyx_L22_try_end:;
4397 }
4398
4399 /* "av/codec/codec.pyx":378
4400 *
4401 * # TODO: Assert these always have the same properties.
4402 * codec = e_codec or d_codec # <<<<<<<<<<<<<<
4403 *
4404 * try:
4405 */
4406 __pyx_t_11 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_e_codec)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 378, __pyx_L1_error)
4407 if (!__pyx_t_11) {
4408 } else {
4409 __Pyx_INCREF(((PyObject *)__pyx_v_e_codec));
4410 __pyx_t_2 = ((PyObject *)__pyx_v_e_codec);
4411 goto __pyx_L25_bool_binop_done;
4412 }
4413 __Pyx_INCREF(((PyObject *)__pyx_v_d_codec));
4414 __pyx_t_2 = ((PyObject *)__pyx_v_d_codec);
4415 __pyx_L25_bool_binop_done:;
4416 __Pyx_XDECREF_SET(__pyx_v_codec, __pyx_t_2);
4417 __pyx_t_2 = 0;
4418
4419 /* "av/codec/codec.pyx":380
4420 * codec = e_codec or d_codec
4421 *
4422 * try: # <<<<<<<<<<<<<<
4423 * print ' %s%s%s%s%s%s %-18s %s' % (
4424 * '.D'[bool(d_codec)],
4425 */
4426 {
4427 __Pyx_PyThreadState_declare
4428 __Pyx_PyThreadState_assign
4429 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
4430 __Pyx_XGOTREF(__pyx_t_6);
4431 __Pyx_XGOTREF(__pyx_t_7);
4432 __Pyx_XGOTREF(__pyx_t_8);
4433 /*try:*/ {
4434
4435 /* "av/codec/codec.pyx":382
4436 * try:
4437 * print ' %s%s%s%s%s%s %-18s %s' % (
4438 * '.D'[bool(d_codec)], # <<<<<<<<<<<<<<
4439 * '.E'[bool(e_codec)],
4440 * codec.type[0].upper(),
4441 */
4442 __pyx_t_11 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_d_codec)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 382, __pyx_L27_error)
4443 __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_11))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L27_error)
4444 __Pyx_GOTREF(__pyx_t_2);
4445 __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_kp_s_D, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 382, __pyx_L27_error)
4446 __Pyx_GOTREF(__pyx_t_10);
4447 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4448
4449 /* "av/codec/codec.pyx":383
4450 * print ' %s%s%s%s%s%s %-18s %s' % (
4451 * '.D'[bool(d_codec)],
4452 * '.E'[bool(e_codec)], # <<<<<<<<<<<<<<
4453 * codec.type[0].upper(),
4454 * '.I'[codec.intra_only],
4455 */
4456 __pyx_t_11 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_e_codec)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 383, __pyx_L27_error)
4457 __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_11))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L27_error)
4458 __Pyx_GOTREF(__pyx_t_2);
4459 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_kp_s_E, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L27_error)
4460 __Pyx_GOTREF(__pyx_t_1);
4461 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4462
4463 /* "av/codec/codec.pyx":384
4464 * '.D'[bool(d_codec)],
4465 * '.E'[bool(e_codec)],
4466 * codec.type[0].upper(), # <<<<<<<<<<<<<<
4467 * '.I'[codec.intra_only],
4468 * '.L'[codec.lossy],
4469 */
4470 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 384, __pyx_L27_error)
4471 __Pyx_GOTREF(__pyx_t_12);
4472 __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 384, __pyx_L27_error)
4473 __Pyx_GOTREF(__pyx_t_13);
4474 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4475 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_upper); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 384, __pyx_L27_error)
4476 __Pyx_GOTREF(__pyx_t_12);
4477 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4478 __pyx_t_13 = NULL;
4479 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
4480 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
4481 if (likely(__pyx_t_13)) {
4482 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
4483 __Pyx_INCREF(__pyx_t_13);
4484 __Pyx_INCREF(function);
4485 __Pyx_DECREF_SET(__pyx_t_12, function);
4486 }
4487 }
4488 __pyx_t_2 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
4489 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
4490 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L27_error)
4491 __Pyx_GOTREF(__pyx_t_2);
4492 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4493
4494 /* "av/codec/codec.pyx":385
4495 * '.E'[bool(e_codec)],
4496 * codec.type[0].upper(),
4497 * '.I'[codec.intra_only], # <<<<<<<<<<<<<<
4498 * '.L'[codec.lossy],
4499 * '.S'[codec.lossless],
4500 */
4501 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_intra_only); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 385, __pyx_L27_error)
4502 __Pyx_GOTREF(__pyx_t_12);
4503 __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_kp_s_I, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 385, __pyx_L27_error)
4504 __Pyx_GOTREF(__pyx_t_13);
4505 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4506
4507 /* "av/codec/codec.pyx":386
4508 * codec.type[0].upper(),
4509 * '.I'[codec.intra_only],
4510 * '.L'[codec.lossy], # <<<<<<<<<<<<<<
4511 * '.S'[codec.lossless],
4512 * codec.name,
4513 */
4514 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_lossy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 386, __pyx_L27_error)
4515 __Pyx_GOTREF(__pyx_t_12);
4516 __pyx_t_14 = __Pyx_PyObject_GetItem(__pyx_kp_s_L, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 386, __pyx_L27_error)
4517 __Pyx_GOTREF(__pyx_t_14);
4518 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4519
4520 /* "av/codec/codec.pyx":387
4521 * '.I'[codec.intra_only],
4522 * '.L'[codec.lossy],
4523 * '.S'[codec.lossless], # <<<<<<<<<<<<<<
4524 * codec.name,
4525 * codec.long_name
4526 */
4527 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_lossless); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L27_error)
4528 __Pyx_GOTREF(__pyx_t_12);
4529 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_kp_s_S, __pyx_t_12); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 387, __pyx_L27_error)
4530 __Pyx_GOTREF(__pyx_t_15);
4531 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4532
4533 /* "av/codec/codec.pyx":388
4534 * '.L'[codec.lossy],
4535 * '.S'[codec.lossless],
4536 * codec.name, # <<<<<<<<<<<<<<
4537 * codec.long_name
4538 * )
4539 */
4540 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 388, __pyx_L27_error)
4541 __Pyx_GOTREF(__pyx_t_12);
4542
4543 /* "av/codec/codec.pyx":389
4544 * '.S'[codec.lossless],
4545 * codec.name,
4546 * codec.long_name # <<<<<<<<<<<<<<
4547 * )
4548 * except Exception as e:
4549 */
4550 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_long_name); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 389, __pyx_L27_error)
4551 __Pyx_GOTREF(__pyx_t_16);
4552
4553 /* "av/codec/codec.pyx":382
4554 * try:
4555 * print ' %s%s%s%s%s%s %-18s %s' % (
4556 * '.D'[bool(d_codec)], # <<<<<<<<<<<<<<
4557 * '.E'[bool(e_codec)],
4558 * codec.type[0].upper(),
4559 */
4560 __pyx_t_17 = PyTuple_New(8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 382, __pyx_L27_error)
4561 __Pyx_GOTREF(__pyx_t_17);
4562 __Pyx_GIVEREF(__pyx_t_10);
4563 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_10);
4564 __Pyx_GIVEREF(__pyx_t_1);
4565 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_1);
4566 __Pyx_GIVEREF(__pyx_t_2);
4567 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_2);
4568 __Pyx_GIVEREF(__pyx_t_13);
4569 PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_13);
4570 __Pyx_GIVEREF(__pyx_t_14);
4571 PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_t_14);
4572 __Pyx_GIVEREF(__pyx_t_15);
4573 PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_t_15);
4574 __Pyx_GIVEREF(__pyx_t_12);
4575 PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_t_12);
4576 __Pyx_GIVEREF(__pyx_t_16);
4577 PyTuple_SET_ITEM(__pyx_t_17, 7, __pyx_t_16);
4578 __pyx_t_10 = 0;
4579 __pyx_t_1 = 0;
4580 __pyx_t_2 = 0;
4581 __pyx_t_13 = 0;
4582 __pyx_t_14 = 0;
4583 __pyx_t_15 = 0;
4584 __pyx_t_12 = 0;
4585 __pyx_t_16 = 0;
4586
4587 /* "av/codec/codec.pyx":381
4588 *
4589 * try:
4590 * print ' %s%s%s%s%s%s %-18s %s' % ( # <<<<<<<<<<<<<<
4591 * '.D'[bool(d_codec)],
4592 * '.E'[bool(e_codec)],
4593 */
4594 __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s_s_s_s_18s_s, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 381, __pyx_L27_error)
4595 __Pyx_GOTREF(__pyx_t_16);
4596 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4597 if (__Pyx_PrintOne(0, __pyx_t_16) < 0) __PYX_ERR(0, 381, __pyx_L27_error)
4598 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4599
4600 /* "av/codec/codec.pyx":380
4601 * codec = e_codec or d_codec
4602 *
4603 * try: # <<<<<<<<<<<<<<
4604 * print ' %s%s%s%s%s%s %-18s %s' % (
4605 * '.D'[bool(d_codec)],
4606 */
4607 }
4608 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4609 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4610 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4611 goto __pyx_L34_try_end;
4612 __pyx_L27_error:;
4613 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4614 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4615 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4616 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
4617 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4618 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
4619 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
4620 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
4621 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4622
4623 /* "av/codec/codec.pyx":391
4624 * codec.long_name
4625 * )
4626 * except Exception as e: # <<<<<<<<<<<<<<
4627 * print '...... %-18s ERROR: %s' % (codec.name, e)
4628 */
4629 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4630 if (__pyx_t_9) {
4631 __Pyx_AddTraceback("av.codec.codec.dump_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
4632 if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_12) < 0) __PYX_ERR(0, 391, __pyx_L29_except_error)
4633 __Pyx_GOTREF(__pyx_t_16);
4634 __Pyx_GOTREF(__pyx_t_17);
4635 __Pyx_GOTREF(__pyx_t_12);
4636 __Pyx_INCREF(__pyx_t_17);
4637 __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_17);
4638
4639 /* "av/codec/codec.pyx":392
4640 * )
4641 * except Exception as e:
4642 * print '...... %-18s ERROR: %s' % (codec.name, e) # <<<<<<<<<<<<<<
4643 */
4644 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_name); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 392, __pyx_L29_except_error)
4645 __Pyx_GOTREF(__pyx_t_15);
4646 __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 392, __pyx_L29_except_error)
4647 __Pyx_GOTREF(__pyx_t_14);
4648 __Pyx_GIVEREF(__pyx_t_15);
4649 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15);
4650 __Pyx_INCREF(__pyx_v_e);
4651 __Pyx_GIVEREF(__pyx_v_e);
4652 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_e);
4653 __pyx_t_15 = 0;
4654 __pyx_t_15 = __Pyx_PyString_Format(__pyx_kp_s_18s_ERROR_s, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 392, __pyx_L29_except_error)
4655 __Pyx_GOTREF(__pyx_t_15);
4656 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4657 if (__Pyx_PrintOne(0, __pyx_t_15) < 0) __PYX_ERR(0, 392, __pyx_L29_except_error)
4658 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4659 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
4660 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
4661 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4662 goto __pyx_L28_exception_handled;
4663 }
4664 goto __pyx_L29_except_error;
4665 __pyx_L29_except_error:;
4666
4667 /* "av/codec/codec.pyx":380
4668 * codec = e_codec or d_codec
4669 *
4670 * try: # <<<<<<<<<<<<<<
4671 * print ' %s%s%s%s%s%s %-18s %s' % (
4672 * '.D'[bool(d_codec)],
4673 */
4674 __Pyx_XGIVEREF(__pyx_t_6);
4675 __Pyx_XGIVEREF(__pyx_t_7);
4676 __Pyx_XGIVEREF(__pyx_t_8);
4677 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
4678 goto __pyx_L1_error;
4679 __pyx_L28_exception_handled:;
4680 __Pyx_XGIVEREF(__pyx_t_6);
4681 __Pyx_XGIVEREF(__pyx_t_7);
4682 __Pyx_XGIVEREF(__pyx_t_8);
4683 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
4684 __pyx_L34_try_end:;
4685 }
4686
4687 /* "av/codec/codec.pyx":365
4688 * ------'''
4689 *
4690 * for name in sorted(codecs_available): # <<<<<<<<<<<<<<
4691 *
4692 * try:
4693 */
4694 }
4695 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4696
4697 /* "av/codec/codec.pyx":351
4698 *
4699 *
4700 * def dump_codecs(): # <<<<<<<<<<<<<<
4701 * """Print information about availible codecs."""
4702 *
4703 */
4704
4705 /* function exit code */
4706 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4707 goto __pyx_L0;
4708 __pyx_L1_error:;
4709 __Pyx_XDECREF(__pyx_t_1);
4710 __Pyx_XDECREF(__pyx_t_2);
4711 __Pyx_XDECREF(__pyx_t_3);
4712 __Pyx_XDECREF(__pyx_t_10);
4713 __Pyx_XDECREF(__pyx_t_12);
4714 __Pyx_XDECREF(__pyx_t_13);
4715 __Pyx_XDECREF(__pyx_t_14);
4716 __Pyx_XDECREF(__pyx_t_15);
4717 __Pyx_XDECREF(__pyx_t_16);
4718 __Pyx_XDECREF(__pyx_t_17);
4719 __Pyx_AddTraceback("av.codec.codec.dump_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
4720 __pyx_r = NULL;
4721 __pyx_L0:;
4722 __Pyx_XDECREF(__pyx_v_name);
4723 __Pyx_XDECREF((PyObject *)__pyx_v_e_codec);
4724 __Pyx_XDECREF((PyObject *)__pyx_v_d_codec);
4725 __Pyx_XDECREF(__pyx_v_codec);
4726 __Pyx_XDECREF(__pyx_v_e);
4727 __Pyx_XGIVEREF(__pyx_r);
4728 __Pyx_RefNannyFinishContext();
4729 return __pyx_r;
4730 }
4731 static struct __pyx_vtabstruct_2av_5codec_5codec_Codec __pyx_vtable_2av_5codec_5codec_Codec;
4732
__pyx_tp_new_2av_5codec_5codec_Codec(PyTypeObject * t,PyObject * a,PyObject * k)4733 static PyObject *__pyx_tp_new_2av_5codec_5codec_Codec(PyTypeObject *t, PyObject *a, PyObject *k) {
4734 struct __pyx_obj_2av_5codec_5codec_Codec *p;
4735 PyObject *o;
4736 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
4737 o = (*t->tp_alloc)(t, 0);
4738 } else {
4739 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
4740 }
4741 if (unlikely(!o)) return 0;
4742 p = ((struct __pyx_obj_2av_5codec_5codec_Codec *)o);
4743 p->__pyx_vtab = __pyx_vtabptr_2av_5codec_5codec_Codec;
4744 if (unlikely(__pyx_pw_2av_5codec_5codec_5Codec_1__cinit__(o, a, k) < 0)) goto bad;
4745 return o;
4746 bad:
4747 Py_DECREF(o); o = 0;
4748 return NULL;
4749 }
4750
__pyx_tp_dealloc_2av_5codec_5codec_Codec(PyObject * o)4751 static void __pyx_tp_dealloc_2av_5codec_5codec_Codec(PyObject *o) {
4752 #if CYTHON_USE_TP_FINALIZE
4753 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
4754 if (PyObject_CallFinalizerFromDealloc(o)) return;
4755 }
4756 #endif
4757 (*Py_TYPE(o)->tp_free)(o);
4758 }
4759
__pyx_getprop_2av_5codec_5codec_5Codec_is_decoder(PyObject * o,CYTHON_UNUSED void * x)4760 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_is_decoder(PyObject *o, CYTHON_UNUSED void *x) {
4761 return __pyx_pw_2av_5codec_5codec_5Codec_10is_decoder_1__get__(o);
4762 }
4763
__pyx_getprop_2av_5codec_5codec_5Codec_descriptor(PyObject * o,CYTHON_UNUSED void * x)4764 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_descriptor(PyObject *o, CYTHON_UNUSED void *x) {
4765 return __pyx_pw_2av_5codec_5codec_5Codec_10descriptor_1__get__(o);
4766 }
4767
__pyx_getprop_2av_5codec_5codec_5Codec_name(PyObject * o,CYTHON_UNUSED void * x)4768 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_name(PyObject *o, CYTHON_UNUSED void *x) {
4769 return __pyx_pw_2av_5codec_5codec_5Codec_4name_1__get__(o);
4770 }
4771
__pyx_getprop_2av_5codec_5codec_5Codec_long_name(PyObject * o,CYTHON_UNUSED void * x)4772 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_long_name(PyObject *o, CYTHON_UNUSED void *x) {
4773 return __pyx_pw_2av_5codec_5codec_5Codec_9long_name_1__get__(o);
4774 }
4775
__pyx_getprop_2av_5codec_5codec_5Codec_type(PyObject * o,CYTHON_UNUSED void * x)4776 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_type(PyObject *o, CYTHON_UNUSED void *x) {
4777 return __pyx_pw_2av_5codec_5codec_5Codec_4type_1__get__(o);
4778 }
4779
__pyx_getprop_2av_5codec_5codec_5Codec_id(PyObject * o,CYTHON_UNUSED void * x)4780 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_id(PyObject *o, CYTHON_UNUSED void *x) {
4781 return __pyx_pw_2av_5codec_5codec_5Codec_2id_1__get__(o);
4782 }
4783
__pyx_getprop_2av_5codec_5codec_5Codec_frame_rates(PyObject * o,CYTHON_UNUSED void * x)4784 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_frame_rates(PyObject *o, CYTHON_UNUSED void *x) {
4785 return __pyx_pw_2av_5codec_5codec_5Codec_11frame_rates_1__get__(o);
4786 }
4787
__pyx_getprop_2av_5codec_5codec_5Codec_audio_rates(PyObject * o,CYTHON_UNUSED void * x)4788 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_audio_rates(PyObject *o, CYTHON_UNUSED void *x) {
4789 return __pyx_pw_2av_5codec_5codec_5Codec_11audio_rates_1__get__(o);
4790 }
4791
__pyx_getprop_2av_5codec_5codec_5Codec_video_formats(PyObject * o,CYTHON_UNUSED void * x)4792 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_video_formats(PyObject *o, CYTHON_UNUSED void *x) {
4793 return __pyx_pw_2av_5codec_5codec_5Codec_13video_formats_1__get__(o);
4794 }
4795
__pyx_getprop_2av_5codec_5codec_5Codec_audio_formats(PyObject * o,CYTHON_UNUSED void * x)4796 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_audio_formats(PyObject *o, CYTHON_UNUSED void *x) {
4797 return __pyx_pw_2av_5codec_5codec_5Codec_13audio_formats_1__get__(o);
4798 }
4799
__pyx_getprop_2av_5codec_5codec_5Codec_is_encoder(PyObject * o,CYTHON_UNUSED void * x)4800 static PyObject *__pyx_getprop_2av_5codec_5codec_5Codec_is_encoder(PyObject *o, CYTHON_UNUSED void *x) {
4801 return __pyx_pw_2av_5codec_5codec_5Codec_10is_encoder_1__get__(o);
4802 }
4803
4804 static PyMethodDef __pyx_methods_2av_5codec_5codec_Codec[] = {
4805 {"create", (PyCFunction)__pyx_pw_2av_5codec_5codec_5Codec_3create, METH_NOARGS, __pyx_doc_2av_5codec_5codec_5Codec_2create},
4806 {"properties", (PyCFunction)__pyx_pw_2av_5codec_5codec_5Codec_5properties, METH_NOARGS, __pyx_doc_2av_5codec_5codec_5Codec_4properties},
4807 {"capabilities", (PyCFunction)__pyx_pw_2av_5codec_5codec_5Codec_7capabilities, METH_NOARGS, __pyx_doc_2av_5codec_5codec_5Codec_6capabilities},
4808 {"__reduce_cython__", (PyCFunction)__pyx_pw_2av_5codec_5codec_5Codec_9__reduce_cython__, METH_NOARGS, __pyx_doc_2av_5codec_5codec_5Codec_8__reduce_cython__},
4809 {"__setstate_cython__", (PyCFunction)__pyx_pw_2av_5codec_5codec_5Codec_11__setstate_cython__, METH_O, __pyx_doc_2av_5codec_5codec_5Codec_10__setstate_cython__},
4810 {0, 0, 0, 0}
4811 };
4812
4813 static struct PyGetSetDef __pyx_getsets_2av_5codec_5codec_Codec[] = {
4814 {(char *)"is_decoder", __pyx_getprop_2av_5codec_5codec_5Codec_is_decoder, 0, (char *)0, 0},
4815 {(char *)"descriptor", __pyx_getprop_2av_5codec_5codec_5Codec_descriptor, 0, (char *)0, 0},
4816 {(char *)"name", __pyx_getprop_2av_5codec_5codec_5Codec_name, 0, (char *)0, 0},
4817 {(char *)"long_name", __pyx_getprop_2av_5codec_5codec_5Codec_long_name, 0, (char *)0, 0},
4818 {(char *)"type", __pyx_getprop_2av_5codec_5codec_5Codec_type, 0, (char *)"\n The media type of this codec.\n\n E.g: ``'audio'``, ``'video'``, ``'subtitle'``.\n\n ", 0},
4819 {(char *)"id", __pyx_getprop_2av_5codec_5codec_5Codec_id, 0, (char *)0, 0},
4820 {(char *)"frame_rates", __pyx_getprop_2av_5codec_5codec_5Codec_frame_rates, 0, (char *)"A list of supported frame rates (:class:`fractions.Fraction`), or ``None``.", 0},
4821 {(char *)"audio_rates", __pyx_getprop_2av_5codec_5codec_5Codec_audio_rates, 0, (char *)"A list of supported audio sample rates (``int``), or ``None``.", 0},
4822 {(char *)"video_formats", __pyx_getprop_2av_5codec_5codec_5Codec_video_formats, 0, (char *)"A list of supported :class:`.VideoFormat`, or ``None``.", 0},
4823 {(char *)"audio_formats", __pyx_getprop_2av_5codec_5codec_5Codec_audio_formats, 0, (char *)"A list of supported :class:`.AudioFormat`, or ``None``.", 0},
4824 {(char *)"is_encoder", __pyx_getprop_2av_5codec_5codec_5Codec_is_encoder, 0, (char *)0, 0},
4825 {0, 0, 0, 0, 0}
4826 };
4827
4828 static PyTypeObject __pyx_type_2av_5codec_5codec_Codec = {
4829 PyVarObject_HEAD_INIT(0, 0)
4830 "av.codec.codec.Codec", /*tp_name*/
4831 sizeof(struct __pyx_obj_2av_5codec_5codec_Codec), /*tp_basicsize*/
4832 0, /*tp_itemsize*/
4833 __pyx_tp_dealloc_2av_5codec_5codec_Codec, /*tp_dealloc*/
4834 #if PY_VERSION_HEX < 0x030800b4
4835 0, /*tp_print*/
4836 #endif
4837 #if PY_VERSION_HEX >= 0x030800b4
4838 0, /*tp_vectorcall_offset*/
4839 #endif
4840 0, /*tp_getattr*/
4841 0, /*tp_setattr*/
4842 #if PY_MAJOR_VERSION < 3
4843 0, /*tp_compare*/
4844 #endif
4845 #if PY_MAJOR_VERSION >= 3
4846 0, /*tp_as_async*/
4847 #endif
4848 0, /*tp_repr*/
4849 0, /*tp_as_number*/
4850 0, /*tp_as_sequence*/
4851 0, /*tp_as_mapping*/
4852 0, /*tp_hash*/
4853 0, /*tp_call*/
4854 0, /*tp_str*/
4855 0, /*tp_getattro*/
4856 0, /*tp_setattro*/
4857 0, /*tp_as_buffer*/
4858 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
4859 "Codec(name, mode='r')\n\n :param str name: The codec name.\n :param str mode: ``'r'`` for decoding or ``'w'`` for encoding.\n\n This object exposes information about an availible codec, and an avenue to\n create a :class:`.CodecContext` to encode/decode directly.\n\n ::\n\n >>> codec = Codec('mpeg4', 'r')\n >>> codec.name\n 'mpeg4'\n >>> codec.type\n 'video'\n >>> codec.is_encoder\n False\n\n ", /*tp_doc*/
4860 0, /*tp_traverse*/
4861 0, /*tp_clear*/
4862 0, /*tp_richcompare*/
4863 0, /*tp_weaklistoffset*/
4864 0, /*tp_iter*/
4865 0, /*tp_iternext*/
4866 __pyx_methods_2av_5codec_5codec_Codec, /*tp_methods*/
4867 0, /*tp_members*/
4868 __pyx_getsets_2av_5codec_5codec_Codec, /*tp_getset*/
4869 0, /*tp_base*/
4870 0, /*tp_dict*/
4871 0, /*tp_descr_get*/
4872 0, /*tp_descr_set*/
4873 0, /*tp_dictoffset*/
4874 0, /*tp_init*/
4875 0, /*tp_alloc*/
4876 __pyx_tp_new_2av_5codec_5codec_Codec, /*tp_new*/
4877 0, /*tp_free*/
4878 0, /*tp_is_gc*/
4879 0, /*tp_bases*/
4880 0, /*tp_mro*/
4881 0, /*tp_cache*/
4882 0, /*tp_subclasses*/
4883 0, /*tp_weaklist*/
4884 0, /*tp_del*/
4885 0, /*tp_version_tag*/
4886 #if PY_VERSION_HEX >= 0x030400a1
4887 0, /*tp_finalize*/
4888 #endif
4889 #if PY_VERSION_HEX >= 0x030800b1
4890 0, /*tp_vectorcall*/
4891 #endif
4892 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
4893 0, /*tp_print*/
4894 #endif
4895 };
4896
4897 static PyMethodDef __pyx_methods[] = {
4898 {0, 0, 0, 0}
4899 };
4900
4901 #if PY_MAJOR_VERSION >= 3
4902 #if CYTHON_PEP489_MULTI_PHASE_INIT
4903 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
4904 static int __pyx_pymod_exec_codec(PyObject* module); /*proto*/
4905 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
4906 {Py_mod_create, (void*)__pyx_pymod_create},
4907 {Py_mod_exec, (void*)__pyx_pymod_exec_codec},
4908 {0, NULL}
4909 };
4910 #endif
4911
4912 static struct PyModuleDef __pyx_moduledef = {
4913 PyModuleDef_HEAD_INIT,
4914 "codec",
4915 0, /* m_doc */
4916 #if CYTHON_PEP489_MULTI_PHASE_INIT
4917 0, /* m_size */
4918 #else
4919 -1, /* m_size */
4920 #endif
4921 __pyx_methods /* m_methods */,
4922 #if CYTHON_PEP489_MULTI_PHASE_INIT
4923 __pyx_moduledef_slots, /* m_slots */
4924 #else
4925 NULL, /* m_reload */
4926 #endif
4927 NULL, /* m_traverse */
4928 NULL, /* m_clear */
4929 NULL /* m_free */
4930 };
4931 #endif
4932 #ifndef CYTHON_SMALL_CODE
4933 #if defined(__clang__)
4934 #define CYTHON_SMALL_CODE
4935 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
4936 #define CYTHON_SMALL_CODE __attribute__((cold))
4937 #else
4938 #define CYTHON_SMALL_CODE
4939 #endif
4940 #endif
4941
4942 static __Pyx_StringTabEntry __pyx_string_tab[] = {
4943 {&__pyx_kp_s_18s_ERROR_s, __pyx_k_18s_ERROR_s, sizeof(__pyx_k_18s_ERROR_s), 0, 0, 1, 0},
4944 {&__pyx_n_s_AUTO_THREADS, __pyx_k_AUTO_THREADS, sizeof(__pyx_k_AUTO_THREADS), 0, 0, 1, 1},
4945 {&__pyx_n_s_AVOID_PROBING, __pyx_k_AVOID_PROBING, sizeof(__pyx_k_AVOID_PROBING), 0, 0, 1, 1},
4946 {&__pyx_kp_s_Audio_encoder_supports_receiving, __pyx_k_Audio_encoder_supports_receiving, sizeof(__pyx_k_Audio_encoder_supports_receiving), 0, 0, 1, 0},
4947 {&__pyx_n_s_BITMAP_SUB, __pyx_k_BITMAP_SUB, sizeof(__pyx_k_BITMAP_SUB), 0, 0, 1, 1},
4948 {&__pyx_n_s_CHANNEL_CONF, __pyx_k_CHANNEL_CONF, sizeof(__pyx_k_CHANNEL_CONF), 0, 0, 1, 1},
4949 {&__pyx_n_s_Capabilities, __pyx_k_Capabilities, sizeof(__pyx_k_Capabilities), 0, 0, 1, 1},
4950 {&__pyx_n_s_Codec, __pyx_k_Codec, sizeof(__pyx_k_Codec), 0, 0, 1, 1},
4951 {&__pyx_n_s_CodecContext, __pyx_k_CodecContext, sizeof(__pyx_k_CodecContext), 0, 0, 1, 1},
4952 {&__pyx_kp_s_Codec_can_be_fed_a_final_frame_w, __pyx_k_Codec_can_be_fed_a_final_frame_w, sizeof(__pyx_k_Codec_can_be_fed_a_final_frame_w), 0, 0, 1, 0},
4953 {&__pyx_kp_s_Codec_can_output_multiple_frames, __pyx_k_Codec_can_output_multiple_frames, sizeof(__pyx_k_Codec_can_output_multiple_frames), 0, 0, 1, 0},
4954 {&__pyx_kp_s_Codec_is_backed_by_a_hardware_im, __pyx_k_Codec_is_backed_by_a_hardware_im, sizeof(__pyx_k_Codec_is_backed_by_a_hardware_im), 0, 0, 1, 0},
4955 {&__pyx_kp_s_Codec_is_experimental_and_is_thu, __pyx_k_Codec_is_experimental_and_is_thu, sizeof(__pyx_k_Codec_is_experimental_and_is_thu), 0, 0, 1, 0},
4956 {&__pyx_kp_s_Codec_is_intra_only, __pyx_k_Codec_is_intra_only, sizeof(__pyx_k_Codec_is_intra_only), 0, 0, 1, 0},
4957 {&__pyx_kp_s_Codec_is_lossless, __pyx_k_Codec_is_lossless, sizeof(__pyx_k_Codec_is_lossless), 0, 0, 1, 0},
4958 {&__pyx_kp_s_Codec_is_potentially_backed_by_a, __pyx_k_Codec_is_potentially_backed_by_a, sizeof(__pyx_k_Codec_is_potentially_backed_by_a), 0, 0, 1, 0},
4959 {&__pyx_kp_s_Codec_should_fill_in_channel_con, __pyx_k_Codec_should_fill_in_channel_con, sizeof(__pyx_k_Codec_should_fill_in_channel_con), 0, 0, 1, 0},
4960 {&__pyx_kp_s_Codec_supports_avctx_thread_coun, __pyx_k_Codec_supports_avctx_thread_coun, sizeof(__pyx_k_Codec_supports_avctx_thread_coun), 0, 0, 1, 0},
4961 {&__pyx_kp_s_Codec_supports_changed_parameter, __pyx_k_Codec_supports_changed_parameter, sizeof(__pyx_k_Codec_supports_changed_parameter), 0, 0, 1, 0},
4962 {&__pyx_kp_s_Codec_supports_frame_level_multi, __pyx_k_Codec_supports_frame_level_multi, sizeof(__pyx_k_Codec_supports_frame_level_multi), 0, 0, 1, 0},
4963 {&__pyx_kp_s_Codec_supports_frame_reordering, __pyx_k_Codec_supports_frame_reordering, sizeof(__pyx_k_Codec_supports_frame_reordering), 0, 0, 1, 0},
4964 {&__pyx_kp_s_Codec_supports_lossless_compress, __pyx_k_Codec_supports_lossless_compress, sizeof(__pyx_k_Codec_supports_lossless_compress), 0, 0, 1, 0},
4965 {&__pyx_kp_s_Codec_supports_lossy_compression, __pyx_k_Codec_supports_lossy_compression, sizeof(__pyx_k_Codec_supports_lossy_compression), 0, 0, 1, 0},
4966 {&__pyx_kp_s_Codec_supports_slice_based_or_pa, __pyx_k_Codec_supports_slice_based_or_pa, sizeof(__pyx_k_Codec_supports_slice_based_or_pa), 0, 0, 1, 0},
4967 {&__pyx_kp_s_Codec_uses_get_buffer_for_alloca, __pyx_k_Codec_uses_get_buffer_for_alloca, sizeof(__pyx_k_Codec_uses_get_buffer_for_alloca), 0, 0, 1, 0},
4968 {&__pyx_kp_s_Codec_uses_only_intra_compressio, __pyx_k_Codec_uses_only_intra_compressio, sizeof(__pyx_k_Codec_uses_only_intra_compressio), 0, 0, 1, 0},
4969 {&__pyx_kp_s_Codecs_D_Decoding_supported_E_En, __pyx_k_Codecs_D_Decoding_supported_E_En, sizeof(__pyx_k_Codecs_D_Decoding_supported_E_En), 0, 0, 1, 0},
4970 {&__pyx_kp_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 0},
4971 {&__pyx_n_s_DELAY, __pyx_k_DELAY, sizeof(__pyx_k_DELAY), 0, 0, 1, 1},
4972 {&__pyx_n_s_DR1, __pyx_k_DR1, sizeof(__pyx_k_DR1), 0, 0, 1, 1},
4973 {&__pyx_n_s_DRAW_HORIZ_BAND, __pyx_k_DRAW_HORIZ_BAND, sizeof(__pyx_k_DRAW_HORIZ_BAND), 0, 0, 1, 1},
4974 {&__pyx_kp_s_Decoder_can_use_draw_horiz_band, __pyx_k_Decoder_can_use_draw_horiz_band, sizeof(__pyx_k_Decoder_can_use_draw_horiz_band), 0, 0, 1, 0},
4975 {&__pyx_kp_s_Decoder_is_not_a_preferred_choic, __pyx_k_Decoder_is_not_a_preferred_choic, sizeof(__pyx_k_Decoder_is_not_a_preferred_choic), 0, 0, 1, 0},
4976 {&__pyx_kp_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 0},
4977 {&__pyx_n_s_ENCODER_REORDERED_OPAQUE, __pyx_k_ENCODER_REORDERED_OPAQUE, sizeof(__pyx_k_ENCODER_REORDERED_OPAQUE), 0, 0, 1, 1},
4978 {&__pyx_n_s_EXPERIMENTAL, __pyx_k_EXPERIMENTAL, sizeof(__pyx_k_EXPERIMENTAL), 0, 0, 1, 1},
4979 {&__pyx_kp_s_Encoder_or_decoder_requires_flus, __pyx_k_Encoder_or_decoder_requires_flus, sizeof(__pyx_k_Encoder_or_decoder_requires_flus), 0, 0, 1, 0},
4980 {&__pyx_n_s_FRAME_THREADS, __pyx_k_FRAME_THREADS, sizeof(__pyx_k_FRAME_THREADS), 0, 0, 1, 1},
4981 {&__pyx_kp_s_Found_codec_does_not_match_mode, __pyx_k_Found_codec_does_not_match_mode, sizeof(__pyx_k_Found_codec_does_not_match_mode), 0, 0, 1, 0},
4982 {&__pyx_n_s_HARDWARE, __pyx_k_HARDWARE, sizeof(__pyx_k_HARDWARE), 0, 0, 1, 1},
4983 {&__pyx_n_s_HWACCEL, __pyx_k_HWACCEL, sizeof(__pyx_k_HWACCEL), 0, 0, 1, 1},
4984 {&__pyx_n_s_HWACCEL_VDPAU, __pyx_k_HWACCEL_VDPAU, sizeof(__pyx_k_HWACCEL_VDPAU), 0, 0, 1, 1},
4985 {&__pyx_n_s_HYBRID, __pyx_k_HYBRID, sizeof(__pyx_k_HYBRID), 0, 0, 1, 1},
4986 {&__pyx_kp_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 0},
4987 {&__pyx_n_s_INTRA_ONLY, __pyx_k_INTRA_ONLY, sizeof(__pyx_k_INTRA_ONLY), 0, 0, 1, 1},
4988 {&__pyx_kp_s_Invalid_mode_must_be_r_or_w, __pyx_k_Invalid_mode_must_be_r_or_w, sizeof(__pyx_k_Invalid_mode_must_be_r_or_w), 0, 0, 1, 0},
4989 {&__pyx_kp_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 0},
4990 {&__pyx_n_s_LOSSLESS, __pyx_k_LOSSLESS, sizeof(__pyx_k_LOSSLESS), 0, 0, 1, 1},
4991 {&__pyx_n_s_LOSSY, __pyx_k_LOSSY, sizeof(__pyx_k_LOSSY), 0, 0, 1, 1},
4992 {&__pyx_n_s_NEG_LINESIZES, __pyx_k_NEG_LINESIZES, sizeof(__pyx_k_NEG_LINESIZES), 0, 0, 1, 1},
4993 {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1},
4994 {&__pyx_kp_s_No_codec_descriptor_for_r, __pyx_k_No_codec_descriptor_for_r, sizeof(__pyx_k_No_codec_descriptor_for_r), 0, 0, 1, 0},
4995 {&__pyx_n_s_PARAM_CHANGE, __pyx_k_PARAM_CHANGE, sizeof(__pyx_k_PARAM_CHANGE), 0, 0, 1, 1},
4996 {&__pyx_n_s_Properties, __pyx_k_Properties, sizeof(__pyx_k_Properties), 0, 0, 1, 1},
4997 {&__pyx_n_s_REORDER, __pyx_k_REORDER, sizeof(__pyx_k_REORDER), 0, 0, 1, 1},
4998 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
4999 {&__pyx_kp_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 0},
5000 {&__pyx_n_s_SLICE_THREADS, __pyx_k_SLICE_THREADS, sizeof(__pyx_k_SLICE_THREADS), 0, 0, 1, 1},
5001 {&__pyx_n_s_SMALL_LAST_FRAME, __pyx_k_SMALL_LAST_FRAME, sizeof(__pyx_k_SMALL_LAST_FRAME), 0, 0, 1, 1},
5002 {&__pyx_n_s_SUBFRAMES, __pyx_k_SUBFRAMES, sizeof(__pyx_k_SUBFRAMES), 0, 0, 1, 1},
5003 {&__pyx_kp_s_Subtitle_codec_is_bitmap_based_D, __pyx_k_Subtitle_codec_is_bitmap_based_D, sizeof(__pyx_k_Subtitle_codec_is_bitmap_based_D), 0, 0, 1, 0},
5004 {&__pyx_kp_s_Subtitle_codec_is_text_based_Dec, __pyx_k_Subtitle_codec_is_text_based_Dec, sizeof(__pyx_k_Subtitle_codec_is_text_based_Dec), 0, 0, 1, 0},
5005 {&__pyx_n_s_TEXT_SUB, __pyx_k_TEXT_SUB, sizeof(__pyx_k_TEXT_SUB), 0, 0, 1, 1},
5006 {&__pyx_n_s_TRUNCATED, __pyx_k_TRUNCATED, sizeof(__pyx_k_TRUNCATED), 0, 0, 1, 1},
5007 {&__pyx_kp_s_This_codec_takes_the_reordered_o, __pyx_k_This_codec_takes_the_reordered_o, sizeof(__pyx_k_This_codec_takes_the_reordered_o), 0, 0, 1, 0},
5008 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
5009 {&__pyx_n_s_UnknownCodecError, __pyx_k_UnknownCodecError, sizeof(__pyx_k_UnknownCodecError), 0, 0, 1, 1},
5010 {&__pyx_n_s_VARIABLE_FRAME_SIZE, __pyx_k_VARIABLE_FRAME_SIZE, sizeof(__pyx_k_VARIABLE_FRAME_SIZE), 0, 0, 1, 1},
5011 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
5012 {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
5013 {&__pyx_n_s_auto_threads, __pyx_k_auto_threads, sizeof(__pyx_k_auto_threads), 0, 0, 1, 1},
5014 {&__pyx_kp_s_av_codec, __pyx_k_av_codec, sizeof(__pyx_k_av_codec), 0, 0, 1, 0},
5015 {&__pyx_n_s_av_codec_codec, __pyx_k_av_codec_codec, sizeof(__pyx_k_av_codec_codec), 0, 0, 1, 1},
5016 {&__pyx_kp_s_av_codec_codec_pyx, __pyx_k_av_codec_codec_pyx, sizeof(__pyx_k_av_codec_codec_pyx), 0, 0, 1, 0},
5017 {&__pyx_n_s_avoid_probing, __pyx_k_avoid_probing, sizeof(__pyx_k_avoid_probing), 0, 0, 1, 1},
5018 {&__pyx_n_s_bitmap_sub, __pyx_k_bitmap_sub, sizeof(__pyx_k_bitmap_sub), 0, 0, 1, 1},
5019 {&__pyx_n_s_capabilities, __pyx_k_capabilities, sizeof(__pyx_k_capabilities), 0, 0, 1, 1},
5020 {&__pyx_n_s_channel_conf, __pyx_k_channel_conf, sizeof(__pyx_k_channel_conf), 0, 0, 1, 1},
5021 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
5022 {&__pyx_n_s_codec, __pyx_k_codec, sizeof(__pyx_k_codec), 0, 0, 1, 1},
5023 {&__pyx_n_s_codec_descriptor, __pyx_k_codec_descriptor, sizeof(__pyx_k_codec_descriptor), 0, 0, 1, 1},
5024 {&__pyx_n_s_codecs_available, __pyx_k_codecs_available, sizeof(__pyx_k_codecs_available), 0, 0, 1, 1},
5025 {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
5026 {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1},
5027 {&__pyx_n_s_d_codec, __pyx_k_d_codec, sizeof(__pyx_k_d_codec), 0, 0, 1, 1},
5028 {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1},
5029 {&__pyx_n_s_den, __pyx_k_den, sizeof(__pyx_k_den), 0, 0, 1, 1},
5030 {&__pyx_n_s_denum, __pyx_k_denum, sizeof(__pyx_k_denum), 0, 0, 1, 1},
5031 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
5032 {&__pyx_n_s_dr1, __pyx_k_dr1, sizeof(__pyx_k_dr1), 0, 0, 1, 1},
5033 {&__pyx_n_s_draw_horiz_band, __pyx_k_draw_horiz_band, sizeof(__pyx_k_draw_horiz_band), 0, 0, 1, 1},
5034 {&__pyx_n_s_dump_codecs, __pyx_k_dump_codecs, sizeof(__pyx_k_dump_codecs), 0, 0, 1, 1},
5035 {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
5036 {&__pyx_n_s_e_codec, __pyx_k_e_codec, sizeof(__pyx_k_e_codec), 0, 0, 1, 1},
5037 {&__pyx_n_s_encoder_reordered_opaque, __pyx_k_encoder_reordered_opaque, sizeof(__pyx_k_encoder_reordered_opaque), 0, 0, 1, 1},
5038 {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
5039 {&__pyx_n_s_experimental, __pyx_k_experimental, sizeof(__pyx_k_experimental), 0, 0, 1, 1},
5040 {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
5041 {&__pyx_n_s_flag_property, __pyx_k_flag_property, sizeof(__pyx_k_flag_property), 0, 0, 1, 1},
5042 {&__pyx_n_s_frame_threads, __pyx_k_frame_threads, sizeof(__pyx_k_frame_threads), 0, 0, 1, 1},
5043 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
5044 {&__pyx_n_s_hardware, __pyx_k_hardware, sizeof(__pyx_k_hardware), 0, 0, 1, 1},
5045 {&__pyx_n_s_hwaccel, __pyx_k_hwaccel, sizeof(__pyx_k_hwaccel), 0, 0, 1, 1},
5046 {&__pyx_n_s_hwaccel_vdpau, __pyx_k_hwaccel_vdpau, sizeof(__pyx_k_hwaccel_vdpau), 0, 0, 1, 1},
5047 {&__pyx_n_s_hybrid, __pyx_k_hybrid, sizeof(__pyx_k_hybrid), 0, 0, 1, 1},
5048 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
5049 {&__pyx_n_s_intra_only, __pyx_k_intra_only, sizeof(__pyx_k_intra_only), 0, 0, 1, 1},
5050 {&__pyx_n_s_long_name, __pyx_k_long_name, sizeof(__pyx_k_long_name), 0, 0, 1, 1},
5051 {&__pyx_n_s_lossless, __pyx_k_lossless, sizeof(__pyx_k_lossless), 0, 0, 1, 1},
5052 {&__pyx_n_s_lossy, __pyx_k_lossy, sizeof(__pyx_k_lossy), 0, 0, 1, 1},
5053 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
5054 {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
5055 {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
5056 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
5057 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
5058 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
5059 {&__pyx_n_s_neg_linesizes, __pyx_k_neg_linesizes, sizeof(__pyx_k_neg_linesizes), 0, 0, 1, 1},
5060 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
5061 {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
5062 {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
5063 {&__pyx_n_s_param_change, __pyx_k_param_change, sizeof(__pyx_k_param_change), 0, 0, 1, 1},
5064 {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
5065 {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
5066 {&__pyx_n_s_properties, __pyx_k_properties, sizeof(__pyx_k_properties), 0, 0, 1, 1},
5067 {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
5068 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
5069 {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
5070 {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
5071 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
5072 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
5073 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
5074 {&__pyx_n_s_reorder, __pyx_k_reorder, sizeof(__pyx_k_reorder), 0, 0, 1, 1},
5075 {&__pyx_kp_s_s_is_both_encoder_and_decoder, __pyx_k_s_is_both_encoder_and_decoder, sizeof(__pyx_k_s_is_both_encoder_and_decoder), 0, 0, 1, 0},
5076 {&__pyx_kp_s_s_s_s_s_s_s_18s_s, __pyx_k_s_s_s_s_s_s_18s_s, sizeof(__pyx_k_s_s_s_s_s_s_18s_s), 0, 0, 1, 0},
5077 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
5078 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
5079 {&__pyx_n_s_slice_threads, __pyx_k_slice_threads, sizeof(__pyx_k_slice_threads), 0, 0, 1, 1},
5080 {&__pyx_n_s_small_last_frame, __pyx_k_small_last_frame, sizeof(__pyx_k_small_last_frame), 0, 0, 1, 1},
5081 {&__pyx_n_s_subframes, __pyx_k_subframes, sizeof(__pyx_k_subframes), 0, 0, 1, 1},
5082 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
5083 {&__pyx_n_s_text_sub, __pyx_k_text_sub, sizeof(__pyx_k_text_sub), 0, 0, 1, 1},
5084 {&__pyx_n_s_truncated, __pyx_k_truncated, sizeof(__pyx_k_truncated), 0, 0, 1, 1},
5085 {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
5086 {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
5087 {&__pyx_n_s_variable_frame_size, __pyx_k_variable_frame_size, sizeof(__pyx_k_variable_frame_size), 0, 0, 1, 1},
5088 {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
5089 {0, 0, 0, 0, 0, 0, 0}
5090 };
__Pyx_InitCachedBuiltins(void)5091 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
5092 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 8, __pyx_L1_error)
5093 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 136, __pyx_L1_error)
5094 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 188, __pyx_L1_error)
5095 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
5096 return 0;
5097 __pyx_L1_error:;
5098 return -1;
5099 }
5100
__Pyx_InitCachedConstants(void)5101 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
5102 __Pyx_RefNannyDeclarations
5103 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
5104
5105 /* "av/codec/codec.pyx":204
5106 * # Sanity check.
5107 * if self.is_encoder and lib.av_codec_is_decoder(self.ptr):
5108 * raise RuntimeError('%s is both encoder and decoder.') # <<<<<<<<<<<<<<
5109 *
5110 * def create(self):
5111 */
5112 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_s_is_both_encoder_and_decoder); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 204, __pyx_L1_error)
5113 __Pyx_GOTREF(__pyx_tuple_);
5114 __Pyx_GIVEREF(__pyx_tuple_);
5115
5116 /* "(tree fragment)":2
5117 * def __reduce_cython__(self):
5118 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5119 * def __setstate_cython__(self, __pyx_state):
5120 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5121 */
5122 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
5123 __Pyx_GOTREF(__pyx_tuple__3);
5124 __Pyx_GIVEREF(__pyx_tuple__3);
5125
5126 /* "(tree fragment)":4
5127 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5128 * def __setstate_cython__(self, __pyx_state):
5129 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5130 */
5131 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
5132 __Pyx_GOTREF(__pyx_tuple__4);
5133 __Pyx_GIVEREF(__pyx_tuple__4);
5134
5135 /* "av/codec/codec.pyx":20
5136 *
5137 * Properties = define_enum('Properties', 'av.codec', (
5138 * ('NONE', 0), # <<<<<<<<<<<<<<
5139 * ('INTRA_ONLY', lib.AV_CODEC_PROP_INTRA_ONLY,
5140 * """Codec uses only intra compression.
5141 */
5142 __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_NONE, __pyx_int_0); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 20, __pyx_L1_error)
5143 __Pyx_GOTREF(__pyx_tuple__5);
5144 __Pyx_GIVEREF(__pyx_tuple__5);
5145
5146 /* "av/codec/codec.pyx":56
5147 * assume the buffer was allocated by avcodec_default_get_buffer."""),
5148 * ('TRUNCATED', lib.AV_CODEC_CAP_TRUNCATED),
5149 * ('HWACCEL', 1 << 4), # <<<<<<<<<<<<<<
5150 * ('DELAY', lib.AV_CODEC_CAP_DELAY,
5151 * """Encoder or decoder requires flushing with NULL input at the end in order to
5152 */
5153 __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_HWACCEL, __pyx_int_16); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 56, __pyx_L1_error)
5154 __Pyx_GOTREF(__pyx_tuple__6);
5155 __Pyx_GIVEREF(__pyx_tuple__6);
5156
5157 /* "av/codec/codec.pyx":82
5158 * """Codec can be fed a final frame with a smaller size.
5159 * This can be used to prevent truncation of the last audio samples."""),
5160 * ('HWACCEL_VDPAU', 1 << 7), # <<<<<<<<<<<<<<
5161 * ('SUBFRAMES', lib.AV_CODEC_CAP_SUBFRAMES,
5162 * """Codec can output multiple frames per AVPacket
5163 */
5164 __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_HWACCEL_VDPAU, __pyx_int_128); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 82, __pyx_L1_error)
5165 __Pyx_GOTREF(__pyx_tuple__7);
5166 __Pyx_GIVEREF(__pyx_tuple__7);
5167
5168 /* "av/codec/codec.pyx":98
5169 * ('CHANNEL_CONF', lib.AV_CODEC_CAP_CHANNEL_CONF,
5170 * """Codec should fill in channel configuration and samplerate instead of container"""),
5171 * ('NEG_LINESIZES', 1 << 11), # <<<<<<<<<<<<<<
5172 * ('FRAME_THREADS', lib.AV_CODEC_CAP_FRAME_THREADS,
5173 * """Codec supports frame-level multithreading""",),
5174 */
5175 __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_NEG_LINESIZES, __pyx_int_2048); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 98, __pyx_L1_error)
5176 __Pyx_GOTREF(__pyx_tuple__8);
5177 __Pyx_GIVEREF(__pyx_tuple__8);
5178
5179 /* "av/codec/codec.pyx":129
5180 * necessarily. This is used instead of AV_CODEC_CAP_HARDWARE, if the
5181 * implementation provides some sort of internal fallback."""),
5182 * ('ENCODER_REORDERED_OPAQUE', 1 << 20, # lib.AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, # FFmpeg 4.2 # <<<<<<<<<<<<<<
5183 * """This codec takes the reordered_opaque field from input AVFrames
5184 * and returns it in the corresponding field in AVCodecContext after
5185 */
5186 __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_ENCODER_REORDERED_OPAQUE, __pyx_int_1048576, __pyx_kp_s_This_codec_takes_the_reordered_o); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 129, __pyx_L1_error)
5187 __Pyx_GOTREF(__pyx_tuple__9);
5188 __Pyx_GIVEREF(__pyx_tuple__9);
5189
5190 /* "av/codec/codec.pyx":136
5191 *
5192 *
5193 * class UnknownCodecError(ValueError): # <<<<<<<<<<<<<<
5194 * pass
5195 *
5196 */
5197 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 136, __pyx_L1_error)
5198 __Pyx_GOTREF(__pyx_tuple__10);
5199 __Pyx_GIVEREF(__pyx_tuple__10);
5200
5201 /* "av/codec/codec.pyx":351
5202 *
5203 *
5204 * def dump_codecs(): # <<<<<<<<<<<<<<
5205 * """Print information about availible codecs."""
5206 *
5207 */
5208 __pyx_tuple__11 = PyTuple_Pack(5, __pyx_n_s_name, __pyx_n_s_e_codec, __pyx_n_s_d_codec, __pyx_n_s_codec, __pyx_n_s_e); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 351, __pyx_L1_error)
5209 __Pyx_GOTREF(__pyx_tuple__11);
5210 __Pyx_GIVEREF(__pyx_tuple__11);
5211 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_av_codec_codec_pyx, __pyx_n_s_dump_codecs, 351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 351, __pyx_L1_error)
5212 __Pyx_RefNannyFinishContext();
5213 return 0;
5214 __pyx_L1_error:;
5215 __Pyx_RefNannyFinishContext();
5216 return -1;
5217 }
5218
__Pyx_InitGlobals(void)5219 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
5220 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
5221 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
5222 __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
5223 __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) __PYX_ERR(0, 1, __pyx_L1_error)
5224 __pyx_int_2048 = PyInt_FromLong(2048); if (unlikely(!__pyx_int_2048)) __PYX_ERR(0, 1, __pyx_L1_error)
5225 __pyx_int_1048576 = PyInt_FromLong(1048576L); if (unlikely(!__pyx_int_1048576)) __PYX_ERR(0, 1, __pyx_L1_error)
5226 return 0;
5227 __pyx_L1_error:;
5228 return -1;
5229 }
5230
5231 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
5232 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
5233 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
5234 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
5235 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
5236 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
5237 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
5238
__Pyx_modinit_global_init_code(void)5239 static int __Pyx_modinit_global_init_code(void) {
5240 __Pyx_RefNannyDeclarations
5241 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
5242 /*--- Global init code ---*/
5243 __pyx_v_2av_5codec_5codec__cinit_sentinel = Py_None; Py_INCREF(Py_None);
5244 __Pyx_RefNannyFinishContext();
5245 return 0;
5246 }
5247
__Pyx_modinit_variable_export_code(void)5248 static int __Pyx_modinit_variable_export_code(void) {
5249 __Pyx_RefNannyDeclarations
5250 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
5251 /*--- Variable export code ---*/
5252 __Pyx_RefNannyFinishContext();
5253 return 0;
5254 }
5255
__Pyx_modinit_function_export_code(void)5256 static int __Pyx_modinit_function_export_code(void) {
5257 __Pyx_RefNannyDeclarations
5258 int __pyx_lineno = 0;
5259 const char *__pyx_filename = NULL;
5260 int __pyx_clineno = 0;
5261 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
5262 /*--- Function export code ---*/
5263 if (__Pyx_ExportFunction("wrap_codec", (void (*)(void))__pyx_f_2av_5codec_5codec_wrap_codec, "struct __pyx_obj_2av_5codec_5codec_Codec *(struct AVCodec const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5264 __Pyx_RefNannyFinishContext();
5265 return 0;
5266 __pyx_L1_error:;
5267 __Pyx_RefNannyFinishContext();
5268 return -1;
5269 }
5270
__Pyx_modinit_type_init_code(void)5271 static int __Pyx_modinit_type_init_code(void) {
5272 __Pyx_RefNannyDeclarations
5273 int __pyx_lineno = 0;
5274 const char *__pyx_filename = NULL;
5275 int __pyx_clineno = 0;
5276 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
5277 /*--- Type init code ---*/
5278 __pyx_vtabptr_2av_5codec_5codec_Codec = &__pyx_vtable_2av_5codec_5codec_Codec;
5279 __pyx_vtable_2av_5codec_5codec_Codec._init = (PyObject *(*)(struct __pyx_obj_2av_5codec_5codec_Codec *, struct __pyx_opt_args_2av_5codec_5codec_5Codec__init *__pyx_optional_args))__pyx_f_2av_5codec_5codec_5Codec__init;
5280 if (PyType_Ready(&__pyx_type_2av_5codec_5codec_Codec) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
5281 #if PY_VERSION_HEX < 0x030800B1
5282 __pyx_type_2av_5codec_5codec_Codec.tp_print = 0;
5283 #endif
5284 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_5codec_5codec_Codec.tp_dictoffset && __pyx_type_2av_5codec_5codec_Codec.tp_getattro == PyObject_GenericGetAttr)) {
5285 __pyx_type_2av_5codec_5codec_Codec.tp_getattro = __Pyx_PyObject_GenericGetAttr;
5286 }
5287 if (__Pyx_SetVtable(__pyx_type_2av_5codec_5codec_Codec.tp_dict, __pyx_vtabptr_2av_5codec_5codec_Codec) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
5288 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Codec, (PyObject *)&__pyx_type_2av_5codec_5codec_Codec) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
5289 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2av_5codec_5codec_Codec) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
5290 __pyx_ptype_2av_5codec_5codec_Codec = &__pyx_type_2av_5codec_5codec_Codec;
5291 __Pyx_RefNannyFinishContext();
5292 return 0;
5293 __pyx_L1_error:;
5294 __Pyx_RefNannyFinishContext();
5295 return -1;
5296 }
5297
__Pyx_modinit_type_import_code(void)5298 static int __Pyx_modinit_type_import_code(void) {
5299 __Pyx_RefNannyDeclarations
5300 PyObject *__pyx_t_1 = NULL;
5301 int __pyx_lineno = 0;
5302 const char *__pyx_filename = NULL;
5303 int __pyx_clineno = 0;
5304 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
5305 /*--- Type import code ---*/
5306 __pyx_t_1 = PyImport_ImportModule("av.audio.format"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error)
5307 __Pyx_GOTREF(__pyx_t_1);
5308 __pyx_ptype_2av_5audio_6format_AudioFormat = __Pyx_ImportType(__pyx_t_1, "av.audio.format", "AudioFormat", sizeof(struct __pyx_obj_2av_5audio_6format_AudioFormat), __Pyx_ImportType_CheckSize_Warn);
5309 if (!__pyx_ptype_2av_5audio_6format_AudioFormat) __PYX_ERR(3, 4, __pyx_L1_error)
5310 __pyx_vtabptr_2av_5audio_6format_AudioFormat = (struct __pyx_vtabstruct_2av_5audio_6format_AudioFormat*)__Pyx_GetVtable(__pyx_ptype_2av_5audio_6format_AudioFormat->tp_dict); if (unlikely(!__pyx_vtabptr_2av_5audio_6format_AudioFormat)) __PYX_ERR(3, 4, __pyx_L1_error)
5311 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5312 __pyx_t_1 = PyImport_ImportModule("av.descriptor"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
5313 __Pyx_GOTREF(__pyx_t_1);
5314 __pyx_ptype_2av_10descriptor_Descriptor = __Pyx_ImportType(__pyx_t_1, "av.descriptor", "Descriptor", sizeof(struct __pyx_obj_2av_10descriptor_Descriptor), __Pyx_ImportType_CheckSize_Warn);
5315 if (!__pyx_ptype_2av_10descriptor_Descriptor) __PYX_ERR(4, 4, __pyx_L1_error)
5316 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5317 __pyx_t_1 = PyImport_ImportModule("av.video.format"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4, __pyx_L1_error)
5318 __Pyx_GOTREF(__pyx_t_1);
5319 __pyx_ptype_2av_5video_6format_VideoFormat = __Pyx_ImportType(__pyx_t_1, "av.video.format", "VideoFormat", sizeof(struct __pyx_obj_2av_5video_6format_VideoFormat), __Pyx_ImportType_CheckSize_Warn);
5320 if (!__pyx_ptype_2av_5video_6format_VideoFormat) __PYX_ERR(5, 4, __pyx_L1_error)
5321 __pyx_vtabptr_2av_5video_6format_VideoFormat = (struct __pyx_vtabstruct_2av_5video_6format_VideoFormat*)__Pyx_GetVtable(__pyx_ptype_2av_5video_6format_VideoFormat->tp_dict); if (unlikely(!__pyx_vtabptr_2av_5video_6format_VideoFormat)) __PYX_ERR(5, 4, __pyx_L1_error)
5322 __pyx_ptype_2av_5video_6format_VideoFormatComponent = __Pyx_ImportType(__pyx_t_1, "av.video.format", "VideoFormatComponent", sizeof(struct __pyx_obj_2av_5video_6format_VideoFormatComponent), __Pyx_ImportType_CheckSize_Warn);
5323 if (!__pyx_ptype_2av_5video_6format_VideoFormatComponent) __PYX_ERR(5, 18, __pyx_L1_error)
5324 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5325 __Pyx_RefNannyFinishContext();
5326 return 0;
5327 __pyx_L1_error:;
5328 __Pyx_XDECREF(__pyx_t_1);
5329 __Pyx_RefNannyFinishContext();
5330 return -1;
5331 }
5332
__Pyx_modinit_variable_import_code(void)5333 static int __Pyx_modinit_variable_import_code(void) {
5334 __Pyx_RefNannyDeclarations
5335 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
5336 /*--- Variable import code ---*/
5337 __Pyx_RefNannyFinishContext();
5338 return 0;
5339 }
5340
__Pyx_modinit_function_import_code(void)5341 static int __Pyx_modinit_function_import_code(void) {
5342 __Pyx_RefNannyDeclarations
5343 PyObject *__pyx_t_1 = NULL;
5344 int __pyx_lineno = 0;
5345 const char *__pyx_filename = NULL;
5346 int __pyx_clineno = 0;
5347 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
5348 /*--- Function import code ---*/
5349 __pyx_t_1 = PyImport_ImportModule("av.audio.format"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
5350 __Pyx_GOTREF(__pyx_t_1);
5351 if (__Pyx_ImportFunction(__pyx_t_1, "get_audio_format", (void (**)(void))&__pyx_f_2av_5audio_6format_get_audio_format, "struct __pyx_obj_2av_5audio_6format_AudioFormat *(enum AVSampleFormat)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5352 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5353 __pyx_t_1 = PyImport_ImportModule("av.descriptor"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
5354 __Pyx_GOTREF(__pyx_t_1);
5355 if (__Pyx_ImportFunction(__pyx_t_1, "wrap_avclass", (void (**)(void))&__pyx_f_2av_10descriptor_wrap_avclass, "struct __pyx_obj_2av_10descriptor_Descriptor *(struct AVClass const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5356 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5357 __pyx_t_1 = PyImport_ImportModule("av.enum"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
5358 __Pyx_GOTREF(__pyx_t_1);
5359 if (__Pyx_ImportFunction(__pyx_t_1, "define_enum", (void (**)(void))&__pyx_f_2av_4enum_define_enum, "PyObject *(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_2av_4enum_define_enum *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5360 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5361 __pyx_t_1 = PyImport_ImportModule("av.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
5362 __Pyx_GOTREF(__pyx_t_1);
5363 if (__Pyx_ImportFunction(__pyx_t_1, "avrational_to_fraction", (void (**)(void))&__pyx_f_2av_5utils_avrational_to_fraction, "PyObject *(AVRational const *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5364 if (__Pyx_ImportFunction(__pyx_t_1, "flag_in_bitfield", (void (**)(void))&__pyx_f_2av_5utils_flag_in_bitfield, "PyObject *(uint64_t, uint64_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5365 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5366 __pyx_t_1 = PyImport_ImportModule("av.video.format"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
5367 __Pyx_GOTREF(__pyx_t_1);
5368 if (__Pyx_ImportFunction(__pyx_t_1, "get_video_format", (void (**)(void))&__pyx_f_2av_5video_6format_get_video_format, "struct __pyx_obj_2av_5video_6format_VideoFormat *(enum AVPixelFormat, unsigned int, unsigned int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5369 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5370 __Pyx_RefNannyFinishContext();
5371 return 0;
5372 __pyx_L1_error:;
5373 __Pyx_XDECREF(__pyx_t_1);
5374 __Pyx_RefNannyFinishContext();
5375 return -1;
5376 }
5377
5378
5379 #ifndef CYTHON_NO_PYINIT_EXPORT
5380 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
5381 #elif PY_MAJOR_VERSION < 3
5382 #ifdef __cplusplus
5383 #define __Pyx_PyMODINIT_FUNC extern "C" void
5384 #else
5385 #define __Pyx_PyMODINIT_FUNC void
5386 #endif
5387 #else
5388 #ifdef __cplusplus
5389 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
5390 #else
5391 #define __Pyx_PyMODINIT_FUNC PyObject *
5392 #endif
5393 #endif
5394
5395
5396 #if PY_MAJOR_VERSION < 3
5397 __Pyx_PyMODINIT_FUNC initcodec(void) CYTHON_SMALL_CODE; /*proto*/
initcodec(void)5398 __Pyx_PyMODINIT_FUNC initcodec(void)
5399 #else
5400 __Pyx_PyMODINIT_FUNC PyInit_codec(void) CYTHON_SMALL_CODE; /*proto*/
5401 __Pyx_PyMODINIT_FUNC PyInit_codec(void)
5402 #if CYTHON_PEP489_MULTI_PHASE_INIT
5403 {
5404 return PyModuleDef_Init(&__pyx_moduledef);
5405 }
5406 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
5407 #if PY_VERSION_HEX >= 0x030700A1
5408 static PY_INT64_T main_interpreter_id = -1;
5409 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
5410 if (main_interpreter_id == -1) {
5411 main_interpreter_id = current_id;
5412 return (unlikely(current_id == -1)) ? -1 : 0;
5413 } else if (unlikely(main_interpreter_id != current_id))
5414 #else
5415 static PyInterpreterState *main_interpreter = NULL;
5416 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
5417 if (!main_interpreter) {
5418 main_interpreter = current_interpreter;
5419 } else if (unlikely(main_interpreter != current_interpreter))
5420 #endif
5421 {
5422 PyErr_SetString(
5423 PyExc_ImportError,
5424 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
5425 return -1;
5426 }
5427 return 0;
5428 }
5429 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
5430 PyObject *value = PyObject_GetAttrString(spec, from_name);
5431 int result = 0;
5432 if (likely(value)) {
5433 if (allow_none || value != Py_None) {
5434 result = PyDict_SetItemString(moddict, to_name, value);
5435 }
5436 Py_DECREF(value);
5437 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
5438 PyErr_Clear();
5439 } else {
5440 result = -1;
5441 }
5442 return result;
5443 }
5444 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
5445 PyObject *module = NULL, *moddict, *modname;
5446 if (__Pyx_check_single_interpreter())
5447 return NULL;
5448 if (__pyx_m)
5449 return __Pyx_NewRef(__pyx_m);
5450 modname = PyObject_GetAttrString(spec, "name");
5451 if (unlikely(!modname)) goto bad;
5452 module = PyModule_NewObject(modname);
5453 Py_DECREF(modname);
5454 if (unlikely(!module)) goto bad;
5455 moddict = PyModule_GetDict(module);
5456 if (unlikely(!moddict)) goto bad;
5457 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
5458 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
5459 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
5460 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
5461 return module;
5462 bad:
5463 Py_XDECREF(module);
5464 return NULL;
5465 }
5466
5467
5468 static CYTHON_SMALL_CODE int __pyx_pymod_exec_codec(PyObject *__pyx_pyinit_module)
5469 #endif
5470 #endif
5471 {
5472 PyObject *__pyx_t_1 = NULL;
5473 PyObject *__pyx_t_2 = NULL;
5474 PyObject *__pyx_t_3 = NULL;
5475 PyObject *__pyx_t_4 = NULL;
5476 PyObject *__pyx_t_5 = NULL;
5477 PyObject *__pyx_t_6 = NULL;
5478 PyObject *__pyx_t_7 = NULL;
5479 struct __pyx_opt_args_2av_4enum_define_enum __pyx_t_8;
5480 PyObject *__pyx_t_9 = NULL;
5481 PyObject *__pyx_t_10 = NULL;
5482 PyObject *__pyx_t_11 = NULL;
5483 PyObject *__pyx_t_12 = NULL;
5484 PyObject *__pyx_t_13 = NULL;
5485 PyObject *__pyx_t_14 = NULL;
5486 PyObject *__pyx_t_15 = NULL;
5487 PyObject *__pyx_t_16 = NULL;
5488 PyObject *__pyx_t_17 = NULL;
5489 PyObject *__pyx_t_18 = NULL;
5490 PyObject *__pyx_t_19 = NULL;
5491 PyObject *__pyx_t_20 = NULL;
5492 int __pyx_lineno = 0;
5493 const char *__pyx_filename = NULL;
5494 int __pyx_clineno = 0;
5495 __Pyx_RefNannyDeclarations
5496 #if CYTHON_PEP489_MULTI_PHASE_INIT
5497 if (__pyx_m) {
5498 if (__pyx_m == __pyx_pyinit_module) return 0;
5499 PyErr_SetString(PyExc_RuntimeError, "Module 'codec' has already been imported. Re-initialisation is not supported.");
5500 return -1;
5501 }
5502 #elif PY_MAJOR_VERSION >= 3
5503 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
5504 #endif
5505 #if CYTHON_REFNANNY
5506 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
5507 if (!__Pyx_RefNanny) {
5508 PyErr_Clear();
5509 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
5510 if (!__Pyx_RefNanny)
5511 Py_FatalError("failed to import 'refnanny' module");
5512 }
5513 #endif
5514 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_codec(void)", 0);
5515 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5516 #ifdef __Pxy_PyFrame_Initialize_Offsets
5517 __Pxy_PyFrame_Initialize_Offsets();
5518 #endif
5519 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
5520 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
5521 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
5522 #ifdef __Pyx_CyFunction_USED
5523 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5524 #endif
5525 #ifdef __Pyx_FusedFunction_USED
5526 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5527 #endif
5528 #ifdef __Pyx_Coroutine_USED
5529 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5530 #endif
5531 #ifdef __Pyx_Generator_USED
5532 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5533 #endif
5534 #ifdef __Pyx_AsyncGen_USED
5535 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5536 #endif
5537 #ifdef __Pyx_StopAsyncIteration_USED
5538 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5539 #endif
5540 /*--- Library function declarations ---*/
5541 /*--- Threads initialization code ---*/
5542 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
5543 #ifdef WITH_THREAD /* Python build with threading support? */
5544 PyEval_InitThreads();
5545 #endif
5546 #endif
5547 /*--- Module creation code ---*/
5548 #if CYTHON_PEP489_MULTI_PHASE_INIT
5549 __pyx_m = __pyx_pyinit_module;
5550 Py_INCREF(__pyx_m);
5551 #else
5552 #if PY_MAJOR_VERSION < 3
5553 __pyx_m = Py_InitModule4("codec", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
5554 #else
5555 __pyx_m = PyModule_Create(&__pyx_moduledef);
5556 #endif
5557 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
5558 #endif
5559 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
5560 Py_INCREF(__pyx_d);
5561 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
5562 Py_INCREF(__pyx_b);
5563 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
5564 Py_INCREF(__pyx_cython_runtime);
5565 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
5566 /*--- Initialize various global constants etc. ---*/
5567 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5568 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
5569 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5570 #endif
5571 if (__pyx_module_is_main_av__codec__codec) {
5572 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5573 }
5574 #if PY_MAJOR_VERSION >= 3
5575 {
5576 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
5577 if (!PyDict_GetItemString(modules, "av.codec.codec")) {
5578 if (unlikely(PyDict_SetItemString(modules, "av.codec.codec", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
5579 }
5580 }
5581 #endif
5582 /*--- Builtin init code ---*/
5583 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5584 /*--- Constants init code ---*/
5585 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5586 /*--- Global type/function init code ---*/
5587 (void)__Pyx_modinit_global_init_code();
5588 (void)__Pyx_modinit_variable_export_code();
5589 if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
5590 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
5591 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
5592 (void)__Pyx_modinit_variable_import_code();
5593 if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
5594 /*--- Execution code ---*/
5595 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
5596 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5597 #endif
5598
5599 /* "av/codec/codec.pyx":8
5600 *
5601 *
5602 * cdef object _cinit_sentinel = object() # <<<<<<<<<<<<<<
5603 *
5604 *
5605 */
5606 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
5607 __Pyx_GOTREF(__pyx_t_1);
5608 __Pyx_XGOTREF(__pyx_v_2av_5codec_5codec__cinit_sentinel);
5609 __Pyx_DECREF_SET(__pyx_v_2av_5codec_5codec__cinit_sentinel, __pyx_t_1);
5610 __Pyx_GIVEREF(__pyx_t_1);
5611 __pyx_t_1 = 0;
5612
5613 /* "av/codec/codec.pyx":21
5614 * Properties = define_enum('Properties', 'av.codec', (
5615 * ('NONE', 0),
5616 * ('INTRA_ONLY', lib.AV_CODEC_PROP_INTRA_ONLY, # <<<<<<<<<<<<<<
5617 * """Codec uses only intra compression.
5618 * Video and audio codecs only."""),
5619 */
5620 __pyx_t_1 = __Pyx_PyInt_From_int(AV_CODEC_PROP_INTRA_ONLY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
5621 __Pyx_GOTREF(__pyx_t_1);
5622 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
5623 __Pyx_GOTREF(__pyx_t_2);
5624 __Pyx_INCREF(__pyx_n_s_INTRA_ONLY);
5625 __Pyx_GIVEREF(__pyx_n_s_INTRA_ONLY);
5626 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_INTRA_ONLY);
5627 __Pyx_GIVEREF(__pyx_t_1);
5628 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
5629 __Pyx_INCREF(__pyx_kp_s_Codec_uses_only_intra_compressio);
5630 __Pyx_GIVEREF(__pyx_kp_s_Codec_uses_only_intra_compressio);
5631 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_s_Codec_uses_only_intra_compressio);
5632 __pyx_t_1 = 0;
5633
5634 /* "av/codec/codec.pyx":24
5635 * """Codec uses only intra compression.
5636 * Video and audio codecs only."""),
5637 * ('LOSSY', lib.AV_CODEC_PROP_LOSSY, # <<<<<<<<<<<<<<
5638 * """Codec supports lossy compression. Audio and video codecs only.
5639 *
5640 */
5641 __pyx_t_1 = __Pyx_PyInt_From_int(AV_CODEC_PROP_LOSSY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
5642 __Pyx_GOTREF(__pyx_t_1);
5643 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
5644 __Pyx_GOTREF(__pyx_t_3);
5645 __Pyx_INCREF(__pyx_n_s_LOSSY);
5646 __Pyx_GIVEREF(__pyx_n_s_LOSSY);
5647 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_LOSSY);
5648 __Pyx_GIVEREF(__pyx_t_1);
5649 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
5650 __Pyx_INCREF(__pyx_kp_s_Codec_supports_lossy_compression);
5651 __Pyx_GIVEREF(__pyx_kp_s_Codec_supports_lossy_compression);
5652 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_s_Codec_supports_lossy_compression);
5653 __pyx_t_1 = 0;
5654
5655 /* "av/codec/codec.pyx":29
5656 * Note: A codec may support both lossy and lossless
5657 * compression modes."""),
5658 * ('LOSSLESS', lib.AV_CODEC_PROP_LOSSLESS, # <<<<<<<<<<<<<<
5659 * """Codec supports lossless compression. Audio and video codecs only."""),
5660 * ('REORDER', lib.AV_CODEC_PROP_REORDER,
5661 */
5662 __pyx_t_1 = __Pyx_PyInt_From_int(AV_CODEC_PROP_LOSSLESS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
5663 __Pyx_GOTREF(__pyx_t_1);
5664 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
5665 __Pyx_GOTREF(__pyx_t_4);
5666 __Pyx_INCREF(__pyx_n_s_LOSSLESS);
5667 __Pyx_GIVEREF(__pyx_n_s_LOSSLESS);
5668 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_LOSSLESS);
5669 __Pyx_GIVEREF(__pyx_t_1);
5670 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
5671 __Pyx_INCREF(__pyx_kp_s_Codec_supports_lossless_compress);
5672 __Pyx_GIVEREF(__pyx_kp_s_Codec_supports_lossless_compress);
5673 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_s_Codec_supports_lossless_compress);
5674 __pyx_t_1 = 0;
5675
5676 /* "av/codec/codec.pyx":31
5677 * ('LOSSLESS', lib.AV_CODEC_PROP_LOSSLESS,
5678 * """Codec supports lossless compression. Audio and video codecs only."""),
5679 * ('REORDER', lib.AV_CODEC_PROP_REORDER, # <<<<<<<<<<<<<<
5680 * """Codec supports frame reordering. That is, the coded order (the order in which
5681 * the encoded packets are output by the encoders / stored / input to the
5682 */
5683 __pyx_t_1 = __Pyx_PyInt_From_int(AV_CODEC_PROP_REORDER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
5684 __Pyx_GOTREF(__pyx_t_1);
5685 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 31, __pyx_L1_error)
5686 __Pyx_GOTREF(__pyx_t_5);
5687 __Pyx_INCREF(__pyx_n_s_REORDER);
5688 __Pyx_GIVEREF(__pyx_n_s_REORDER);
5689 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_REORDER);
5690 __Pyx_GIVEREF(__pyx_t_1);
5691 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
5692 __Pyx_INCREF(__pyx_kp_s_Codec_supports_frame_reordering);
5693 __Pyx_GIVEREF(__pyx_kp_s_Codec_supports_frame_reordering);
5694 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_s_Codec_supports_frame_reordering);
5695 __pyx_t_1 = 0;
5696
5697 /* "av/codec/codec.pyx":39
5698 * For codecs that do not have this property set, PTS and DTS should always be
5699 * equal."""),
5700 * ('BITMAP_SUB', lib.AV_CODEC_PROP_BITMAP_SUB, # <<<<<<<<<<<<<<
5701 * """Subtitle codec is bitmap based
5702 * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field."""),
5703 */
5704 __pyx_t_1 = __Pyx_PyInt_From_int(AV_CODEC_PROP_BITMAP_SUB); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
5705 __Pyx_GOTREF(__pyx_t_1);
5706 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error)
5707 __Pyx_GOTREF(__pyx_t_6);
5708 __Pyx_INCREF(__pyx_n_s_BITMAP_SUB);
5709 __Pyx_GIVEREF(__pyx_n_s_BITMAP_SUB);
5710 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_BITMAP_SUB);
5711 __Pyx_GIVEREF(__pyx_t_1);
5712 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
5713 __Pyx_INCREF(__pyx_kp_s_Subtitle_codec_is_bitmap_based_D);
5714 __Pyx_GIVEREF(__pyx_kp_s_Subtitle_codec_is_bitmap_based_D);
5715 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_s_Subtitle_codec_is_bitmap_based_D);
5716 __pyx_t_1 = 0;
5717
5718 /* "av/codec/codec.pyx":42
5719 * """Subtitle codec is bitmap based
5720 * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field."""),
5721 * ('TEXT_SUB', lib.AV_CODEC_PROP_TEXT_SUB, # <<<<<<<<<<<<<<
5722 * """Subtitle codec is text based.
5723 * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field."""),
5724 */
5725 __pyx_t_1 = __Pyx_PyInt_From_int(AV_CODEC_PROP_TEXT_SUB); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
5726 __Pyx_GOTREF(__pyx_t_1);
5727 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
5728 __Pyx_GOTREF(__pyx_t_7);
5729 __Pyx_INCREF(__pyx_n_s_TEXT_SUB);
5730 __Pyx_GIVEREF(__pyx_n_s_TEXT_SUB);
5731 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_TEXT_SUB);
5732 __Pyx_GIVEREF(__pyx_t_1);
5733 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
5734 __Pyx_INCREF(__pyx_kp_s_Subtitle_codec_is_text_based_Dec);
5735 __Pyx_GIVEREF(__pyx_kp_s_Subtitle_codec_is_text_based_Dec);
5736 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_s_Subtitle_codec_is_text_based_Dec);
5737 __pyx_t_1 = 0;
5738
5739 /* "av/codec/codec.pyx":20
5740 *
5741 * Properties = define_enum('Properties', 'av.codec', (
5742 * ('NONE', 0), # <<<<<<<<<<<<<<
5743 * ('INTRA_ONLY', lib.AV_CODEC_PROP_INTRA_ONLY,
5744 * """Codec uses only intra compression.
5745 */
5746 __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
5747 __Pyx_GOTREF(__pyx_t_1);
5748 __Pyx_INCREF(__pyx_tuple__5);
5749 __Pyx_GIVEREF(__pyx_tuple__5);
5750 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_tuple__5);
5751 __Pyx_GIVEREF(__pyx_t_2);
5752 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
5753 __Pyx_GIVEREF(__pyx_t_3);
5754 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
5755 __Pyx_GIVEREF(__pyx_t_4);
5756 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
5757 __Pyx_GIVEREF(__pyx_t_5);
5758 PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_5);
5759 __Pyx_GIVEREF(__pyx_t_6);
5760 PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_6);
5761 __Pyx_GIVEREF(__pyx_t_7);
5762 PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_7);
5763 __pyx_t_2 = 0;
5764 __pyx_t_3 = 0;
5765 __pyx_t_4 = 0;
5766 __pyx_t_5 = 0;
5767 __pyx_t_6 = 0;
5768 __pyx_t_7 = 0;
5769
5770 /* "av/codec/codec.pyx":19
5771 *
5772 *
5773 * Properties = define_enum('Properties', 'av.codec', ( # <<<<<<<<<<<<<<
5774 * ('NONE', 0),
5775 * ('INTRA_ONLY', lib.AV_CODEC_PROP_INTRA_ONLY,
5776 */
5777 __pyx_t_8.__pyx_n = 1;
5778 __pyx_t_8.is_flags = 1;
5779 __pyx_t_7 = __pyx_f_2av_4enum_define_enum(__pyx_n_s_Properties, __pyx_kp_s_av_codec, __pyx_t_1, 0, &__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 19, __pyx_L1_error)
5780 __Pyx_GOTREF(__pyx_t_7);
5781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5782 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Properties, __pyx_t_7) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
5783 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5784
5785 /* "av/codec/codec.pyx":49
5786 * Capabilities = define_enum('Capabilities', 'av.codec', (
5787 * ('NONE', 0),
5788 * ('DRAW_HORIZ_BAND', lib.AV_CODEC_CAP_DRAW_HORIZ_BAND, # <<<<<<<<<<<<<<
5789 * """Decoder can use draw_horiz_band callback."""),
5790 * ('DR1', lib.AV_CODEC_CAP_DR1,
5791 */
5792 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_DRAW_HORIZ_BAND); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error)
5793 __Pyx_GOTREF(__pyx_t_7);
5794 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
5795 __Pyx_GOTREF(__pyx_t_1);
5796 __Pyx_INCREF(__pyx_n_s_DRAW_HORIZ_BAND);
5797 __Pyx_GIVEREF(__pyx_n_s_DRAW_HORIZ_BAND);
5798 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_DRAW_HORIZ_BAND);
5799 __Pyx_GIVEREF(__pyx_t_7);
5800 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
5801 __Pyx_INCREF(__pyx_kp_s_Decoder_can_use_draw_horiz_band);
5802 __Pyx_GIVEREF(__pyx_kp_s_Decoder_can_use_draw_horiz_band);
5803 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_s_Decoder_can_use_draw_horiz_band);
5804 __pyx_t_7 = 0;
5805
5806 /* "av/codec/codec.pyx":51
5807 * ('DRAW_HORIZ_BAND', lib.AV_CODEC_CAP_DRAW_HORIZ_BAND,
5808 * """Decoder can use draw_horiz_band callback."""),
5809 * ('DR1', lib.AV_CODEC_CAP_DR1, # <<<<<<<<<<<<<<
5810 * """Codec uses get_buffer() for allocating buffers and supports custom allocators.
5811 * If not set, it might not use get_buffer() at all or use operations that
5812 */
5813 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_DR1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error)
5814 __Pyx_GOTREF(__pyx_t_7);
5815 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error)
5816 __Pyx_GOTREF(__pyx_t_6);
5817 __Pyx_INCREF(__pyx_n_s_DR1);
5818 __Pyx_GIVEREF(__pyx_n_s_DR1);
5819 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_DR1);
5820 __Pyx_GIVEREF(__pyx_t_7);
5821 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
5822 __Pyx_INCREF(__pyx_kp_s_Codec_uses_get_buffer_for_alloca);
5823 __Pyx_GIVEREF(__pyx_kp_s_Codec_uses_get_buffer_for_alloca);
5824 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_s_Codec_uses_get_buffer_for_alloca);
5825 __pyx_t_7 = 0;
5826
5827 /* "av/codec/codec.pyx":55
5828 * If not set, it might not use get_buffer() at all or use operations that
5829 * assume the buffer was allocated by avcodec_default_get_buffer."""),
5830 * ('TRUNCATED', lib.AV_CODEC_CAP_TRUNCATED), # <<<<<<<<<<<<<<
5831 * ('HWACCEL', 1 << 4),
5832 * ('DELAY', lib.AV_CODEC_CAP_DELAY,
5833 */
5834 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_TRUNCATED); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error)
5835 __Pyx_GOTREF(__pyx_t_7);
5836 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
5837 __Pyx_GOTREF(__pyx_t_5);
5838 __Pyx_INCREF(__pyx_n_s_TRUNCATED);
5839 __Pyx_GIVEREF(__pyx_n_s_TRUNCATED);
5840 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_TRUNCATED);
5841 __Pyx_GIVEREF(__pyx_t_7);
5842 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
5843 __pyx_t_7 = 0;
5844
5845 /* "av/codec/codec.pyx":57
5846 * ('TRUNCATED', lib.AV_CODEC_CAP_TRUNCATED),
5847 * ('HWACCEL', 1 << 4),
5848 * ('DELAY', lib.AV_CODEC_CAP_DELAY, # <<<<<<<<<<<<<<
5849 * """Encoder or decoder requires flushing with NULL input at the end in order to
5850 * give the complete and correct output.
5851 */
5852 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_DELAY); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error)
5853 __Pyx_GOTREF(__pyx_t_7);
5854 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
5855 __Pyx_GOTREF(__pyx_t_4);
5856 __Pyx_INCREF(__pyx_n_s_DELAY);
5857 __Pyx_GIVEREF(__pyx_n_s_DELAY);
5858 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_DELAY);
5859 __Pyx_GIVEREF(__pyx_t_7);
5860 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
5861 __Pyx_INCREF(__pyx_kp_s_Encoder_or_decoder_requires_flus);
5862 __Pyx_GIVEREF(__pyx_kp_s_Encoder_or_decoder_requires_flus);
5863 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_s_Encoder_or_decoder_requires_flus);
5864 __pyx_t_7 = 0;
5865
5866 /* "av/codec/codec.pyx":79
5867 * each output packet. If this flag is not set, the pts and duration will
5868 * be determined by libavcodec from the input frame."""),
5869 * ('SMALL_LAST_FRAME', lib.AV_CODEC_CAP_SMALL_LAST_FRAME, # <<<<<<<<<<<<<<
5870 * """Codec can be fed a final frame with a smaller size.
5871 * This can be used to prevent truncation of the last audio samples."""),
5872 */
5873 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_SMALL_LAST_FRAME); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
5874 __Pyx_GOTREF(__pyx_t_7);
5875 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
5876 __Pyx_GOTREF(__pyx_t_3);
5877 __Pyx_INCREF(__pyx_n_s_SMALL_LAST_FRAME);
5878 __Pyx_GIVEREF(__pyx_n_s_SMALL_LAST_FRAME);
5879 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SMALL_LAST_FRAME);
5880 __Pyx_GIVEREF(__pyx_t_7);
5881 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
5882 __Pyx_INCREF(__pyx_kp_s_Codec_can_be_fed_a_final_frame_w);
5883 __Pyx_GIVEREF(__pyx_kp_s_Codec_can_be_fed_a_final_frame_w);
5884 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_s_Codec_can_be_fed_a_final_frame_w);
5885 __pyx_t_7 = 0;
5886
5887 /* "av/codec/codec.pyx":83
5888 * This can be used to prevent truncation of the last audio samples."""),
5889 * ('HWACCEL_VDPAU', 1 << 7),
5890 * ('SUBFRAMES', lib.AV_CODEC_CAP_SUBFRAMES, # <<<<<<<<<<<<<<
5891 * """Codec can output multiple frames per AVPacket
5892 * Normally demuxers return one frame at a time, demuxers which do not do
5893 */
5894 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_SUBFRAMES); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error)
5895 __Pyx_GOTREF(__pyx_t_7);
5896 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
5897 __Pyx_GOTREF(__pyx_t_2);
5898 __Pyx_INCREF(__pyx_n_s_SUBFRAMES);
5899 __Pyx_GIVEREF(__pyx_n_s_SUBFRAMES);
5900 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SUBFRAMES);
5901 __Pyx_GIVEREF(__pyx_t_7);
5902 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
5903 __Pyx_INCREF(__pyx_kp_s_Codec_can_output_multiple_frames);
5904 __Pyx_GIVEREF(__pyx_kp_s_Codec_can_output_multiple_frames);
5905 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_s_Codec_can_output_multiple_frames);
5906 __pyx_t_7 = 0;
5907
5908 /* "av/codec/codec.pyx":93
5909 * prohibiting stream copy in many cases thus it should only be considered
5910 * as a last resort."""),
5911 * ('EXPERIMENTAL', lib.AV_CODEC_CAP_EXPERIMENTAL, # <<<<<<<<<<<<<<
5912 * """Codec is experimental and is thus avoided in favor of non experimental
5913 * encoders"""),
5914 */
5915 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_EXPERIMENTAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error)
5916 __Pyx_GOTREF(__pyx_t_7);
5917 __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L1_error)
5918 __Pyx_GOTREF(__pyx_t_9);
5919 __Pyx_INCREF(__pyx_n_s_EXPERIMENTAL);
5920 __Pyx_GIVEREF(__pyx_n_s_EXPERIMENTAL);
5921 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_EXPERIMENTAL);
5922 __Pyx_GIVEREF(__pyx_t_7);
5923 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
5924 __Pyx_INCREF(__pyx_kp_s_Codec_is_experimental_and_is_thu);
5925 __Pyx_GIVEREF(__pyx_kp_s_Codec_is_experimental_and_is_thu);
5926 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_kp_s_Codec_is_experimental_and_is_thu);
5927 __pyx_t_7 = 0;
5928
5929 /* "av/codec/codec.pyx":96
5930 * """Codec is experimental and is thus avoided in favor of non experimental
5931 * encoders"""),
5932 * ('CHANNEL_CONF', lib.AV_CODEC_CAP_CHANNEL_CONF, # <<<<<<<<<<<<<<
5933 * """Codec should fill in channel configuration and samplerate instead of container"""),
5934 * ('NEG_LINESIZES', 1 << 11),
5935 */
5936 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_CHANNEL_CONF); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error)
5937 __Pyx_GOTREF(__pyx_t_7);
5938 __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L1_error)
5939 __Pyx_GOTREF(__pyx_t_10);
5940 __Pyx_INCREF(__pyx_n_s_CHANNEL_CONF);
5941 __Pyx_GIVEREF(__pyx_n_s_CHANNEL_CONF);
5942 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_CHANNEL_CONF);
5943 __Pyx_GIVEREF(__pyx_t_7);
5944 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
5945 __Pyx_INCREF(__pyx_kp_s_Codec_should_fill_in_channel_con);
5946 __Pyx_GIVEREF(__pyx_kp_s_Codec_should_fill_in_channel_con);
5947 PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_s_Codec_should_fill_in_channel_con);
5948 __pyx_t_7 = 0;
5949
5950 /* "av/codec/codec.pyx":99
5951 * """Codec should fill in channel configuration and samplerate instead of container"""),
5952 * ('NEG_LINESIZES', 1 << 11),
5953 * ('FRAME_THREADS', lib.AV_CODEC_CAP_FRAME_THREADS, # <<<<<<<<<<<<<<
5954 * """Codec supports frame-level multithreading""",),
5955 * ('SLICE_THREADS', lib.AV_CODEC_CAP_SLICE_THREADS,
5956 */
5957 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_FRAME_THREADS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L1_error)
5958 __Pyx_GOTREF(__pyx_t_7);
5959 __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error)
5960 __Pyx_GOTREF(__pyx_t_11);
5961 __Pyx_INCREF(__pyx_n_s_FRAME_THREADS);
5962 __Pyx_GIVEREF(__pyx_n_s_FRAME_THREADS);
5963 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_FRAME_THREADS);
5964 __Pyx_GIVEREF(__pyx_t_7);
5965 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7);
5966 __Pyx_INCREF(__pyx_kp_s_Codec_supports_frame_level_multi);
5967 __Pyx_GIVEREF(__pyx_kp_s_Codec_supports_frame_level_multi);
5968 PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_kp_s_Codec_supports_frame_level_multi);
5969 __pyx_t_7 = 0;
5970
5971 /* "av/codec/codec.pyx":101
5972 * ('FRAME_THREADS', lib.AV_CODEC_CAP_FRAME_THREADS,
5973 * """Codec supports frame-level multithreading""",),
5974 * ('SLICE_THREADS', lib.AV_CODEC_CAP_SLICE_THREADS, # <<<<<<<<<<<<<<
5975 * """Codec supports slice-based (or partition-based) multithreading."""),
5976 * ('PARAM_CHANGE', lib.AV_CODEC_CAP_PARAM_CHANGE,
5977 */
5978 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_SLICE_THREADS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 101, __pyx_L1_error)
5979 __Pyx_GOTREF(__pyx_t_7);
5980 __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 101, __pyx_L1_error)
5981 __Pyx_GOTREF(__pyx_t_12);
5982 __Pyx_INCREF(__pyx_n_s_SLICE_THREADS);
5983 __Pyx_GIVEREF(__pyx_n_s_SLICE_THREADS);
5984 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_SLICE_THREADS);
5985 __Pyx_GIVEREF(__pyx_t_7);
5986 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7);
5987 __Pyx_INCREF(__pyx_kp_s_Codec_supports_slice_based_or_pa);
5988 __Pyx_GIVEREF(__pyx_kp_s_Codec_supports_slice_based_or_pa);
5989 PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_kp_s_Codec_supports_slice_based_or_pa);
5990 __pyx_t_7 = 0;
5991
5992 /* "av/codec/codec.pyx":103
5993 * ('SLICE_THREADS', lib.AV_CODEC_CAP_SLICE_THREADS,
5994 * """Codec supports slice-based (or partition-based) multithreading."""),
5995 * ('PARAM_CHANGE', lib.AV_CODEC_CAP_PARAM_CHANGE, # <<<<<<<<<<<<<<
5996 * """Codec supports changed parameters at any point."""),
5997 * ('AUTO_THREADS', lib.AV_CODEC_CAP_AUTO_THREADS,
5998 */
5999 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_PARAM_CHANGE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error)
6000 __Pyx_GOTREF(__pyx_t_7);
6001 __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 103, __pyx_L1_error)
6002 __Pyx_GOTREF(__pyx_t_13);
6003 __Pyx_INCREF(__pyx_n_s_PARAM_CHANGE);
6004 __Pyx_GIVEREF(__pyx_n_s_PARAM_CHANGE);
6005 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_n_s_PARAM_CHANGE);
6006 __Pyx_GIVEREF(__pyx_t_7);
6007 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7);
6008 __Pyx_INCREF(__pyx_kp_s_Codec_supports_changed_parameter);
6009 __Pyx_GIVEREF(__pyx_kp_s_Codec_supports_changed_parameter);
6010 PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_kp_s_Codec_supports_changed_parameter);
6011 __pyx_t_7 = 0;
6012
6013 /* "av/codec/codec.pyx":105
6014 * ('PARAM_CHANGE', lib.AV_CODEC_CAP_PARAM_CHANGE,
6015 * """Codec supports changed parameters at any point."""),
6016 * ('AUTO_THREADS', lib.AV_CODEC_CAP_AUTO_THREADS, # <<<<<<<<<<<<<<
6017 * """Codec supports avctx->thread_count == 0 (auto)."""),
6018 * ('VARIABLE_FRAME_SIZE', lib.AV_CODEC_CAP_VARIABLE_FRAME_SIZE,
6019 */
6020 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_AUTO_THREADS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error)
6021 __Pyx_GOTREF(__pyx_t_7);
6022 __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 105, __pyx_L1_error)
6023 __Pyx_GOTREF(__pyx_t_14);
6024 __Pyx_INCREF(__pyx_n_s_AUTO_THREADS);
6025 __Pyx_GIVEREF(__pyx_n_s_AUTO_THREADS);
6026 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_n_s_AUTO_THREADS);
6027 __Pyx_GIVEREF(__pyx_t_7);
6028 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_7);
6029 __Pyx_INCREF(__pyx_kp_s_Codec_supports_avctx_thread_coun);
6030 __Pyx_GIVEREF(__pyx_kp_s_Codec_supports_avctx_thread_coun);
6031 PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_kp_s_Codec_supports_avctx_thread_coun);
6032 __pyx_t_7 = 0;
6033
6034 /* "av/codec/codec.pyx":107
6035 * ('AUTO_THREADS', lib.AV_CODEC_CAP_AUTO_THREADS,
6036 * """Codec supports avctx->thread_count == 0 (auto)."""),
6037 * ('VARIABLE_FRAME_SIZE', lib.AV_CODEC_CAP_VARIABLE_FRAME_SIZE, # <<<<<<<<<<<<<<
6038 * """Audio encoder supports receiving a different number of samples in each call."""),
6039 * ('AVOID_PROBING', lib.AV_CODEC_CAP_AVOID_PROBING,
6040 */
6041 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_VARIABLE_FRAME_SIZE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 107, __pyx_L1_error)
6042 __Pyx_GOTREF(__pyx_t_7);
6043 __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 107, __pyx_L1_error)
6044 __Pyx_GOTREF(__pyx_t_15);
6045 __Pyx_INCREF(__pyx_n_s_VARIABLE_FRAME_SIZE);
6046 __Pyx_GIVEREF(__pyx_n_s_VARIABLE_FRAME_SIZE);
6047 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_n_s_VARIABLE_FRAME_SIZE);
6048 __Pyx_GIVEREF(__pyx_t_7);
6049 PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_7);
6050 __Pyx_INCREF(__pyx_kp_s_Audio_encoder_supports_receiving);
6051 __Pyx_GIVEREF(__pyx_kp_s_Audio_encoder_supports_receiving);
6052 PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_kp_s_Audio_encoder_supports_receiving);
6053 __pyx_t_7 = 0;
6054
6055 /* "av/codec/codec.pyx":109
6056 * ('VARIABLE_FRAME_SIZE', lib.AV_CODEC_CAP_VARIABLE_FRAME_SIZE,
6057 * """Audio encoder supports receiving a different number of samples in each call."""),
6058 * ('AVOID_PROBING', lib.AV_CODEC_CAP_AVOID_PROBING, # <<<<<<<<<<<<<<
6059 * """Decoder is not a preferred choice for probing.
6060 * This indicates that the decoder is not a good choice for probing.
6061 */
6062 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_AVOID_PROBING); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 109, __pyx_L1_error)
6063 __Pyx_GOTREF(__pyx_t_7);
6064 __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 109, __pyx_L1_error)
6065 __Pyx_GOTREF(__pyx_t_16);
6066 __Pyx_INCREF(__pyx_n_s_AVOID_PROBING);
6067 __Pyx_GIVEREF(__pyx_n_s_AVOID_PROBING);
6068 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_n_s_AVOID_PROBING);
6069 __Pyx_GIVEREF(__pyx_t_7);
6070 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_7);
6071 __Pyx_INCREF(__pyx_kp_s_Decoder_is_not_a_preferred_choic);
6072 __Pyx_GIVEREF(__pyx_kp_s_Decoder_is_not_a_preferred_choic);
6073 PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_kp_s_Decoder_is_not_a_preferred_choic);
6074 __pyx_t_7 = 0;
6075
6076 /* "av/codec/codec.pyx":117
6077 * A decoder marked with this flag should only be used as last resort
6078 * choice for probing."""),
6079 * ('INTRA_ONLY', lib.AV_CODEC_CAP_INTRA_ONLY, # <<<<<<<<<<<<<<
6080 * """Codec is intra only."""),
6081 * ('LOSSLESS', lib.AV_CODEC_CAP_LOSSLESS,
6082 */
6083 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_INTRA_ONLY); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 117, __pyx_L1_error)
6084 __Pyx_GOTREF(__pyx_t_7);
6085 __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 117, __pyx_L1_error)
6086 __Pyx_GOTREF(__pyx_t_17);
6087 __Pyx_INCREF(__pyx_n_s_INTRA_ONLY);
6088 __Pyx_GIVEREF(__pyx_n_s_INTRA_ONLY);
6089 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_n_s_INTRA_ONLY);
6090 __Pyx_GIVEREF(__pyx_t_7);
6091 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_7);
6092 __Pyx_INCREF(__pyx_kp_s_Codec_is_intra_only);
6093 __Pyx_GIVEREF(__pyx_kp_s_Codec_is_intra_only);
6094 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_kp_s_Codec_is_intra_only);
6095 __pyx_t_7 = 0;
6096
6097 /* "av/codec/codec.pyx":119
6098 * ('INTRA_ONLY', lib.AV_CODEC_CAP_INTRA_ONLY,
6099 * """Codec is intra only."""),
6100 * ('LOSSLESS', lib.AV_CODEC_CAP_LOSSLESS, # <<<<<<<<<<<<<<
6101 * """Codec is lossless."""),
6102 * ('HARDWARE', lib.AV_CODEC_CAP_HARDWARE,
6103 */
6104 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_LOSSLESS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 119, __pyx_L1_error)
6105 __Pyx_GOTREF(__pyx_t_7);
6106 __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 119, __pyx_L1_error)
6107 __Pyx_GOTREF(__pyx_t_18);
6108 __Pyx_INCREF(__pyx_n_s_LOSSLESS);
6109 __Pyx_GIVEREF(__pyx_n_s_LOSSLESS);
6110 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_LOSSLESS);
6111 __Pyx_GIVEREF(__pyx_t_7);
6112 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_7);
6113 __Pyx_INCREF(__pyx_kp_s_Codec_is_lossless);
6114 __Pyx_GIVEREF(__pyx_kp_s_Codec_is_lossless);
6115 PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_kp_s_Codec_is_lossless);
6116 __pyx_t_7 = 0;
6117
6118 /* "av/codec/codec.pyx":121
6119 * ('LOSSLESS', lib.AV_CODEC_CAP_LOSSLESS,
6120 * """Codec is lossless."""),
6121 * ('HARDWARE', lib.AV_CODEC_CAP_HARDWARE, # <<<<<<<<<<<<<<
6122 * """Codec is backed by a hardware implementation. Typically used to
6123 * identify a non-hwaccel hardware decoder. For information about hwaccels, use
6124 */
6125 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_HARDWARE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error)
6126 __Pyx_GOTREF(__pyx_t_7);
6127 __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 121, __pyx_L1_error)
6128 __Pyx_GOTREF(__pyx_t_19);
6129 __Pyx_INCREF(__pyx_n_s_HARDWARE);
6130 __Pyx_GIVEREF(__pyx_n_s_HARDWARE);
6131 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_HARDWARE);
6132 __Pyx_GIVEREF(__pyx_t_7);
6133 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_7);
6134 __Pyx_INCREF(__pyx_kp_s_Codec_is_backed_by_a_hardware_im);
6135 __Pyx_GIVEREF(__pyx_kp_s_Codec_is_backed_by_a_hardware_im);
6136 PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_kp_s_Codec_is_backed_by_a_hardware_im);
6137 __pyx_t_7 = 0;
6138
6139 /* "av/codec/codec.pyx":125
6140 * identify a non-hwaccel hardware decoder. For information about hwaccels, use
6141 * avcodec_get_hw_config() instead."""),
6142 * ('HYBRID', lib.AV_CODEC_CAP_HYBRID, # <<<<<<<<<<<<<<
6143 * """Codec is potentially backed by a hardware implementation, but not
6144 * necessarily. This is used instead of AV_CODEC_CAP_HARDWARE, if the
6145 */
6146 __pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_HYBRID); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error)
6147 __Pyx_GOTREF(__pyx_t_7);
6148 __pyx_t_20 = PyTuple_New(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 125, __pyx_L1_error)
6149 __Pyx_GOTREF(__pyx_t_20);
6150 __Pyx_INCREF(__pyx_n_s_HYBRID);
6151 __Pyx_GIVEREF(__pyx_n_s_HYBRID);
6152 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_n_s_HYBRID);
6153 __Pyx_GIVEREF(__pyx_t_7);
6154 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_7);
6155 __Pyx_INCREF(__pyx_kp_s_Codec_is_potentially_backed_by_a);
6156 __Pyx_GIVEREF(__pyx_kp_s_Codec_is_potentially_backed_by_a);
6157 PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_kp_s_Codec_is_potentially_backed_by_a);
6158 __pyx_t_7 = 0;
6159
6160 /* "av/codec/codec.pyx":48
6161 *
6162 * Capabilities = define_enum('Capabilities', 'av.codec', (
6163 * ('NONE', 0), # <<<<<<<<<<<<<<
6164 * ('DRAW_HORIZ_BAND', lib.AV_CODEC_CAP_DRAW_HORIZ_BAND,
6165 * """Decoder can use draw_horiz_band callback."""),
6166 */
6167 __pyx_t_7 = PyTuple_New(23); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
6168 __Pyx_GOTREF(__pyx_t_7);
6169 __Pyx_INCREF(__pyx_tuple__5);
6170 __Pyx_GIVEREF(__pyx_tuple__5);
6171 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_tuple__5);
6172 __Pyx_GIVEREF(__pyx_t_1);
6173 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
6174 __Pyx_GIVEREF(__pyx_t_6);
6175 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
6176 __Pyx_GIVEREF(__pyx_t_5);
6177 PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5);
6178 __Pyx_INCREF(__pyx_tuple__6);
6179 __Pyx_GIVEREF(__pyx_tuple__6);
6180 PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_tuple__6);
6181 __Pyx_GIVEREF(__pyx_t_4);
6182 PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_4);
6183 __Pyx_GIVEREF(__pyx_t_3);
6184 PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_3);
6185 __Pyx_INCREF(__pyx_tuple__7);
6186 __Pyx_GIVEREF(__pyx_tuple__7);
6187 PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_tuple__7);
6188 __Pyx_GIVEREF(__pyx_t_2);
6189 PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_t_2);
6190 __Pyx_GIVEREF(__pyx_t_9);
6191 PyTuple_SET_ITEM(__pyx_t_7, 9, __pyx_t_9);
6192 __Pyx_GIVEREF(__pyx_t_10);
6193 PyTuple_SET_ITEM(__pyx_t_7, 10, __pyx_t_10);
6194 __Pyx_INCREF(__pyx_tuple__8);
6195 __Pyx_GIVEREF(__pyx_tuple__8);
6196 PyTuple_SET_ITEM(__pyx_t_7, 11, __pyx_tuple__8);
6197 __Pyx_GIVEREF(__pyx_t_11);
6198 PyTuple_SET_ITEM(__pyx_t_7, 12, __pyx_t_11);
6199 __Pyx_GIVEREF(__pyx_t_12);
6200 PyTuple_SET_ITEM(__pyx_t_7, 13, __pyx_t_12);
6201 __Pyx_GIVEREF(__pyx_t_13);
6202 PyTuple_SET_ITEM(__pyx_t_7, 14, __pyx_t_13);
6203 __Pyx_GIVEREF(__pyx_t_14);
6204 PyTuple_SET_ITEM(__pyx_t_7, 15, __pyx_t_14);
6205 __Pyx_GIVEREF(__pyx_t_15);
6206 PyTuple_SET_ITEM(__pyx_t_7, 16, __pyx_t_15);
6207 __Pyx_GIVEREF(__pyx_t_16);
6208 PyTuple_SET_ITEM(__pyx_t_7, 17, __pyx_t_16);
6209 __Pyx_GIVEREF(__pyx_t_17);
6210 PyTuple_SET_ITEM(__pyx_t_7, 18, __pyx_t_17);
6211 __Pyx_GIVEREF(__pyx_t_18);
6212 PyTuple_SET_ITEM(__pyx_t_7, 19, __pyx_t_18);
6213 __Pyx_GIVEREF(__pyx_t_19);
6214 PyTuple_SET_ITEM(__pyx_t_7, 20, __pyx_t_19);
6215 __Pyx_GIVEREF(__pyx_t_20);
6216 PyTuple_SET_ITEM(__pyx_t_7, 21, __pyx_t_20);
6217 __Pyx_INCREF(__pyx_tuple__9);
6218 __Pyx_GIVEREF(__pyx_tuple__9);
6219 PyTuple_SET_ITEM(__pyx_t_7, 22, __pyx_tuple__9);
6220 __pyx_t_1 = 0;
6221 __pyx_t_6 = 0;
6222 __pyx_t_5 = 0;
6223 __pyx_t_4 = 0;
6224 __pyx_t_3 = 0;
6225 __pyx_t_2 = 0;
6226 __pyx_t_9 = 0;
6227 __pyx_t_10 = 0;
6228 __pyx_t_11 = 0;
6229 __pyx_t_12 = 0;
6230 __pyx_t_13 = 0;
6231 __pyx_t_14 = 0;
6232 __pyx_t_15 = 0;
6233 __pyx_t_16 = 0;
6234 __pyx_t_17 = 0;
6235 __pyx_t_18 = 0;
6236 __pyx_t_19 = 0;
6237 __pyx_t_20 = 0;
6238
6239 /* "av/codec/codec.pyx":47
6240 * ), is_flags=True)
6241 *
6242 * Capabilities = define_enum('Capabilities', 'av.codec', ( # <<<<<<<<<<<<<<
6243 * ('NONE', 0),
6244 * ('DRAW_HORIZ_BAND', lib.AV_CODEC_CAP_DRAW_HORIZ_BAND,
6245 */
6246 __pyx_t_8.__pyx_n = 1;
6247 __pyx_t_8.is_flags = 1;
6248 __pyx_t_20 = __pyx_f_2av_4enum_define_enum(__pyx_n_s_Capabilities, __pyx_kp_s_av_codec, __pyx_t_7, 0, &__pyx_t_8); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 47, __pyx_L1_error)
6249 __Pyx_GOTREF(__pyx_t_20);
6250 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6251 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Capabilities, __pyx_t_20) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
6252 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6253
6254 /* "av/codec/codec.pyx":136
6255 *
6256 *
6257 * class UnknownCodecError(ValueError): # <<<<<<<<<<<<<<
6258 * pass
6259 *
6260 */
6261 __pyx_t_20 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__10); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 136, __pyx_L1_error)
6262 __Pyx_GOTREF(__pyx_t_20);
6263 __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_20, __pyx_tuple__10, __pyx_n_s_UnknownCodecError, __pyx_n_s_UnknownCodecError, (PyObject *) NULL, __pyx_n_s_av_codec_codec, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error)
6264 __Pyx_GOTREF(__pyx_t_7);
6265 __pyx_t_19 = __Pyx_Py3ClassCreate(__pyx_t_20, __pyx_n_s_UnknownCodecError, __pyx_tuple__10, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 136, __pyx_L1_error)
6266 __Pyx_GOTREF(__pyx_t_19);
6267 if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnknownCodecError, __pyx_t_19) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
6268 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6269 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6270 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6271
6272 /* "av/codec/codec.pyx":292
6273 * # Also, LOSSLESS and LOSSY don't have to agree.
6274 *
6275 * @Properties.property # <<<<<<<<<<<<<<
6276 * def properties(self):
6277 * """Flag property of :class:`.Properties`"""
6278 */
6279 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Properties); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 292, __pyx_L1_error)
6280 __Pyx_GOTREF(__pyx_t_7);
6281 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 292, __pyx_L1_error)
6282 __Pyx_GOTREF(__pyx_t_19);
6283 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6284
6285 /* "av/codec/codec.pyx":293
6286 *
6287 * @Properties.property
6288 * def properties(self): # <<<<<<<<<<<<<<
6289 * """Flag property of :class:`.Properties`"""
6290 * return self.desc.props
6291 */
6292 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_properties); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error)
6293 __Pyx_GOTREF(__pyx_t_7);
6294 __pyx_t_18 = NULL;
6295 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6296 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_19);
6297 if (likely(__pyx_t_18)) {
6298 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6299 __Pyx_INCREF(__pyx_t_18);
6300 __Pyx_INCREF(function);
6301 __Pyx_DECREF_SET(__pyx_t_19, function);
6302 }
6303 }
6304 __pyx_t_20 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_18, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_7);
6305 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6306 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6307 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 292, __pyx_L1_error)
6308 __Pyx_GOTREF(__pyx_t_20);
6309 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6310 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_properties, __pyx_t_20) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
6311 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6312 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6313
6314 /* "av/codec/codec.pyx":297
6315 * return self.desc.props
6316 *
6317 * intra_only = properties.flag_property('INTRA_ONLY') # <<<<<<<<<<<<<<
6318 * lossy = properties.flag_property('LOSSY') # Defer to capability.
6319 * lossless = properties.flag_property('LOSSLESS') # Defer to capability.
6320 */
6321 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_properties); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 297, __pyx_L1_error)
6322 __Pyx_GOTREF(__pyx_t_19);
6323 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error)
6324 __Pyx_GOTREF(__pyx_t_7);
6325 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6326 __pyx_t_19 = NULL;
6327 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6328 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
6329 if (likely(__pyx_t_19)) {
6330 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6331 __Pyx_INCREF(__pyx_t_19);
6332 __Pyx_INCREF(function);
6333 __Pyx_DECREF_SET(__pyx_t_7, function);
6334 }
6335 }
6336 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_INTRA_ONLY) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_INTRA_ONLY);
6337 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6338 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 297, __pyx_L1_error)
6339 __Pyx_GOTREF(__pyx_t_20);
6340 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6341 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_intra_only, __pyx_t_20) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
6342 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6343 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6344
6345 /* "av/codec/codec.pyx":298
6346 *
6347 * intra_only = properties.flag_property('INTRA_ONLY')
6348 * lossy = properties.flag_property('LOSSY') # Defer to capability. # <<<<<<<<<<<<<<
6349 * lossless = properties.flag_property('LOSSLESS') # Defer to capability.
6350 * reorder = properties.flag_property('REORDER')
6351 */
6352 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_properties); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
6353 __Pyx_GOTREF(__pyx_t_7);
6354 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 298, __pyx_L1_error)
6355 __Pyx_GOTREF(__pyx_t_19);
6356 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6357 __pyx_t_7 = NULL;
6358 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6359 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6360 if (likely(__pyx_t_7)) {
6361 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6362 __Pyx_INCREF(__pyx_t_7);
6363 __Pyx_INCREF(function);
6364 __Pyx_DECREF_SET(__pyx_t_19, function);
6365 }
6366 }
6367 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_LOSSY) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_LOSSY);
6368 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6369 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 298, __pyx_L1_error)
6370 __Pyx_GOTREF(__pyx_t_20);
6371 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6372 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_lossy, __pyx_t_20) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
6373 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6374 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6375
6376 /* "av/codec/codec.pyx":299
6377 * intra_only = properties.flag_property('INTRA_ONLY')
6378 * lossy = properties.flag_property('LOSSY') # Defer to capability.
6379 * lossless = properties.flag_property('LOSSLESS') # Defer to capability. # <<<<<<<<<<<<<<
6380 * reorder = properties.flag_property('REORDER')
6381 * bitmap_sub = properties.flag_property('BITMAP_SUB')
6382 */
6383 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_properties); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 299, __pyx_L1_error)
6384 __Pyx_GOTREF(__pyx_t_19);
6385 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 299, __pyx_L1_error)
6386 __Pyx_GOTREF(__pyx_t_7);
6387 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6388 __pyx_t_19 = NULL;
6389 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6390 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
6391 if (likely(__pyx_t_19)) {
6392 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6393 __Pyx_INCREF(__pyx_t_19);
6394 __Pyx_INCREF(function);
6395 __Pyx_DECREF_SET(__pyx_t_7, function);
6396 }
6397 }
6398 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_LOSSLESS) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_LOSSLESS);
6399 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6400 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 299, __pyx_L1_error)
6401 __Pyx_GOTREF(__pyx_t_20);
6402 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6403 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_lossless, __pyx_t_20) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
6404 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6405 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6406
6407 /* "av/codec/codec.pyx":300
6408 * lossy = properties.flag_property('LOSSY') # Defer to capability.
6409 * lossless = properties.flag_property('LOSSLESS') # Defer to capability.
6410 * reorder = properties.flag_property('REORDER') # <<<<<<<<<<<<<<
6411 * bitmap_sub = properties.flag_property('BITMAP_SUB')
6412 * text_sub = properties.flag_property('TEXT_SUB')
6413 */
6414 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_properties); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error)
6415 __Pyx_GOTREF(__pyx_t_7);
6416 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 300, __pyx_L1_error)
6417 __Pyx_GOTREF(__pyx_t_19);
6418 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6419 __pyx_t_7 = NULL;
6420 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6421 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6422 if (likely(__pyx_t_7)) {
6423 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6424 __Pyx_INCREF(__pyx_t_7);
6425 __Pyx_INCREF(function);
6426 __Pyx_DECREF_SET(__pyx_t_19, function);
6427 }
6428 }
6429 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_REORDER) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_REORDER);
6430 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6431 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 300, __pyx_L1_error)
6432 __Pyx_GOTREF(__pyx_t_20);
6433 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6434 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_reorder, __pyx_t_20) < 0) __PYX_ERR(0, 300, __pyx_L1_error)
6435 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6436 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6437
6438 /* "av/codec/codec.pyx":301
6439 * lossless = properties.flag_property('LOSSLESS') # Defer to capability.
6440 * reorder = properties.flag_property('REORDER')
6441 * bitmap_sub = properties.flag_property('BITMAP_SUB') # <<<<<<<<<<<<<<
6442 * text_sub = properties.flag_property('TEXT_SUB')
6443 *
6444 */
6445 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_properties); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 301, __pyx_L1_error)
6446 __Pyx_GOTREF(__pyx_t_19);
6447 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 301, __pyx_L1_error)
6448 __Pyx_GOTREF(__pyx_t_7);
6449 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6450 __pyx_t_19 = NULL;
6451 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6452 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
6453 if (likely(__pyx_t_19)) {
6454 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6455 __Pyx_INCREF(__pyx_t_19);
6456 __Pyx_INCREF(function);
6457 __Pyx_DECREF_SET(__pyx_t_7, function);
6458 }
6459 }
6460 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_BITMAP_SUB) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_BITMAP_SUB);
6461 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6462 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 301, __pyx_L1_error)
6463 __Pyx_GOTREF(__pyx_t_20);
6464 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6465 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_bitmap_sub, __pyx_t_20) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
6466 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6467 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6468
6469 /* "av/codec/codec.pyx":302
6470 * reorder = properties.flag_property('REORDER')
6471 * bitmap_sub = properties.flag_property('BITMAP_SUB')
6472 * text_sub = properties.flag_property('TEXT_SUB') # <<<<<<<<<<<<<<
6473 *
6474 * @Capabilities.property
6475 */
6476 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_properties); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error)
6477 __Pyx_GOTREF(__pyx_t_7);
6478 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 302, __pyx_L1_error)
6479 __Pyx_GOTREF(__pyx_t_19);
6480 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6481 __pyx_t_7 = NULL;
6482 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6483 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6484 if (likely(__pyx_t_7)) {
6485 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6486 __Pyx_INCREF(__pyx_t_7);
6487 __Pyx_INCREF(function);
6488 __Pyx_DECREF_SET(__pyx_t_19, function);
6489 }
6490 }
6491 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_TEXT_SUB) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_TEXT_SUB);
6492 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6493 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 302, __pyx_L1_error)
6494 __Pyx_GOTREF(__pyx_t_20);
6495 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6496 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_text_sub, __pyx_t_20) < 0) __PYX_ERR(0, 302, __pyx_L1_error)
6497 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6498 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6499
6500 /* "av/codec/codec.pyx":304
6501 * text_sub = properties.flag_property('TEXT_SUB')
6502 *
6503 * @Capabilities.property # <<<<<<<<<<<<<<
6504 * def capabilities(self):
6505 * """Flag property of :class:`.Capabilities`"""
6506 */
6507 __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_Capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 304, __pyx_L1_error)
6508 __Pyx_GOTREF(__pyx_t_19);
6509 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error)
6510 __Pyx_GOTREF(__pyx_t_7);
6511 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6512
6513 /* "av/codec/codec.pyx":305
6514 *
6515 * @Capabilities.property
6516 * def capabilities(self): # <<<<<<<<<<<<<<
6517 * """Flag property of :class:`.Capabilities`"""
6518 * return self.ptr.capabilities
6519 */
6520 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 305, __pyx_L1_error)
6521 __Pyx_GOTREF(__pyx_t_19);
6522 __pyx_t_18 = NULL;
6523 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6524 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_7);
6525 if (likely(__pyx_t_18)) {
6526 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6527 __Pyx_INCREF(__pyx_t_18);
6528 __Pyx_INCREF(function);
6529 __Pyx_DECREF_SET(__pyx_t_7, function);
6530 }
6531 }
6532 __pyx_t_20 = (__pyx_t_18) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_18, __pyx_t_19) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_19);
6533 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6534 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6535 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 304, __pyx_L1_error)
6536 __Pyx_GOTREF(__pyx_t_20);
6537 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6538 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_capabilities, __pyx_t_20) < 0) __PYX_ERR(0, 305, __pyx_L1_error)
6539 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6540 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6541
6542 /* "av/codec/codec.pyx":309
6543 * return self.ptr.capabilities
6544 *
6545 * draw_horiz_band = capabilities.flag_property('DRAW_HORIZ_BAND') # <<<<<<<<<<<<<<
6546 * dr1 = capabilities.flag_property('DR1')
6547 * truncated = capabilities.flag_property('TRUNCATED')
6548 */
6549 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error)
6550 __Pyx_GOTREF(__pyx_t_7);
6551 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 309, __pyx_L1_error)
6552 __Pyx_GOTREF(__pyx_t_19);
6553 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6554 __pyx_t_7 = NULL;
6555 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6556 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6557 if (likely(__pyx_t_7)) {
6558 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6559 __Pyx_INCREF(__pyx_t_7);
6560 __Pyx_INCREF(function);
6561 __Pyx_DECREF_SET(__pyx_t_19, function);
6562 }
6563 }
6564 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_DRAW_HORIZ_BAND) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_DRAW_HORIZ_BAND);
6565 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6566 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 309, __pyx_L1_error)
6567 __Pyx_GOTREF(__pyx_t_20);
6568 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6569 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_draw_horiz_band, __pyx_t_20) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
6570 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6571 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6572
6573 /* "av/codec/codec.pyx":310
6574 *
6575 * draw_horiz_band = capabilities.flag_property('DRAW_HORIZ_BAND')
6576 * dr1 = capabilities.flag_property('DR1') # <<<<<<<<<<<<<<
6577 * truncated = capabilities.flag_property('TRUNCATED')
6578 * hwaccel = capabilities.flag_property('HWACCEL')
6579 */
6580 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 310, __pyx_L1_error)
6581 __Pyx_GOTREF(__pyx_t_19);
6582 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error)
6583 __Pyx_GOTREF(__pyx_t_7);
6584 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6585 __pyx_t_19 = NULL;
6586 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6587 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
6588 if (likely(__pyx_t_19)) {
6589 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6590 __Pyx_INCREF(__pyx_t_19);
6591 __Pyx_INCREF(function);
6592 __Pyx_DECREF_SET(__pyx_t_7, function);
6593 }
6594 }
6595 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_DR1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_DR1);
6596 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6597 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 310, __pyx_L1_error)
6598 __Pyx_GOTREF(__pyx_t_20);
6599 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6600 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_dr1, __pyx_t_20) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
6601 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6602 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6603
6604 /* "av/codec/codec.pyx":311
6605 * draw_horiz_band = capabilities.flag_property('DRAW_HORIZ_BAND')
6606 * dr1 = capabilities.flag_property('DR1')
6607 * truncated = capabilities.flag_property('TRUNCATED') # <<<<<<<<<<<<<<
6608 * hwaccel = capabilities.flag_property('HWACCEL')
6609 * delay = capabilities.flag_property('DELAY')
6610 */
6611 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
6612 __Pyx_GOTREF(__pyx_t_7);
6613 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 311, __pyx_L1_error)
6614 __Pyx_GOTREF(__pyx_t_19);
6615 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6616 __pyx_t_7 = NULL;
6617 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6618 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6619 if (likely(__pyx_t_7)) {
6620 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6621 __Pyx_INCREF(__pyx_t_7);
6622 __Pyx_INCREF(function);
6623 __Pyx_DECREF_SET(__pyx_t_19, function);
6624 }
6625 }
6626 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_TRUNCATED) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_TRUNCATED);
6627 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6628 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 311, __pyx_L1_error)
6629 __Pyx_GOTREF(__pyx_t_20);
6630 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6631 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_truncated, __pyx_t_20) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
6632 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6633 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6634
6635 /* "av/codec/codec.pyx":312
6636 * dr1 = capabilities.flag_property('DR1')
6637 * truncated = capabilities.flag_property('TRUNCATED')
6638 * hwaccel = capabilities.flag_property('HWACCEL') # <<<<<<<<<<<<<<
6639 * delay = capabilities.flag_property('DELAY')
6640 * small_last_frame = capabilities.flag_property('SMALL_LAST_FRAME')
6641 */
6642 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 312, __pyx_L1_error)
6643 __Pyx_GOTREF(__pyx_t_19);
6644 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 312, __pyx_L1_error)
6645 __Pyx_GOTREF(__pyx_t_7);
6646 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6647 __pyx_t_19 = NULL;
6648 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6649 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
6650 if (likely(__pyx_t_19)) {
6651 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6652 __Pyx_INCREF(__pyx_t_19);
6653 __Pyx_INCREF(function);
6654 __Pyx_DECREF_SET(__pyx_t_7, function);
6655 }
6656 }
6657 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_HWACCEL) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_HWACCEL);
6658 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6659 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 312, __pyx_L1_error)
6660 __Pyx_GOTREF(__pyx_t_20);
6661 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6662 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_hwaccel, __pyx_t_20) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
6663 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6664 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6665
6666 /* "av/codec/codec.pyx":313
6667 * truncated = capabilities.flag_property('TRUNCATED')
6668 * hwaccel = capabilities.flag_property('HWACCEL')
6669 * delay = capabilities.flag_property('DELAY') # <<<<<<<<<<<<<<
6670 * small_last_frame = capabilities.flag_property('SMALL_LAST_FRAME')
6671 * hwaccel_vdpau = capabilities.flag_property('HWACCEL_VDPAU')
6672 */
6673 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error)
6674 __Pyx_GOTREF(__pyx_t_7);
6675 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 313, __pyx_L1_error)
6676 __Pyx_GOTREF(__pyx_t_19);
6677 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6678 __pyx_t_7 = NULL;
6679 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6680 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6681 if (likely(__pyx_t_7)) {
6682 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6683 __Pyx_INCREF(__pyx_t_7);
6684 __Pyx_INCREF(function);
6685 __Pyx_DECREF_SET(__pyx_t_19, function);
6686 }
6687 }
6688 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_DELAY) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_DELAY);
6689 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6690 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 313, __pyx_L1_error)
6691 __Pyx_GOTREF(__pyx_t_20);
6692 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6693 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_delay, __pyx_t_20) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
6694 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6695 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6696
6697 /* "av/codec/codec.pyx":314
6698 * hwaccel = capabilities.flag_property('HWACCEL')
6699 * delay = capabilities.flag_property('DELAY')
6700 * small_last_frame = capabilities.flag_property('SMALL_LAST_FRAME') # <<<<<<<<<<<<<<
6701 * hwaccel_vdpau = capabilities.flag_property('HWACCEL_VDPAU')
6702 * subframes = capabilities.flag_property('SUBFRAMES')
6703 */
6704 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 314, __pyx_L1_error)
6705 __Pyx_GOTREF(__pyx_t_19);
6706 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error)
6707 __Pyx_GOTREF(__pyx_t_7);
6708 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6709 __pyx_t_19 = NULL;
6710 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6711 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
6712 if (likely(__pyx_t_19)) {
6713 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6714 __Pyx_INCREF(__pyx_t_19);
6715 __Pyx_INCREF(function);
6716 __Pyx_DECREF_SET(__pyx_t_7, function);
6717 }
6718 }
6719 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_SMALL_LAST_FRAME) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_SMALL_LAST_FRAME);
6720 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6721 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 314, __pyx_L1_error)
6722 __Pyx_GOTREF(__pyx_t_20);
6723 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6724 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_small_last_frame, __pyx_t_20) < 0) __PYX_ERR(0, 314, __pyx_L1_error)
6725 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6726 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6727
6728 /* "av/codec/codec.pyx":315
6729 * delay = capabilities.flag_property('DELAY')
6730 * small_last_frame = capabilities.flag_property('SMALL_LAST_FRAME')
6731 * hwaccel_vdpau = capabilities.flag_property('HWACCEL_VDPAU') # <<<<<<<<<<<<<<
6732 * subframes = capabilities.flag_property('SUBFRAMES')
6733 * experimental = capabilities.flag_property('EXPERIMENTAL')
6734 */
6735 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error)
6736 __Pyx_GOTREF(__pyx_t_7);
6737 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 315, __pyx_L1_error)
6738 __Pyx_GOTREF(__pyx_t_19);
6739 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6740 __pyx_t_7 = NULL;
6741 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6742 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6743 if (likely(__pyx_t_7)) {
6744 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6745 __Pyx_INCREF(__pyx_t_7);
6746 __Pyx_INCREF(function);
6747 __Pyx_DECREF_SET(__pyx_t_19, function);
6748 }
6749 }
6750 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_HWACCEL_VDPAU) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_HWACCEL_VDPAU);
6751 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6752 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 315, __pyx_L1_error)
6753 __Pyx_GOTREF(__pyx_t_20);
6754 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6755 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_hwaccel_vdpau, __pyx_t_20) < 0) __PYX_ERR(0, 315, __pyx_L1_error)
6756 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6757 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6758
6759 /* "av/codec/codec.pyx":316
6760 * small_last_frame = capabilities.flag_property('SMALL_LAST_FRAME')
6761 * hwaccel_vdpau = capabilities.flag_property('HWACCEL_VDPAU')
6762 * subframes = capabilities.flag_property('SUBFRAMES') # <<<<<<<<<<<<<<
6763 * experimental = capabilities.flag_property('EXPERIMENTAL')
6764 * channel_conf = capabilities.flag_property('CHANNEL_CONF')
6765 */
6766 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 316, __pyx_L1_error)
6767 __Pyx_GOTREF(__pyx_t_19);
6768 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error)
6769 __Pyx_GOTREF(__pyx_t_7);
6770 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6771 __pyx_t_19 = NULL;
6772 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6773 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
6774 if (likely(__pyx_t_19)) {
6775 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6776 __Pyx_INCREF(__pyx_t_19);
6777 __Pyx_INCREF(function);
6778 __Pyx_DECREF_SET(__pyx_t_7, function);
6779 }
6780 }
6781 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_SUBFRAMES) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_SUBFRAMES);
6782 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6783 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 316, __pyx_L1_error)
6784 __Pyx_GOTREF(__pyx_t_20);
6785 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6786 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_subframes, __pyx_t_20) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
6787 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6788 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6789
6790 /* "av/codec/codec.pyx":317
6791 * hwaccel_vdpau = capabilities.flag_property('HWACCEL_VDPAU')
6792 * subframes = capabilities.flag_property('SUBFRAMES')
6793 * experimental = capabilities.flag_property('EXPERIMENTAL') # <<<<<<<<<<<<<<
6794 * channel_conf = capabilities.flag_property('CHANNEL_CONF')
6795 * neg_linesizes = capabilities.flag_property('NEG_LINESIZES')
6796 */
6797 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
6798 __Pyx_GOTREF(__pyx_t_7);
6799 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 317, __pyx_L1_error)
6800 __Pyx_GOTREF(__pyx_t_19);
6801 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6802 __pyx_t_7 = NULL;
6803 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6804 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6805 if (likely(__pyx_t_7)) {
6806 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6807 __Pyx_INCREF(__pyx_t_7);
6808 __Pyx_INCREF(function);
6809 __Pyx_DECREF_SET(__pyx_t_19, function);
6810 }
6811 }
6812 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_EXPERIMENTAL) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_EXPERIMENTAL);
6813 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6814 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 317, __pyx_L1_error)
6815 __Pyx_GOTREF(__pyx_t_20);
6816 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6817 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_experimental, __pyx_t_20) < 0) __PYX_ERR(0, 317, __pyx_L1_error)
6818 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6819 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6820
6821 /* "av/codec/codec.pyx":318
6822 * subframes = capabilities.flag_property('SUBFRAMES')
6823 * experimental = capabilities.flag_property('EXPERIMENTAL')
6824 * channel_conf = capabilities.flag_property('CHANNEL_CONF') # <<<<<<<<<<<<<<
6825 * neg_linesizes = capabilities.flag_property('NEG_LINESIZES')
6826 * frame_threads = capabilities.flag_property('FRAME_THREADS')
6827 */
6828 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 318, __pyx_L1_error)
6829 __Pyx_GOTREF(__pyx_t_19);
6830 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error)
6831 __Pyx_GOTREF(__pyx_t_7);
6832 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6833 __pyx_t_19 = NULL;
6834 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6835 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
6836 if (likely(__pyx_t_19)) {
6837 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6838 __Pyx_INCREF(__pyx_t_19);
6839 __Pyx_INCREF(function);
6840 __Pyx_DECREF_SET(__pyx_t_7, function);
6841 }
6842 }
6843 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_CHANNEL_CONF) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_CHANNEL_CONF);
6844 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6845 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 318, __pyx_L1_error)
6846 __Pyx_GOTREF(__pyx_t_20);
6847 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6848 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_channel_conf, __pyx_t_20) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
6849 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6850 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6851
6852 /* "av/codec/codec.pyx":319
6853 * experimental = capabilities.flag_property('EXPERIMENTAL')
6854 * channel_conf = capabilities.flag_property('CHANNEL_CONF')
6855 * neg_linesizes = capabilities.flag_property('NEG_LINESIZES') # <<<<<<<<<<<<<<
6856 * frame_threads = capabilities.flag_property('FRAME_THREADS')
6857 * slice_threads = capabilities.flag_property('SLICE_THREADS')
6858 */
6859 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error)
6860 __Pyx_GOTREF(__pyx_t_7);
6861 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 319, __pyx_L1_error)
6862 __Pyx_GOTREF(__pyx_t_19);
6863 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6864 __pyx_t_7 = NULL;
6865 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6866 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6867 if (likely(__pyx_t_7)) {
6868 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6869 __Pyx_INCREF(__pyx_t_7);
6870 __Pyx_INCREF(function);
6871 __Pyx_DECREF_SET(__pyx_t_19, function);
6872 }
6873 }
6874 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_NEG_LINESIZES) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_NEG_LINESIZES);
6875 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6876 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 319, __pyx_L1_error)
6877 __Pyx_GOTREF(__pyx_t_20);
6878 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6879 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_neg_linesizes, __pyx_t_20) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
6880 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6881 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6882
6883 /* "av/codec/codec.pyx":320
6884 * channel_conf = capabilities.flag_property('CHANNEL_CONF')
6885 * neg_linesizes = capabilities.flag_property('NEG_LINESIZES')
6886 * frame_threads = capabilities.flag_property('FRAME_THREADS') # <<<<<<<<<<<<<<
6887 * slice_threads = capabilities.flag_property('SLICE_THREADS')
6888 * param_change = capabilities.flag_property('PARAM_CHANGE')
6889 */
6890 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 320, __pyx_L1_error)
6891 __Pyx_GOTREF(__pyx_t_19);
6892 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 320, __pyx_L1_error)
6893 __Pyx_GOTREF(__pyx_t_7);
6894 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6895 __pyx_t_19 = NULL;
6896 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6897 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
6898 if (likely(__pyx_t_19)) {
6899 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6900 __Pyx_INCREF(__pyx_t_19);
6901 __Pyx_INCREF(function);
6902 __Pyx_DECREF_SET(__pyx_t_7, function);
6903 }
6904 }
6905 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_FRAME_THREADS) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_FRAME_THREADS);
6906 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6907 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 320, __pyx_L1_error)
6908 __Pyx_GOTREF(__pyx_t_20);
6909 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6910 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_frame_threads, __pyx_t_20) < 0) __PYX_ERR(0, 320, __pyx_L1_error)
6911 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6912 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6913
6914 /* "av/codec/codec.pyx":321
6915 * neg_linesizes = capabilities.flag_property('NEG_LINESIZES')
6916 * frame_threads = capabilities.flag_property('FRAME_THREADS')
6917 * slice_threads = capabilities.flag_property('SLICE_THREADS') # <<<<<<<<<<<<<<
6918 * param_change = capabilities.flag_property('PARAM_CHANGE')
6919 * auto_threads = capabilities.flag_property('AUTO_THREADS')
6920 */
6921 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error)
6922 __Pyx_GOTREF(__pyx_t_7);
6923 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 321, __pyx_L1_error)
6924 __Pyx_GOTREF(__pyx_t_19);
6925 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6926 __pyx_t_7 = NULL;
6927 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6928 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6929 if (likely(__pyx_t_7)) {
6930 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6931 __Pyx_INCREF(__pyx_t_7);
6932 __Pyx_INCREF(function);
6933 __Pyx_DECREF_SET(__pyx_t_19, function);
6934 }
6935 }
6936 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_SLICE_THREADS) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_SLICE_THREADS);
6937 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6938 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 321, __pyx_L1_error)
6939 __Pyx_GOTREF(__pyx_t_20);
6940 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6941 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_slice_threads, __pyx_t_20) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
6942 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6943 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6944
6945 /* "av/codec/codec.pyx":322
6946 * frame_threads = capabilities.flag_property('FRAME_THREADS')
6947 * slice_threads = capabilities.flag_property('SLICE_THREADS')
6948 * param_change = capabilities.flag_property('PARAM_CHANGE') # <<<<<<<<<<<<<<
6949 * auto_threads = capabilities.flag_property('AUTO_THREADS')
6950 * variable_frame_size = capabilities.flag_property('VARIABLE_FRAME_SIZE')
6951 */
6952 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 322, __pyx_L1_error)
6953 __Pyx_GOTREF(__pyx_t_19);
6954 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error)
6955 __Pyx_GOTREF(__pyx_t_7);
6956 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6957 __pyx_t_19 = NULL;
6958 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6959 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
6960 if (likely(__pyx_t_19)) {
6961 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6962 __Pyx_INCREF(__pyx_t_19);
6963 __Pyx_INCREF(function);
6964 __Pyx_DECREF_SET(__pyx_t_7, function);
6965 }
6966 }
6967 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_PARAM_CHANGE) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_PARAM_CHANGE);
6968 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6969 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 322, __pyx_L1_error)
6970 __Pyx_GOTREF(__pyx_t_20);
6971 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6972 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_param_change, __pyx_t_20) < 0) __PYX_ERR(0, 322, __pyx_L1_error)
6973 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6974 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
6975
6976 /* "av/codec/codec.pyx":323
6977 * slice_threads = capabilities.flag_property('SLICE_THREADS')
6978 * param_change = capabilities.flag_property('PARAM_CHANGE')
6979 * auto_threads = capabilities.flag_property('AUTO_THREADS') # <<<<<<<<<<<<<<
6980 * variable_frame_size = capabilities.flag_property('VARIABLE_FRAME_SIZE')
6981 * avoid_probing = capabilities.flag_property('AVOID_PROBING')
6982 */
6983 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error)
6984 __Pyx_GOTREF(__pyx_t_7);
6985 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 323, __pyx_L1_error)
6986 __Pyx_GOTREF(__pyx_t_19);
6987 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6988 __pyx_t_7 = NULL;
6989 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6990 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
6991 if (likely(__pyx_t_7)) {
6992 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
6993 __Pyx_INCREF(__pyx_t_7);
6994 __Pyx_INCREF(function);
6995 __Pyx_DECREF_SET(__pyx_t_19, function);
6996 }
6997 }
6998 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_AUTO_THREADS) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_AUTO_THREADS);
6999 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7000 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 323, __pyx_L1_error)
7001 __Pyx_GOTREF(__pyx_t_20);
7002 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7003 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_auto_threads, __pyx_t_20) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
7004 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7005 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
7006
7007 /* "av/codec/codec.pyx":324
7008 * param_change = capabilities.flag_property('PARAM_CHANGE')
7009 * auto_threads = capabilities.flag_property('AUTO_THREADS')
7010 * variable_frame_size = capabilities.flag_property('VARIABLE_FRAME_SIZE') # <<<<<<<<<<<<<<
7011 * avoid_probing = capabilities.flag_property('AVOID_PROBING')
7012 * # intra_only = capabilities.flag_property('INTRA_ONLY') # Dupes.
7013 */
7014 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 324, __pyx_L1_error)
7015 __Pyx_GOTREF(__pyx_t_19);
7016 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error)
7017 __Pyx_GOTREF(__pyx_t_7);
7018 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7019 __pyx_t_19 = NULL;
7020 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7021 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
7022 if (likely(__pyx_t_19)) {
7023 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7024 __Pyx_INCREF(__pyx_t_19);
7025 __Pyx_INCREF(function);
7026 __Pyx_DECREF_SET(__pyx_t_7, function);
7027 }
7028 }
7029 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_VARIABLE_FRAME_SIZE) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_VARIABLE_FRAME_SIZE);
7030 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
7031 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 324, __pyx_L1_error)
7032 __Pyx_GOTREF(__pyx_t_20);
7033 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7034 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_variable_frame_size, __pyx_t_20) < 0) __PYX_ERR(0, 324, __pyx_L1_error)
7035 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7036 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
7037
7038 /* "av/codec/codec.pyx":325
7039 * auto_threads = capabilities.flag_property('AUTO_THREADS')
7040 * variable_frame_size = capabilities.flag_property('VARIABLE_FRAME_SIZE')
7041 * avoid_probing = capabilities.flag_property('AVOID_PROBING') # <<<<<<<<<<<<<<
7042 * # intra_only = capabilities.flag_property('INTRA_ONLY') # Dupes.
7043 * # lossless = capabilities.flag_property('LOSSLESS') # Dupes.
7044 */
7045 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error)
7046 __Pyx_GOTREF(__pyx_t_7);
7047 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 325, __pyx_L1_error)
7048 __Pyx_GOTREF(__pyx_t_19);
7049 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7050 __pyx_t_7 = NULL;
7051 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
7052 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
7053 if (likely(__pyx_t_7)) {
7054 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
7055 __Pyx_INCREF(__pyx_t_7);
7056 __Pyx_INCREF(function);
7057 __Pyx_DECREF_SET(__pyx_t_19, function);
7058 }
7059 }
7060 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_AVOID_PROBING) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_AVOID_PROBING);
7061 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7062 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 325, __pyx_L1_error)
7063 __Pyx_GOTREF(__pyx_t_20);
7064 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7065 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_avoid_probing, __pyx_t_20) < 0) __PYX_ERR(0, 325, __pyx_L1_error)
7066 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7067 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
7068
7069 /* "av/codec/codec.pyx":328
7070 * # intra_only = capabilities.flag_property('INTRA_ONLY') # Dupes.
7071 * # lossless = capabilities.flag_property('LOSSLESS') # Dupes.
7072 * hardware = capabilities.flag_property('HARDWARE') # <<<<<<<<<<<<<<
7073 * hybrid = capabilities.flag_property('HYBRID')
7074 * encoder_reordered_opaque = capabilities.flag_property('ENCODER_REORDERED_OPAQUE')
7075 */
7076 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 328, __pyx_L1_error)
7077 __Pyx_GOTREF(__pyx_t_19);
7078 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error)
7079 __Pyx_GOTREF(__pyx_t_7);
7080 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7081 __pyx_t_19 = NULL;
7082 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7083 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
7084 if (likely(__pyx_t_19)) {
7085 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7086 __Pyx_INCREF(__pyx_t_19);
7087 __Pyx_INCREF(function);
7088 __Pyx_DECREF_SET(__pyx_t_7, function);
7089 }
7090 }
7091 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_HARDWARE) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_HARDWARE);
7092 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
7093 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 328, __pyx_L1_error)
7094 __Pyx_GOTREF(__pyx_t_20);
7095 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7096 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_hardware, __pyx_t_20) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
7097 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7098 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
7099
7100 /* "av/codec/codec.pyx":329
7101 * # lossless = capabilities.flag_property('LOSSLESS') # Dupes.
7102 * hardware = capabilities.flag_property('HARDWARE')
7103 * hybrid = capabilities.flag_property('HYBRID') # <<<<<<<<<<<<<<
7104 * encoder_reordered_opaque = capabilities.flag_property('ENCODER_REORDERED_OPAQUE')
7105 *
7106 */
7107 __Pyx_GetNameInClass(__pyx_t_7, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error)
7108 __Pyx_GOTREF(__pyx_t_7);
7109 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 329, __pyx_L1_error)
7110 __Pyx_GOTREF(__pyx_t_19);
7111 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7112 __pyx_t_7 = NULL;
7113 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
7114 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_19);
7115 if (likely(__pyx_t_7)) {
7116 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
7117 __Pyx_INCREF(__pyx_t_7);
7118 __Pyx_INCREF(function);
7119 __Pyx_DECREF_SET(__pyx_t_19, function);
7120 }
7121 }
7122 __pyx_t_20 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_7, __pyx_n_s_HYBRID) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_n_s_HYBRID);
7123 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7124 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 329, __pyx_L1_error)
7125 __Pyx_GOTREF(__pyx_t_20);
7126 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7127 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_hybrid, __pyx_t_20) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
7128 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7129 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
7130
7131 /* "av/codec/codec.pyx":330
7132 * hardware = capabilities.flag_property('HARDWARE')
7133 * hybrid = capabilities.flag_property('HYBRID')
7134 * encoder_reordered_opaque = capabilities.flag_property('ENCODER_REORDERED_OPAQUE') # <<<<<<<<<<<<<<
7135 *
7136 *
7137 */
7138 __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_2av_5codec_5codec_Codec, __pyx_n_s_capabilities); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 330, __pyx_L1_error)
7139 __Pyx_GOTREF(__pyx_t_19);
7140 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_flag_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error)
7141 __Pyx_GOTREF(__pyx_t_7);
7142 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7143 __pyx_t_19 = NULL;
7144 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7145 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_7);
7146 if (likely(__pyx_t_19)) {
7147 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7148 __Pyx_INCREF(__pyx_t_19);
7149 __Pyx_INCREF(function);
7150 __Pyx_DECREF_SET(__pyx_t_7, function);
7151 }
7152 }
7153 __pyx_t_20 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_19, __pyx_n_s_ENCODER_REORDERED_OPAQUE) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_ENCODER_REORDERED_OPAQUE);
7154 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
7155 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 330, __pyx_L1_error)
7156 __Pyx_GOTREF(__pyx_t_20);
7157 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7158 if (PyDict_SetItem((PyObject *)__pyx_ptype_2av_5codec_5codec_Codec->tp_dict, __pyx_n_s_encoder_reordered_opaque, __pyx_t_20) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
7159 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7160 PyType_Modified(__pyx_ptype_2av_5codec_5codec_Codec);
7161
7162 /* "av/codec/codec.pyx":345
7163 * return names
7164 *
7165 * codecs_available = get_codec_names() # <<<<<<<<<<<<<<
7166 *
7167 *
7168 */
7169 __pyx_t_20 = __pyx_f_2av_5codec_5codec_get_codec_names(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 345, __pyx_L1_error)
7170 __Pyx_GOTREF(__pyx_t_20);
7171 if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs_available, __pyx_t_20) < 0) __PYX_ERR(0, 345, __pyx_L1_error)
7172 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7173
7174 /* "av/codec/codec.pyx":348
7175 *
7176 *
7177 * codec_descriptor = wrap_avclass(lib.avcodec_get_class()) # <<<<<<<<<<<<<<
7178 *
7179 *
7180 */
7181 __pyx_t_20 = ((PyObject *)__pyx_f_2av_10descriptor_wrap_avclass(avcodec_get_class())); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 348, __pyx_L1_error)
7182 __Pyx_GOTREF(__pyx_t_20);
7183 if (PyDict_SetItem(__pyx_d, __pyx_n_s_codec_descriptor, __pyx_t_20) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
7184 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7185
7186 /* "av/codec/codec.pyx":351
7187 *
7188 *
7189 * def dump_codecs(): # <<<<<<<<<<<<<<
7190 * """Print information about availible codecs."""
7191 *
7192 */
7193 __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_2av_5codec_5codec_1dump_codecs, NULL, __pyx_n_s_av_codec_codec); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 351, __pyx_L1_error)
7194 __Pyx_GOTREF(__pyx_t_20);
7195 if (PyDict_SetItem(__pyx_d, __pyx_n_s_dump_codecs, __pyx_t_20) < 0) __PYX_ERR(0, 351, __pyx_L1_error)
7196 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7197
7198 /* "av/codec/codec.pyx":1
7199 * from av.audio.format cimport get_audio_format # <<<<<<<<<<<<<<
7200 * from av.descriptor cimport wrap_avclass
7201 * from av.enum cimport define_enum
7202 */
7203 __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1, __pyx_L1_error)
7204 __Pyx_GOTREF(__pyx_t_20);
7205 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_20) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7206 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7207
7208 /*--- Wrapped vars code ---*/
7209
7210 goto __pyx_L0;
7211 __pyx_L1_error:;
7212 __Pyx_XDECREF(__pyx_t_1);
7213 __Pyx_XDECREF(__pyx_t_2);
7214 __Pyx_XDECREF(__pyx_t_3);
7215 __Pyx_XDECREF(__pyx_t_4);
7216 __Pyx_XDECREF(__pyx_t_5);
7217 __Pyx_XDECREF(__pyx_t_6);
7218 __Pyx_XDECREF(__pyx_t_7);
7219 __Pyx_XDECREF(__pyx_t_9);
7220 __Pyx_XDECREF(__pyx_t_10);
7221 __Pyx_XDECREF(__pyx_t_11);
7222 __Pyx_XDECREF(__pyx_t_12);
7223 __Pyx_XDECREF(__pyx_t_13);
7224 __Pyx_XDECREF(__pyx_t_14);
7225 __Pyx_XDECREF(__pyx_t_15);
7226 __Pyx_XDECREF(__pyx_t_16);
7227 __Pyx_XDECREF(__pyx_t_17);
7228 __Pyx_XDECREF(__pyx_t_18);
7229 __Pyx_XDECREF(__pyx_t_19);
7230 __Pyx_XDECREF(__pyx_t_20);
7231 if (__pyx_m) {
7232 if (__pyx_d) {
7233 __Pyx_AddTraceback("init av.codec.codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
7234 }
7235 Py_CLEAR(__pyx_m);
7236 } else if (!PyErr_Occurred()) {
7237 PyErr_SetString(PyExc_ImportError, "init av.codec.codec");
7238 }
7239 __pyx_L0:;
7240 __Pyx_RefNannyFinishContext();
7241 #if CYTHON_PEP489_MULTI_PHASE_INIT
7242 return (__pyx_m != NULL) ? 0 : -1;
7243 #elif PY_MAJOR_VERSION >= 3
7244 return __pyx_m;
7245 #else
7246 return;
7247 #endif
7248 }
7249
7250 /* --- Runtime support code --- */
7251 /* Refnanny */
7252 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)7253 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
7254 PyObject *m = NULL, *p = NULL;
7255 void *r = NULL;
7256 m = PyImport_ImportModule(modname);
7257 if (!m) goto end;
7258 p = PyObject_GetAttrString(m, "RefNannyAPI");
7259 if (!p) goto end;
7260 r = PyLong_AsVoidPtr(p);
7261 end:
7262 Py_XDECREF(p);
7263 Py_XDECREF(m);
7264 return (__Pyx_RefNannyAPIStruct *)r;
7265 }
7266 #endif
7267
7268 /* PyObjectGetAttrStr */
7269 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)7270 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
7271 PyTypeObject* tp = Py_TYPE(obj);
7272 if (likely(tp->tp_getattro))
7273 return tp->tp_getattro(obj, attr_name);
7274 #if PY_MAJOR_VERSION < 3
7275 if (likely(tp->tp_getattr))
7276 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
7277 #endif
7278 return PyObject_GetAttr(obj, attr_name);
7279 }
7280 #endif
7281
7282 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)7283 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
7284 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
7285 if (unlikely(!result)) {
7286 PyErr_Format(PyExc_NameError,
7287 #if PY_MAJOR_VERSION >= 3
7288 "name '%U' is not defined", name);
7289 #else
7290 "name '%.200s' is not defined", PyString_AS_STRING(name));
7291 #endif
7292 }
7293 return result;
7294 }
7295
7296 /* PyCFunctionFastCall */
7297 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)7298 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
7299 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
7300 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
7301 PyObject *self = PyCFunction_GET_SELF(func);
7302 int flags = PyCFunction_GET_FLAGS(func);
7303 assert(PyCFunction_Check(func));
7304 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
7305 assert(nargs >= 0);
7306 assert(nargs == 0 || args != NULL);
7307 /* _PyCFunction_FastCallDict() must not be called with an exception set,
7308 because it may clear it (directly or indirectly) and so the
7309 caller loses its exception */
7310 assert(!PyErr_Occurred());
7311 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
7312 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
7313 } else {
7314 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
7315 }
7316 }
7317 #endif
7318
7319 /* PyFunctionFastCall */
7320 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)7321 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
7322 PyObject *globals) {
7323 PyFrameObject *f;
7324 PyThreadState *tstate = __Pyx_PyThreadState_Current;
7325 PyObject **fastlocals;
7326 Py_ssize_t i;
7327 PyObject *result;
7328 assert(globals != NULL);
7329 /* XXX Perhaps we should create a specialized
7330 PyFrame_New() that doesn't take locals, but does
7331 take builtins without sanity checking them.
7332 */
7333 assert(tstate != NULL);
7334 f = PyFrame_New(tstate, co, globals, NULL);
7335 if (f == NULL) {
7336 return NULL;
7337 }
7338 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
7339 for (i = 0; i < na; i++) {
7340 Py_INCREF(*args);
7341 fastlocals[i] = *args++;
7342 }
7343 result = PyEval_EvalFrameEx(f,0);
7344 ++tstate->recursion_depth;
7345 Py_DECREF(f);
7346 --tstate->recursion_depth;
7347 return result;
7348 }
7349 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)7350 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
7351 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
7352 PyObject *globals = PyFunction_GET_GLOBALS(func);
7353 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
7354 PyObject *closure;
7355 #if PY_MAJOR_VERSION >= 3
7356 PyObject *kwdefs;
7357 #endif
7358 PyObject *kwtuple, **k;
7359 PyObject **d;
7360 Py_ssize_t nd;
7361 Py_ssize_t nk;
7362 PyObject *result;
7363 assert(kwargs == NULL || PyDict_Check(kwargs));
7364 nk = kwargs ? PyDict_Size(kwargs) : 0;
7365 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
7366 return NULL;
7367 }
7368 if (
7369 #if PY_MAJOR_VERSION >= 3
7370 co->co_kwonlyargcount == 0 &&
7371 #endif
7372 likely(kwargs == NULL || nk == 0) &&
7373 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
7374 if (argdefs == NULL && co->co_argcount == nargs) {
7375 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
7376 goto done;
7377 }
7378 else if (nargs == 0 && argdefs != NULL
7379 && co->co_argcount == Py_SIZE(argdefs)) {
7380 /* function called with no arguments, but all parameters have
7381 a default value: use default values as arguments .*/
7382 args = &PyTuple_GET_ITEM(argdefs, 0);
7383 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
7384 goto done;
7385 }
7386 }
7387 if (kwargs != NULL) {
7388 Py_ssize_t pos, i;
7389 kwtuple = PyTuple_New(2 * nk);
7390 if (kwtuple == NULL) {
7391 result = NULL;
7392 goto done;
7393 }
7394 k = &PyTuple_GET_ITEM(kwtuple, 0);
7395 pos = i = 0;
7396 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
7397 Py_INCREF(k[i]);
7398 Py_INCREF(k[i+1]);
7399 i += 2;
7400 }
7401 nk = i / 2;
7402 }
7403 else {
7404 kwtuple = NULL;
7405 k = NULL;
7406 }
7407 closure = PyFunction_GET_CLOSURE(func);
7408 #if PY_MAJOR_VERSION >= 3
7409 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
7410 #endif
7411 if (argdefs != NULL) {
7412 d = &PyTuple_GET_ITEM(argdefs, 0);
7413 nd = Py_SIZE(argdefs);
7414 }
7415 else {
7416 d = NULL;
7417 nd = 0;
7418 }
7419 #if PY_MAJOR_VERSION >= 3
7420 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
7421 args, (int)nargs,
7422 k, (int)nk,
7423 d, (int)nd, kwdefs, closure);
7424 #else
7425 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
7426 args, (int)nargs,
7427 k, (int)nk,
7428 d, (int)nd, closure);
7429 #endif
7430 Py_XDECREF(kwtuple);
7431 done:
7432 Py_LeaveRecursiveCall();
7433 return result;
7434 }
7435 #endif
7436 #endif
7437
7438 /* PyObjectCall */
7439 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)7440 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
7441 PyObject *result;
7442 ternaryfunc call = func->ob_type->tp_call;
7443 if (unlikely(!call))
7444 return PyObject_Call(func, arg, kw);
7445 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
7446 return NULL;
7447 result = (*call)(func, arg, kw);
7448 Py_LeaveRecursiveCall();
7449 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7450 PyErr_SetString(
7451 PyExc_SystemError,
7452 "NULL result without error in PyObject_Call");
7453 }
7454 return result;
7455 }
7456 #endif
7457
7458 /* PyObjectCallMethO */
7459 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)7460 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
7461 PyObject *self, *result;
7462 PyCFunction cfunc;
7463 cfunc = PyCFunction_GET_FUNCTION(func);
7464 self = PyCFunction_GET_SELF(func);
7465 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
7466 return NULL;
7467 result = cfunc(self, arg);
7468 Py_LeaveRecursiveCall();
7469 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7470 PyErr_SetString(
7471 PyExc_SystemError,
7472 "NULL result without error in PyObject_Call");
7473 }
7474 return result;
7475 }
7476 #endif
7477
7478 /* PyObjectCallOneArg */
7479 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)7480 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7481 PyObject *result;
7482 PyObject *args = PyTuple_New(1);
7483 if (unlikely(!args)) return NULL;
7484 Py_INCREF(arg);
7485 PyTuple_SET_ITEM(args, 0, arg);
7486 result = __Pyx_PyObject_Call(func, args, NULL);
7487 Py_DECREF(args);
7488 return result;
7489 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)7490 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7491 #if CYTHON_FAST_PYCALL
7492 if (PyFunction_Check(func)) {
7493 return __Pyx_PyFunction_FastCall(func, &arg, 1);
7494 }
7495 #endif
7496 if (likely(PyCFunction_Check(func))) {
7497 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
7498 return __Pyx_PyObject_CallMethO(func, arg);
7499 #if CYTHON_FAST_PYCCALL
7500 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
7501 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
7502 #endif
7503 }
7504 }
7505 return __Pyx__PyObject_CallOneArg(func, arg);
7506 }
7507 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)7508 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7509 PyObject *result;
7510 PyObject *args = PyTuple_Pack(1, arg);
7511 if (unlikely(!args)) return NULL;
7512 result = __Pyx_PyObject_Call(func, args, NULL);
7513 Py_DECREF(args);
7514 return result;
7515 }
7516 #endif
7517
7518 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)7519 static void __Pyx_RaiseDoubleKeywordsError(
7520 const char* func_name,
7521 PyObject* kw_name)
7522 {
7523 PyErr_Format(PyExc_TypeError,
7524 #if PY_MAJOR_VERSION >= 3
7525 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
7526 #else
7527 "%s() got multiple values for keyword argument '%s'", func_name,
7528 PyString_AsString(kw_name));
7529 #endif
7530 }
7531
7532 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)7533 static int __Pyx_ParseOptionalKeywords(
7534 PyObject *kwds,
7535 PyObject **argnames[],
7536 PyObject *kwds2,
7537 PyObject *values[],
7538 Py_ssize_t num_pos_args,
7539 const char* function_name)
7540 {
7541 PyObject *key = 0, *value = 0;
7542 Py_ssize_t pos = 0;
7543 PyObject*** name;
7544 PyObject*** first_kw_arg = argnames + num_pos_args;
7545 while (PyDict_Next(kwds, &pos, &key, &value)) {
7546 name = first_kw_arg;
7547 while (*name && (**name != key)) name++;
7548 if (*name) {
7549 values[name-argnames] = value;
7550 continue;
7551 }
7552 name = first_kw_arg;
7553 #if PY_MAJOR_VERSION < 3
7554 if (likely(PyString_Check(key))) {
7555 while (*name) {
7556 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
7557 && _PyString_Eq(**name, key)) {
7558 values[name-argnames] = value;
7559 break;
7560 }
7561 name++;
7562 }
7563 if (*name) continue;
7564 else {
7565 PyObject*** argname = argnames;
7566 while (argname != first_kw_arg) {
7567 if ((**argname == key) || (
7568 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
7569 && _PyString_Eq(**argname, key))) {
7570 goto arg_passed_twice;
7571 }
7572 argname++;
7573 }
7574 }
7575 } else
7576 #endif
7577 if (likely(PyUnicode_Check(key))) {
7578 while (*name) {
7579 int cmp = (**name == key) ? 0 :
7580 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7581 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
7582 #endif
7583 PyUnicode_Compare(**name, key);
7584 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7585 if (cmp == 0) {
7586 values[name-argnames] = value;
7587 break;
7588 }
7589 name++;
7590 }
7591 if (*name) continue;
7592 else {
7593 PyObject*** argname = argnames;
7594 while (argname != first_kw_arg) {
7595 int cmp = (**argname == key) ? 0 :
7596 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7597 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
7598 #endif
7599 PyUnicode_Compare(**argname, key);
7600 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7601 if (cmp == 0) goto arg_passed_twice;
7602 argname++;
7603 }
7604 }
7605 } else
7606 goto invalid_keyword_type;
7607 if (kwds2) {
7608 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
7609 } else {
7610 goto invalid_keyword;
7611 }
7612 }
7613 return 0;
7614 arg_passed_twice:
7615 __Pyx_RaiseDoubleKeywordsError(function_name, key);
7616 goto bad;
7617 invalid_keyword_type:
7618 PyErr_Format(PyExc_TypeError,
7619 "%.200s() keywords must be strings", function_name);
7620 goto bad;
7621 invalid_keyword:
7622 PyErr_Format(PyExc_TypeError,
7623 #if PY_MAJOR_VERSION < 3
7624 "%.200s() got an unexpected keyword argument '%.200s'",
7625 function_name, PyString_AsString(key));
7626 #else
7627 "%s() got an unexpected keyword argument '%U'",
7628 function_name, key);
7629 #endif
7630 bad:
7631 return -1;
7632 }
7633
7634 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)7635 static void __Pyx_RaiseArgtupleInvalid(
7636 const char* func_name,
7637 int exact,
7638 Py_ssize_t num_min,
7639 Py_ssize_t num_max,
7640 Py_ssize_t num_found)
7641 {
7642 Py_ssize_t num_expected;
7643 const char *more_or_less;
7644 if (num_found < num_min) {
7645 num_expected = num_min;
7646 more_or_less = "at least";
7647 } else {
7648 num_expected = num_max;
7649 more_or_less = "at most";
7650 }
7651 if (exact) {
7652 more_or_less = "exactly";
7653 }
7654 PyErr_Format(PyExc_TypeError,
7655 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
7656 func_name, more_or_less, num_expected,
7657 (num_expected == 1) ? "" : "s", num_found);
7658 }
7659
7660 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)7661 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
7662 #if CYTHON_COMPILING_IN_PYPY
7663 return PyObject_RichCompareBool(s1, s2, equals);
7664 #else
7665 if (s1 == s2) {
7666 return (equals == Py_EQ);
7667 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
7668 const char *ps1, *ps2;
7669 Py_ssize_t length = PyBytes_GET_SIZE(s1);
7670 if (length != PyBytes_GET_SIZE(s2))
7671 return (equals == Py_NE);
7672 ps1 = PyBytes_AS_STRING(s1);
7673 ps2 = PyBytes_AS_STRING(s2);
7674 if (ps1[0] != ps2[0]) {
7675 return (equals == Py_NE);
7676 } else if (length == 1) {
7677 return (equals == Py_EQ);
7678 } else {
7679 int result;
7680 #if CYTHON_USE_UNICODE_INTERNALS
7681 Py_hash_t hash1, hash2;
7682 hash1 = ((PyBytesObject*)s1)->ob_shash;
7683 hash2 = ((PyBytesObject*)s2)->ob_shash;
7684 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
7685 return (equals == Py_NE);
7686 }
7687 #endif
7688 result = memcmp(ps1, ps2, (size_t)length);
7689 return (equals == Py_EQ) ? (result == 0) : (result != 0);
7690 }
7691 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
7692 return (equals == Py_NE);
7693 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
7694 return (equals == Py_NE);
7695 } else {
7696 int result;
7697 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
7698 if (!py_result)
7699 return -1;
7700 result = __Pyx_PyObject_IsTrue(py_result);
7701 Py_DECREF(py_result);
7702 return result;
7703 }
7704 #endif
7705 }
7706
7707 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)7708 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
7709 #if CYTHON_COMPILING_IN_PYPY
7710 return PyObject_RichCompareBool(s1, s2, equals);
7711 #else
7712 #if PY_MAJOR_VERSION < 3
7713 PyObject* owned_ref = NULL;
7714 #endif
7715 int s1_is_unicode, s2_is_unicode;
7716 if (s1 == s2) {
7717 goto return_eq;
7718 }
7719 s1_is_unicode = PyUnicode_CheckExact(s1);
7720 s2_is_unicode = PyUnicode_CheckExact(s2);
7721 #if PY_MAJOR_VERSION < 3
7722 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
7723 owned_ref = PyUnicode_FromObject(s2);
7724 if (unlikely(!owned_ref))
7725 return -1;
7726 s2 = owned_ref;
7727 s2_is_unicode = 1;
7728 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
7729 owned_ref = PyUnicode_FromObject(s1);
7730 if (unlikely(!owned_ref))
7731 return -1;
7732 s1 = owned_ref;
7733 s1_is_unicode = 1;
7734 } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
7735 return __Pyx_PyBytes_Equals(s1, s2, equals);
7736 }
7737 #endif
7738 if (s1_is_unicode & s2_is_unicode) {
7739 Py_ssize_t length;
7740 int kind;
7741 void *data1, *data2;
7742 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
7743 return -1;
7744 length = __Pyx_PyUnicode_GET_LENGTH(s1);
7745 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
7746 goto return_ne;
7747 }
7748 #if CYTHON_USE_UNICODE_INTERNALS
7749 {
7750 Py_hash_t hash1, hash2;
7751 #if CYTHON_PEP393_ENABLED
7752 hash1 = ((PyASCIIObject*)s1)->hash;
7753 hash2 = ((PyASCIIObject*)s2)->hash;
7754 #else
7755 hash1 = ((PyUnicodeObject*)s1)->hash;
7756 hash2 = ((PyUnicodeObject*)s2)->hash;
7757 #endif
7758 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
7759 goto return_ne;
7760 }
7761 }
7762 #endif
7763 kind = __Pyx_PyUnicode_KIND(s1);
7764 if (kind != __Pyx_PyUnicode_KIND(s2)) {
7765 goto return_ne;
7766 }
7767 data1 = __Pyx_PyUnicode_DATA(s1);
7768 data2 = __Pyx_PyUnicode_DATA(s2);
7769 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
7770 goto return_ne;
7771 } else if (length == 1) {
7772 goto return_eq;
7773 } else {
7774 int result = memcmp(data1, data2, (size_t)(length * kind));
7775 #if PY_MAJOR_VERSION < 3
7776 Py_XDECREF(owned_ref);
7777 #endif
7778 return (equals == Py_EQ) ? (result == 0) : (result != 0);
7779 }
7780 } else if ((s1 == Py_None) & s2_is_unicode) {
7781 goto return_ne;
7782 } else if ((s2 == Py_None) & s1_is_unicode) {
7783 goto return_ne;
7784 } else {
7785 int result;
7786 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
7787 #if PY_MAJOR_VERSION < 3
7788 Py_XDECREF(owned_ref);
7789 #endif
7790 if (!py_result)
7791 return -1;
7792 result = __Pyx_PyObject_IsTrue(py_result);
7793 Py_DECREF(py_result);
7794 return result;
7795 }
7796 return_eq:
7797 #if PY_MAJOR_VERSION < 3
7798 Py_XDECREF(owned_ref);
7799 #endif
7800 return (equals == Py_EQ);
7801 return_ne:
7802 #if PY_MAJOR_VERSION < 3
7803 Py_XDECREF(owned_ref);
7804 #endif
7805 return (equals == Py_NE);
7806 #endif
7807 }
7808
7809 /* PyErrFetchRestore */
7810 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)7811 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
7812 PyObject *tmp_type, *tmp_value, *tmp_tb;
7813 tmp_type = tstate->curexc_type;
7814 tmp_value = tstate->curexc_value;
7815 tmp_tb = tstate->curexc_traceback;
7816 tstate->curexc_type = type;
7817 tstate->curexc_value = value;
7818 tstate->curexc_traceback = tb;
7819 Py_XDECREF(tmp_type);
7820 Py_XDECREF(tmp_value);
7821 Py_XDECREF(tmp_tb);
7822 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)7823 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7824 *type = tstate->curexc_type;
7825 *value = tstate->curexc_value;
7826 *tb = tstate->curexc_traceback;
7827 tstate->curexc_type = 0;
7828 tstate->curexc_value = 0;
7829 tstate->curexc_traceback = 0;
7830 }
7831 #endif
7832
7833 /* RaiseException */
7834 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)7835 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
7836 CYTHON_UNUSED PyObject *cause) {
7837 __Pyx_PyThreadState_declare
7838 Py_XINCREF(type);
7839 if (!value || value == Py_None)
7840 value = NULL;
7841 else
7842 Py_INCREF(value);
7843 if (!tb || tb == Py_None)
7844 tb = NULL;
7845 else {
7846 Py_INCREF(tb);
7847 if (!PyTraceBack_Check(tb)) {
7848 PyErr_SetString(PyExc_TypeError,
7849 "raise: arg 3 must be a traceback or None");
7850 goto raise_error;
7851 }
7852 }
7853 if (PyType_Check(type)) {
7854 #if CYTHON_COMPILING_IN_PYPY
7855 if (!value) {
7856 Py_INCREF(Py_None);
7857 value = Py_None;
7858 }
7859 #endif
7860 PyErr_NormalizeException(&type, &value, &tb);
7861 } else {
7862 if (value) {
7863 PyErr_SetString(PyExc_TypeError,
7864 "instance exception may not have a separate value");
7865 goto raise_error;
7866 }
7867 value = type;
7868 type = (PyObject*) Py_TYPE(type);
7869 Py_INCREF(type);
7870 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
7871 PyErr_SetString(PyExc_TypeError,
7872 "raise: exception class must be a subclass of BaseException");
7873 goto raise_error;
7874 }
7875 }
7876 __Pyx_PyThreadState_assign
7877 __Pyx_ErrRestore(type, value, tb);
7878 return;
7879 raise_error:
7880 Py_XDECREF(value);
7881 Py_XDECREF(type);
7882 Py_XDECREF(tb);
7883 return;
7884 }
7885 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)7886 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
7887 PyObject* owned_instance = NULL;
7888 if (tb == Py_None) {
7889 tb = 0;
7890 } else if (tb && !PyTraceBack_Check(tb)) {
7891 PyErr_SetString(PyExc_TypeError,
7892 "raise: arg 3 must be a traceback or None");
7893 goto bad;
7894 }
7895 if (value == Py_None)
7896 value = 0;
7897 if (PyExceptionInstance_Check(type)) {
7898 if (value) {
7899 PyErr_SetString(PyExc_TypeError,
7900 "instance exception may not have a separate value");
7901 goto bad;
7902 }
7903 value = type;
7904 type = (PyObject*) Py_TYPE(value);
7905 } else if (PyExceptionClass_Check(type)) {
7906 PyObject *instance_class = NULL;
7907 if (value && PyExceptionInstance_Check(value)) {
7908 instance_class = (PyObject*) Py_TYPE(value);
7909 if (instance_class != type) {
7910 int is_subclass = PyObject_IsSubclass(instance_class, type);
7911 if (!is_subclass) {
7912 instance_class = NULL;
7913 } else if (unlikely(is_subclass == -1)) {
7914 goto bad;
7915 } else {
7916 type = instance_class;
7917 }
7918 }
7919 }
7920 if (!instance_class) {
7921 PyObject *args;
7922 if (!value)
7923 args = PyTuple_New(0);
7924 else if (PyTuple_Check(value)) {
7925 Py_INCREF(value);
7926 args = value;
7927 } else
7928 args = PyTuple_Pack(1, value);
7929 if (!args)
7930 goto bad;
7931 owned_instance = PyObject_Call(type, args, NULL);
7932 Py_DECREF(args);
7933 if (!owned_instance)
7934 goto bad;
7935 value = owned_instance;
7936 if (!PyExceptionInstance_Check(value)) {
7937 PyErr_Format(PyExc_TypeError,
7938 "calling %R should have returned an instance of "
7939 "BaseException, not %R",
7940 type, Py_TYPE(value));
7941 goto bad;
7942 }
7943 }
7944 } else {
7945 PyErr_SetString(PyExc_TypeError,
7946 "raise: exception class must be a subclass of BaseException");
7947 goto bad;
7948 }
7949 if (cause) {
7950 PyObject *fixed_cause;
7951 if (cause == Py_None) {
7952 fixed_cause = NULL;
7953 } else if (PyExceptionClass_Check(cause)) {
7954 fixed_cause = PyObject_CallObject(cause, NULL);
7955 if (fixed_cause == NULL)
7956 goto bad;
7957 } else if (PyExceptionInstance_Check(cause)) {
7958 fixed_cause = cause;
7959 Py_INCREF(fixed_cause);
7960 } else {
7961 PyErr_SetString(PyExc_TypeError,
7962 "exception causes must derive from "
7963 "BaseException");
7964 goto bad;
7965 }
7966 PyException_SetCause(value, fixed_cause);
7967 }
7968 PyErr_SetObject(type, value);
7969 if (tb) {
7970 #if CYTHON_COMPILING_IN_PYPY
7971 PyObject *tmp_type, *tmp_value, *tmp_tb;
7972 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
7973 Py_INCREF(tb);
7974 PyErr_Restore(tmp_type, tmp_value, tb);
7975 Py_XDECREF(tmp_tb);
7976 #else
7977 PyThreadState *tstate = __Pyx_PyThreadState_Current;
7978 PyObject* tmp_tb = tstate->curexc_traceback;
7979 if (tb != tmp_tb) {
7980 Py_INCREF(tb);
7981 tstate->curexc_traceback = tb;
7982 Py_XDECREF(tmp_tb);
7983 }
7984 #endif
7985 }
7986 bad:
7987 Py_XDECREF(owned_instance);
7988 return;
7989 }
7990 #endif
7991
7992 /* PyDictVersioning */
7993 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)7994 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
7995 PyObject *dict = Py_TYPE(obj)->tp_dict;
7996 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
7997 }
__Pyx_get_object_dict_version(PyObject * obj)7998 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
7999 PyObject **dictptr = NULL;
8000 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
8001 if (offset) {
8002 #if CYTHON_COMPILING_IN_CPYTHON
8003 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
8004 #else
8005 dictptr = _PyObject_GetDictPtr(obj);
8006 #endif
8007 }
8008 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
8009 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)8010 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
8011 PyObject *dict = Py_TYPE(obj)->tp_dict;
8012 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
8013 return 0;
8014 return obj_dict_version == __Pyx_get_object_dict_version(obj);
8015 }
8016 #endif
8017
8018 /* GetModuleGlobalName */
8019 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)8020 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
8021 #else
8022 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
8023 #endif
8024 {
8025 PyObject *result;
8026 #if !CYTHON_AVOID_BORROWED_REFS
8027 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
8028 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
8029 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
8030 if (likely(result)) {
8031 return __Pyx_NewRef(result);
8032 } else if (unlikely(PyErr_Occurred())) {
8033 return NULL;
8034 }
8035 #else
8036 result = PyDict_GetItem(__pyx_d, name);
8037 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
8038 if (likely(result)) {
8039 return __Pyx_NewRef(result);
8040 }
8041 #endif
8042 #else
8043 result = PyObject_GetItem(__pyx_d, name);
8044 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
8045 if (likely(result)) {
8046 return __Pyx_NewRef(result);
8047 }
8048 PyErr_Clear();
8049 #endif
8050 return __Pyx_GetBuiltinName(name);
8051 }
8052
8053 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)8054 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
8055 PyObject *args, *result = NULL;
8056 #if CYTHON_FAST_PYCALL
8057 if (PyFunction_Check(function)) {
8058 PyObject *args[2] = {arg1, arg2};
8059 return __Pyx_PyFunction_FastCall(function, args, 2);
8060 }
8061 #endif
8062 #if CYTHON_FAST_PYCCALL
8063 if (__Pyx_PyFastCFunction_Check(function)) {
8064 PyObject *args[2] = {arg1, arg2};
8065 return __Pyx_PyCFunction_FastCall(function, args, 2);
8066 }
8067 #endif
8068 args = PyTuple_New(2);
8069 if (unlikely(!args)) goto done;
8070 Py_INCREF(arg1);
8071 PyTuple_SET_ITEM(args, 0, arg1);
8072 Py_INCREF(arg2);
8073 PyTuple_SET_ITEM(args, 1, arg2);
8074 Py_INCREF(function);
8075 result = __Pyx_PyObject_Call(function, args, NULL);
8076 Py_DECREF(args);
8077 Py_DECREF(function);
8078 done:
8079 return result;
8080 }
8081
8082 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)8083 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
8084 PyObject *empty_list = 0;
8085 PyObject *module = 0;
8086 PyObject *global_dict = 0;
8087 PyObject *empty_dict = 0;
8088 PyObject *list;
8089 #if PY_MAJOR_VERSION < 3
8090 PyObject *py_import;
8091 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
8092 if (!py_import)
8093 goto bad;
8094 #endif
8095 if (from_list)
8096 list = from_list;
8097 else {
8098 empty_list = PyList_New(0);
8099 if (!empty_list)
8100 goto bad;
8101 list = empty_list;
8102 }
8103 global_dict = PyModule_GetDict(__pyx_m);
8104 if (!global_dict)
8105 goto bad;
8106 empty_dict = PyDict_New();
8107 if (!empty_dict)
8108 goto bad;
8109 {
8110 #if PY_MAJOR_VERSION >= 3
8111 if (level == -1) {
8112 if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
8113 module = PyImport_ImportModuleLevelObject(
8114 name, global_dict, empty_dict, list, 1);
8115 if (!module) {
8116 if (!PyErr_ExceptionMatches(PyExc_ImportError))
8117 goto bad;
8118 PyErr_Clear();
8119 }
8120 }
8121 level = 0;
8122 }
8123 #endif
8124 if (!module) {
8125 #if PY_MAJOR_VERSION < 3
8126 PyObject *py_level = PyInt_FromLong(level);
8127 if (!py_level)
8128 goto bad;
8129 module = PyObject_CallFunctionObjArgs(py_import,
8130 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
8131 Py_DECREF(py_level);
8132 #else
8133 module = PyImport_ImportModuleLevelObject(
8134 name, global_dict, empty_dict, list, level);
8135 #endif
8136 }
8137 }
8138 bad:
8139 #if PY_MAJOR_VERSION < 3
8140 Py_XDECREF(py_import);
8141 #endif
8142 Py_XDECREF(empty_list);
8143 Py_XDECREF(empty_dict);
8144 return module;
8145 }
8146
8147 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)8148 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
8149 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
8150 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
8151 PyErr_Format(PyExc_ImportError,
8152 #if PY_MAJOR_VERSION < 3
8153 "cannot import name %.230s", PyString_AS_STRING(name));
8154 #else
8155 "cannot import name %S", name);
8156 #endif
8157 }
8158 return value;
8159 }
8160
8161 /* GetTopmostException */
8162 #if CYTHON_USE_EXC_INFO_STACK
8163 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)8164 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
8165 {
8166 _PyErr_StackItem *exc_info = tstate->exc_info;
8167 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
8168 exc_info->previous_item != NULL)
8169 {
8170 exc_info = exc_info->previous_item;
8171 }
8172 return exc_info;
8173 }
8174 #endif
8175
8176 /* SaveResetException */
8177 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)8178 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8179 #if CYTHON_USE_EXC_INFO_STACK
8180 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
8181 *type = exc_info->exc_type;
8182 *value = exc_info->exc_value;
8183 *tb = exc_info->exc_traceback;
8184 #else
8185 *type = tstate->exc_type;
8186 *value = tstate->exc_value;
8187 *tb = tstate->exc_traceback;
8188 #endif
8189 Py_XINCREF(*type);
8190 Py_XINCREF(*value);
8191 Py_XINCREF(*tb);
8192 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)8193 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8194 PyObject *tmp_type, *tmp_value, *tmp_tb;
8195 #if CYTHON_USE_EXC_INFO_STACK
8196 _PyErr_StackItem *exc_info = tstate->exc_info;
8197 tmp_type = exc_info->exc_type;
8198 tmp_value = exc_info->exc_value;
8199 tmp_tb = exc_info->exc_traceback;
8200 exc_info->exc_type = type;
8201 exc_info->exc_value = value;
8202 exc_info->exc_traceback = tb;
8203 #else
8204 tmp_type = tstate->exc_type;
8205 tmp_value = tstate->exc_value;
8206 tmp_tb = tstate->exc_traceback;
8207 tstate->exc_type = type;
8208 tstate->exc_value = value;
8209 tstate->exc_traceback = tb;
8210 #endif
8211 Py_XDECREF(tmp_type);
8212 Py_XDECREF(tmp_value);
8213 Py_XDECREF(tmp_tb);
8214 }
8215 #endif
8216
8217 /* PyErrExceptionMatches */
8218 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)8219 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8220 Py_ssize_t i, n;
8221 n = PyTuple_GET_SIZE(tuple);
8222 #if PY_MAJOR_VERSION >= 3
8223 for (i=0; i<n; i++) {
8224 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
8225 }
8226 #endif
8227 for (i=0; i<n; i++) {
8228 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
8229 }
8230 return 0;
8231 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)8232 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
8233 PyObject *exc_type = tstate->curexc_type;
8234 if (exc_type == err) return 1;
8235 if (unlikely(!exc_type)) return 0;
8236 if (unlikely(PyTuple_Check(err)))
8237 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
8238 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
8239 }
8240 #endif
8241
8242 /* GetException */
8243 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)8244 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
8245 #else
8246 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
8247 #endif
8248 {
8249 PyObject *local_type, *local_value, *local_tb;
8250 #if CYTHON_FAST_THREAD_STATE
8251 PyObject *tmp_type, *tmp_value, *tmp_tb;
8252 local_type = tstate->curexc_type;
8253 local_value = tstate->curexc_value;
8254 local_tb = tstate->curexc_traceback;
8255 tstate->curexc_type = 0;
8256 tstate->curexc_value = 0;
8257 tstate->curexc_traceback = 0;
8258 #else
8259 PyErr_Fetch(&local_type, &local_value, &local_tb);
8260 #endif
8261 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
8262 #if CYTHON_FAST_THREAD_STATE
8263 if (unlikely(tstate->curexc_type))
8264 #else
8265 if (unlikely(PyErr_Occurred()))
8266 #endif
8267 goto bad;
8268 #if PY_MAJOR_VERSION >= 3
8269 if (local_tb) {
8270 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
8271 goto bad;
8272 }
8273 #endif
8274 Py_XINCREF(local_tb);
8275 Py_XINCREF(local_type);
8276 Py_XINCREF(local_value);
8277 *type = local_type;
8278 *value = local_value;
8279 *tb = local_tb;
8280 #if CYTHON_FAST_THREAD_STATE
8281 #if CYTHON_USE_EXC_INFO_STACK
8282 {
8283 _PyErr_StackItem *exc_info = tstate->exc_info;
8284 tmp_type = exc_info->exc_type;
8285 tmp_value = exc_info->exc_value;
8286 tmp_tb = exc_info->exc_traceback;
8287 exc_info->exc_type = local_type;
8288 exc_info->exc_value = local_value;
8289 exc_info->exc_traceback = local_tb;
8290 }
8291 #else
8292 tmp_type = tstate->exc_type;
8293 tmp_value = tstate->exc_value;
8294 tmp_tb = tstate->exc_traceback;
8295 tstate->exc_type = local_type;
8296 tstate->exc_value = local_value;
8297 tstate->exc_traceback = local_tb;
8298 #endif
8299 Py_XDECREF(tmp_type);
8300 Py_XDECREF(tmp_value);
8301 Py_XDECREF(tmp_tb);
8302 #else
8303 PyErr_SetExcInfo(local_type, local_value, local_tb);
8304 #endif
8305 return 0;
8306 bad:
8307 *type = 0;
8308 *value = 0;
8309 *tb = 0;
8310 Py_XDECREF(local_type);
8311 Py_XDECREF(local_value);
8312 Py_XDECREF(local_tb);
8313 return -1;
8314 }
8315
8316 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)8317 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
8318 PyObject *r;
8319 if (!j) return NULL;
8320 r = PyObject_GetItem(o, j);
8321 Py_DECREF(j);
8322 return r;
8323 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)8324 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
8325 CYTHON_NCP_UNUSED int wraparound,
8326 CYTHON_NCP_UNUSED int boundscheck) {
8327 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8328 Py_ssize_t wrapped_i = i;
8329 if (wraparound & unlikely(i < 0)) {
8330 wrapped_i += PyList_GET_SIZE(o);
8331 }
8332 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
8333 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
8334 Py_INCREF(r);
8335 return r;
8336 }
8337 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
8338 #else
8339 return PySequence_GetItem(o, i);
8340 #endif
8341 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)8342 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
8343 CYTHON_NCP_UNUSED int wraparound,
8344 CYTHON_NCP_UNUSED int boundscheck) {
8345 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8346 Py_ssize_t wrapped_i = i;
8347 if (wraparound & unlikely(i < 0)) {
8348 wrapped_i += PyTuple_GET_SIZE(o);
8349 }
8350 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
8351 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
8352 Py_INCREF(r);
8353 return r;
8354 }
8355 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
8356 #else
8357 return PySequence_GetItem(o, i);
8358 #endif
8359 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)8360 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
8361 CYTHON_NCP_UNUSED int wraparound,
8362 CYTHON_NCP_UNUSED int boundscheck) {
8363 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
8364 if (is_list || PyList_CheckExact(o)) {
8365 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
8366 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
8367 PyObject *r = PyList_GET_ITEM(o, n);
8368 Py_INCREF(r);
8369 return r;
8370 }
8371 }
8372 else if (PyTuple_CheckExact(o)) {
8373 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
8374 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
8375 PyObject *r = PyTuple_GET_ITEM(o, n);
8376 Py_INCREF(r);
8377 return r;
8378 }
8379 } else {
8380 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
8381 if (likely(m && m->sq_item)) {
8382 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
8383 Py_ssize_t l = m->sq_length(o);
8384 if (likely(l >= 0)) {
8385 i += l;
8386 } else {
8387 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
8388 return NULL;
8389 PyErr_Clear();
8390 }
8391 }
8392 return m->sq_item(o, i);
8393 }
8394 }
8395 #else
8396 if (is_list || PySequence_Check(o)) {
8397 return PySequence_GetItem(o, i);
8398 }
8399 #endif
8400 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
8401 }
8402
8403 /* ObjectGetItem */
8404 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)8405 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
8406 PyObject *runerr;
8407 Py_ssize_t key_value;
8408 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
8409 if (unlikely(!(m && m->sq_item))) {
8410 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
8411 return NULL;
8412 }
8413 key_value = __Pyx_PyIndex_AsSsize_t(index);
8414 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
8415 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
8416 }
8417 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
8418 PyErr_Clear();
8419 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
8420 }
8421 return NULL;
8422 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)8423 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
8424 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
8425 if (likely(m && m->mp_subscript)) {
8426 return m->mp_subscript(obj, key);
8427 }
8428 return __Pyx_PyObject_GetIndex(obj, key);
8429 }
8430 #endif
8431
8432 /* PyObjectCallNoArg */
8433 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)8434 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
8435 #if CYTHON_FAST_PYCALL
8436 if (PyFunction_Check(func)) {
8437 return __Pyx_PyFunction_FastCall(func, NULL, 0);
8438 }
8439 #endif
8440 #ifdef __Pyx_CyFunction_USED
8441 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
8442 #else
8443 if (likely(PyCFunction_Check(func)))
8444 #endif
8445 {
8446 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
8447 return __Pyx_PyObject_CallMethO(func, NULL);
8448 }
8449 }
8450 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
8451 }
8452 #endif
8453
8454 /* PyObject_GenericGetAttrNoDict */
8455 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)8456 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
8457 PyErr_Format(PyExc_AttributeError,
8458 #if PY_MAJOR_VERSION >= 3
8459 "'%.50s' object has no attribute '%U'",
8460 tp->tp_name, attr_name);
8461 #else
8462 "'%.50s' object has no attribute '%.400s'",
8463 tp->tp_name, PyString_AS_STRING(attr_name));
8464 #endif
8465 return NULL;
8466 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)8467 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
8468 PyObject *descr;
8469 PyTypeObject *tp = Py_TYPE(obj);
8470 if (unlikely(!PyString_Check(attr_name))) {
8471 return PyObject_GenericGetAttr(obj, attr_name);
8472 }
8473 assert(!tp->tp_dictoffset);
8474 descr = _PyType_Lookup(tp, attr_name);
8475 if (unlikely(!descr)) {
8476 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
8477 }
8478 Py_INCREF(descr);
8479 #if PY_MAJOR_VERSION < 3
8480 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
8481 #endif
8482 {
8483 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
8484 if (unlikely(f)) {
8485 PyObject *res = f(descr, obj, (PyObject *)tp);
8486 Py_DECREF(descr);
8487 return res;
8488 }
8489 }
8490 return descr;
8491 }
8492 #endif
8493
8494 /* PyObject_GenericGetAttr */
8495 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)8496 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
8497 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
8498 return PyObject_GenericGetAttr(obj, attr_name);
8499 }
8500 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
8501 }
8502 #endif
8503
8504 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)8505 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
8506 #if PY_VERSION_HEX >= 0x02070000
8507 PyObject *ob = PyCapsule_New(vtable, 0, 0);
8508 #else
8509 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
8510 #endif
8511 if (!ob)
8512 goto bad;
8513 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
8514 goto bad;
8515 Py_DECREF(ob);
8516 return 0;
8517 bad:
8518 Py_XDECREF(ob);
8519 return -1;
8520 }
8521
8522 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)8523 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
8524 __Pyx_PyThreadState_declare
8525 __Pyx_PyThreadState_assign
8526 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
8527 __Pyx_PyErr_Clear();
8528 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)8529 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
8530 PyObject *result;
8531 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
8532 PyTypeObject* tp = Py_TYPE(obj);
8533 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
8534 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
8535 }
8536 #endif
8537 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
8538 if (unlikely(!result)) {
8539 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
8540 }
8541 return result;
8542 }
8543
8544 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)8545 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
8546 int ret;
8547 PyObject *name_attr;
8548 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
8549 if (likely(name_attr)) {
8550 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
8551 } else {
8552 ret = -1;
8553 }
8554 if (unlikely(ret < 0)) {
8555 PyErr_Clear();
8556 ret = 0;
8557 }
8558 Py_XDECREF(name_attr);
8559 return ret;
8560 }
__Pyx_setup_reduce(PyObject * type_obj)8561 static int __Pyx_setup_reduce(PyObject* type_obj) {
8562 int ret = 0;
8563 PyObject *object_reduce = NULL;
8564 PyObject *object_reduce_ex = NULL;
8565 PyObject *reduce = NULL;
8566 PyObject *reduce_ex = NULL;
8567 PyObject *reduce_cython = NULL;
8568 PyObject *setstate = NULL;
8569 PyObject *setstate_cython = NULL;
8570 #if CYTHON_USE_PYTYPE_LOOKUP
8571 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
8572 #else
8573 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
8574 #endif
8575 #if CYTHON_USE_PYTYPE_LOOKUP
8576 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
8577 #else
8578 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
8579 #endif
8580 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
8581 if (reduce_ex == object_reduce_ex) {
8582 #if CYTHON_USE_PYTYPE_LOOKUP
8583 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
8584 #else
8585 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
8586 #endif
8587 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
8588 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
8589 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
8590 if (likely(reduce_cython)) {
8591 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8592 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8593 } else if (reduce == object_reduce || PyErr_Occurred()) {
8594 goto __PYX_BAD;
8595 }
8596 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
8597 if (!setstate) PyErr_Clear();
8598 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
8599 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
8600 if (likely(setstate_cython)) {
8601 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8602 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8603 } else if (!setstate || PyErr_Occurred()) {
8604 goto __PYX_BAD;
8605 }
8606 }
8607 PyType_Modified((PyTypeObject*)type_obj);
8608 }
8609 }
8610 goto __PYX_GOOD;
8611 __PYX_BAD:
8612 if (!PyErr_Occurred())
8613 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
8614 ret = -1;
8615 __PYX_GOOD:
8616 #if !CYTHON_USE_PYTYPE_LOOKUP
8617 Py_XDECREF(object_reduce);
8618 Py_XDECREF(object_reduce_ex);
8619 #endif
8620 Py_XDECREF(reduce);
8621 Py_XDECREF(reduce_ex);
8622 Py_XDECREF(reduce_cython);
8623 Py_XDECREF(setstate);
8624 Py_XDECREF(setstate_cython);
8625 return ret;
8626 }
8627
8628 /* TypeImport */
8629 #ifndef __PYX_HAVE_RT_ImportType
8630 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)8631 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
8632 size_t size, enum __Pyx_ImportType_CheckSize check_size)
8633 {
8634 PyObject *result = 0;
8635 char warning[200];
8636 Py_ssize_t basicsize;
8637 #ifdef Py_LIMITED_API
8638 PyObject *py_basicsize;
8639 #endif
8640 result = PyObject_GetAttrString(module, class_name);
8641 if (!result)
8642 goto bad;
8643 if (!PyType_Check(result)) {
8644 PyErr_Format(PyExc_TypeError,
8645 "%.200s.%.200s is not a type object",
8646 module_name, class_name);
8647 goto bad;
8648 }
8649 #ifndef Py_LIMITED_API
8650 basicsize = ((PyTypeObject *)result)->tp_basicsize;
8651 #else
8652 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
8653 if (!py_basicsize)
8654 goto bad;
8655 basicsize = PyLong_AsSsize_t(py_basicsize);
8656 Py_DECREF(py_basicsize);
8657 py_basicsize = 0;
8658 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
8659 goto bad;
8660 #endif
8661 if ((size_t)basicsize < size) {
8662 PyErr_Format(PyExc_ValueError,
8663 "%.200s.%.200s size changed, may indicate binary incompatibility. "
8664 "Expected %zd from C header, got %zd from PyObject",
8665 module_name, class_name, size, basicsize);
8666 goto bad;
8667 }
8668 if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
8669 PyErr_Format(PyExc_ValueError,
8670 "%.200s.%.200s size changed, may indicate binary incompatibility. "
8671 "Expected %zd from C header, got %zd from PyObject",
8672 module_name, class_name, size, basicsize);
8673 goto bad;
8674 }
8675 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
8676 PyOS_snprintf(warning, sizeof(warning),
8677 "%s.%s size changed, may indicate binary incompatibility. "
8678 "Expected %zd from C header, got %zd from PyObject",
8679 module_name, class_name, size, basicsize);
8680 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
8681 }
8682 return (PyTypeObject *)result;
8683 bad:
8684 Py_XDECREF(result);
8685 return NULL;
8686 }
8687 #endif
8688
8689 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)8690 static void* __Pyx_GetVtable(PyObject *dict) {
8691 void* ptr;
8692 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
8693 if (!ob)
8694 goto bad;
8695 #if PY_VERSION_HEX >= 0x02070000
8696 ptr = PyCapsule_GetPointer(ob, 0);
8697 #else
8698 ptr = PyCObject_AsVoidPtr(ob);
8699 #endif
8700 if (!ptr && !PyErr_Occurred())
8701 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
8702 Py_DECREF(ob);
8703 return ptr;
8704 bad:
8705 Py_XDECREF(ob);
8706 return NULL;
8707 }
8708
8709 /* CalculateMetaclass */
__Pyx_CalculateMetaclass(PyTypeObject * metaclass,PyObject * bases)8710 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
8711 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
8712 for (i=0; i < nbases; i++) {
8713 PyTypeObject *tmptype;
8714 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
8715 tmptype = Py_TYPE(tmp);
8716 #if PY_MAJOR_VERSION < 3
8717 if (tmptype == &PyClass_Type)
8718 continue;
8719 #endif
8720 if (!metaclass) {
8721 metaclass = tmptype;
8722 continue;
8723 }
8724 if (PyType_IsSubtype(metaclass, tmptype))
8725 continue;
8726 if (PyType_IsSubtype(tmptype, metaclass)) {
8727 metaclass = tmptype;
8728 continue;
8729 }
8730 PyErr_SetString(PyExc_TypeError,
8731 "metaclass conflict: "
8732 "the metaclass of a derived class "
8733 "must be a (non-strict) subclass "
8734 "of the metaclasses of all its bases");
8735 return NULL;
8736 }
8737 if (!metaclass) {
8738 #if PY_MAJOR_VERSION < 3
8739 metaclass = &PyClass_Type;
8740 #else
8741 metaclass = &PyType_Type;
8742 #endif
8743 }
8744 Py_INCREF((PyObject*) metaclass);
8745 return (PyObject*) metaclass;
8746 }
8747
8748 /* Py3ClassCreate */
__Pyx_Py3MetaclassPrepare(PyObject * metaclass,PyObject * bases,PyObject * name,PyObject * qualname,PyObject * mkw,PyObject * modname,PyObject * doc)8749 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
8750 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
8751 PyObject *ns;
8752 if (metaclass) {
8753 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
8754 if (prep) {
8755 PyObject *pargs = PyTuple_Pack(2, name, bases);
8756 if (unlikely(!pargs)) {
8757 Py_DECREF(prep);
8758 return NULL;
8759 }
8760 ns = PyObject_Call(prep, pargs, mkw);
8761 Py_DECREF(prep);
8762 Py_DECREF(pargs);
8763 } else {
8764 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
8765 return NULL;
8766 PyErr_Clear();
8767 ns = PyDict_New();
8768 }
8769 } else {
8770 ns = PyDict_New();
8771 }
8772 if (unlikely(!ns))
8773 return NULL;
8774 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
8775 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
8776 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
8777 return ns;
8778 bad:
8779 Py_DECREF(ns);
8780 return NULL;
8781 }
__Pyx_Py3ClassCreate(PyObject * metaclass,PyObject * name,PyObject * bases,PyObject * dict,PyObject * mkw,int calculate_metaclass,int allow_py2_metaclass)8782 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
8783 PyObject *dict, PyObject *mkw,
8784 int calculate_metaclass, int allow_py2_metaclass) {
8785 PyObject *result, *margs;
8786 PyObject *owned_metaclass = NULL;
8787 if (allow_py2_metaclass) {
8788 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
8789 if (owned_metaclass) {
8790 metaclass = owned_metaclass;
8791 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
8792 PyErr_Clear();
8793 } else {
8794 return NULL;
8795 }
8796 }
8797 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
8798 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
8799 Py_XDECREF(owned_metaclass);
8800 if (unlikely(!metaclass))
8801 return NULL;
8802 owned_metaclass = metaclass;
8803 }
8804 margs = PyTuple_Pack(3, name, bases, dict);
8805 if (unlikely(!margs)) {
8806 result = NULL;
8807 } else {
8808 result = PyObject_Call(metaclass, margs, mkw);
8809 Py_DECREF(margs);
8810 }
8811 Py_XDECREF(owned_metaclass);
8812 return result;
8813 }
8814
8815 /* GetNameInClass */
__Pyx_GetGlobalNameAfterAttributeLookup(PyObject * name)8816 static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
8817 PyObject *result;
8818 __Pyx_PyThreadState_declare
8819 __Pyx_PyThreadState_assign
8820 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
8821 return NULL;
8822 __Pyx_PyErr_Clear();
8823 __Pyx_GetModuleGlobalNameUncached(result, name);
8824 return result;
8825 }
__Pyx__GetNameInClass(PyObject * nmspace,PyObject * name)8826 static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
8827 PyObject *result;
8828 result = __Pyx_PyObject_GetAttrStr(nmspace, name);
8829 if (!result) {
8830 result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
8831 }
8832 return result;
8833 }
8834
8835 /* CLineInTraceback */
8836 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)8837 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
8838 PyObject *use_cline;
8839 PyObject *ptype, *pvalue, *ptraceback;
8840 #if CYTHON_COMPILING_IN_CPYTHON
8841 PyObject **cython_runtime_dict;
8842 #endif
8843 if (unlikely(!__pyx_cython_runtime)) {
8844 return c_line;
8845 }
8846 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
8847 #if CYTHON_COMPILING_IN_CPYTHON
8848 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
8849 if (likely(cython_runtime_dict)) {
8850 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
8851 use_cline, *cython_runtime_dict,
8852 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
8853 } else
8854 #endif
8855 {
8856 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
8857 if (use_cline_obj) {
8858 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
8859 Py_DECREF(use_cline_obj);
8860 } else {
8861 PyErr_Clear();
8862 use_cline = NULL;
8863 }
8864 }
8865 if (!use_cline) {
8866 c_line = 0;
8867 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
8868 }
8869 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
8870 c_line = 0;
8871 }
8872 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
8873 return c_line;
8874 }
8875 #endif
8876
8877 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)8878 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
8879 int start = 0, mid = 0, end = count - 1;
8880 if (end >= 0 && code_line > entries[end].code_line) {
8881 return count;
8882 }
8883 while (start < end) {
8884 mid = start + (end - start) / 2;
8885 if (code_line < entries[mid].code_line) {
8886 end = mid;
8887 } else if (code_line > entries[mid].code_line) {
8888 start = mid + 1;
8889 } else {
8890 return mid;
8891 }
8892 }
8893 if (code_line <= entries[mid].code_line) {
8894 return mid;
8895 } else {
8896 return mid + 1;
8897 }
8898 }
__pyx_find_code_object(int code_line)8899 static PyCodeObject *__pyx_find_code_object(int code_line) {
8900 PyCodeObject* code_object;
8901 int pos;
8902 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
8903 return NULL;
8904 }
8905 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
8906 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
8907 return NULL;
8908 }
8909 code_object = __pyx_code_cache.entries[pos].code_object;
8910 Py_INCREF(code_object);
8911 return code_object;
8912 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)8913 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
8914 int pos, i;
8915 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
8916 if (unlikely(!code_line)) {
8917 return;
8918 }
8919 if (unlikely(!entries)) {
8920 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
8921 if (likely(entries)) {
8922 __pyx_code_cache.entries = entries;
8923 __pyx_code_cache.max_count = 64;
8924 __pyx_code_cache.count = 1;
8925 entries[0].code_line = code_line;
8926 entries[0].code_object = code_object;
8927 Py_INCREF(code_object);
8928 }
8929 return;
8930 }
8931 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
8932 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
8933 PyCodeObject* tmp = entries[pos].code_object;
8934 entries[pos].code_object = code_object;
8935 Py_DECREF(tmp);
8936 return;
8937 }
8938 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
8939 int new_max = __pyx_code_cache.max_count + 64;
8940 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
8941 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
8942 if (unlikely(!entries)) {
8943 return;
8944 }
8945 __pyx_code_cache.entries = entries;
8946 __pyx_code_cache.max_count = new_max;
8947 }
8948 for (i=__pyx_code_cache.count; i>pos; i--) {
8949 entries[i] = entries[i-1];
8950 }
8951 entries[pos].code_line = code_line;
8952 entries[pos].code_object = code_object;
8953 __pyx_code_cache.count++;
8954 Py_INCREF(code_object);
8955 }
8956
8957 /* AddTraceback */
8958 #include "compile.h"
8959 #include "frameobject.h"
8960 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)8961 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
8962 const char *funcname, int c_line,
8963 int py_line, const char *filename) {
8964 PyCodeObject *py_code = 0;
8965 PyObject *py_srcfile = 0;
8966 PyObject *py_funcname = 0;
8967 #if PY_MAJOR_VERSION < 3
8968 py_srcfile = PyString_FromString(filename);
8969 #else
8970 py_srcfile = PyUnicode_FromString(filename);
8971 #endif
8972 if (!py_srcfile) goto bad;
8973 if (c_line) {
8974 #if PY_MAJOR_VERSION < 3
8975 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
8976 #else
8977 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
8978 #endif
8979 }
8980 else {
8981 #if PY_MAJOR_VERSION < 3
8982 py_funcname = PyString_FromString(funcname);
8983 #else
8984 py_funcname = PyUnicode_FromString(funcname);
8985 #endif
8986 }
8987 if (!py_funcname) goto bad;
8988 py_code = __Pyx_PyCode_New(
8989 0,
8990 0,
8991 0,
8992 0,
8993 0,
8994 __pyx_empty_bytes, /*PyObject *code,*/
8995 __pyx_empty_tuple, /*PyObject *consts,*/
8996 __pyx_empty_tuple, /*PyObject *names,*/
8997 __pyx_empty_tuple, /*PyObject *varnames,*/
8998 __pyx_empty_tuple, /*PyObject *freevars,*/
8999 __pyx_empty_tuple, /*PyObject *cellvars,*/
9000 py_srcfile, /*PyObject *filename,*/
9001 py_funcname, /*PyObject *name,*/
9002 py_line,
9003 __pyx_empty_bytes /*PyObject *lnotab*/
9004 );
9005 Py_DECREF(py_srcfile);
9006 Py_DECREF(py_funcname);
9007 return py_code;
9008 bad:
9009 Py_XDECREF(py_srcfile);
9010 Py_XDECREF(py_funcname);
9011 return NULL;
9012 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)9013 static void __Pyx_AddTraceback(const char *funcname, int c_line,
9014 int py_line, const char *filename) {
9015 PyCodeObject *py_code = 0;
9016 PyFrameObject *py_frame = 0;
9017 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9018 if (c_line) {
9019 c_line = __Pyx_CLineForTraceback(tstate, c_line);
9020 }
9021 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
9022 if (!py_code) {
9023 py_code = __Pyx_CreateCodeObjectForTraceback(
9024 funcname, c_line, py_line, filename);
9025 if (!py_code) goto bad;
9026 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
9027 }
9028 py_frame = PyFrame_New(
9029 tstate, /*PyThreadState *tstate,*/
9030 py_code, /*PyCodeObject *code,*/
9031 __pyx_d, /*PyObject *globals,*/
9032 0 /*PyObject *locals*/
9033 );
9034 if (!py_frame) goto bad;
9035 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
9036 PyTraceBack_Here(py_frame);
9037 bad:
9038 Py_XDECREF(py_code);
9039 Py_XDECREF(py_frame);
9040 }
9041
9042 /* CIntToPy */
__Pyx_PyInt_From_int(int value)9043 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
9044 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
9045 const int is_unsigned = neg_one > const_zero;
9046 if (is_unsigned) {
9047 if (sizeof(int) < sizeof(long)) {
9048 return PyInt_FromLong((long) value);
9049 } else if (sizeof(int) <= sizeof(unsigned long)) {
9050 return PyLong_FromUnsignedLong((unsigned long) value);
9051 #ifdef HAVE_LONG_LONG
9052 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
9053 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
9054 #endif
9055 }
9056 } else {
9057 if (sizeof(int) <= sizeof(long)) {
9058 return PyInt_FromLong((long) value);
9059 #ifdef HAVE_LONG_LONG
9060 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
9061 return PyLong_FromLongLong((PY_LONG_LONG) value);
9062 #endif
9063 }
9064 }
9065 {
9066 int one = 1; int little = (int)*(unsigned char *)&one;
9067 unsigned char *bytes = (unsigned char *)&value;
9068 return _PyLong_FromByteArray(bytes, sizeof(int),
9069 little, !is_unsigned);
9070 }
9071 }
9072
9073 /* CIntToPy */
__Pyx_PyInt_From_enum__AVCodecID(enum AVCodecID value)9074 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__AVCodecID(enum AVCodecID value) {
9075 const enum AVCodecID neg_one = (enum AVCodecID) ((enum AVCodecID) 0 - (enum AVCodecID) 1), const_zero = (enum AVCodecID) 0;
9076 const int is_unsigned = neg_one > const_zero;
9077 if (is_unsigned) {
9078 if (sizeof(enum AVCodecID) < sizeof(long)) {
9079 return PyInt_FromLong((long) value);
9080 } else if (sizeof(enum AVCodecID) <= sizeof(unsigned long)) {
9081 return PyLong_FromUnsignedLong((unsigned long) value);
9082 #ifdef HAVE_LONG_LONG
9083 } else if (sizeof(enum AVCodecID) <= sizeof(unsigned PY_LONG_LONG)) {
9084 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
9085 #endif
9086 }
9087 } else {
9088 if (sizeof(enum AVCodecID) <= sizeof(long)) {
9089 return PyInt_FromLong((long) value);
9090 #ifdef HAVE_LONG_LONG
9091 } else if (sizeof(enum AVCodecID) <= sizeof(PY_LONG_LONG)) {
9092 return PyLong_FromLongLong((PY_LONG_LONG) value);
9093 #endif
9094 }
9095 }
9096 {
9097 int one = 1; int little = (int)*(unsigned char *)&one;
9098 unsigned char *bytes = (unsigned char *)&value;
9099 return _PyLong_FromByteArray(bytes, sizeof(enum AVCodecID),
9100 little, !is_unsigned);
9101 }
9102 }
9103
__pyx_convert__to_py_AVRational(AVRational s)9104 static PyObject* __pyx_convert__to_py_AVRational(AVRational s) {
9105 PyObject* res;
9106 PyObject* member;
9107 res = __Pyx_PyDict_NewPresized(2); if (unlikely(!res)) return NULL;
9108 member = __Pyx_PyInt_From_int(s.num); if (unlikely(!member)) goto bad;
9109 if (unlikely(PyDict_SetItem(res, __pyx_n_s_num, member) < 0)) goto bad;
9110 Py_DECREF(member);
9111 member = __Pyx_PyInt_From_int(s.den); if (unlikely(!member)) goto bad;
9112 if (unlikely(PyDict_SetItem(res, __pyx_n_s_den, member) < 0)) goto bad;
9113 Py_DECREF(member);
9114 return res;
9115 bad:
9116 Py_XDECREF(member);
9117 Py_DECREF(res);
9118 return NULL;
9119 }
9120 /* Print */
9121 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
__Pyx_GetStdout(void)9122 static PyObject *__Pyx_GetStdout(void) {
9123 PyObject *f = PySys_GetObject((char *)"stdout");
9124 if (!f) {
9125 PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
9126 }
9127 return f;
9128 }
__Pyx_Print(PyObject * f,PyObject * arg_tuple,int newline)9129 static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
9130 int i;
9131 if (!f) {
9132 if (!(f = __Pyx_GetStdout()))
9133 return -1;
9134 }
9135 Py_INCREF(f);
9136 for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
9137 PyObject* v;
9138 if (PyFile_SoftSpace(f, 1)) {
9139 if (PyFile_WriteString(" ", f) < 0)
9140 goto error;
9141 }
9142 v = PyTuple_GET_ITEM(arg_tuple, i);
9143 if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
9144 goto error;
9145 if (PyString_Check(v)) {
9146 char *s = PyString_AsString(v);
9147 Py_ssize_t len = PyString_Size(v);
9148 if (len > 0) {
9149 switch (s[len-1]) {
9150 case ' ': break;
9151 case '\f': case '\r': case '\n': case '\t': case '\v':
9152 PyFile_SoftSpace(f, 0);
9153 break;
9154 default: break;
9155 }
9156 }
9157 }
9158 }
9159 if (newline) {
9160 if (PyFile_WriteString("\n", f) < 0)
9161 goto error;
9162 PyFile_SoftSpace(f, 0);
9163 }
9164 Py_DECREF(f);
9165 return 0;
9166 error:
9167 Py_DECREF(f);
9168 return -1;
9169 }
9170 #else
__Pyx_Print(PyObject * stream,PyObject * arg_tuple,int newline)9171 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
9172 PyObject* kwargs = 0;
9173 PyObject* result = 0;
9174 PyObject* end_string;
9175 if (unlikely(!__pyx_print)) {
9176 __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
9177 if (!__pyx_print)
9178 return -1;
9179 }
9180 if (stream) {
9181 kwargs = PyDict_New();
9182 if (unlikely(!kwargs))
9183 return -1;
9184 if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
9185 goto bad;
9186 if (!newline) {
9187 end_string = PyUnicode_FromStringAndSize(" ", 1);
9188 if (unlikely(!end_string))
9189 goto bad;
9190 if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
9191 Py_DECREF(end_string);
9192 goto bad;
9193 }
9194 Py_DECREF(end_string);
9195 }
9196 } else if (!newline) {
9197 if (unlikely(!__pyx_print_kwargs)) {
9198 __pyx_print_kwargs = PyDict_New();
9199 if (unlikely(!__pyx_print_kwargs))
9200 return -1;
9201 end_string = PyUnicode_FromStringAndSize(" ", 1);
9202 if (unlikely(!end_string))
9203 return -1;
9204 if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
9205 Py_DECREF(end_string);
9206 return -1;
9207 }
9208 Py_DECREF(end_string);
9209 }
9210 kwargs = __pyx_print_kwargs;
9211 }
9212 result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
9213 if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
9214 Py_DECREF(kwargs);
9215 if (!result)
9216 return -1;
9217 Py_DECREF(result);
9218 return 0;
9219 bad:
9220 if (kwargs != __pyx_print_kwargs)
9221 Py_XDECREF(kwargs);
9222 return -1;
9223 }
9224 #endif
9225
9226 /* CIntToPy */
__Pyx_PyInt_From_long(long value)9227 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
9228 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
9229 const int is_unsigned = neg_one > const_zero;
9230 if (is_unsigned) {
9231 if (sizeof(long) < sizeof(long)) {
9232 return PyInt_FromLong((long) value);
9233 } else if (sizeof(long) <= sizeof(unsigned long)) {
9234 return PyLong_FromUnsignedLong((unsigned long) value);
9235 #ifdef HAVE_LONG_LONG
9236 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
9237 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
9238 #endif
9239 }
9240 } else {
9241 if (sizeof(long) <= sizeof(long)) {
9242 return PyInt_FromLong((long) value);
9243 #ifdef HAVE_LONG_LONG
9244 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
9245 return PyLong_FromLongLong((PY_LONG_LONG) value);
9246 #endif
9247 }
9248 }
9249 {
9250 int one = 1; int little = (int)*(unsigned char *)&one;
9251 unsigned char *bytes = (unsigned char *)&value;
9252 return _PyLong_FromByteArray(bytes, sizeof(long),
9253 little, !is_unsigned);
9254 }
9255 }
9256
9257 /* PrintOne */
9258 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
__Pyx_PrintOne(PyObject * f,PyObject * o)9259 static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
9260 if (!f) {
9261 if (!(f = __Pyx_GetStdout()))
9262 return -1;
9263 }
9264 Py_INCREF(f);
9265 if (PyFile_SoftSpace(f, 0)) {
9266 if (PyFile_WriteString(" ", f) < 0)
9267 goto error;
9268 }
9269 if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
9270 goto error;
9271 if (PyFile_WriteString("\n", f) < 0)
9272 goto error;
9273 Py_DECREF(f);
9274 return 0;
9275 error:
9276 Py_DECREF(f);
9277 return -1;
9278 /* the line below is just to avoid C compiler
9279 * warnings about unused functions */
9280 return __Pyx_Print(f, NULL, 0);
9281 }
9282 #else
__Pyx_PrintOne(PyObject * stream,PyObject * o)9283 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
9284 int res;
9285 PyObject* arg_tuple = PyTuple_Pack(1, o);
9286 if (unlikely(!arg_tuple))
9287 return -1;
9288 res = __Pyx_Print(stream, arg_tuple, 1);
9289 Py_DECREF(arg_tuple);
9290 return res;
9291 }
9292 #endif
9293
9294 /* CIntFromPyVerify */
9295 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
9296 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
9297 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
9298 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
9299 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
9300 {\
9301 func_type value = func_value;\
9302 if (sizeof(target_type) < sizeof(func_type)) {\
9303 if (unlikely(value != (func_type) (target_type) value)) {\
9304 func_type zero = 0;\
9305 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
9306 return (target_type) -1;\
9307 if (is_unsigned && unlikely(value < zero))\
9308 goto raise_neg_overflow;\
9309 else\
9310 goto raise_overflow;\
9311 }\
9312 }\
9313 return (target_type) value;\
9314 }
9315
9316 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)9317 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
9318 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
9319 const int is_unsigned = neg_one > const_zero;
9320 #if PY_MAJOR_VERSION < 3
9321 if (likely(PyInt_Check(x))) {
9322 if (sizeof(long) < sizeof(long)) {
9323 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
9324 } else {
9325 long val = PyInt_AS_LONG(x);
9326 if (is_unsigned && unlikely(val < 0)) {
9327 goto raise_neg_overflow;
9328 }
9329 return (long) val;
9330 }
9331 } else
9332 #endif
9333 if (likely(PyLong_Check(x))) {
9334 if (is_unsigned) {
9335 #if CYTHON_USE_PYLONG_INTERNALS
9336 const digit* digits = ((PyLongObject*)x)->ob_digit;
9337 switch (Py_SIZE(x)) {
9338 case 0: return (long) 0;
9339 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
9340 case 2:
9341 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
9342 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9343 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9344 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
9345 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9346 }
9347 }
9348 break;
9349 case 3:
9350 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
9351 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9352 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9353 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
9354 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9355 }
9356 }
9357 break;
9358 case 4:
9359 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
9360 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9361 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9362 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
9363 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9364 }
9365 }
9366 break;
9367 }
9368 #endif
9369 #if CYTHON_COMPILING_IN_CPYTHON
9370 if (unlikely(Py_SIZE(x) < 0)) {
9371 goto raise_neg_overflow;
9372 }
9373 #else
9374 {
9375 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
9376 if (unlikely(result < 0))
9377 return (long) -1;
9378 if (unlikely(result == 1))
9379 goto raise_neg_overflow;
9380 }
9381 #endif
9382 if (sizeof(long) <= sizeof(unsigned long)) {
9383 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
9384 #ifdef HAVE_LONG_LONG
9385 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
9386 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
9387 #endif
9388 }
9389 } else {
9390 #if CYTHON_USE_PYLONG_INTERNALS
9391 const digit* digits = ((PyLongObject*)x)->ob_digit;
9392 switch (Py_SIZE(x)) {
9393 case 0: return (long) 0;
9394 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
9395 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
9396 case -2:
9397 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
9398 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9399 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9400 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9401 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9402 }
9403 }
9404 break;
9405 case 2:
9406 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
9407 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9408 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9409 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9410 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9411 }
9412 }
9413 break;
9414 case -3:
9415 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9416 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9417 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9418 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9419 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9420 }
9421 }
9422 break;
9423 case 3:
9424 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
9425 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9426 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9427 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9428 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9429 }
9430 }
9431 break;
9432 case -4:
9433 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9434 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9435 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9436 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
9437 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9438 }
9439 }
9440 break;
9441 case 4:
9442 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
9443 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9444 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9445 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
9446 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9447 }
9448 }
9449 break;
9450 }
9451 #endif
9452 if (sizeof(long) <= sizeof(long)) {
9453 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
9454 #ifdef HAVE_LONG_LONG
9455 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
9456 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
9457 #endif
9458 }
9459 }
9460 {
9461 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
9462 PyErr_SetString(PyExc_RuntimeError,
9463 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
9464 #else
9465 long val;
9466 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
9467 #if PY_MAJOR_VERSION < 3
9468 if (likely(v) && !PyLong_Check(v)) {
9469 PyObject *tmp = v;
9470 v = PyNumber_Long(tmp);
9471 Py_DECREF(tmp);
9472 }
9473 #endif
9474 if (likely(v)) {
9475 int one = 1; int is_little = (int)*(unsigned char *)&one;
9476 unsigned char *bytes = (unsigned char *)&val;
9477 int ret = _PyLong_AsByteArray((PyLongObject *)v,
9478 bytes, sizeof(val),
9479 is_little, !is_unsigned);
9480 Py_DECREF(v);
9481 if (likely(!ret))
9482 return val;
9483 }
9484 #endif
9485 return (long) -1;
9486 }
9487 } else {
9488 long val;
9489 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
9490 if (!tmp) return (long) -1;
9491 val = __Pyx_PyInt_As_long(tmp);
9492 Py_DECREF(tmp);
9493 return val;
9494 }
9495 raise_overflow:
9496 PyErr_SetString(PyExc_OverflowError,
9497 "value too large to convert to long");
9498 return (long) -1;
9499 raise_neg_overflow:
9500 PyErr_SetString(PyExc_OverflowError,
9501 "can't convert negative value to long");
9502 return (long) -1;
9503 }
9504
9505 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)9506 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
9507 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
9508 const int is_unsigned = neg_one > const_zero;
9509 #if PY_MAJOR_VERSION < 3
9510 if (likely(PyInt_Check(x))) {
9511 if (sizeof(int) < sizeof(long)) {
9512 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
9513 } else {
9514 long val = PyInt_AS_LONG(x);
9515 if (is_unsigned && unlikely(val < 0)) {
9516 goto raise_neg_overflow;
9517 }
9518 return (int) val;
9519 }
9520 } else
9521 #endif
9522 if (likely(PyLong_Check(x))) {
9523 if (is_unsigned) {
9524 #if CYTHON_USE_PYLONG_INTERNALS
9525 const digit* digits = ((PyLongObject*)x)->ob_digit;
9526 switch (Py_SIZE(x)) {
9527 case 0: return (int) 0;
9528 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
9529 case 2:
9530 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
9531 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9532 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9533 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
9534 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
9535 }
9536 }
9537 break;
9538 case 3:
9539 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
9540 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9541 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9542 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
9543 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
9544 }
9545 }
9546 break;
9547 case 4:
9548 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
9549 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9550 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9551 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
9552 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
9553 }
9554 }
9555 break;
9556 }
9557 #endif
9558 #if CYTHON_COMPILING_IN_CPYTHON
9559 if (unlikely(Py_SIZE(x) < 0)) {
9560 goto raise_neg_overflow;
9561 }
9562 #else
9563 {
9564 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
9565 if (unlikely(result < 0))
9566 return (int) -1;
9567 if (unlikely(result == 1))
9568 goto raise_neg_overflow;
9569 }
9570 #endif
9571 if (sizeof(int) <= sizeof(unsigned long)) {
9572 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
9573 #ifdef HAVE_LONG_LONG
9574 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
9575 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
9576 #endif
9577 }
9578 } else {
9579 #if CYTHON_USE_PYLONG_INTERNALS
9580 const digit* digits = ((PyLongObject*)x)->ob_digit;
9581 switch (Py_SIZE(x)) {
9582 case 0: return (int) 0;
9583 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
9584 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
9585 case -2:
9586 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
9587 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9588 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9589 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
9590 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9591 }
9592 }
9593 break;
9594 case 2:
9595 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
9596 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9597 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9598 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
9599 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9600 }
9601 }
9602 break;
9603 case -3:
9604 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
9605 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9606 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9607 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
9608 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9609 }
9610 }
9611 break;
9612 case 3:
9613 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
9614 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9615 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9616 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
9617 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9618 }
9619 }
9620 break;
9621 case -4:
9622 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
9623 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9624 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9625 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
9626 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9627 }
9628 }
9629 break;
9630 case 4:
9631 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
9632 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9633 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9634 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
9635 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9636 }
9637 }
9638 break;
9639 }
9640 #endif
9641 if (sizeof(int) <= sizeof(long)) {
9642 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
9643 #ifdef HAVE_LONG_LONG
9644 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
9645 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
9646 #endif
9647 }
9648 }
9649 {
9650 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
9651 PyErr_SetString(PyExc_RuntimeError,
9652 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
9653 #else
9654 int val;
9655 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
9656 #if PY_MAJOR_VERSION < 3
9657 if (likely(v) && !PyLong_Check(v)) {
9658 PyObject *tmp = v;
9659 v = PyNumber_Long(tmp);
9660 Py_DECREF(tmp);
9661 }
9662 #endif
9663 if (likely(v)) {
9664 int one = 1; int is_little = (int)*(unsigned char *)&one;
9665 unsigned char *bytes = (unsigned char *)&val;
9666 int ret = _PyLong_AsByteArray((PyLongObject *)v,
9667 bytes, sizeof(val),
9668 is_little, !is_unsigned);
9669 Py_DECREF(v);
9670 if (likely(!ret))
9671 return val;
9672 }
9673 #endif
9674 return (int) -1;
9675 }
9676 } else {
9677 int val;
9678 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
9679 if (!tmp) return (int) -1;
9680 val = __Pyx_PyInt_As_int(tmp);
9681 Py_DECREF(tmp);
9682 return val;
9683 }
9684 raise_overflow:
9685 PyErr_SetString(PyExc_OverflowError,
9686 "value too large to convert to int");
9687 return (int) -1;
9688 raise_neg_overflow:
9689 PyErr_SetString(PyExc_OverflowError,
9690 "can't convert negative value to int");
9691 return (int) -1;
9692 }
9693
9694 /* FastTypeChecks */
9695 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)9696 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
9697 while (a) {
9698 a = a->tp_base;
9699 if (a == b)
9700 return 1;
9701 }
9702 return b == &PyBaseObject_Type;
9703 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)9704 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
9705 PyObject *mro;
9706 if (a == b) return 1;
9707 mro = a->tp_mro;
9708 if (likely(mro)) {
9709 Py_ssize_t i, n;
9710 n = PyTuple_GET_SIZE(mro);
9711 for (i = 0; i < n; i++) {
9712 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
9713 return 1;
9714 }
9715 return 0;
9716 }
9717 return __Pyx_InBases(a, b);
9718 }
9719 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)9720 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
9721 PyObject *exception, *value, *tb;
9722 int res;
9723 __Pyx_PyThreadState_declare
9724 __Pyx_PyThreadState_assign
9725 __Pyx_ErrFetch(&exception, &value, &tb);
9726 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
9727 if (unlikely(res == -1)) {
9728 PyErr_WriteUnraisable(err);
9729 res = 0;
9730 }
9731 if (!res) {
9732 res = PyObject_IsSubclass(err, exc_type2);
9733 if (unlikely(res == -1)) {
9734 PyErr_WriteUnraisable(err);
9735 res = 0;
9736 }
9737 }
9738 __Pyx_ErrRestore(exception, value, tb);
9739 return res;
9740 }
9741 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)9742 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
9743 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
9744 if (!res) {
9745 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
9746 }
9747 return res;
9748 }
9749 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)9750 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
9751 Py_ssize_t i, n;
9752 assert(PyExceptionClass_Check(exc_type));
9753 n = PyTuple_GET_SIZE(tuple);
9754 #if PY_MAJOR_VERSION >= 3
9755 for (i=0; i<n; i++) {
9756 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
9757 }
9758 #endif
9759 for (i=0; i<n; i++) {
9760 PyObject *t = PyTuple_GET_ITEM(tuple, i);
9761 #if PY_MAJOR_VERSION < 3
9762 if (likely(exc_type == t)) return 1;
9763 #endif
9764 if (likely(PyExceptionClass_Check(t))) {
9765 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
9766 } else {
9767 }
9768 }
9769 return 0;
9770 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)9771 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
9772 if (likely(err == exc_type)) return 1;
9773 if (likely(PyExceptionClass_Check(err))) {
9774 if (likely(PyExceptionClass_Check(exc_type))) {
9775 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
9776 } else if (likely(PyTuple_Check(exc_type))) {
9777 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
9778 } else {
9779 }
9780 }
9781 return PyErr_GivenExceptionMatches(err, exc_type);
9782 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)9783 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
9784 assert(PyExceptionClass_Check(exc_type1));
9785 assert(PyExceptionClass_Check(exc_type2));
9786 if (likely(err == exc_type1 || err == exc_type2)) return 1;
9787 if (likely(PyExceptionClass_Check(err))) {
9788 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
9789 }
9790 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
9791 }
9792 #endif
9793
9794 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)9795 static int __Pyx_check_binary_version(void) {
9796 char ctversion[4], rtversion[4];
9797 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
9798 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
9799 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
9800 char message[200];
9801 PyOS_snprintf(message, sizeof(message),
9802 "compiletime version %s of module '%.100s' "
9803 "does not match runtime version %s",
9804 ctversion, __Pyx_MODULE_NAME, rtversion);
9805 return PyErr_WarnEx(NULL, message, 1);
9806 }
9807 return 0;
9808 }
9809
9810 /* FunctionExport */
__Pyx_ExportFunction(const char * name,void (* f)(void),const char * sig)9811 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
9812 PyObject *d = 0;
9813 PyObject *cobj = 0;
9814 union {
9815 void (*fp)(void);
9816 void *p;
9817 } tmp;
9818 d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
9819 if (!d) {
9820 PyErr_Clear();
9821 d = PyDict_New();
9822 if (!d)
9823 goto bad;
9824 Py_INCREF(d);
9825 if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
9826 goto bad;
9827 }
9828 tmp.fp = f;
9829 #if PY_VERSION_HEX >= 0x02070000
9830 cobj = PyCapsule_New(tmp.p, sig, 0);
9831 #else
9832 cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
9833 #endif
9834 if (!cobj)
9835 goto bad;
9836 if (PyDict_SetItemString(d, name, cobj) < 0)
9837 goto bad;
9838 Py_DECREF(cobj);
9839 Py_DECREF(d);
9840 return 0;
9841 bad:
9842 Py_XDECREF(cobj);
9843 Py_XDECREF(d);
9844 return -1;
9845 }
9846
9847 /* FunctionImport */
9848 #ifndef __PYX_HAVE_RT_ImportFunction
9849 #define __PYX_HAVE_RT_ImportFunction
__Pyx_ImportFunction(PyObject * module,const char * funcname,void (** f)(void),const char * sig)9850 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
9851 PyObject *d = 0;
9852 PyObject *cobj = 0;
9853 union {
9854 void (*fp)(void);
9855 void *p;
9856 } tmp;
9857 d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
9858 if (!d)
9859 goto bad;
9860 cobj = PyDict_GetItemString(d, funcname);
9861 if (!cobj) {
9862 PyErr_Format(PyExc_ImportError,
9863 "%.200s does not export expected C function %.200s",
9864 PyModule_GetName(module), funcname);
9865 goto bad;
9866 }
9867 #if PY_VERSION_HEX >= 0x02070000
9868 if (!PyCapsule_IsValid(cobj, sig)) {
9869 PyErr_Format(PyExc_TypeError,
9870 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
9871 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
9872 goto bad;
9873 }
9874 tmp.p = PyCapsule_GetPointer(cobj, sig);
9875 #else
9876 {const char *desc, *s1, *s2;
9877 desc = (const char *)PyCObject_GetDesc(cobj);
9878 if (!desc)
9879 goto bad;
9880 s1 = desc; s2 = sig;
9881 while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
9882 if (*s1 != *s2) {
9883 PyErr_Format(PyExc_TypeError,
9884 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
9885 PyModule_GetName(module), funcname, sig, desc);
9886 goto bad;
9887 }
9888 tmp.p = PyCObject_AsVoidPtr(cobj);}
9889 #endif
9890 *f = tmp.fp;
9891 if (!(*f))
9892 goto bad;
9893 Py_DECREF(d);
9894 return 0;
9895 bad:
9896 Py_XDECREF(d);
9897 return -1;
9898 }
9899 #endif
9900
9901 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)9902 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
9903 while (t->p) {
9904 #if PY_MAJOR_VERSION < 3
9905 if (t->is_unicode) {
9906 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
9907 } else if (t->intern) {
9908 *t->p = PyString_InternFromString(t->s);
9909 } else {
9910 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
9911 }
9912 #else
9913 if (t->is_unicode | t->is_str) {
9914 if (t->intern) {
9915 *t->p = PyUnicode_InternFromString(t->s);
9916 } else if (t->encoding) {
9917 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
9918 } else {
9919 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
9920 }
9921 } else {
9922 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
9923 }
9924 #endif
9925 if (!*t->p)
9926 return -1;
9927 if (PyObject_Hash(*t->p) == -1)
9928 return -1;
9929 ++t;
9930 }
9931 return 0;
9932 }
9933
__Pyx_PyUnicode_FromString(const char * c_str)9934 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
9935 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
9936 }
__Pyx_PyObject_AsString(PyObject * o)9937 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
9938 Py_ssize_t ignore;
9939 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
9940 }
9941 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
9942 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)9943 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9944 char* defenc_c;
9945 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
9946 if (!defenc) return NULL;
9947 defenc_c = PyBytes_AS_STRING(defenc);
9948 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9949 {
9950 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
9951 char* c;
9952 for (c = defenc_c; c < end; c++) {
9953 if ((unsigned char) (*c) >= 128) {
9954 PyUnicode_AsASCIIString(o);
9955 return NULL;
9956 }
9957 }
9958 }
9959 #endif
9960 *length = PyBytes_GET_SIZE(defenc);
9961 return defenc_c;
9962 }
9963 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)9964 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9965 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
9966 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9967 if (likely(PyUnicode_IS_ASCII(o))) {
9968 *length = PyUnicode_GET_LENGTH(o);
9969 return PyUnicode_AsUTF8(o);
9970 } else {
9971 PyUnicode_AsASCIIString(o);
9972 return NULL;
9973 }
9974 #else
9975 return PyUnicode_AsUTF8AndSize(o, length);
9976 #endif
9977 }
9978 #endif
9979 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)9980 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9981 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
9982 if (
9983 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9984 __Pyx_sys_getdefaultencoding_not_ascii &&
9985 #endif
9986 PyUnicode_Check(o)) {
9987 return __Pyx_PyUnicode_AsStringAndSize(o, length);
9988 } else
9989 #endif
9990 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
9991 if (PyByteArray_Check(o)) {
9992 *length = PyByteArray_GET_SIZE(o);
9993 return PyByteArray_AS_STRING(o);
9994 } else
9995 #endif
9996 {
9997 char* result;
9998 int r = PyBytes_AsStringAndSize(o, &result, length);
9999 if (unlikely(r < 0)) {
10000 return NULL;
10001 } else {
10002 return result;
10003 }
10004 }
10005 }
__Pyx_PyObject_IsTrue(PyObject * x)10006 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
10007 int is_true = x == Py_True;
10008 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
10009 else return PyObject_IsTrue(x);
10010 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)10011 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
10012 int retval;
10013 if (unlikely(!x)) return -1;
10014 retval = __Pyx_PyObject_IsTrue(x);
10015 Py_DECREF(x);
10016 return retval;
10017 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)10018 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
10019 #if PY_MAJOR_VERSION >= 3
10020 if (PyLong_Check(result)) {
10021 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
10022 "__int__ returned non-int (type %.200s). "
10023 "The ability to return an instance of a strict subclass of int "
10024 "is deprecated, and may be removed in a future version of Python.",
10025 Py_TYPE(result)->tp_name)) {
10026 Py_DECREF(result);
10027 return NULL;
10028 }
10029 return result;
10030 }
10031 #endif
10032 PyErr_Format(PyExc_TypeError,
10033 "__%.4s__ returned non-%.4s (type %.200s)",
10034 type_name, type_name, Py_TYPE(result)->tp_name);
10035 Py_DECREF(result);
10036 return NULL;
10037 }
__Pyx_PyNumber_IntOrLong(PyObject * x)10038 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
10039 #if CYTHON_USE_TYPE_SLOTS
10040 PyNumberMethods *m;
10041 #endif
10042 const char *name = NULL;
10043 PyObject *res = NULL;
10044 #if PY_MAJOR_VERSION < 3
10045 if (likely(PyInt_Check(x) || PyLong_Check(x)))
10046 #else
10047 if (likely(PyLong_Check(x)))
10048 #endif
10049 return __Pyx_NewRef(x);
10050 #if CYTHON_USE_TYPE_SLOTS
10051 m = Py_TYPE(x)->tp_as_number;
10052 #if PY_MAJOR_VERSION < 3
10053 if (m && m->nb_int) {
10054 name = "int";
10055 res = m->nb_int(x);
10056 }
10057 else if (m && m->nb_long) {
10058 name = "long";
10059 res = m->nb_long(x);
10060 }
10061 #else
10062 if (likely(m && m->nb_int)) {
10063 name = "int";
10064 res = m->nb_int(x);
10065 }
10066 #endif
10067 #else
10068 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
10069 res = PyNumber_Int(x);
10070 }
10071 #endif
10072 if (likely(res)) {
10073 #if PY_MAJOR_VERSION < 3
10074 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
10075 #else
10076 if (unlikely(!PyLong_CheckExact(res))) {
10077 #endif
10078 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
10079 }
10080 }
10081 else if (!PyErr_Occurred()) {
10082 PyErr_SetString(PyExc_TypeError,
10083 "an integer is required");
10084 }
10085 return res;
10086 }
10087 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
10088 Py_ssize_t ival;
10089 PyObject *x;
10090 #if PY_MAJOR_VERSION < 3
10091 if (likely(PyInt_CheckExact(b))) {
10092 if (sizeof(Py_ssize_t) >= sizeof(long))
10093 return PyInt_AS_LONG(b);
10094 else
10095 return PyInt_AsSsize_t(b);
10096 }
10097 #endif
10098 if (likely(PyLong_CheckExact(b))) {
10099 #if CYTHON_USE_PYLONG_INTERNALS
10100 const digit* digits = ((PyLongObject*)b)->ob_digit;
10101 const Py_ssize_t size = Py_SIZE(b);
10102 if (likely(__Pyx_sst_abs(size) <= 1)) {
10103 ival = likely(size) ? digits[0] : 0;
10104 if (size == -1) ival = -ival;
10105 return ival;
10106 } else {
10107 switch (size) {
10108 case 2:
10109 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
10110 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10111 }
10112 break;
10113 case -2:
10114 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
10115 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10116 }
10117 break;
10118 case 3:
10119 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
10120 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10121 }
10122 break;
10123 case -3:
10124 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
10125 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10126 }
10127 break;
10128 case 4:
10129 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
10130 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10131 }
10132 break;
10133 case -4:
10134 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
10135 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
10136 }
10137 break;
10138 }
10139 }
10140 #endif
10141 return PyLong_AsSsize_t(b);
10142 }
10143 x = PyNumber_Index(b);
10144 if (!x) return -1;
10145 ival = PyInt_AsSsize_t(x);
10146 Py_DECREF(x);
10147 return ival;
10148 }
10149 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
10150 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
10151 }
10152 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
10153 return PyInt_FromSize_t(ival);
10154 }
10155
10156
10157 #endif /* Py_PYTHON_H */
10158