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.filter.pad",
52 "sources": [
53 "av/filter/pad.pyx"
54 ]
55 },
56 "module_name": "av.filter.pad"
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__filter__pad
663 #define __PYX_HAVE_API__av__filter__pad
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/filter/pad.pyx",
900 "stringsource",
901 "av/filter/pad.pxd",
902 "av/descriptor.pxd",
903 "av/filter/filter.pxd",
904 "av/filter/graph.pxd",
905 "av/filter/context.pxd",
906 "av/filter/link.pxd",
907 };
908
909 /*--- Type declarations ---*/
910 struct __pyx_obj_2av_10descriptor_Descriptor;
911 struct __pyx_obj_2av_6filter_6filter_Filter;
912 struct __pyx_obj_2av_6filter_5graph_Graph;
913 struct __pyx_obj_2av_6filter_7context_FilterContext;
914 struct __pyx_obj_2av_6filter_4link_FilterLink;
915 struct __pyx_obj_2av_6filter_3pad_FilterPad;
916 struct __pyx_obj_2av_6filter_3pad_FilterContextPad;
917 struct __pyx_opt_args_2av_6filter_5graph_5Graph_configure;
918
919 /* "av/filter/graph.pxd":11
920 *
921 * cdef readonly bint configured
922 * cpdef configure(self, bint auto_buffer=*, bint force=*) # <<<<<<<<<<<<<<
923 *
924 * cdef dict _name_counts
925 */
926 struct __pyx_opt_args_2av_6filter_5graph_5Graph_configure {
927 int __pyx_n;
928 int auto_buffer;
929 int force;
930 };
931 struct __pyx_opt_args_2av_6filter_3pad_alloc_filter_pads;
932
933 /* "av/filter/pad.pxd":23
934 *
935 *
936 * cdef tuple alloc_filter_pads(Filter, const lib.AVFilterPad *ptr, bint is_input, FilterContext context=?) # <<<<<<<<<<<<<<
937 */
938 struct __pyx_opt_args_2av_6filter_3pad_alloc_filter_pads {
939 int __pyx_n;
940 struct __pyx_obj_2av_6filter_7context_FilterContext *context;
941 };
942
943 /* "av/descriptor.pxd":4
944 *
945 *
946 * cdef class Descriptor(object): # <<<<<<<<<<<<<<
947 *
948 * # These are present as:
949 */
950 struct __pyx_obj_2av_10descriptor_Descriptor {
951 PyObject_HEAD
952 struct AVClass const *ptr;
953 PyObject *_options;
954 };
955
956
957 /* "av/filter/filter.pxd":6
958 *
959 *
960 * cdef class Filter(object): # <<<<<<<<<<<<<<
961 *
962 * cdef const lib.AVFilter *ptr
963 */
964 struct __pyx_obj_2av_6filter_6filter_Filter {
965 PyObject_HEAD
966 struct AVFilter const *ptr;
967 PyObject *_inputs;
968 PyObject *_outputs;
969 struct __pyx_obj_2av_10descriptor_Descriptor *_descriptor;
970 };
971
972
973 /* "av/filter/graph.pxd":6
974 *
975 *
976 * cdef class Graph(object): # <<<<<<<<<<<<<<
977 *
978 * cdef lib.AVFilterGraph *ptr
979 */
980 struct __pyx_obj_2av_6filter_5graph_Graph {
981 PyObject_HEAD
982 struct __pyx_vtabstruct_2av_6filter_5graph_Graph *__pyx_vtab;
983 struct AVFilterGraph *ptr;
984 int configured;
985 PyObject *_name_counts;
986 int _nb_filters_seen;
987 PyObject *_context_by_ptr;
988 PyObject *_context_by_name;
989 PyObject *_context_by_type;
990 };
991
992
993 /* "av/filter/context.pxd":7
994 *
995 *
996 * cdef class FilterContext(object): # <<<<<<<<<<<<<<
997 *
998 * cdef lib.AVFilterContext *ptr
999 */
1000 struct __pyx_obj_2av_6filter_7context_FilterContext {
1001 PyObject_HEAD
1002 struct AVFilterContext *ptr;
1003 struct __pyx_obj_2av_6filter_5graph_Graph *graph;
1004 struct __pyx_obj_2av_6filter_6filter_Filter *filter;
1005 PyObject *_inputs;
1006 PyObject *_outputs;
1007 int inited;
1008 };
1009
1010
1011 /* "av/filter/link.pxd":7
1012 *
1013 *
1014 * cdef class FilterLink(object): # <<<<<<<<<<<<<<
1015 *
1016 * cdef readonly Graph graph
1017 */
1018 struct __pyx_obj_2av_6filter_4link_FilterLink {
1019 PyObject_HEAD
1020 struct __pyx_obj_2av_6filter_5graph_Graph *graph;
1021 struct AVFilterLink *ptr;
1022 struct __pyx_obj_2av_6filter_3pad_FilterContextPad *_input;
1023 struct __pyx_obj_2av_6filter_3pad_FilterContextPad *_output;
1024 };
1025
1026
1027 /* "av/filter/pad.pxd":8
1028 *
1029 *
1030 * cdef class FilterPad(object): # <<<<<<<<<<<<<<
1031 *
1032 * cdef readonly Filter filter
1033 */
1034 struct __pyx_obj_2av_6filter_3pad_FilterPad {
1035 PyObject_HEAD
1036 struct __pyx_obj_2av_6filter_6filter_Filter *filter;
1037 struct __pyx_obj_2av_6filter_7context_FilterContext *context;
1038 int is_input;
1039 int index;
1040 struct AVFilterPad const *base_ptr;
1041 };
1042
1043
1044 /* "av/filter/pad.pxd":18
1045 *
1046 *
1047 * cdef class FilterContextPad(FilterPad): # <<<<<<<<<<<<<<
1048 *
1049 * cdef FilterLink _link
1050 */
1051 struct __pyx_obj_2av_6filter_3pad_FilterContextPad {
1052 struct __pyx_obj_2av_6filter_3pad_FilterPad __pyx_base;
1053 struct __pyx_obj_2av_6filter_4link_FilterLink *_link;
1054 };
1055
1056
1057
1058 /* "av/filter/graph.pxd":6
1059 *
1060 *
1061 * cdef class Graph(object): # <<<<<<<<<<<<<<
1062 *
1063 * cdef lib.AVFilterGraph *ptr
1064 */
1065
1066 struct __pyx_vtabstruct_2av_6filter_5graph_Graph {
1067 PyObject *(*configure)(struct __pyx_obj_2av_6filter_5graph_Graph *, int __pyx_skip_dispatch, struct __pyx_opt_args_2av_6filter_5graph_5Graph_configure *__pyx_optional_args);
1068 PyObject *(*_get_unique_name)(struct __pyx_obj_2av_6filter_5graph_Graph *, PyObject *);
1069 PyObject *(*_register_context)(struct __pyx_obj_2av_6filter_5graph_Graph *, struct __pyx_obj_2av_6filter_7context_FilterContext *);
1070 PyObject *(*_auto_register)(struct __pyx_obj_2av_6filter_5graph_Graph *);
1071 };
1072 static struct __pyx_vtabstruct_2av_6filter_5graph_Graph *__pyx_vtabptr_2av_6filter_5graph_Graph;
1073
1074 /* --- Runtime support code (head) --- */
1075 /* Refnanny.proto */
1076 #ifndef CYTHON_REFNANNY
1077 #define CYTHON_REFNANNY 0
1078 #endif
1079 #if CYTHON_REFNANNY
1080 typedef struct {
1081 void (*INCREF)(void*, PyObject*, int);
1082 void (*DECREF)(void*, PyObject*, int);
1083 void (*GOTREF)(void*, PyObject*, int);
1084 void (*GIVEREF)(void*, PyObject*, int);
1085 void* (*SetupContext)(const char*, int, const char*);
1086 void (*FinishContext)(void**);
1087 } __Pyx_RefNannyAPIStruct;
1088 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1089 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1090 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1091 #ifdef WITH_THREAD
1092 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1093 if (acquire_gil) {\
1094 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1095 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1096 PyGILState_Release(__pyx_gilstate_save);\
1097 } else {\
1098 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1099 }
1100 #else
1101 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1102 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1103 #endif
1104 #define __Pyx_RefNannyFinishContext()\
1105 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1106 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1107 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1108 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1109 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1110 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1111 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1112 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1113 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1114 #else
1115 #define __Pyx_RefNannyDeclarations
1116 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1117 #define __Pyx_RefNannyFinishContext()
1118 #define __Pyx_INCREF(r) Py_INCREF(r)
1119 #define __Pyx_DECREF(r) Py_DECREF(r)
1120 #define __Pyx_GOTREF(r)
1121 #define __Pyx_GIVEREF(r)
1122 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1123 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1124 #define __Pyx_XGOTREF(r)
1125 #define __Pyx_XGIVEREF(r)
1126 #endif
1127 #define __Pyx_XDECREF_SET(r, v) do {\
1128 PyObject *tmp = (PyObject *) r;\
1129 r = v; __Pyx_XDECREF(tmp);\
1130 } while (0)
1131 #define __Pyx_DECREF_SET(r, v) do {\
1132 PyObject *tmp = (PyObject *) r;\
1133 r = v; __Pyx_DECREF(tmp);\
1134 } while (0)
1135 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1136 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1137
1138 /* PyObjectGetAttrStr.proto */
1139 #if CYTHON_USE_TYPE_SLOTS
1140 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1141 #else
1142 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1143 #endif
1144
1145 /* GetBuiltinName.proto */
1146 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1147
1148 /* RaiseDoubleKeywords.proto */
1149 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1150
1151 /* ParseKeywords.proto */
1152 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1153 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1154 const char* function_name);
1155
1156 /* RaiseArgTupleInvalid.proto */
1157 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1158 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1159
1160 /* PyObjectCall.proto */
1161 #if CYTHON_COMPILING_IN_CPYTHON
1162 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1163 #else
1164 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1165 #endif
1166
1167 /* PyThreadStateGet.proto */
1168 #if CYTHON_FAST_THREAD_STATE
1169 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1170 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1171 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1172 #else
1173 #define __Pyx_PyThreadState_declare
1174 #define __Pyx_PyThreadState_assign
1175 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1176 #endif
1177
1178 /* PyErrFetchRestore.proto */
1179 #if CYTHON_FAST_THREAD_STATE
1180 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1181 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1182 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1183 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1184 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1185 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1186 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1187 #if CYTHON_COMPILING_IN_CPYTHON
1188 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1189 #else
1190 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1191 #endif
1192 #else
1193 #define __Pyx_PyErr_Clear() PyErr_Clear()
1194 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1195 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1196 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1197 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1198 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1199 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1200 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1201 #endif
1202
1203 /* RaiseException.proto */
1204 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1205
1206 /* ExtTypeTest.proto */
1207 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1208
1209 /* PyCFunctionFastCall.proto */
1210 #if CYTHON_FAST_PYCCALL
1211 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1212 #else
1213 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1214 #endif
1215
1216 /* PyFunctionFastCall.proto */
1217 #if CYTHON_FAST_PYCALL
1218 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1219 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1220 #if 1 || PY_VERSION_HEX < 0x030600B1
1221 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1222 #else
1223 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1224 #endif
1225 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1226 (sizeof(char [1 - 2*!(cond)]) - 1)
1227 #ifndef Py_MEMBER_SIZE
1228 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1229 #endif
1230 static size_t __pyx_pyframe_localsplus_offset = 0;
1231 #include "frameobject.h"
1232 #define __Pxy_PyFrame_Initialize_Offsets()\
1233 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1234 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1235 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1236 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1237 #endif
1238
1239 /* PyObjectCallMethO.proto */
1240 #if CYTHON_COMPILING_IN_CPYTHON
1241 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1242 #endif
1243
1244 /* PyObjectCallOneArg.proto */
1245 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1246
1247 /* ListAppend.proto */
1248 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1249 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1250 PyListObject* L = (PyListObject*) list;
1251 Py_ssize_t len = Py_SIZE(list);
1252 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1253 Py_INCREF(x);
1254 PyList_SET_ITEM(list, len, x);
1255 __Pyx_SET_SIZE(list, len + 1);
1256 return 0;
1257 }
1258 return PyList_Append(list, x);
1259 }
1260 #else
1261 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1262 #endif
1263
1264 /* PyObject_GenericGetAttrNoDict.proto */
1265 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1266 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1267 #else
1268 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1269 #endif
1270
1271 /* PyObject_GenericGetAttr.proto */
1272 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1273 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1274 #else
1275 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1276 #endif
1277
1278 /* PyErrExceptionMatches.proto */
1279 #if CYTHON_FAST_THREAD_STATE
1280 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1281 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1282 #else
1283 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1284 #endif
1285
1286 /* PyObjectGetAttrStrNoError.proto */
1287 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1288
1289 /* SetupReduce.proto */
1290 static int __Pyx_setup_reduce(PyObject* type_obj);
1291
1292 /* TypeImport.proto */
1293 #ifndef __PYX_HAVE_RT_ImportType_proto
1294 #define __PYX_HAVE_RT_ImportType_proto
1295 enum __Pyx_ImportType_CheckSize {
1296 __Pyx_ImportType_CheckSize_Error = 0,
1297 __Pyx_ImportType_CheckSize_Warn = 1,
1298 __Pyx_ImportType_CheckSize_Ignore = 2
1299 };
1300 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1301 #endif
1302
1303 /* GetVTable.proto */
1304 static void* __Pyx_GetVtable(PyObject *dict);
1305
1306 /* PyObjectCallNoArg.proto */
1307 #if CYTHON_COMPILING_IN_CPYTHON
1308 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1309 #else
1310 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1311 #endif
1312
1313 /* PyDictVersioning.proto */
1314 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1315 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1316 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1317 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1318 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1319 (cache_var) = (value);
1320 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1321 static PY_UINT64_T __pyx_dict_version = 0;\
1322 static PyObject *__pyx_dict_cached_value = NULL;\
1323 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1324 (VAR) = __pyx_dict_cached_value;\
1325 } else {\
1326 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1327 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1328 }\
1329 }
1330 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1331 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1332 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1333 #else
1334 #define __PYX_GET_DICT_VERSION(dict) (0)
1335 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1336 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1337 #endif
1338
1339 /* CLineInTraceback.proto */
1340 #ifdef CYTHON_CLINE_IN_TRACEBACK
1341 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1342 #else
1343 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1344 #endif
1345
1346 /* CodeObjectCache.proto */
1347 typedef struct {
1348 PyCodeObject* code_object;
1349 int code_line;
1350 } __Pyx_CodeObjectCacheEntry;
1351 struct __Pyx_CodeObjectCache {
1352 int count;
1353 int max_count;
1354 __Pyx_CodeObjectCacheEntry* entries;
1355 };
1356 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1357 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1358 static PyCodeObject *__pyx_find_code_object(int code_line);
1359 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1360
1361 /* AddTraceback.proto */
1362 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1363 int py_line, const char *filename);
1364
1365 /* CIntToPy.proto */
1366 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1367
1368 /* CIntToPy.proto */
1369 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1370
1371 /* CIntFromPy.proto */
1372 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1373
1374 /* CIntFromPy.proto */
1375 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1376
1377 /* FastTypeChecks.proto */
1378 #if CYTHON_COMPILING_IN_CPYTHON
1379 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1380 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1381 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1382 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1383 #else
1384 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1385 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1386 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1387 #endif
1388 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1389
1390 /* CheckBinaryVersion.proto */
1391 static int __Pyx_check_binary_version(void);
1392
1393 /* FunctionExport.proto */
1394 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
1395
1396 /* FunctionImport.proto */
1397 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
1398
1399 /* InitStrings.proto */
1400 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1401
1402
1403 /* Module declarations from 'libc.stdint' */
1404
1405 /* Module declarations from 'libav' */
1406
1407 /* Module declarations from 'av.descriptor' */
1408 static PyTypeObject *__pyx_ptype_2av_10descriptor_Descriptor = 0;
1409
1410 /* Module declarations from 'av.filter.filter' */
1411 static PyTypeObject *__pyx_ptype_2av_6filter_6filter_Filter = 0;
1412
1413 /* Module declarations from 'av.filter.graph' */
1414 static PyTypeObject *__pyx_ptype_2av_6filter_5graph_Graph = 0;
1415
1416 /* Module declarations from 'av.filter.context' */
1417 static PyTypeObject *__pyx_ptype_2av_6filter_7context_FilterContext = 0;
1418
1419 /* Module declarations from 'av.filter.link' */
1420 static PyTypeObject *__pyx_ptype_2av_6filter_4link_FilterLink = 0;
1421 static struct __pyx_obj_2av_6filter_4link_FilterLink *(*__pyx_f_2av_6filter_4link_wrap_filter_link)(struct __pyx_obj_2av_6filter_5graph_Graph *, struct AVFilterLink *); /*proto*/
1422
1423 /* Module declarations from 'av.filter.pad' */
1424 static PyTypeObject *__pyx_ptype_2av_6filter_3pad_FilterPad = 0;
1425 static PyTypeObject *__pyx_ptype_2av_6filter_3pad_FilterContextPad = 0;
1426 static PyObject *__pyx_v_2av_6filter_3pad__cinit_sentinel = 0;
1427 #define __Pyx_MODULE_NAME "av.filter.pad"
1428 extern int __pyx_module_is_main_av__filter__pad;
1429 int __pyx_module_is_main_av__filter__pad = 0;
1430
1431 /* Implementation of 'av.filter.pad' */
1432 static PyObject *__pyx_builtin_object;
1433 static PyObject *__pyx_builtin_RuntimeError;
1434 static PyObject *__pyx_builtin_TypeError;
1435 static const char __pyx_k_link[] = "link";
1436 static const char __pyx_k_main[] = "__main__";
1437 static const char __pyx_k_name[] = "name";
1438 static const char __pyx_k_test[] = "__test__";
1439 static const char __pyx_k_type[] = "type";
1440 static const char __pyx_k_input[] = "input";
1441 static const char __pyx_k_inputs[] = "inputs";
1442 static const char __pyx_k_name_2[] = "__name__";
1443 static const char __pyx_k_object[] = "object";
1444 static const char __pyx_k_output[] = "output";
1445 static const char __pyx_k_reduce[] = "__reduce__";
1446 static const char __pyx_k_outputs[] = "outputs";
1447 static const char __pyx_k_getstate[] = "__getstate__";
1448 static const char __pyx_k_sentinel[] = "sentinel";
1449 static const char __pyx_k_setstate[] = "__setstate__";
1450 static const char __pyx_k_FilterPad[] = "FilterPad";
1451 static const char __pyx_k_TypeError[] = "TypeError";
1452 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
1453 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
1454 static const char __pyx_k_RuntimeError[] = "RuntimeError";
1455 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
1456 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
1457 static const char __pyx_k_FilterContextPad[] = "FilterContextPad";
1458 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1459 static const char __pyx_k_av_FilterPad_s_s_d_s_s[] = "<av.FilterPad %s.%s[%d]: %s (%s)>";
1460 static const char __pyx_k_cannot_construct_FilterPad[] = "cannot construct FilterPad";
1461 static const char __pyx_k_av_FilterContextPad_s_s_d_of_s[] = "<av.FilterContextPad %s.%s[%d] of %s: %s (%s)>";
1462 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
1463 static PyObject *__pyx_n_s_FilterContextPad;
1464 static PyObject *__pyx_n_s_FilterPad;
1465 static PyObject *__pyx_n_s_RuntimeError;
1466 static PyObject *__pyx_n_s_TypeError;
1467 static PyObject *__pyx_kp_s_av_FilterContextPad_s_s_d_of_s;
1468 static PyObject *__pyx_kp_s_av_FilterPad_s_s_d_s_s;
1469 static PyObject *__pyx_kp_s_cannot_construct_FilterPad;
1470 static PyObject *__pyx_n_s_cline_in_traceback;
1471 static PyObject *__pyx_n_s_getstate;
1472 static PyObject *__pyx_n_s_input;
1473 static PyObject *__pyx_n_s_inputs;
1474 static PyObject *__pyx_n_s_link;
1475 static PyObject *__pyx_n_s_main;
1476 static PyObject *__pyx_n_s_name;
1477 static PyObject *__pyx_n_s_name_2;
1478 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
1479 static PyObject *__pyx_n_s_object;
1480 static PyObject *__pyx_n_s_output;
1481 static PyObject *__pyx_n_s_outputs;
1482 static PyObject *__pyx_n_s_pyx_vtable;
1483 static PyObject *__pyx_n_s_reduce;
1484 static PyObject *__pyx_n_s_reduce_cython;
1485 static PyObject *__pyx_n_s_reduce_ex;
1486 static PyObject *__pyx_n_s_sentinel;
1487 static PyObject *__pyx_n_s_setstate;
1488 static PyObject *__pyx_n_s_setstate_cython;
1489 static PyObject *__pyx_n_s_test;
1490 static PyObject *__pyx_n_s_type;
1491 static int __pyx_pf_2av_6filter_3pad_9FilterPad___cinit__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self, PyObject *__pyx_v_sentinel); /* proto */
1492 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_2__repr__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self); /* proto */
1493 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_9is_output___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self); /* proto */
1494 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_4name___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self); /* proto */
1495 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_4type___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self); /* proto */
1496 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_6filter___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self); /* proto */
1497 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_7context___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self); /* proto */
1498 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_8is_input___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self); /* proto */
1499 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_5index___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self); /* proto */
1500 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self); /* proto */
1501 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1502 static PyObject *__pyx_pf_2av_6filter_3pad_16FilterContextPad___repr__(struct __pyx_obj_2av_6filter_3pad_FilterContextPad *__pyx_v_self); /* proto */
1503 static PyObject *__pyx_pf_2av_6filter_3pad_16FilterContextPad_4link___get__(struct __pyx_obj_2av_6filter_3pad_FilterContextPad *__pyx_v_self); /* proto */
1504 static PyObject *__pyx_pf_2av_6filter_3pad_16FilterContextPad_6linked___get__(struct __pyx_obj_2av_6filter_3pad_FilterContextPad *__pyx_v_self); /* proto */
1505 static PyObject *__pyx_pf_2av_6filter_3pad_16FilterContextPad_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterContextPad *__pyx_v_self); /* proto */
1506 static PyObject *__pyx_pf_2av_6filter_3pad_16FilterContextPad_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterContextPad *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1507 static PyObject *__pyx_tp_new_2av_6filter_3pad_FilterPad(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1508 static PyObject *__pyx_tp_new_2av_6filter_3pad_FilterContextPad(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1509 static PyObject *__pyx_tuple_;
1510 static PyObject *__pyx_tuple__2;
1511 static PyObject *__pyx_tuple__3;
1512 static PyObject *__pyx_tuple__4;
1513 static PyObject *__pyx_tuple__5;
1514 /* Late includes */
1515
1516 /* "av/filter/pad.pyx":9
1517 * cdef class FilterPad(object):
1518 *
1519 * def __cinit__(self, sentinel): # <<<<<<<<<<<<<<
1520 * if sentinel is not _cinit_sentinel:
1521 * raise RuntimeError('cannot construct FilterPad')
1522 */
1523
1524 /* Python wrapper */
1525 static int __pyx_pw_2av_6filter_3pad_9FilterPad_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2av_6filter_3pad_9FilterPad_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1526 static int __pyx_pw_2av_6filter_3pad_9FilterPad_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1527 PyObject *__pyx_v_sentinel = 0;
1528 int __pyx_lineno = 0;
1529 const char *__pyx_filename = NULL;
1530 int __pyx_clineno = 0;
1531 int __pyx_r;
1532 __Pyx_RefNannyDeclarations
1533 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
1534 {
1535 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sentinel,0};
1536 PyObject* values[1] = {0};
1537 if (unlikely(__pyx_kwds)) {
1538 Py_ssize_t kw_args;
1539 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1540 switch (pos_args) {
1541 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1542 CYTHON_FALLTHROUGH;
1543 case 0: break;
1544 default: goto __pyx_L5_argtuple_error;
1545 }
1546 kw_args = PyDict_Size(__pyx_kwds);
1547 switch (pos_args) {
1548 case 0:
1549 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sentinel)) != 0)) kw_args--;
1550 else goto __pyx_L5_argtuple_error;
1551 }
1552 if (unlikely(kw_args > 0)) {
1553 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 9, __pyx_L3_error)
1554 }
1555 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
1556 goto __pyx_L5_argtuple_error;
1557 } else {
1558 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1559 }
1560 __pyx_v_sentinel = values[0];
1561 }
1562 goto __pyx_L4_argument_unpacking_done;
1563 __pyx_L5_argtuple_error:;
1564 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 9, __pyx_L3_error)
1565 __pyx_L3_error:;
1566 __Pyx_AddTraceback("av.filter.pad.FilterPad.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1567 __Pyx_RefNannyFinishContext();
1568 return -1;
1569 __pyx_L4_argument_unpacking_done:;
1570 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad___cinit__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self), __pyx_v_sentinel);
1571
1572 /* function exit code */
1573 __Pyx_RefNannyFinishContext();
1574 return __pyx_r;
1575 }
1576
__pyx_pf_2av_6filter_3pad_9FilterPad___cinit__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self,PyObject * __pyx_v_sentinel)1577 static int __pyx_pf_2av_6filter_3pad_9FilterPad___cinit__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self, PyObject *__pyx_v_sentinel) {
1578 int __pyx_r;
1579 __Pyx_RefNannyDeclarations
1580 int __pyx_t_1;
1581 int __pyx_t_2;
1582 PyObject *__pyx_t_3 = NULL;
1583 int __pyx_lineno = 0;
1584 const char *__pyx_filename = NULL;
1585 int __pyx_clineno = 0;
1586 __Pyx_RefNannySetupContext("__cinit__", 0);
1587
1588 /* "av/filter/pad.pyx":10
1589 *
1590 * def __cinit__(self, sentinel):
1591 * if sentinel is not _cinit_sentinel: # <<<<<<<<<<<<<<
1592 * raise RuntimeError('cannot construct FilterPad')
1593 *
1594 */
1595 __pyx_t_1 = (__pyx_v_sentinel != __pyx_v_2av_6filter_3pad__cinit_sentinel);
1596 __pyx_t_2 = (__pyx_t_1 != 0);
1597 if (unlikely(__pyx_t_2)) {
1598
1599 /* "av/filter/pad.pyx":11
1600 * def __cinit__(self, sentinel):
1601 * if sentinel is not _cinit_sentinel:
1602 * raise RuntimeError('cannot construct FilterPad') # <<<<<<<<<<<<<<
1603 *
1604 * def __repr__(self):
1605 */
1606 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error)
1607 __Pyx_GOTREF(__pyx_t_3);
1608 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
1609 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1610 __PYX_ERR(0, 11, __pyx_L1_error)
1611
1612 /* "av/filter/pad.pyx":10
1613 *
1614 * def __cinit__(self, sentinel):
1615 * if sentinel is not _cinit_sentinel: # <<<<<<<<<<<<<<
1616 * raise RuntimeError('cannot construct FilterPad')
1617 *
1618 */
1619 }
1620
1621 /* "av/filter/pad.pyx":9
1622 * cdef class FilterPad(object):
1623 *
1624 * def __cinit__(self, sentinel): # <<<<<<<<<<<<<<
1625 * if sentinel is not _cinit_sentinel:
1626 * raise RuntimeError('cannot construct FilterPad')
1627 */
1628
1629 /* function exit code */
1630 __pyx_r = 0;
1631 goto __pyx_L0;
1632 __pyx_L1_error:;
1633 __Pyx_XDECREF(__pyx_t_3);
1634 __Pyx_AddTraceback("av.filter.pad.FilterPad.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1635 __pyx_r = -1;
1636 __pyx_L0:;
1637 __Pyx_RefNannyFinishContext();
1638 return __pyx_r;
1639 }
1640
1641 /* "av/filter/pad.pyx":13
1642 * raise RuntimeError('cannot construct FilterPad')
1643 *
1644 * def __repr__(self): # <<<<<<<<<<<<<<
1645 * return '<av.FilterPad %s.%s[%d]: %s (%s)>' % (
1646 * self.filter.name,
1647 */
1648
1649 /* Python wrapper */
1650 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_3__repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_9FilterPad_3__repr__(PyObject * __pyx_v_self)1651 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_3__repr__(PyObject *__pyx_v_self) {
1652 PyObject *__pyx_r = 0;
1653 __Pyx_RefNannyDeclarations
1654 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
1655 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad_2__repr__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self));
1656
1657 /* function exit code */
1658 __Pyx_RefNannyFinishContext();
1659 return __pyx_r;
1660 }
1661
__pyx_pf_2av_6filter_3pad_9FilterPad_2__repr__(struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self)1662 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_2__repr__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self) {
1663 PyObject *__pyx_r = NULL;
1664 __Pyx_RefNannyDeclarations
1665 PyObject *__pyx_t_1 = NULL;
1666 PyObject *__pyx_t_2 = NULL;
1667 PyObject *__pyx_t_3 = NULL;
1668 PyObject *__pyx_t_4 = NULL;
1669 PyObject *__pyx_t_5 = NULL;
1670 PyObject *__pyx_t_6 = NULL;
1671 int __pyx_lineno = 0;
1672 const char *__pyx_filename = NULL;
1673 int __pyx_clineno = 0;
1674 __Pyx_RefNannySetupContext("__repr__", 0);
1675
1676 /* "av/filter/pad.pyx":14
1677 *
1678 * def __repr__(self):
1679 * return '<av.FilterPad %s.%s[%d]: %s (%s)>' % ( # <<<<<<<<<<<<<<
1680 * self.filter.name,
1681 * 'inputs' if self.is_input else 'outputs',
1682 */
1683 __Pyx_XDECREF(__pyx_r);
1684
1685 /* "av/filter/pad.pyx":15
1686 * def __repr__(self):
1687 * return '<av.FilterPad %s.%s[%d]: %s (%s)>' % (
1688 * self.filter.name, # <<<<<<<<<<<<<<
1689 * 'inputs' if self.is_input else 'outputs',
1690 * self.index,
1691 */
1692 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->filter), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
1693 __Pyx_GOTREF(__pyx_t_1);
1694
1695 /* "av/filter/pad.pyx":16
1696 * return '<av.FilterPad %s.%s[%d]: %s (%s)>' % (
1697 * self.filter.name,
1698 * 'inputs' if self.is_input else 'outputs', # <<<<<<<<<<<<<<
1699 * self.index,
1700 * self.name,
1701 */
1702 if ((__pyx_v_self->is_input != 0)) {
1703 __Pyx_INCREF(__pyx_n_s_inputs);
1704 __pyx_t_2 = __pyx_n_s_inputs;
1705 } else {
1706 __Pyx_INCREF(__pyx_n_s_outputs);
1707 __pyx_t_2 = __pyx_n_s_outputs;
1708 }
1709
1710 /* "av/filter/pad.pyx":17
1711 * self.filter.name,
1712 * 'inputs' if self.is_input else 'outputs',
1713 * self.index, # <<<<<<<<<<<<<<
1714 * self.name,
1715 * self.type,
1716 */
1717 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error)
1718 __Pyx_GOTREF(__pyx_t_3);
1719
1720 /* "av/filter/pad.pyx":18
1721 * 'inputs' if self.is_input else 'outputs',
1722 * self.index,
1723 * self.name, # <<<<<<<<<<<<<<
1724 * self.type,
1725 * )
1726 */
1727 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error)
1728 __Pyx_GOTREF(__pyx_t_4);
1729
1730 /* "av/filter/pad.pyx":19
1731 * self.index,
1732 * self.name,
1733 * self.type, # <<<<<<<<<<<<<<
1734 * )
1735 *
1736 */
1737 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 19, __pyx_L1_error)
1738 __Pyx_GOTREF(__pyx_t_5);
1739
1740 /* "av/filter/pad.pyx":15
1741 * def __repr__(self):
1742 * return '<av.FilterPad %s.%s[%d]: %s (%s)>' % (
1743 * self.filter.name, # <<<<<<<<<<<<<<
1744 * 'inputs' if self.is_input else 'outputs',
1745 * self.index,
1746 */
1747 __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 15, __pyx_L1_error)
1748 __Pyx_GOTREF(__pyx_t_6);
1749 __Pyx_GIVEREF(__pyx_t_1);
1750 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
1751 __Pyx_GIVEREF(__pyx_t_2);
1752 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
1753 __Pyx_GIVEREF(__pyx_t_3);
1754 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
1755 __Pyx_GIVEREF(__pyx_t_4);
1756 PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4);
1757 __Pyx_GIVEREF(__pyx_t_5);
1758 PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5);
1759 __pyx_t_1 = 0;
1760 __pyx_t_2 = 0;
1761 __pyx_t_3 = 0;
1762 __pyx_t_4 = 0;
1763 __pyx_t_5 = 0;
1764
1765 /* "av/filter/pad.pyx":14
1766 *
1767 * def __repr__(self):
1768 * return '<av.FilterPad %s.%s[%d]: %s (%s)>' % ( # <<<<<<<<<<<<<<
1769 * self.filter.name,
1770 * 'inputs' if self.is_input else 'outputs',
1771 */
1772 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_av_FilterPad_s_s_d_s_s, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 14, __pyx_L1_error)
1773 __Pyx_GOTREF(__pyx_t_5);
1774 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1775 __pyx_r = __pyx_t_5;
1776 __pyx_t_5 = 0;
1777 goto __pyx_L0;
1778
1779 /* "av/filter/pad.pyx":13
1780 * raise RuntimeError('cannot construct FilterPad')
1781 *
1782 * def __repr__(self): # <<<<<<<<<<<<<<
1783 * return '<av.FilterPad %s.%s[%d]: %s (%s)>' % (
1784 * self.filter.name,
1785 */
1786
1787 /* function exit code */
1788 __pyx_L1_error:;
1789 __Pyx_XDECREF(__pyx_t_1);
1790 __Pyx_XDECREF(__pyx_t_2);
1791 __Pyx_XDECREF(__pyx_t_3);
1792 __Pyx_XDECREF(__pyx_t_4);
1793 __Pyx_XDECREF(__pyx_t_5);
1794 __Pyx_XDECREF(__pyx_t_6);
1795 __Pyx_AddTraceback("av.filter.pad.FilterPad.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1796 __pyx_r = NULL;
1797 __pyx_L0:;
1798 __Pyx_XGIVEREF(__pyx_r);
1799 __Pyx_RefNannyFinishContext();
1800 return __pyx_r;
1801 }
1802
1803 /* "av/filter/pad.pyx":23
1804 *
1805 * property is_output:
1806 * def __get__(self): # <<<<<<<<<<<<<<
1807 * return not self.is_input
1808 *
1809 */
1810
1811 /* Python wrapper */
1812 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_9is_output_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_9FilterPad_9is_output_1__get__(PyObject * __pyx_v_self)1813 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_9is_output_1__get__(PyObject *__pyx_v_self) {
1814 PyObject *__pyx_r = 0;
1815 __Pyx_RefNannyDeclarations
1816 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
1817 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad_9is_output___get__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self));
1818
1819 /* function exit code */
1820 __Pyx_RefNannyFinishContext();
1821 return __pyx_r;
1822 }
1823
__pyx_pf_2av_6filter_3pad_9FilterPad_9is_output___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self)1824 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_9is_output___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self) {
1825 PyObject *__pyx_r = NULL;
1826 __Pyx_RefNannyDeclarations
1827 PyObject *__pyx_t_1 = NULL;
1828 int __pyx_lineno = 0;
1829 const char *__pyx_filename = NULL;
1830 int __pyx_clineno = 0;
1831 __Pyx_RefNannySetupContext("__get__", 0);
1832
1833 /* "av/filter/pad.pyx":24
1834 * property is_output:
1835 * def __get__(self):
1836 * return not self.is_input # <<<<<<<<<<<<<<
1837 *
1838 * property name:
1839 */
1840 __Pyx_XDECREF(__pyx_r);
1841 __pyx_t_1 = __Pyx_PyBool_FromLong((!(__pyx_v_self->is_input != 0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
1842 __Pyx_GOTREF(__pyx_t_1);
1843 __pyx_r = __pyx_t_1;
1844 __pyx_t_1 = 0;
1845 goto __pyx_L0;
1846
1847 /* "av/filter/pad.pyx":23
1848 *
1849 * property is_output:
1850 * def __get__(self): # <<<<<<<<<<<<<<
1851 * return not self.is_input
1852 *
1853 */
1854
1855 /* function exit code */
1856 __pyx_L1_error:;
1857 __Pyx_XDECREF(__pyx_t_1);
1858 __Pyx_AddTraceback("av.filter.pad.FilterPad.is_output.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1859 __pyx_r = NULL;
1860 __pyx_L0:;
1861 __Pyx_XGIVEREF(__pyx_r);
1862 __Pyx_RefNannyFinishContext();
1863 return __pyx_r;
1864 }
1865
1866 /* "av/filter/pad.pyx":27
1867 *
1868 * property name:
1869 * def __get__(self): # <<<<<<<<<<<<<<
1870 * return lib.avfilter_pad_get_name(self.base_ptr, self.index)
1871 *
1872 */
1873
1874 /* Python wrapper */
1875 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_9FilterPad_4name_1__get__(PyObject * __pyx_v_self)1876 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_4name_1__get__(PyObject *__pyx_v_self) {
1877 PyObject *__pyx_r = 0;
1878 __Pyx_RefNannyDeclarations
1879 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
1880 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad_4name___get__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self));
1881
1882 /* function exit code */
1883 __Pyx_RefNannyFinishContext();
1884 return __pyx_r;
1885 }
1886
__pyx_pf_2av_6filter_3pad_9FilterPad_4name___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self)1887 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_4name___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self) {
1888 PyObject *__pyx_r = NULL;
1889 __Pyx_RefNannyDeclarations
1890 PyObject *__pyx_t_1 = NULL;
1891 int __pyx_lineno = 0;
1892 const char *__pyx_filename = NULL;
1893 int __pyx_clineno = 0;
1894 __Pyx_RefNannySetupContext("__get__", 0);
1895
1896 /* "av/filter/pad.pyx":28
1897 * property name:
1898 * def __get__(self):
1899 * return lib.avfilter_pad_get_name(self.base_ptr, self.index) # <<<<<<<<<<<<<<
1900 *
1901 * @property
1902 */
1903 __Pyx_XDECREF(__pyx_r);
1904 __pyx_t_1 = __Pyx_PyStr_FromString(avfilter_pad_get_name(__pyx_v_self->base_ptr, __pyx_v_self->index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
1905 __Pyx_GOTREF(__pyx_t_1);
1906 __pyx_r = __pyx_t_1;
1907 __pyx_t_1 = 0;
1908 goto __pyx_L0;
1909
1910 /* "av/filter/pad.pyx":27
1911 *
1912 * property name:
1913 * def __get__(self): # <<<<<<<<<<<<<<
1914 * return lib.avfilter_pad_get_name(self.base_ptr, self.index)
1915 *
1916 */
1917
1918 /* function exit code */
1919 __pyx_L1_error:;
1920 __Pyx_XDECREF(__pyx_t_1);
1921 __Pyx_AddTraceback("av.filter.pad.FilterPad.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1922 __pyx_r = NULL;
1923 __pyx_L0:;
1924 __Pyx_XGIVEREF(__pyx_r);
1925 __Pyx_RefNannyFinishContext();
1926 return __pyx_r;
1927 }
1928
1929 /* "av/filter/pad.pyx":31
1930 *
1931 * @property
1932 * def type(self): # <<<<<<<<<<<<<<
1933 * """
1934 * The media type of this filter pad.
1935 */
1936
1937 /* Python wrapper */
1938 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_9FilterPad_4type_1__get__(PyObject * __pyx_v_self)1939 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_4type_1__get__(PyObject *__pyx_v_self) {
1940 PyObject *__pyx_r = 0;
1941 __Pyx_RefNannyDeclarations
1942 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
1943 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad_4type___get__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self));
1944
1945 /* function exit code */
1946 __Pyx_RefNannyFinishContext();
1947 return __pyx_r;
1948 }
1949
__pyx_pf_2av_6filter_3pad_9FilterPad_4type___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self)1950 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_4type___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self) {
1951 PyObject *__pyx_r = NULL;
1952 __Pyx_RefNannyDeclarations
1953 PyObject *__pyx_t_1 = NULL;
1954 int __pyx_lineno = 0;
1955 const char *__pyx_filename = NULL;
1956 int __pyx_clineno = 0;
1957 __Pyx_RefNannySetupContext("__get__", 0);
1958
1959 /* "av/filter/pad.pyx":39
1960 * :type: str
1961 * """
1962 * return lib.av_get_media_type_string(lib.avfilter_pad_get_type(self.base_ptr, self.index)) # <<<<<<<<<<<<<<
1963 *
1964 *
1965 */
1966 __Pyx_XDECREF(__pyx_r);
1967 __pyx_t_1 = __Pyx_PyStr_FromString(av_get_media_type_string(avfilter_pad_get_type(__pyx_v_self->base_ptr, __pyx_v_self->index))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
1968 __Pyx_GOTREF(__pyx_t_1);
1969 __pyx_r = __pyx_t_1;
1970 __pyx_t_1 = 0;
1971 goto __pyx_L0;
1972
1973 /* "av/filter/pad.pyx":31
1974 *
1975 * @property
1976 * def type(self): # <<<<<<<<<<<<<<
1977 * """
1978 * The media type of this filter pad.
1979 */
1980
1981 /* function exit code */
1982 __pyx_L1_error:;
1983 __Pyx_XDECREF(__pyx_t_1);
1984 __Pyx_AddTraceback("av.filter.pad.FilterPad.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1985 __pyx_r = NULL;
1986 __pyx_L0:;
1987 __Pyx_XGIVEREF(__pyx_r);
1988 __Pyx_RefNannyFinishContext();
1989 return __pyx_r;
1990 }
1991
1992 /* "av/filter/pad.pxd":10
1993 * cdef class FilterPad(object):
1994 *
1995 * cdef readonly Filter filter # <<<<<<<<<<<<<<
1996 * cdef readonly FilterContext context
1997 * cdef readonly bint is_input
1998 */
1999
2000 /* Python wrapper */
2001 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_6filter_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_9FilterPad_6filter_1__get__(PyObject * __pyx_v_self)2002 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_6filter_1__get__(PyObject *__pyx_v_self) {
2003 PyObject *__pyx_r = 0;
2004 __Pyx_RefNannyDeclarations
2005 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2006 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad_6filter___get__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self));
2007
2008 /* function exit code */
2009 __Pyx_RefNannyFinishContext();
2010 return __pyx_r;
2011 }
2012
__pyx_pf_2av_6filter_3pad_9FilterPad_6filter___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self)2013 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_6filter___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self) {
2014 PyObject *__pyx_r = NULL;
2015 __Pyx_RefNannyDeclarations
2016 __Pyx_RefNannySetupContext("__get__", 0);
2017 __Pyx_XDECREF(__pyx_r);
2018 __Pyx_INCREF(((PyObject *)__pyx_v_self->filter));
2019 __pyx_r = ((PyObject *)__pyx_v_self->filter);
2020 goto __pyx_L0;
2021
2022 /* function exit code */
2023 __pyx_L0:;
2024 __Pyx_XGIVEREF(__pyx_r);
2025 __Pyx_RefNannyFinishContext();
2026 return __pyx_r;
2027 }
2028
2029 /* "av/filter/pad.pxd":11
2030 *
2031 * cdef readonly Filter filter
2032 * cdef readonly FilterContext context # <<<<<<<<<<<<<<
2033 * cdef readonly bint is_input
2034 * cdef readonly int index
2035 */
2036
2037 /* Python wrapper */
2038 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_7context_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_9FilterPad_7context_1__get__(PyObject * __pyx_v_self)2039 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_7context_1__get__(PyObject *__pyx_v_self) {
2040 PyObject *__pyx_r = 0;
2041 __Pyx_RefNannyDeclarations
2042 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2043 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad_7context___get__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self));
2044
2045 /* function exit code */
2046 __Pyx_RefNannyFinishContext();
2047 return __pyx_r;
2048 }
2049
__pyx_pf_2av_6filter_3pad_9FilterPad_7context___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self)2050 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_7context___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self) {
2051 PyObject *__pyx_r = NULL;
2052 __Pyx_RefNannyDeclarations
2053 __Pyx_RefNannySetupContext("__get__", 0);
2054 __Pyx_XDECREF(__pyx_r);
2055 __Pyx_INCREF(((PyObject *)__pyx_v_self->context));
2056 __pyx_r = ((PyObject *)__pyx_v_self->context);
2057 goto __pyx_L0;
2058
2059 /* function exit code */
2060 __pyx_L0:;
2061 __Pyx_XGIVEREF(__pyx_r);
2062 __Pyx_RefNannyFinishContext();
2063 return __pyx_r;
2064 }
2065
2066 /* "av/filter/pad.pxd":12
2067 * cdef readonly Filter filter
2068 * cdef readonly FilterContext context
2069 * cdef readonly bint is_input # <<<<<<<<<<<<<<
2070 * cdef readonly int index
2071 *
2072 */
2073
2074 /* Python wrapper */
2075 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_8is_input_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_9FilterPad_8is_input_1__get__(PyObject * __pyx_v_self)2076 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_8is_input_1__get__(PyObject *__pyx_v_self) {
2077 PyObject *__pyx_r = 0;
2078 __Pyx_RefNannyDeclarations
2079 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2080 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad_8is_input___get__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self));
2081
2082 /* function exit code */
2083 __Pyx_RefNannyFinishContext();
2084 return __pyx_r;
2085 }
2086
__pyx_pf_2av_6filter_3pad_9FilterPad_8is_input___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self)2087 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_8is_input___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self) {
2088 PyObject *__pyx_r = NULL;
2089 __Pyx_RefNannyDeclarations
2090 PyObject *__pyx_t_1 = NULL;
2091 int __pyx_lineno = 0;
2092 const char *__pyx_filename = NULL;
2093 int __pyx_clineno = 0;
2094 __Pyx_RefNannySetupContext("__get__", 0);
2095 __Pyx_XDECREF(__pyx_r);
2096 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_input); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
2097 __Pyx_GOTREF(__pyx_t_1);
2098 __pyx_r = __pyx_t_1;
2099 __pyx_t_1 = 0;
2100 goto __pyx_L0;
2101
2102 /* function exit code */
2103 __pyx_L1_error:;
2104 __Pyx_XDECREF(__pyx_t_1);
2105 __Pyx_AddTraceback("av.filter.pad.FilterPad.is_input.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2106 __pyx_r = NULL;
2107 __pyx_L0:;
2108 __Pyx_XGIVEREF(__pyx_r);
2109 __Pyx_RefNannyFinishContext();
2110 return __pyx_r;
2111 }
2112
2113 /* "av/filter/pad.pxd":13
2114 * cdef readonly FilterContext context
2115 * cdef readonly bint is_input
2116 * cdef readonly int index # <<<<<<<<<<<<<<
2117 *
2118 * cdef const lib.AVFilterPad *base_ptr
2119 */
2120
2121 /* Python wrapper */
2122 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_5index_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_9FilterPad_5index_1__get__(PyObject * __pyx_v_self)2123 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_5index_1__get__(PyObject *__pyx_v_self) {
2124 PyObject *__pyx_r = 0;
2125 __Pyx_RefNannyDeclarations
2126 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2127 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad_5index___get__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self));
2128
2129 /* function exit code */
2130 __Pyx_RefNannyFinishContext();
2131 return __pyx_r;
2132 }
2133
__pyx_pf_2av_6filter_3pad_9FilterPad_5index___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self)2134 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_5index___get__(struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self) {
2135 PyObject *__pyx_r = NULL;
2136 __Pyx_RefNannyDeclarations
2137 PyObject *__pyx_t_1 = NULL;
2138 int __pyx_lineno = 0;
2139 const char *__pyx_filename = NULL;
2140 int __pyx_clineno = 0;
2141 __Pyx_RefNannySetupContext("__get__", 0);
2142 __Pyx_XDECREF(__pyx_r);
2143 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
2144 __Pyx_GOTREF(__pyx_t_1);
2145 __pyx_r = __pyx_t_1;
2146 __pyx_t_1 = 0;
2147 goto __pyx_L0;
2148
2149 /* function exit code */
2150 __pyx_L1_error:;
2151 __Pyx_XDECREF(__pyx_t_1);
2152 __Pyx_AddTraceback("av.filter.pad.FilterPad.index.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2153 __pyx_r = NULL;
2154 __pyx_L0:;
2155 __Pyx_XGIVEREF(__pyx_r);
2156 __Pyx_RefNannyFinishContext();
2157 return __pyx_r;
2158 }
2159
2160 /* "(tree fragment)":1
2161 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2162 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2163 * def __setstate_cython__(self, __pyx_state):
2164 */
2165
2166 /* Python wrapper */
2167 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2168 static char __pyx_doc_2av_6filter_3pad_9FilterPad_4__reduce_cython__[] = "FilterPad.__reduce_cython__()";
__pyx_pw_2av_6filter_3pad_9FilterPad_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)2169 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2170 PyObject *__pyx_r = 0;
2171 __Pyx_RefNannyDeclarations
2172 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
2173 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad_4__reduce_cython__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self));
2174
2175 /* function exit code */
2176 __Pyx_RefNannyFinishContext();
2177 return __pyx_r;
2178 }
2179
__pyx_pf_2av_6filter_3pad_9FilterPad_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self)2180 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self) {
2181 PyObject *__pyx_r = NULL;
2182 __Pyx_RefNannyDeclarations
2183 PyObject *__pyx_t_1 = NULL;
2184 int __pyx_lineno = 0;
2185 const char *__pyx_filename = NULL;
2186 int __pyx_clineno = 0;
2187 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
2188
2189 /* "(tree fragment)":2
2190 * def __reduce_cython__(self):
2191 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
2192 * def __setstate_cython__(self, __pyx_state):
2193 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2194 */
2195 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
2196 __Pyx_GOTREF(__pyx_t_1);
2197 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2198 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2199 __PYX_ERR(1, 2, __pyx_L1_error)
2200
2201 /* "(tree fragment)":1
2202 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2203 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2204 * def __setstate_cython__(self, __pyx_state):
2205 */
2206
2207 /* function exit code */
2208 __pyx_L1_error:;
2209 __Pyx_XDECREF(__pyx_t_1);
2210 __Pyx_AddTraceback("av.filter.pad.FilterPad.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2211 __pyx_r = NULL;
2212 __Pyx_XGIVEREF(__pyx_r);
2213 __Pyx_RefNannyFinishContext();
2214 return __pyx_r;
2215 }
2216
2217 /* "(tree fragment)":3
2218 * def __reduce_cython__(self):
2219 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2220 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2221 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2222 */
2223
2224 /* Python wrapper */
2225 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
2226 static char __pyx_doc_2av_6filter_3pad_9FilterPad_6__setstate_cython__[] = "FilterPad.__setstate_cython__(__pyx_state)";
__pyx_pw_2av_6filter_3pad_9FilterPad_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)2227 static PyObject *__pyx_pw_2av_6filter_3pad_9FilterPad_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
2228 PyObject *__pyx_r = 0;
2229 __Pyx_RefNannyDeclarations
2230 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
2231 __pyx_r = __pyx_pf_2av_6filter_3pad_9FilterPad_6__setstate_cython__(((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
2232
2233 /* function exit code */
2234 __Pyx_RefNannyFinishContext();
2235 return __pyx_r;
2236 }
2237
__pyx_pf_2av_6filter_3pad_9FilterPad_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterPad * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)2238 static PyObject *__pyx_pf_2av_6filter_3pad_9FilterPad_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
2239 PyObject *__pyx_r = NULL;
2240 __Pyx_RefNannyDeclarations
2241 PyObject *__pyx_t_1 = NULL;
2242 int __pyx_lineno = 0;
2243 const char *__pyx_filename = NULL;
2244 int __pyx_clineno = 0;
2245 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
2246
2247 /* "(tree fragment)":4
2248 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2249 * def __setstate_cython__(self, __pyx_state):
2250 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
2251 */
2252 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
2253 __Pyx_GOTREF(__pyx_t_1);
2254 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2255 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2256 __PYX_ERR(1, 4, __pyx_L1_error)
2257
2258 /* "(tree fragment)":3
2259 * def __reduce_cython__(self):
2260 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2261 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2262 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2263 */
2264
2265 /* function exit code */
2266 __pyx_L1_error:;
2267 __Pyx_XDECREF(__pyx_t_1);
2268 __Pyx_AddTraceback("av.filter.pad.FilterPad.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2269 __pyx_r = NULL;
2270 __Pyx_XGIVEREF(__pyx_r);
2271 __Pyx_RefNannyFinishContext();
2272 return __pyx_r;
2273 }
2274
2275 /* "av/filter/pad.pyx":44
2276 * cdef class FilterContextPad(FilterPad):
2277 *
2278 * def __repr__(self): # <<<<<<<<<<<<<<
2279 *
2280 * return '<av.FilterContextPad %s.%s[%d] of %s: %s (%s)>' % (
2281 */
2282
2283 /* Python wrapper */
2284 static PyObject *__pyx_pw_2av_6filter_3pad_16FilterContextPad_1__repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_16FilterContextPad_1__repr__(PyObject * __pyx_v_self)2285 static PyObject *__pyx_pw_2av_6filter_3pad_16FilterContextPad_1__repr__(PyObject *__pyx_v_self) {
2286 PyObject *__pyx_r = 0;
2287 __Pyx_RefNannyDeclarations
2288 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
2289 __pyx_r = __pyx_pf_2av_6filter_3pad_16FilterContextPad___repr__(((struct __pyx_obj_2av_6filter_3pad_FilterContextPad *)__pyx_v_self));
2290
2291 /* function exit code */
2292 __Pyx_RefNannyFinishContext();
2293 return __pyx_r;
2294 }
2295
__pyx_pf_2av_6filter_3pad_16FilterContextPad___repr__(struct __pyx_obj_2av_6filter_3pad_FilterContextPad * __pyx_v_self)2296 static PyObject *__pyx_pf_2av_6filter_3pad_16FilterContextPad___repr__(struct __pyx_obj_2av_6filter_3pad_FilterContextPad *__pyx_v_self) {
2297 PyObject *__pyx_r = NULL;
2298 __Pyx_RefNannyDeclarations
2299 PyObject *__pyx_t_1 = NULL;
2300 PyObject *__pyx_t_2 = NULL;
2301 PyObject *__pyx_t_3 = NULL;
2302 PyObject *__pyx_t_4 = NULL;
2303 PyObject *__pyx_t_5 = NULL;
2304 PyObject *__pyx_t_6 = NULL;
2305 PyObject *__pyx_t_7 = NULL;
2306 int __pyx_lineno = 0;
2307 const char *__pyx_filename = NULL;
2308 int __pyx_clineno = 0;
2309 __Pyx_RefNannySetupContext("__repr__", 0);
2310
2311 /* "av/filter/pad.pyx":46
2312 * def __repr__(self):
2313 *
2314 * return '<av.FilterContextPad %s.%s[%d] of %s: %s (%s)>' % ( # <<<<<<<<<<<<<<
2315 * self.filter.name,
2316 * 'inputs' if self.is_input else 'outputs',
2317 */
2318 __Pyx_XDECREF(__pyx_r);
2319
2320 /* "av/filter/pad.pyx":47
2321 *
2322 * return '<av.FilterContextPad %s.%s[%d] of %s: %s (%s)>' % (
2323 * self.filter.name, # <<<<<<<<<<<<<<
2324 * 'inputs' if self.is_input else 'outputs',
2325 * self.index,
2326 */
2327 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.filter), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
2328 __Pyx_GOTREF(__pyx_t_1);
2329
2330 /* "av/filter/pad.pyx":48
2331 * return '<av.FilterContextPad %s.%s[%d] of %s: %s (%s)>' % (
2332 * self.filter.name,
2333 * 'inputs' if self.is_input else 'outputs', # <<<<<<<<<<<<<<
2334 * self.index,
2335 * self.context.name,
2336 */
2337 if ((__pyx_v_self->__pyx_base.is_input != 0)) {
2338 __Pyx_INCREF(__pyx_n_s_inputs);
2339 __pyx_t_2 = __pyx_n_s_inputs;
2340 } else {
2341 __Pyx_INCREF(__pyx_n_s_outputs);
2342 __pyx_t_2 = __pyx_n_s_outputs;
2343 }
2344
2345 /* "av/filter/pad.pyx":49
2346 * self.filter.name,
2347 * 'inputs' if self.is_input else 'outputs',
2348 * self.index, # <<<<<<<<<<<<<<
2349 * self.context.name,
2350 * self.name,
2351 */
2352 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
2353 __Pyx_GOTREF(__pyx_t_3);
2354
2355 /* "av/filter/pad.pyx":50
2356 * 'inputs' if self.is_input else 'outputs',
2357 * self.index,
2358 * self.context.name, # <<<<<<<<<<<<<<
2359 * self.name,
2360 * self.type,
2361 */
2362 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.context), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
2363 __Pyx_GOTREF(__pyx_t_4);
2364
2365 /* "av/filter/pad.pyx":51
2366 * self.index,
2367 * self.context.name,
2368 * self.name, # <<<<<<<<<<<<<<
2369 * self.type,
2370 * )
2371 */
2372 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error)
2373 __Pyx_GOTREF(__pyx_t_5);
2374
2375 /* "av/filter/pad.pyx":52
2376 * self.context.name,
2377 * self.name,
2378 * self.type, # <<<<<<<<<<<<<<
2379 * )
2380 *
2381 */
2382 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error)
2383 __Pyx_GOTREF(__pyx_t_6);
2384
2385 /* "av/filter/pad.pyx":47
2386 *
2387 * return '<av.FilterContextPad %s.%s[%d] of %s: %s (%s)>' % (
2388 * self.filter.name, # <<<<<<<<<<<<<<
2389 * 'inputs' if self.is_input else 'outputs',
2390 * self.index,
2391 */
2392 __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error)
2393 __Pyx_GOTREF(__pyx_t_7);
2394 __Pyx_GIVEREF(__pyx_t_1);
2395 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
2396 __Pyx_GIVEREF(__pyx_t_2);
2397 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
2398 __Pyx_GIVEREF(__pyx_t_3);
2399 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
2400 __Pyx_GIVEREF(__pyx_t_4);
2401 PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4);
2402 __Pyx_GIVEREF(__pyx_t_5);
2403 PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5);
2404 __Pyx_GIVEREF(__pyx_t_6);
2405 PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6);
2406 __pyx_t_1 = 0;
2407 __pyx_t_2 = 0;
2408 __pyx_t_3 = 0;
2409 __pyx_t_4 = 0;
2410 __pyx_t_5 = 0;
2411 __pyx_t_6 = 0;
2412
2413 /* "av/filter/pad.pyx":46
2414 * def __repr__(self):
2415 *
2416 * return '<av.FilterContextPad %s.%s[%d] of %s: %s (%s)>' % ( # <<<<<<<<<<<<<<
2417 * self.filter.name,
2418 * 'inputs' if self.is_input else 'outputs',
2419 */
2420 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_av_FilterContextPad_s_s_d_of_s, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error)
2421 __Pyx_GOTREF(__pyx_t_6);
2422 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2423 __pyx_r = __pyx_t_6;
2424 __pyx_t_6 = 0;
2425 goto __pyx_L0;
2426
2427 /* "av/filter/pad.pyx":44
2428 * cdef class FilterContextPad(FilterPad):
2429 *
2430 * def __repr__(self): # <<<<<<<<<<<<<<
2431 *
2432 * return '<av.FilterContextPad %s.%s[%d] of %s: %s (%s)>' % (
2433 */
2434
2435 /* function exit code */
2436 __pyx_L1_error:;
2437 __Pyx_XDECREF(__pyx_t_1);
2438 __Pyx_XDECREF(__pyx_t_2);
2439 __Pyx_XDECREF(__pyx_t_3);
2440 __Pyx_XDECREF(__pyx_t_4);
2441 __Pyx_XDECREF(__pyx_t_5);
2442 __Pyx_XDECREF(__pyx_t_6);
2443 __Pyx_XDECREF(__pyx_t_7);
2444 __Pyx_AddTraceback("av.filter.pad.FilterContextPad.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2445 __pyx_r = NULL;
2446 __pyx_L0:;
2447 __Pyx_XGIVEREF(__pyx_r);
2448 __Pyx_RefNannyFinishContext();
2449 return __pyx_r;
2450 }
2451
2452 /* "av/filter/pad.pyx":56
2453 *
2454 * property link:
2455 * def __get__(self): # <<<<<<<<<<<<<<
2456 * if self._link:
2457 * return self._link
2458 */
2459
2460 /* Python wrapper */
2461 static PyObject *__pyx_pw_2av_6filter_3pad_16FilterContextPad_4link_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_16FilterContextPad_4link_1__get__(PyObject * __pyx_v_self)2462 static PyObject *__pyx_pw_2av_6filter_3pad_16FilterContextPad_4link_1__get__(PyObject *__pyx_v_self) {
2463 PyObject *__pyx_r = 0;
2464 __Pyx_RefNannyDeclarations
2465 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2466 __pyx_r = __pyx_pf_2av_6filter_3pad_16FilterContextPad_4link___get__(((struct __pyx_obj_2av_6filter_3pad_FilterContextPad *)__pyx_v_self));
2467
2468 /* function exit code */
2469 __Pyx_RefNannyFinishContext();
2470 return __pyx_r;
2471 }
2472
__pyx_pf_2av_6filter_3pad_16FilterContextPad_4link___get__(struct __pyx_obj_2av_6filter_3pad_FilterContextPad * __pyx_v_self)2473 static PyObject *__pyx_pf_2av_6filter_3pad_16FilterContextPad_4link___get__(struct __pyx_obj_2av_6filter_3pad_FilterContextPad *__pyx_v_self) {
2474 struct AVFilterLink **__pyx_v_links;
2475 struct AVFilterLink *__pyx_v_link;
2476 PyObject *__pyx_r = NULL;
2477 __Pyx_RefNannyDeclarations
2478 int __pyx_t_1;
2479 struct AVFilterLink **__pyx_t_2;
2480 PyObject *__pyx_t_3 = NULL;
2481 PyObject *__pyx_t_4 = NULL;
2482 int __pyx_lineno = 0;
2483 const char *__pyx_filename = NULL;
2484 int __pyx_clineno = 0;
2485 __Pyx_RefNannySetupContext("__get__", 0);
2486
2487 /* "av/filter/pad.pyx":57
2488 * property link:
2489 * def __get__(self):
2490 * if self._link: # <<<<<<<<<<<<<<
2491 * return self._link
2492 * cdef lib.AVFilterLink **links = self.context.ptr.inputs if self.is_input else self.context.ptr.outputs
2493 */
2494 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->_link)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 57, __pyx_L1_error)
2495 if (__pyx_t_1) {
2496
2497 /* "av/filter/pad.pyx":58
2498 * def __get__(self):
2499 * if self._link:
2500 * return self._link # <<<<<<<<<<<<<<
2501 * cdef lib.AVFilterLink **links = self.context.ptr.inputs if self.is_input else self.context.ptr.outputs
2502 * cdef lib.AVFilterLink *link = links[self.index]
2503 */
2504 __Pyx_XDECREF(__pyx_r);
2505 __Pyx_INCREF(((PyObject *)__pyx_v_self->_link));
2506 __pyx_r = ((PyObject *)__pyx_v_self->_link);
2507 goto __pyx_L0;
2508
2509 /* "av/filter/pad.pyx":57
2510 * property link:
2511 * def __get__(self):
2512 * if self._link: # <<<<<<<<<<<<<<
2513 * return self._link
2514 * cdef lib.AVFilterLink **links = self.context.ptr.inputs if self.is_input else self.context.ptr.outputs
2515 */
2516 }
2517
2518 /* "av/filter/pad.pyx":59
2519 * if self._link:
2520 * return self._link
2521 * cdef lib.AVFilterLink **links = self.context.ptr.inputs if self.is_input else self.context.ptr.outputs # <<<<<<<<<<<<<<
2522 * cdef lib.AVFilterLink *link = links[self.index]
2523 * if not link:
2524 */
2525 if ((__pyx_v_self->__pyx_base.is_input != 0)) {
2526 __pyx_t_2 = __pyx_v_self->__pyx_base.context->ptr->inputs;
2527 } else {
2528 __pyx_t_2 = __pyx_v_self->__pyx_base.context->ptr->outputs;
2529 }
2530 __pyx_v_links = __pyx_t_2;
2531
2532 /* "av/filter/pad.pyx":60
2533 * return self._link
2534 * cdef lib.AVFilterLink **links = self.context.ptr.inputs if self.is_input else self.context.ptr.outputs
2535 * cdef lib.AVFilterLink *link = links[self.index] # <<<<<<<<<<<<<<
2536 * if not link:
2537 * return
2538 */
2539 __pyx_v_link = (__pyx_v_links[__pyx_v_self->__pyx_base.index]);
2540
2541 /* "av/filter/pad.pyx":61
2542 * cdef lib.AVFilterLink **links = self.context.ptr.inputs if self.is_input else self.context.ptr.outputs
2543 * cdef lib.AVFilterLink *link = links[self.index]
2544 * if not link: # <<<<<<<<<<<<<<
2545 * return
2546 * self._link = wrap_filter_link(self.context.graph, link)
2547 */
2548 __pyx_t_1 = ((!(__pyx_v_link != 0)) != 0);
2549 if (__pyx_t_1) {
2550
2551 /* "av/filter/pad.pyx":62
2552 * cdef lib.AVFilterLink *link = links[self.index]
2553 * if not link:
2554 * return # <<<<<<<<<<<<<<
2555 * self._link = wrap_filter_link(self.context.graph, link)
2556 * return self._link
2557 */
2558 __Pyx_XDECREF(__pyx_r);
2559 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2560 goto __pyx_L0;
2561
2562 /* "av/filter/pad.pyx":61
2563 * cdef lib.AVFilterLink **links = self.context.ptr.inputs if self.is_input else self.context.ptr.outputs
2564 * cdef lib.AVFilterLink *link = links[self.index]
2565 * if not link: # <<<<<<<<<<<<<<
2566 * return
2567 * self._link = wrap_filter_link(self.context.graph, link)
2568 */
2569 }
2570
2571 /* "av/filter/pad.pyx":63
2572 * if not link:
2573 * return
2574 * self._link = wrap_filter_link(self.context.graph, link) # <<<<<<<<<<<<<<
2575 * return self._link
2576 *
2577 */
2578 __pyx_t_3 = ((PyObject *)__pyx_v_self->__pyx_base.context->graph);
2579 __Pyx_INCREF(__pyx_t_3);
2580 __pyx_t_4 = ((PyObject *)__pyx_f_2av_6filter_4link_wrap_filter_link(((struct __pyx_obj_2av_6filter_5graph_Graph *)__pyx_t_3), __pyx_v_link)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
2581 __Pyx_GOTREF(__pyx_t_4);
2582 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2583 __Pyx_GIVEREF(__pyx_t_4);
2584 __Pyx_GOTREF(__pyx_v_self->_link);
2585 __Pyx_DECREF(((PyObject *)__pyx_v_self->_link));
2586 __pyx_v_self->_link = ((struct __pyx_obj_2av_6filter_4link_FilterLink *)__pyx_t_4);
2587 __pyx_t_4 = 0;
2588
2589 /* "av/filter/pad.pyx":64
2590 * return
2591 * self._link = wrap_filter_link(self.context.graph, link)
2592 * return self._link # <<<<<<<<<<<<<<
2593 *
2594 * property linked:
2595 */
2596 __Pyx_XDECREF(__pyx_r);
2597 __Pyx_INCREF(((PyObject *)__pyx_v_self->_link));
2598 __pyx_r = ((PyObject *)__pyx_v_self->_link);
2599 goto __pyx_L0;
2600
2601 /* "av/filter/pad.pyx":56
2602 *
2603 * property link:
2604 * def __get__(self): # <<<<<<<<<<<<<<
2605 * if self._link:
2606 * return self._link
2607 */
2608
2609 /* function exit code */
2610 __pyx_L1_error:;
2611 __Pyx_XDECREF(__pyx_t_3);
2612 __Pyx_XDECREF(__pyx_t_4);
2613 __Pyx_AddTraceback("av.filter.pad.FilterContextPad.link.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2614 __pyx_r = NULL;
2615 __pyx_L0:;
2616 __Pyx_XGIVEREF(__pyx_r);
2617 __Pyx_RefNannyFinishContext();
2618 return __pyx_r;
2619 }
2620
2621 /* "av/filter/pad.pyx":67
2622 *
2623 * property linked:
2624 * def __get__(self): # <<<<<<<<<<<<<<
2625 * cdef FilterLink link = self.link
2626 * if link:
2627 */
2628
2629 /* Python wrapper */
2630 static PyObject *__pyx_pw_2av_6filter_3pad_16FilterContextPad_6linked_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_6filter_3pad_16FilterContextPad_6linked_1__get__(PyObject * __pyx_v_self)2631 static PyObject *__pyx_pw_2av_6filter_3pad_16FilterContextPad_6linked_1__get__(PyObject *__pyx_v_self) {
2632 PyObject *__pyx_r = 0;
2633 __Pyx_RefNannyDeclarations
2634 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2635 __pyx_r = __pyx_pf_2av_6filter_3pad_16FilterContextPad_6linked___get__(((struct __pyx_obj_2av_6filter_3pad_FilterContextPad *)__pyx_v_self));
2636
2637 /* function exit code */
2638 __Pyx_RefNannyFinishContext();
2639 return __pyx_r;
2640 }
2641
__pyx_pf_2av_6filter_3pad_16FilterContextPad_6linked___get__(struct __pyx_obj_2av_6filter_3pad_FilterContextPad * __pyx_v_self)2642 static PyObject *__pyx_pf_2av_6filter_3pad_16FilterContextPad_6linked___get__(struct __pyx_obj_2av_6filter_3pad_FilterContextPad *__pyx_v_self) {
2643 struct __pyx_obj_2av_6filter_4link_FilterLink *__pyx_v_link = 0;
2644 PyObject *__pyx_r = NULL;
2645 __Pyx_RefNannyDeclarations
2646 PyObject *__pyx_t_1 = NULL;
2647 int __pyx_t_2;
2648 PyObject *__pyx_t_3 = NULL;
2649 int __pyx_lineno = 0;
2650 const char *__pyx_filename = NULL;
2651 int __pyx_clineno = 0;
2652 __Pyx_RefNannySetupContext("__get__", 0);
2653
2654 /* "av/filter/pad.pyx":68
2655 * property linked:
2656 * def __get__(self):
2657 * cdef FilterLink link = self.link # <<<<<<<<<<<<<<
2658 * if link:
2659 * return link.input if self.is_input else link.output
2660 */
2661 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
2662 __Pyx_GOTREF(__pyx_t_1);
2663 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2av_6filter_4link_FilterLink))))) __PYX_ERR(0, 68, __pyx_L1_error)
2664 __pyx_v_link = ((struct __pyx_obj_2av_6filter_4link_FilterLink *)__pyx_t_1);
2665 __pyx_t_1 = 0;
2666
2667 /* "av/filter/pad.pyx":69
2668 * def __get__(self):
2669 * cdef FilterLink link = self.link
2670 * if link: # <<<<<<<<<<<<<<
2671 * return link.input if self.is_input else link.output
2672 *
2673 */
2674 __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_link)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 69, __pyx_L1_error)
2675 if (__pyx_t_2) {
2676
2677 /* "av/filter/pad.pyx":70
2678 * cdef FilterLink link = self.link
2679 * if link:
2680 * return link.input if self.is_input else link.output # <<<<<<<<<<<<<<
2681 *
2682 *
2683 */
2684 __Pyx_XDECREF(__pyx_r);
2685 if ((__pyx_v_self->__pyx_base.is_input != 0)) {
2686 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_link), __pyx_n_s_input); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
2687 __Pyx_GOTREF(__pyx_t_3);
2688 __pyx_t_1 = __pyx_t_3;
2689 __pyx_t_3 = 0;
2690 } else {
2691 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_link), __pyx_n_s_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
2692 __Pyx_GOTREF(__pyx_t_3);
2693 __pyx_t_1 = __pyx_t_3;
2694 __pyx_t_3 = 0;
2695 }
2696 __pyx_r = __pyx_t_1;
2697 __pyx_t_1 = 0;
2698 goto __pyx_L0;
2699
2700 /* "av/filter/pad.pyx":69
2701 * def __get__(self):
2702 * cdef FilterLink link = self.link
2703 * if link: # <<<<<<<<<<<<<<
2704 * return link.input if self.is_input else link.output
2705 *
2706 */
2707 }
2708
2709 /* "av/filter/pad.pyx":67
2710 *
2711 * property linked:
2712 * def __get__(self): # <<<<<<<<<<<<<<
2713 * cdef FilterLink link = self.link
2714 * if link:
2715 */
2716
2717 /* function exit code */
2718 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2719 goto __pyx_L0;
2720 __pyx_L1_error:;
2721 __Pyx_XDECREF(__pyx_t_1);
2722 __Pyx_XDECREF(__pyx_t_3);
2723 __Pyx_AddTraceback("av.filter.pad.FilterContextPad.linked.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2724 __pyx_r = NULL;
2725 __pyx_L0:;
2726 __Pyx_XDECREF((PyObject *)__pyx_v_link);
2727 __Pyx_XGIVEREF(__pyx_r);
2728 __Pyx_RefNannyFinishContext();
2729 return __pyx_r;
2730 }
2731
2732 /* "(tree fragment)":1
2733 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2734 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2735 * def __setstate_cython__(self, __pyx_state):
2736 */
2737
2738 /* Python wrapper */
2739 static PyObject *__pyx_pw_2av_6filter_3pad_16FilterContextPad_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2740 static char __pyx_doc_2av_6filter_3pad_16FilterContextPad_2__reduce_cython__[] = "FilterContextPad.__reduce_cython__()";
__pyx_pw_2av_6filter_3pad_16FilterContextPad_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)2741 static PyObject *__pyx_pw_2av_6filter_3pad_16FilterContextPad_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2742 PyObject *__pyx_r = 0;
2743 __Pyx_RefNannyDeclarations
2744 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
2745 __pyx_r = __pyx_pf_2av_6filter_3pad_16FilterContextPad_2__reduce_cython__(((struct __pyx_obj_2av_6filter_3pad_FilterContextPad *)__pyx_v_self));
2746
2747 /* function exit code */
2748 __Pyx_RefNannyFinishContext();
2749 return __pyx_r;
2750 }
2751
__pyx_pf_2av_6filter_3pad_16FilterContextPad_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterContextPad * __pyx_v_self)2752 static PyObject *__pyx_pf_2av_6filter_3pad_16FilterContextPad_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterContextPad *__pyx_v_self) {
2753 PyObject *__pyx_r = NULL;
2754 __Pyx_RefNannyDeclarations
2755 PyObject *__pyx_t_1 = NULL;
2756 int __pyx_lineno = 0;
2757 const char *__pyx_filename = NULL;
2758 int __pyx_clineno = 0;
2759 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
2760
2761 /* "(tree fragment)":2
2762 * def __reduce_cython__(self):
2763 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
2764 * def __setstate_cython__(self, __pyx_state):
2765 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2766 */
2767 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
2768 __Pyx_GOTREF(__pyx_t_1);
2769 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2771 __PYX_ERR(1, 2, __pyx_L1_error)
2772
2773 /* "(tree fragment)":1
2774 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2775 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2776 * def __setstate_cython__(self, __pyx_state):
2777 */
2778
2779 /* function exit code */
2780 __pyx_L1_error:;
2781 __Pyx_XDECREF(__pyx_t_1);
2782 __Pyx_AddTraceback("av.filter.pad.FilterContextPad.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2783 __pyx_r = NULL;
2784 __Pyx_XGIVEREF(__pyx_r);
2785 __Pyx_RefNannyFinishContext();
2786 return __pyx_r;
2787 }
2788
2789 /* "(tree fragment)":3
2790 * def __reduce_cython__(self):
2791 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2792 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2793 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2794 */
2795
2796 /* Python wrapper */
2797 static PyObject *__pyx_pw_2av_6filter_3pad_16FilterContextPad_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
2798 static char __pyx_doc_2av_6filter_3pad_16FilterContextPad_4__setstate_cython__[] = "FilterContextPad.__setstate_cython__(__pyx_state)";
__pyx_pw_2av_6filter_3pad_16FilterContextPad_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)2799 static PyObject *__pyx_pw_2av_6filter_3pad_16FilterContextPad_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
2800 PyObject *__pyx_r = 0;
2801 __Pyx_RefNannyDeclarations
2802 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
2803 __pyx_r = __pyx_pf_2av_6filter_3pad_16FilterContextPad_4__setstate_cython__(((struct __pyx_obj_2av_6filter_3pad_FilterContextPad *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
2804
2805 /* function exit code */
2806 __Pyx_RefNannyFinishContext();
2807 return __pyx_r;
2808 }
2809
__pyx_pf_2av_6filter_3pad_16FilterContextPad_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterContextPad * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)2810 static PyObject *__pyx_pf_2av_6filter_3pad_16FilterContextPad_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_6filter_3pad_FilterContextPad *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
2811 PyObject *__pyx_r = NULL;
2812 __Pyx_RefNannyDeclarations
2813 PyObject *__pyx_t_1 = NULL;
2814 int __pyx_lineno = 0;
2815 const char *__pyx_filename = NULL;
2816 int __pyx_clineno = 0;
2817 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
2818
2819 /* "(tree fragment)":4
2820 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2821 * def __setstate_cython__(self, __pyx_state):
2822 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
2823 */
2824 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
2825 __Pyx_GOTREF(__pyx_t_1);
2826 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2827 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2828 __PYX_ERR(1, 4, __pyx_L1_error)
2829
2830 /* "(tree fragment)":3
2831 * def __reduce_cython__(self):
2832 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2833 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2834 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2835 */
2836
2837 /* function exit code */
2838 __pyx_L1_error:;
2839 __Pyx_XDECREF(__pyx_t_1);
2840 __Pyx_AddTraceback("av.filter.pad.FilterContextPad.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2841 __pyx_r = NULL;
2842 __Pyx_XGIVEREF(__pyx_r);
2843 __Pyx_RefNannyFinishContext();
2844 return __pyx_r;
2845 }
2846
2847 /* "av/filter/pad.pyx":73
2848 *
2849 *
2850 * cdef tuple alloc_filter_pads(Filter filter, const lib.AVFilterPad *ptr, bint is_input, FilterContext context=None): # <<<<<<<<<<<<<<
2851 *
2852 * if not ptr:
2853 */
2854
__pyx_f_2av_6filter_3pad_alloc_filter_pads(struct __pyx_obj_2av_6filter_6filter_Filter * __pyx_v_filter,struct AVFilterPad const * __pyx_v_ptr,int __pyx_v_is_input,struct __pyx_opt_args_2av_6filter_3pad_alloc_filter_pads * __pyx_optional_args)2855 static PyObject *__pyx_f_2av_6filter_3pad_alloc_filter_pads(struct __pyx_obj_2av_6filter_6filter_Filter *__pyx_v_filter, struct AVFilterPad const *__pyx_v_ptr, int __pyx_v_is_input, struct __pyx_opt_args_2av_6filter_3pad_alloc_filter_pads *__pyx_optional_args) {
2856 struct __pyx_obj_2av_6filter_7context_FilterContext *__pyx_v_context = ((struct __pyx_obj_2av_6filter_7context_FilterContext *)Py_None);
2857 PyObject *__pyx_v_pads = NULL;
2858 int __pyx_v_i;
2859 int __pyx_v_count;
2860 struct __pyx_obj_2av_6filter_3pad_FilterPad *__pyx_v_pad = 0;
2861 PyObject *__pyx_r = NULL;
2862 __Pyx_RefNannyDeclarations
2863 int __pyx_t_1;
2864 PyObject *__pyx_t_2 = NULL;
2865 unsigned int __pyx_t_3;
2866 unsigned int __pyx_t_4;
2867 int __pyx_t_5;
2868 PyObject *__pyx_t_6 = NULL;
2869 int __pyx_t_7;
2870 int __pyx_lineno = 0;
2871 const char *__pyx_filename = NULL;
2872 int __pyx_clineno = 0;
2873 __Pyx_RefNannySetupContext("alloc_filter_pads", 0);
2874 if (__pyx_optional_args) {
2875 if (__pyx_optional_args->__pyx_n > 0) {
2876 __pyx_v_context = __pyx_optional_args->context;
2877 }
2878 }
2879
2880 /* "av/filter/pad.pyx":75
2881 * cdef tuple alloc_filter_pads(Filter filter, const lib.AVFilterPad *ptr, bint is_input, FilterContext context=None):
2882 *
2883 * if not ptr: # <<<<<<<<<<<<<<
2884 * return ()
2885 *
2886 */
2887 __pyx_t_1 = ((!(__pyx_v_ptr != 0)) != 0);
2888 if (__pyx_t_1) {
2889
2890 /* "av/filter/pad.pyx":76
2891 *
2892 * if not ptr:
2893 * return () # <<<<<<<<<<<<<<
2894 *
2895 * pads = []
2896 */
2897 __Pyx_XDECREF(__pyx_r);
2898 __Pyx_INCREF(__pyx_empty_tuple);
2899 __pyx_r = __pyx_empty_tuple;
2900 goto __pyx_L0;
2901
2902 /* "av/filter/pad.pyx":75
2903 * cdef tuple alloc_filter_pads(Filter filter, const lib.AVFilterPad *ptr, bint is_input, FilterContext context=None):
2904 *
2905 * if not ptr: # <<<<<<<<<<<<<<
2906 * return ()
2907 *
2908 */
2909 }
2910
2911 /* "av/filter/pad.pyx":78
2912 * return ()
2913 *
2914 * pads = [] # <<<<<<<<<<<<<<
2915 *
2916 * # We need to be careful and check our bounds if we know what they are,
2917 */
2918 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)
2919 __Pyx_GOTREF(__pyx_t_2);
2920 __pyx_v_pads = ((PyObject*)__pyx_t_2);
2921 __pyx_t_2 = 0;
2922
2923 /* "av/filter/pad.pyx":82
2924 * # We need to be careful and check our bounds if we know what they are,
2925 * # since the arrays on a AVFilterContext are not NULL terminated.
2926 * cdef int i = 0 # <<<<<<<<<<<<<<
2927 * cdef int count = (context.ptr.nb_inputs if is_input else context.ptr.nb_outputs) if context is not None else -1
2928 *
2929 */
2930 __pyx_v_i = 0;
2931
2932 /* "av/filter/pad.pyx":83
2933 * # since the arrays on a AVFilterContext are not NULL terminated.
2934 * cdef int i = 0
2935 * cdef int count = (context.ptr.nb_inputs if is_input else context.ptr.nb_outputs) if context is not None else -1 # <<<<<<<<<<<<<<
2936 *
2937 * cdef FilterPad pad
2938 */
2939 __pyx_t_1 = (((PyObject *)__pyx_v_context) != Py_None);
2940 if ((__pyx_t_1 != 0)) {
2941 if ((__pyx_v_is_input != 0)) {
2942 __pyx_t_4 = __pyx_v_context->ptr->nb_inputs;
2943 } else {
2944 __pyx_t_4 = __pyx_v_context->ptr->nb_outputs;
2945 }
2946 __pyx_t_3 = __pyx_t_4;
2947 } else {
2948 __pyx_t_3 = -1;
2949 }
2950 __pyx_v_count = __pyx_t_3;
2951
2952 /* "av/filter/pad.pyx":86
2953 *
2954 * cdef FilterPad pad
2955 * while (i < count or count < 0) and lib.avfilter_pad_get_name(ptr, i): # <<<<<<<<<<<<<<
2956 * pad = FilterPad(_cinit_sentinel) if context is None else FilterContextPad(_cinit_sentinel)
2957 * pads.append(pad)
2958 */
2959 while (1) {
2960 __pyx_t_5 = ((__pyx_v_i < __pyx_v_count) != 0);
2961 if (!__pyx_t_5) {
2962 } else {
2963 goto __pyx_L7_next_and;
2964 }
2965 __pyx_t_5 = ((__pyx_v_count < 0) != 0);
2966 if (__pyx_t_5) {
2967 } else {
2968 __pyx_t_1 = __pyx_t_5;
2969 goto __pyx_L6_bool_binop_done;
2970 }
2971 __pyx_L7_next_and:;
2972 __pyx_t_5 = (avfilter_pad_get_name(__pyx_v_ptr, __pyx_v_i) != 0);
2973 __pyx_t_1 = __pyx_t_5;
2974 __pyx_L6_bool_binop_done:;
2975 if (!__pyx_t_1) break;
2976
2977 /* "av/filter/pad.pyx":87
2978 * cdef FilterPad pad
2979 * while (i < count or count < 0) and lib.avfilter_pad_get_name(ptr, i):
2980 * pad = FilterPad(_cinit_sentinel) if context is None else FilterContextPad(_cinit_sentinel) # <<<<<<<<<<<<<<
2981 * pads.append(pad)
2982 * pad.filter = filter
2983 */
2984 __pyx_t_1 = (((PyObject *)__pyx_v_context) == Py_None);
2985 if ((__pyx_t_1 != 0)) {
2986 __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_2av_6filter_3pad_FilterPad), __pyx_v_2av_6filter_3pad__cinit_sentinel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
2987 __Pyx_GOTREF(__pyx_t_6);
2988 __pyx_t_2 = __pyx_t_6;
2989 __pyx_t_6 = 0;
2990 } else {
2991 __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_2av_6filter_3pad_FilterContextPad), __pyx_v_2av_6filter_3pad__cinit_sentinel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
2992 __Pyx_GOTREF(__pyx_t_6);
2993 __pyx_t_2 = __pyx_t_6;
2994 __pyx_t_6 = 0;
2995 }
2996 __Pyx_XDECREF_SET(__pyx_v_pad, ((struct __pyx_obj_2av_6filter_3pad_FilterPad *)__pyx_t_2));
2997 __pyx_t_2 = 0;
2998
2999 /* "av/filter/pad.pyx":88
3000 * while (i < count or count < 0) and lib.avfilter_pad_get_name(ptr, i):
3001 * pad = FilterPad(_cinit_sentinel) if context is None else FilterContextPad(_cinit_sentinel)
3002 * pads.append(pad) # <<<<<<<<<<<<<<
3003 * pad.filter = filter
3004 * pad.context = context
3005 */
3006 __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_pads, ((PyObject *)__pyx_v_pad)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 88, __pyx_L1_error)
3007
3008 /* "av/filter/pad.pyx":89
3009 * pad = FilterPad(_cinit_sentinel) if context is None else FilterContextPad(_cinit_sentinel)
3010 * pads.append(pad)
3011 * pad.filter = filter # <<<<<<<<<<<<<<
3012 * pad.context = context
3013 * pad.is_input = is_input
3014 */
3015 __Pyx_INCREF(((PyObject *)__pyx_v_filter));
3016 __Pyx_GIVEREF(((PyObject *)__pyx_v_filter));
3017 __Pyx_GOTREF(__pyx_v_pad->filter);
3018 __Pyx_DECREF(((PyObject *)__pyx_v_pad->filter));
3019 __pyx_v_pad->filter = __pyx_v_filter;
3020
3021 /* "av/filter/pad.pyx":90
3022 * pads.append(pad)
3023 * pad.filter = filter
3024 * pad.context = context # <<<<<<<<<<<<<<
3025 * pad.is_input = is_input
3026 * pad.base_ptr = ptr
3027 */
3028 __Pyx_INCREF(((PyObject *)__pyx_v_context));
3029 __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
3030 __Pyx_GOTREF(__pyx_v_pad->context);
3031 __Pyx_DECREF(((PyObject *)__pyx_v_pad->context));
3032 __pyx_v_pad->context = __pyx_v_context;
3033
3034 /* "av/filter/pad.pyx":91
3035 * pad.filter = filter
3036 * pad.context = context
3037 * pad.is_input = is_input # <<<<<<<<<<<<<<
3038 * pad.base_ptr = ptr
3039 * pad.index = i
3040 */
3041 __pyx_v_pad->is_input = __pyx_v_is_input;
3042
3043 /* "av/filter/pad.pyx":92
3044 * pad.context = context
3045 * pad.is_input = is_input
3046 * pad.base_ptr = ptr # <<<<<<<<<<<<<<
3047 * pad.index = i
3048 * i += 1
3049 */
3050 __pyx_v_pad->base_ptr = __pyx_v_ptr;
3051
3052 /* "av/filter/pad.pyx":93
3053 * pad.is_input = is_input
3054 * pad.base_ptr = ptr
3055 * pad.index = i # <<<<<<<<<<<<<<
3056 * i += 1
3057 *
3058 */
3059 __pyx_v_pad->index = __pyx_v_i;
3060
3061 /* "av/filter/pad.pyx":94
3062 * pad.base_ptr = ptr
3063 * pad.index = i
3064 * i += 1 # <<<<<<<<<<<<<<
3065 *
3066 * return tuple(pads)
3067 */
3068 __pyx_v_i = (__pyx_v_i + 1);
3069 }
3070
3071 /* "av/filter/pad.pyx":96
3072 * i += 1
3073 *
3074 * return tuple(pads) # <<<<<<<<<<<<<<
3075 */
3076 __Pyx_XDECREF(__pyx_r);
3077 __pyx_t_2 = PyList_AsTuple(__pyx_v_pads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
3078 __Pyx_GOTREF(__pyx_t_2);
3079 __pyx_r = ((PyObject*)__pyx_t_2);
3080 __pyx_t_2 = 0;
3081 goto __pyx_L0;
3082
3083 /* "av/filter/pad.pyx":73
3084 *
3085 *
3086 * cdef tuple alloc_filter_pads(Filter filter, const lib.AVFilterPad *ptr, bint is_input, FilterContext context=None): # <<<<<<<<<<<<<<
3087 *
3088 * if not ptr:
3089 */
3090
3091 /* function exit code */
3092 __pyx_L1_error:;
3093 __Pyx_XDECREF(__pyx_t_2);
3094 __Pyx_XDECREF(__pyx_t_6);
3095 __Pyx_AddTraceback("av.filter.pad.alloc_filter_pads", __pyx_clineno, __pyx_lineno, __pyx_filename);
3096 __pyx_r = 0;
3097 __pyx_L0:;
3098 __Pyx_XDECREF(__pyx_v_pads);
3099 __Pyx_XDECREF((PyObject *)__pyx_v_pad);
3100 __Pyx_XGIVEREF(__pyx_r);
3101 __Pyx_RefNannyFinishContext();
3102 return __pyx_r;
3103 }
3104
__pyx_tp_new_2av_6filter_3pad_FilterPad(PyTypeObject * t,PyObject * a,PyObject * k)3105 static PyObject *__pyx_tp_new_2av_6filter_3pad_FilterPad(PyTypeObject *t, PyObject *a, PyObject *k) {
3106 struct __pyx_obj_2av_6filter_3pad_FilterPad *p;
3107 PyObject *o;
3108 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
3109 o = (*t->tp_alloc)(t, 0);
3110 } else {
3111 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
3112 }
3113 if (unlikely(!o)) return 0;
3114 p = ((struct __pyx_obj_2av_6filter_3pad_FilterPad *)o);
3115 p->filter = ((struct __pyx_obj_2av_6filter_6filter_Filter *)Py_None); Py_INCREF(Py_None);
3116 p->context = ((struct __pyx_obj_2av_6filter_7context_FilterContext *)Py_None); Py_INCREF(Py_None);
3117 if (unlikely(__pyx_pw_2av_6filter_3pad_9FilterPad_1__cinit__(o, a, k) < 0)) goto bad;
3118 return o;
3119 bad:
3120 Py_DECREF(o); o = 0;
3121 return NULL;
3122 }
3123
__pyx_tp_dealloc_2av_6filter_3pad_FilterPad(PyObject * o)3124 static void __pyx_tp_dealloc_2av_6filter_3pad_FilterPad(PyObject *o) {
3125 struct __pyx_obj_2av_6filter_3pad_FilterPad *p = (struct __pyx_obj_2av_6filter_3pad_FilterPad *)o;
3126 #if CYTHON_USE_TP_FINALIZE
3127 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
3128 if (PyObject_CallFinalizerFromDealloc(o)) return;
3129 }
3130 #endif
3131 PyObject_GC_UnTrack(o);
3132 Py_CLEAR(p->filter);
3133 Py_CLEAR(p->context);
3134 (*Py_TYPE(o)->tp_free)(o);
3135 }
3136
__pyx_tp_traverse_2av_6filter_3pad_FilterPad(PyObject * o,visitproc v,void * a)3137 static int __pyx_tp_traverse_2av_6filter_3pad_FilterPad(PyObject *o, visitproc v, void *a) {
3138 int e;
3139 struct __pyx_obj_2av_6filter_3pad_FilterPad *p = (struct __pyx_obj_2av_6filter_3pad_FilterPad *)o;
3140 if (p->filter) {
3141 e = (*v)(((PyObject *)p->filter), a); if (e) return e;
3142 }
3143 if (p->context) {
3144 e = (*v)(((PyObject *)p->context), a); if (e) return e;
3145 }
3146 return 0;
3147 }
3148
__pyx_tp_clear_2av_6filter_3pad_FilterPad(PyObject * o)3149 static int __pyx_tp_clear_2av_6filter_3pad_FilterPad(PyObject *o) {
3150 PyObject* tmp;
3151 struct __pyx_obj_2av_6filter_3pad_FilterPad *p = (struct __pyx_obj_2av_6filter_3pad_FilterPad *)o;
3152 tmp = ((PyObject*)p->filter);
3153 p->filter = ((struct __pyx_obj_2av_6filter_6filter_Filter *)Py_None); Py_INCREF(Py_None);
3154 Py_XDECREF(tmp);
3155 tmp = ((PyObject*)p->context);
3156 p->context = ((struct __pyx_obj_2av_6filter_7context_FilterContext *)Py_None); Py_INCREF(Py_None);
3157 Py_XDECREF(tmp);
3158 return 0;
3159 }
3160
__pyx_getprop_2av_6filter_3pad_9FilterPad_is_output(PyObject * o,CYTHON_UNUSED void * x)3161 static PyObject *__pyx_getprop_2av_6filter_3pad_9FilterPad_is_output(PyObject *o, CYTHON_UNUSED void *x) {
3162 return __pyx_pw_2av_6filter_3pad_9FilterPad_9is_output_1__get__(o);
3163 }
3164
__pyx_getprop_2av_6filter_3pad_9FilterPad_name(PyObject * o,CYTHON_UNUSED void * x)3165 static PyObject *__pyx_getprop_2av_6filter_3pad_9FilterPad_name(PyObject *o, CYTHON_UNUSED void *x) {
3166 return __pyx_pw_2av_6filter_3pad_9FilterPad_4name_1__get__(o);
3167 }
3168
__pyx_getprop_2av_6filter_3pad_9FilterPad_type(PyObject * o,CYTHON_UNUSED void * x)3169 static PyObject *__pyx_getprop_2av_6filter_3pad_9FilterPad_type(PyObject *o, CYTHON_UNUSED void *x) {
3170 return __pyx_pw_2av_6filter_3pad_9FilterPad_4type_1__get__(o);
3171 }
3172
__pyx_getprop_2av_6filter_3pad_9FilterPad_filter(PyObject * o,CYTHON_UNUSED void * x)3173 static PyObject *__pyx_getprop_2av_6filter_3pad_9FilterPad_filter(PyObject *o, CYTHON_UNUSED void *x) {
3174 return __pyx_pw_2av_6filter_3pad_9FilterPad_6filter_1__get__(o);
3175 }
3176
__pyx_getprop_2av_6filter_3pad_9FilterPad_context(PyObject * o,CYTHON_UNUSED void * x)3177 static PyObject *__pyx_getprop_2av_6filter_3pad_9FilterPad_context(PyObject *o, CYTHON_UNUSED void *x) {
3178 return __pyx_pw_2av_6filter_3pad_9FilterPad_7context_1__get__(o);
3179 }
3180
__pyx_getprop_2av_6filter_3pad_9FilterPad_is_input(PyObject * o,CYTHON_UNUSED void * x)3181 static PyObject *__pyx_getprop_2av_6filter_3pad_9FilterPad_is_input(PyObject *o, CYTHON_UNUSED void *x) {
3182 return __pyx_pw_2av_6filter_3pad_9FilterPad_8is_input_1__get__(o);
3183 }
3184
__pyx_getprop_2av_6filter_3pad_9FilterPad_index(PyObject * o,CYTHON_UNUSED void * x)3185 static PyObject *__pyx_getprop_2av_6filter_3pad_9FilterPad_index(PyObject *o, CYTHON_UNUSED void *x) {
3186 return __pyx_pw_2av_6filter_3pad_9FilterPad_5index_1__get__(o);
3187 }
3188
3189 static PyMethodDef __pyx_methods_2av_6filter_3pad_FilterPad[] = {
3190 {"__reduce_cython__", (PyCFunction)__pyx_pw_2av_6filter_3pad_9FilterPad_5__reduce_cython__, METH_NOARGS, __pyx_doc_2av_6filter_3pad_9FilterPad_4__reduce_cython__},
3191 {"__setstate_cython__", (PyCFunction)__pyx_pw_2av_6filter_3pad_9FilterPad_7__setstate_cython__, METH_O, __pyx_doc_2av_6filter_3pad_9FilterPad_6__setstate_cython__},
3192 {0, 0, 0, 0}
3193 };
3194
3195 static struct PyGetSetDef __pyx_getsets_2av_6filter_3pad_FilterPad[] = {
3196 {(char *)"is_output", __pyx_getprop_2av_6filter_3pad_9FilterPad_is_output, 0, (char *)0, 0},
3197 {(char *)"name", __pyx_getprop_2av_6filter_3pad_9FilterPad_name, 0, (char *)0, 0},
3198 {(char *)"type", __pyx_getprop_2av_6filter_3pad_9FilterPad_type, 0, (char *)"\n The media type of this filter pad.\n\n Examples: `'audio'`, `'video'`, `'subtitle'`.\n\n :type: str\n ", 0},
3199 {(char *)"filter", __pyx_getprop_2av_6filter_3pad_9FilterPad_filter, 0, (char *)0, 0},
3200 {(char *)"context", __pyx_getprop_2av_6filter_3pad_9FilterPad_context, 0, (char *)0, 0},
3201 {(char *)"is_input", __pyx_getprop_2av_6filter_3pad_9FilterPad_is_input, 0, (char *)0, 0},
3202 {(char *)"index", __pyx_getprop_2av_6filter_3pad_9FilterPad_index, 0, (char *)0, 0},
3203 {0, 0, 0, 0, 0}
3204 };
3205
3206 static PyTypeObject __pyx_type_2av_6filter_3pad_FilterPad = {
3207 PyVarObject_HEAD_INIT(0, 0)
3208 "av.filter.pad.FilterPad", /*tp_name*/
3209 sizeof(struct __pyx_obj_2av_6filter_3pad_FilterPad), /*tp_basicsize*/
3210 0, /*tp_itemsize*/
3211 __pyx_tp_dealloc_2av_6filter_3pad_FilterPad, /*tp_dealloc*/
3212 #if PY_VERSION_HEX < 0x030800b4
3213 0, /*tp_print*/
3214 #endif
3215 #if PY_VERSION_HEX >= 0x030800b4
3216 0, /*tp_vectorcall_offset*/
3217 #endif
3218 0, /*tp_getattr*/
3219 0, /*tp_setattr*/
3220 #if PY_MAJOR_VERSION < 3
3221 0, /*tp_compare*/
3222 #endif
3223 #if PY_MAJOR_VERSION >= 3
3224 0, /*tp_as_async*/
3225 #endif
3226 __pyx_pw_2av_6filter_3pad_9FilterPad_3__repr__, /*tp_repr*/
3227 0, /*tp_as_number*/
3228 0, /*tp_as_sequence*/
3229 0, /*tp_as_mapping*/
3230 0, /*tp_hash*/
3231 0, /*tp_call*/
3232 0, /*tp_str*/
3233 0, /*tp_getattro*/
3234 0, /*tp_setattro*/
3235 0, /*tp_as_buffer*/
3236 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
3237 0, /*tp_doc*/
3238 __pyx_tp_traverse_2av_6filter_3pad_FilterPad, /*tp_traverse*/
3239 __pyx_tp_clear_2av_6filter_3pad_FilterPad, /*tp_clear*/
3240 0, /*tp_richcompare*/
3241 0, /*tp_weaklistoffset*/
3242 0, /*tp_iter*/
3243 0, /*tp_iternext*/
3244 __pyx_methods_2av_6filter_3pad_FilterPad, /*tp_methods*/
3245 0, /*tp_members*/
3246 __pyx_getsets_2av_6filter_3pad_FilterPad, /*tp_getset*/
3247 0, /*tp_base*/
3248 0, /*tp_dict*/
3249 0, /*tp_descr_get*/
3250 0, /*tp_descr_set*/
3251 0, /*tp_dictoffset*/
3252 0, /*tp_init*/
3253 0, /*tp_alloc*/
3254 __pyx_tp_new_2av_6filter_3pad_FilterPad, /*tp_new*/
3255 0, /*tp_free*/
3256 0, /*tp_is_gc*/
3257 0, /*tp_bases*/
3258 0, /*tp_mro*/
3259 0, /*tp_cache*/
3260 0, /*tp_subclasses*/
3261 0, /*tp_weaklist*/
3262 0, /*tp_del*/
3263 0, /*tp_version_tag*/
3264 #if PY_VERSION_HEX >= 0x030400a1
3265 0, /*tp_finalize*/
3266 #endif
3267 #if PY_VERSION_HEX >= 0x030800b1
3268 0, /*tp_vectorcall*/
3269 #endif
3270 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
3271 0, /*tp_print*/
3272 #endif
3273 };
3274
__pyx_tp_new_2av_6filter_3pad_FilterContextPad(PyTypeObject * t,PyObject * a,PyObject * k)3275 static PyObject *__pyx_tp_new_2av_6filter_3pad_FilterContextPad(PyTypeObject *t, PyObject *a, PyObject *k) {
3276 struct __pyx_obj_2av_6filter_3pad_FilterContextPad *p;
3277 PyObject *o = __pyx_tp_new_2av_6filter_3pad_FilterPad(t, a, k);
3278 if (unlikely(!o)) return 0;
3279 p = ((struct __pyx_obj_2av_6filter_3pad_FilterContextPad *)o);
3280 p->_link = ((struct __pyx_obj_2av_6filter_4link_FilterLink *)Py_None); Py_INCREF(Py_None);
3281 return o;
3282 }
3283
__pyx_tp_dealloc_2av_6filter_3pad_FilterContextPad(PyObject * o)3284 static void __pyx_tp_dealloc_2av_6filter_3pad_FilterContextPad(PyObject *o) {
3285 struct __pyx_obj_2av_6filter_3pad_FilterContextPad *p = (struct __pyx_obj_2av_6filter_3pad_FilterContextPad *)o;
3286 #if CYTHON_USE_TP_FINALIZE
3287 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
3288 if (PyObject_CallFinalizerFromDealloc(o)) return;
3289 }
3290 #endif
3291 PyObject_GC_UnTrack(o);
3292 Py_CLEAR(p->_link);
3293 PyObject_GC_Track(o);
3294 __pyx_tp_dealloc_2av_6filter_3pad_FilterPad(o);
3295 }
3296
__pyx_tp_traverse_2av_6filter_3pad_FilterContextPad(PyObject * o,visitproc v,void * a)3297 static int __pyx_tp_traverse_2av_6filter_3pad_FilterContextPad(PyObject *o, visitproc v, void *a) {
3298 int e;
3299 struct __pyx_obj_2av_6filter_3pad_FilterContextPad *p = (struct __pyx_obj_2av_6filter_3pad_FilterContextPad *)o;
3300 e = __pyx_tp_traverse_2av_6filter_3pad_FilterPad(o, v, a); if (e) return e;
3301 if (p->_link) {
3302 e = (*v)(((PyObject *)p->_link), a); if (e) return e;
3303 }
3304 return 0;
3305 }
3306
__pyx_tp_clear_2av_6filter_3pad_FilterContextPad(PyObject * o)3307 static int __pyx_tp_clear_2av_6filter_3pad_FilterContextPad(PyObject *o) {
3308 PyObject* tmp;
3309 struct __pyx_obj_2av_6filter_3pad_FilterContextPad *p = (struct __pyx_obj_2av_6filter_3pad_FilterContextPad *)o;
3310 __pyx_tp_clear_2av_6filter_3pad_FilterPad(o);
3311 tmp = ((PyObject*)p->_link);
3312 p->_link = ((struct __pyx_obj_2av_6filter_4link_FilterLink *)Py_None); Py_INCREF(Py_None);
3313 Py_XDECREF(tmp);
3314 return 0;
3315 }
3316
__pyx_getprop_2av_6filter_3pad_16FilterContextPad_link(PyObject * o,CYTHON_UNUSED void * x)3317 static PyObject *__pyx_getprop_2av_6filter_3pad_16FilterContextPad_link(PyObject *o, CYTHON_UNUSED void *x) {
3318 return __pyx_pw_2av_6filter_3pad_16FilterContextPad_4link_1__get__(o);
3319 }
3320
__pyx_getprop_2av_6filter_3pad_16FilterContextPad_linked(PyObject * o,CYTHON_UNUSED void * x)3321 static PyObject *__pyx_getprop_2av_6filter_3pad_16FilterContextPad_linked(PyObject *o, CYTHON_UNUSED void *x) {
3322 return __pyx_pw_2av_6filter_3pad_16FilterContextPad_6linked_1__get__(o);
3323 }
3324
3325 static PyMethodDef __pyx_methods_2av_6filter_3pad_FilterContextPad[] = {
3326 {"__reduce_cython__", (PyCFunction)__pyx_pw_2av_6filter_3pad_16FilterContextPad_3__reduce_cython__, METH_NOARGS, __pyx_doc_2av_6filter_3pad_16FilterContextPad_2__reduce_cython__},
3327 {"__setstate_cython__", (PyCFunction)__pyx_pw_2av_6filter_3pad_16FilterContextPad_5__setstate_cython__, METH_O, __pyx_doc_2av_6filter_3pad_16FilterContextPad_4__setstate_cython__},
3328 {0, 0, 0, 0}
3329 };
3330
3331 static struct PyGetSetDef __pyx_getsets_2av_6filter_3pad_FilterContextPad[] = {
3332 {(char *)"link", __pyx_getprop_2av_6filter_3pad_16FilterContextPad_link, 0, (char *)0, 0},
3333 {(char *)"linked", __pyx_getprop_2av_6filter_3pad_16FilterContextPad_linked, 0, (char *)0, 0},
3334 {0, 0, 0, 0, 0}
3335 };
3336
3337 static PyTypeObject __pyx_type_2av_6filter_3pad_FilterContextPad = {
3338 PyVarObject_HEAD_INIT(0, 0)
3339 "av.filter.pad.FilterContextPad", /*tp_name*/
3340 sizeof(struct __pyx_obj_2av_6filter_3pad_FilterContextPad), /*tp_basicsize*/
3341 0, /*tp_itemsize*/
3342 __pyx_tp_dealloc_2av_6filter_3pad_FilterContextPad, /*tp_dealloc*/
3343 #if PY_VERSION_HEX < 0x030800b4
3344 0, /*tp_print*/
3345 #endif
3346 #if PY_VERSION_HEX >= 0x030800b4
3347 0, /*tp_vectorcall_offset*/
3348 #endif
3349 0, /*tp_getattr*/
3350 0, /*tp_setattr*/
3351 #if PY_MAJOR_VERSION < 3
3352 0, /*tp_compare*/
3353 #endif
3354 #if PY_MAJOR_VERSION >= 3
3355 0, /*tp_as_async*/
3356 #endif
3357 __pyx_pw_2av_6filter_3pad_16FilterContextPad_1__repr__, /*tp_repr*/
3358 0, /*tp_as_number*/
3359 0, /*tp_as_sequence*/
3360 0, /*tp_as_mapping*/
3361 0, /*tp_hash*/
3362 0, /*tp_call*/
3363 0, /*tp_str*/
3364 0, /*tp_getattro*/
3365 0, /*tp_setattro*/
3366 0, /*tp_as_buffer*/
3367 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
3368 0, /*tp_doc*/
3369 __pyx_tp_traverse_2av_6filter_3pad_FilterContextPad, /*tp_traverse*/
3370 __pyx_tp_clear_2av_6filter_3pad_FilterContextPad, /*tp_clear*/
3371 0, /*tp_richcompare*/
3372 0, /*tp_weaklistoffset*/
3373 0, /*tp_iter*/
3374 0, /*tp_iternext*/
3375 __pyx_methods_2av_6filter_3pad_FilterContextPad, /*tp_methods*/
3376 0, /*tp_members*/
3377 __pyx_getsets_2av_6filter_3pad_FilterContextPad, /*tp_getset*/
3378 0, /*tp_base*/
3379 0, /*tp_dict*/
3380 0, /*tp_descr_get*/
3381 0, /*tp_descr_set*/
3382 0, /*tp_dictoffset*/
3383 0, /*tp_init*/
3384 0, /*tp_alloc*/
3385 __pyx_tp_new_2av_6filter_3pad_FilterContextPad, /*tp_new*/
3386 0, /*tp_free*/
3387 0, /*tp_is_gc*/
3388 0, /*tp_bases*/
3389 0, /*tp_mro*/
3390 0, /*tp_cache*/
3391 0, /*tp_subclasses*/
3392 0, /*tp_weaklist*/
3393 0, /*tp_del*/
3394 0, /*tp_version_tag*/
3395 #if PY_VERSION_HEX >= 0x030400a1
3396 0, /*tp_finalize*/
3397 #endif
3398 #if PY_VERSION_HEX >= 0x030800b1
3399 0, /*tp_vectorcall*/
3400 #endif
3401 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
3402 0, /*tp_print*/
3403 #endif
3404 };
3405
3406 static PyMethodDef __pyx_methods[] = {
3407 {0, 0, 0, 0}
3408 };
3409
3410 #if PY_MAJOR_VERSION >= 3
3411 #if CYTHON_PEP489_MULTI_PHASE_INIT
3412 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
3413 static int __pyx_pymod_exec_pad(PyObject* module); /*proto*/
3414 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3415 {Py_mod_create, (void*)__pyx_pymod_create},
3416 {Py_mod_exec, (void*)__pyx_pymod_exec_pad},
3417 {0, NULL}
3418 };
3419 #endif
3420
3421 static struct PyModuleDef __pyx_moduledef = {
3422 PyModuleDef_HEAD_INIT,
3423 "pad",
3424 0, /* m_doc */
3425 #if CYTHON_PEP489_MULTI_PHASE_INIT
3426 0, /* m_size */
3427 #else
3428 -1, /* m_size */
3429 #endif
3430 __pyx_methods /* m_methods */,
3431 #if CYTHON_PEP489_MULTI_PHASE_INIT
3432 __pyx_moduledef_slots, /* m_slots */
3433 #else
3434 NULL, /* m_reload */
3435 #endif
3436 NULL, /* m_traverse */
3437 NULL, /* m_clear */
3438 NULL /* m_free */
3439 };
3440 #endif
3441 #ifndef CYTHON_SMALL_CODE
3442 #if defined(__clang__)
3443 #define CYTHON_SMALL_CODE
3444 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3445 #define CYTHON_SMALL_CODE __attribute__((cold))
3446 #else
3447 #define CYTHON_SMALL_CODE
3448 #endif
3449 #endif
3450
3451 static __Pyx_StringTabEntry __pyx_string_tab[] = {
3452 {&__pyx_n_s_FilterContextPad, __pyx_k_FilterContextPad, sizeof(__pyx_k_FilterContextPad), 0, 0, 1, 1},
3453 {&__pyx_n_s_FilterPad, __pyx_k_FilterPad, sizeof(__pyx_k_FilterPad), 0, 0, 1, 1},
3454 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
3455 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
3456 {&__pyx_kp_s_av_FilterContextPad_s_s_d_of_s, __pyx_k_av_FilterContextPad_s_s_d_of_s, sizeof(__pyx_k_av_FilterContextPad_s_s_d_of_s), 0, 0, 1, 0},
3457 {&__pyx_kp_s_av_FilterPad_s_s_d_s_s, __pyx_k_av_FilterPad_s_s_d_s_s, sizeof(__pyx_k_av_FilterPad_s_s_d_s_s), 0, 0, 1, 0},
3458 {&__pyx_kp_s_cannot_construct_FilterPad, __pyx_k_cannot_construct_FilterPad, sizeof(__pyx_k_cannot_construct_FilterPad), 0, 0, 1, 0},
3459 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
3460 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
3461 {&__pyx_n_s_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 0, 1, 1},
3462 {&__pyx_n_s_inputs, __pyx_k_inputs, sizeof(__pyx_k_inputs), 0, 0, 1, 1},
3463 {&__pyx_n_s_link, __pyx_k_link, sizeof(__pyx_k_link), 0, 0, 1, 1},
3464 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
3465 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
3466 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
3467 {&__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},
3468 {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
3469 {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
3470 {&__pyx_n_s_outputs, __pyx_k_outputs, sizeof(__pyx_k_outputs), 0, 0, 1, 1},
3471 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
3472 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
3473 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
3474 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
3475 {&__pyx_n_s_sentinel, __pyx_k_sentinel, sizeof(__pyx_k_sentinel), 0, 0, 1, 1},
3476 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
3477 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
3478 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
3479 {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
3480 {0, 0, 0, 0, 0, 0, 0}
3481 };
__Pyx_InitCachedBuiltins(void)3482 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
3483 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 4, __pyx_L1_error)
3484 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 11, __pyx_L1_error)
3485 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
3486 return 0;
3487 __pyx_L1_error:;
3488 return -1;
3489 }
3490
__Pyx_InitCachedConstants(void)3491 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
3492 __Pyx_RefNannyDeclarations
3493 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
3494
3495 /* "av/filter/pad.pyx":11
3496 * def __cinit__(self, sentinel):
3497 * if sentinel is not _cinit_sentinel:
3498 * raise RuntimeError('cannot construct FilterPad') # <<<<<<<<<<<<<<
3499 *
3500 * def __repr__(self):
3501 */
3502 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_cannot_construct_FilterPad); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 11, __pyx_L1_error)
3503 __Pyx_GOTREF(__pyx_tuple_);
3504 __Pyx_GIVEREF(__pyx_tuple_);
3505
3506 /* "(tree fragment)":2
3507 * def __reduce_cython__(self):
3508 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3509 * def __setstate_cython__(self, __pyx_state):
3510 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3511 */
3512 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error)
3513 __Pyx_GOTREF(__pyx_tuple__2);
3514 __Pyx_GIVEREF(__pyx_tuple__2);
3515
3516 /* "(tree fragment)":4
3517 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3518 * def __setstate_cython__(self, __pyx_state):
3519 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3520 */
3521 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error)
3522 __Pyx_GOTREF(__pyx_tuple__3);
3523 __Pyx_GIVEREF(__pyx_tuple__3);
3524
3525 /* "(tree fragment)":2
3526 * def __reduce_cython__(self):
3527 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3528 * def __setstate_cython__(self, __pyx_state):
3529 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3530 */
3531 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
3532 __Pyx_GOTREF(__pyx_tuple__4);
3533 __Pyx_GIVEREF(__pyx_tuple__4);
3534
3535 /* "(tree fragment)":4
3536 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3537 * def __setstate_cython__(self, __pyx_state):
3538 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3539 */
3540 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
3541 __Pyx_GOTREF(__pyx_tuple__5);
3542 __Pyx_GIVEREF(__pyx_tuple__5);
3543 __Pyx_RefNannyFinishContext();
3544 return 0;
3545 __pyx_L1_error:;
3546 __Pyx_RefNannyFinishContext();
3547 return -1;
3548 }
3549
__Pyx_InitGlobals(void)3550 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
3551 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3552 return 0;
3553 __pyx_L1_error:;
3554 return -1;
3555 }
3556
3557 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
3558 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
3559 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
3560 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
3561 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
3562 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
3563 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
3564
__Pyx_modinit_global_init_code(void)3565 static int __Pyx_modinit_global_init_code(void) {
3566 __Pyx_RefNannyDeclarations
3567 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
3568 /*--- Global init code ---*/
3569 __pyx_v_2av_6filter_3pad__cinit_sentinel = Py_None; Py_INCREF(Py_None);
3570 __Pyx_RefNannyFinishContext();
3571 return 0;
3572 }
3573
__Pyx_modinit_variable_export_code(void)3574 static int __Pyx_modinit_variable_export_code(void) {
3575 __Pyx_RefNannyDeclarations
3576 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
3577 /*--- Variable export code ---*/
3578 __Pyx_RefNannyFinishContext();
3579 return 0;
3580 }
3581
__Pyx_modinit_function_export_code(void)3582 static int __Pyx_modinit_function_export_code(void) {
3583 __Pyx_RefNannyDeclarations
3584 int __pyx_lineno = 0;
3585 const char *__pyx_filename = NULL;
3586 int __pyx_clineno = 0;
3587 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
3588 /*--- Function export code ---*/
3589 if (__Pyx_ExportFunction("alloc_filter_pads", (void (*)(void))__pyx_f_2av_6filter_3pad_alloc_filter_pads, "PyObject *(struct __pyx_obj_2av_6filter_6filter_Filter *, struct AVFilterPad const *, int, struct __pyx_opt_args_2av_6filter_3pad_alloc_filter_pads *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3590 __Pyx_RefNannyFinishContext();
3591 return 0;
3592 __pyx_L1_error:;
3593 __Pyx_RefNannyFinishContext();
3594 return -1;
3595 }
3596
__Pyx_modinit_type_init_code(void)3597 static int __Pyx_modinit_type_init_code(void) {
3598 __Pyx_RefNannyDeclarations
3599 int __pyx_lineno = 0;
3600 const char *__pyx_filename = NULL;
3601 int __pyx_clineno = 0;
3602 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
3603 /*--- Type init code ---*/
3604 if (PyType_Ready(&__pyx_type_2av_6filter_3pad_FilterPad) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
3605 #if PY_VERSION_HEX < 0x030800B1
3606 __pyx_type_2av_6filter_3pad_FilterPad.tp_print = 0;
3607 #endif
3608 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_6filter_3pad_FilterPad.tp_dictoffset && __pyx_type_2av_6filter_3pad_FilterPad.tp_getattro == PyObject_GenericGetAttr)) {
3609 __pyx_type_2av_6filter_3pad_FilterPad.tp_getattro = __Pyx_PyObject_GenericGetAttr;
3610 }
3611 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FilterPad, (PyObject *)&__pyx_type_2av_6filter_3pad_FilterPad) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
3612 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2av_6filter_3pad_FilterPad) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
3613 __pyx_ptype_2av_6filter_3pad_FilterPad = &__pyx_type_2av_6filter_3pad_FilterPad;
3614 __pyx_type_2av_6filter_3pad_FilterContextPad.tp_base = __pyx_ptype_2av_6filter_3pad_FilterPad;
3615 if (PyType_Ready(&__pyx_type_2av_6filter_3pad_FilterContextPad) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
3616 #if PY_VERSION_HEX < 0x030800B1
3617 __pyx_type_2av_6filter_3pad_FilterContextPad.tp_print = 0;
3618 #endif
3619 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_6filter_3pad_FilterContextPad.tp_dictoffset && __pyx_type_2av_6filter_3pad_FilterContextPad.tp_getattro == PyObject_GenericGetAttr)) {
3620 __pyx_type_2av_6filter_3pad_FilterContextPad.tp_getattro = __Pyx_PyObject_GenericGetAttr;
3621 }
3622 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FilterContextPad, (PyObject *)&__pyx_type_2av_6filter_3pad_FilterContextPad) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
3623 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2av_6filter_3pad_FilterContextPad) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
3624 __pyx_ptype_2av_6filter_3pad_FilterContextPad = &__pyx_type_2av_6filter_3pad_FilterContextPad;
3625 __Pyx_RefNannyFinishContext();
3626 return 0;
3627 __pyx_L1_error:;
3628 __Pyx_RefNannyFinishContext();
3629 return -1;
3630 }
3631
__Pyx_modinit_type_import_code(void)3632 static int __Pyx_modinit_type_import_code(void) {
3633 __Pyx_RefNannyDeclarations
3634 PyObject *__pyx_t_1 = NULL;
3635 int __pyx_lineno = 0;
3636 const char *__pyx_filename = NULL;
3637 int __pyx_clineno = 0;
3638 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
3639 /*--- Type import code ---*/
3640 __pyx_t_1 = PyImport_ImportModule("av.descriptor"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error)
3641 __Pyx_GOTREF(__pyx_t_1);
3642 __pyx_ptype_2av_10descriptor_Descriptor = __Pyx_ImportType(__pyx_t_1, "av.descriptor", "Descriptor", sizeof(struct __pyx_obj_2av_10descriptor_Descriptor), __Pyx_ImportType_CheckSize_Warn);
3643 if (!__pyx_ptype_2av_10descriptor_Descriptor) __PYX_ERR(3, 4, __pyx_L1_error)
3644 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3645 __pyx_t_1 = PyImport_ImportModule("av.filter.filter"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
3646 __Pyx_GOTREF(__pyx_t_1);
3647 __pyx_ptype_2av_6filter_6filter_Filter = __Pyx_ImportType(__pyx_t_1, "av.filter.filter", "Filter", sizeof(struct __pyx_obj_2av_6filter_6filter_Filter), __Pyx_ImportType_CheckSize_Warn);
3648 if (!__pyx_ptype_2av_6filter_6filter_Filter) __PYX_ERR(4, 6, __pyx_L1_error)
3649 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3650 __pyx_t_1 = PyImport_ImportModule("av.filter.graph"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 6, __pyx_L1_error)
3651 __Pyx_GOTREF(__pyx_t_1);
3652 __pyx_ptype_2av_6filter_5graph_Graph = __Pyx_ImportType(__pyx_t_1, "av.filter.graph", "Graph", sizeof(struct __pyx_obj_2av_6filter_5graph_Graph), __Pyx_ImportType_CheckSize_Warn);
3653 if (!__pyx_ptype_2av_6filter_5graph_Graph) __PYX_ERR(5, 6, __pyx_L1_error)
3654 __pyx_vtabptr_2av_6filter_5graph_Graph = (struct __pyx_vtabstruct_2av_6filter_5graph_Graph*)__Pyx_GetVtable(__pyx_ptype_2av_6filter_5graph_Graph->tp_dict); if (unlikely(!__pyx_vtabptr_2av_6filter_5graph_Graph)) __PYX_ERR(5, 6, __pyx_L1_error)
3655 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3656 __pyx_t_1 = PyImport_ImportModule("av.filter.context"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 7, __pyx_L1_error)
3657 __Pyx_GOTREF(__pyx_t_1);
3658 __pyx_ptype_2av_6filter_7context_FilterContext = __Pyx_ImportType(__pyx_t_1, "av.filter.context", "FilterContext", sizeof(struct __pyx_obj_2av_6filter_7context_FilterContext), __Pyx_ImportType_CheckSize_Warn);
3659 if (!__pyx_ptype_2av_6filter_7context_FilterContext) __PYX_ERR(6, 7, __pyx_L1_error)
3660 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3661 __pyx_t_1 = PyImport_ImportModule("av.filter.link"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 7, __pyx_L1_error)
3662 __Pyx_GOTREF(__pyx_t_1);
3663 __pyx_ptype_2av_6filter_4link_FilterLink = __Pyx_ImportType(__pyx_t_1, "av.filter.link", "FilterLink", sizeof(struct __pyx_obj_2av_6filter_4link_FilterLink), __Pyx_ImportType_CheckSize_Warn);
3664 if (!__pyx_ptype_2av_6filter_4link_FilterLink) __PYX_ERR(7, 7, __pyx_L1_error)
3665 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3666 __Pyx_RefNannyFinishContext();
3667 return 0;
3668 __pyx_L1_error:;
3669 __Pyx_XDECREF(__pyx_t_1);
3670 __Pyx_RefNannyFinishContext();
3671 return -1;
3672 }
3673
__Pyx_modinit_variable_import_code(void)3674 static int __Pyx_modinit_variable_import_code(void) {
3675 __Pyx_RefNannyDeclarations
3676 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
3677 /*--- Variable import code ---*/
3678 __Pyx_RefNannyFinishContext();
3679 return 0;
3680 }
3681
__Pyx_modinit_function_import_code(void)3682 static int __Pyx_modinit_function_import_code(void) {
3683 __Pyx_RefNannyDeclarations
3684 PyObject *__pyx_t_1 = NULL;
3685 int __pyx_lineno = 0;
3686 const char *__pyx_filename = NULL;
3687 int __pyx_clineno = 0;
3688 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
3689 /*--- Function import code ---*/
3690 __pyx_t_1 = PyImport_ImportModule("av.filter.link"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
3691 __Pyx_GOTREF(__pyx_t_1);
3692 if (__Pyx_ImportFunction(__pyx_t_1, "wrap_filter_link", (void (**)(void))&__pyx_f_2av_6filter_4link_wrap_filter_link, "struct __pyx_obj_2av_6filter_4link_FilterLink *(struct __pyx_obj_2av_6filter_5graph_Graph *, struct AVFilterLink *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3693 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3694 __Pyx_RefNannyFinishContext();
3695 return 0;
3696 __pyx_L1_error:;
3697 __Pyx_XDECREF(__pyx_t_1);
3698 __Pyx_RefNannyFinishContext();
3699 return -1;
3700 }
3701
3702
3703 #ifndef CYTHON_NO_PYINIT_EXPORT
3704 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3705 #elif PY_MAJOR_VERSION < 3
3706 #ifdef __cplusplus
3707 #define __Pyx_PyMODINIT_FUNC extern "C" void
3708 #else
3709 #define __Pyx_PyMODINIT_FUNC void
3710 #endif
3711 #else
3712 #ifdef __cplusplus
3713 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
3714 #else
3715 #define __Pyx_PyMODINIT_FUNC PyObject *
3716 #endif
3717 #endif
3718
3719
3720 #if PY_MAJOR_VERSION < 3
3721 __Pyx_PyMODINIT_FUNC initpad(void) CYTHON_SMALL_CODE; /*proto*/
initpad(void)3722 __Pyx_PyMODINIT_FUNC initpad(void)
3723 #else
3724 __Pyx_PyMODINIT_FUNC PyInit_pad(void) CYTHON_SMALL_CODE; /*proto*/
3725 __Pyx_PyMODINIT_FUNC PyInit_pad(void)
3726 #if CYTHON_PEP489_MULTI_PHASE_INIT
3727 {
3728 return PyModuleDef_Init(&__pyx_moduledef);
3729 }
3730 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
3731 #if PY_VERSION_HEX >= 0x030700A1
3732 static PY_INT64_T main_interpreter_id = -1;
3733 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
3734 if (main_interpreter_id == -1) {
3735 main_interpreter_id = current_id;
3736 return (unlikely(current_id == -1)) ? -1 : 0;
3737 } else if (unlikely(main_interpreter_id != current_id))
3738 #else
3739 static PyInterpreterState *main_interpreter = NULL;
3740 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
3741 if (!main_interpreter) {
3742 main_interpreter = current_interpreter;
3743 } else if (unlikely(main_interpreter != current_interpreter))
3744 #endif
3745 {
3746 PyErr_SetString(
3747 PyExc_ImportError,
3748 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
3749 return -1;
3750 }
3751 return 0;
3752 }
3753 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) {
3754 PyObject *value = PyObject_GetAttrString(spec, from_name);
3755 int result = 0;
3756 if (likely(value)) {
3757 if (allow_none || value != Py_None) {
3758 result = PyDict_SetItemString(moddict, to_name, value);
3759 }
3760 Py_DECREF(value);
3761 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3762 PyErr_Clear();
3763 } else {
3764 result = -1;
3765 }
3766 return result;
3767 }
3768 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
3769 PyObject *module = NULL, *moddict, *modname;
3770 if (__Pyx_check_single_interpreter())
3771 return NULL;
3772 if (__pyx_m)
3773 return __Pyx_NewRef(__pyx_m);
3774 modname = PyObject_GetAttrString(spec, "name");
3775 if (unlikely(!modname)) goto bad;
3776 module = PyModule_NewObject(modname);
3777 Py_DECREF(modname);
3778 if (unlikely(!module)) goto bad;
3779 moddict = PyModule_GetDict(module);
3780 if (unlikely(!moddict)) goto bad;
3781 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
3782 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
3783 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
3784 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
3785 return module;
3786 bad:
3787 Py_XDECREF(module);
3788 return NULL;
3789 }
3790
3791
3792 static CYTHON_SMALL_CODE int __pyx_pymod_exec_pad(PyObject *__pyx_pyinit_module)
3793 #endif
3794 #endif
3795 {
3796 PyObject *__pyx_t_1 = NULL;
3797 int __pyx_lineno = 0;
3798 const char *__pyx_filename = NULL;
3799 int __pyx_clineno = 0;
3800 __Pyx_RefNannyDeclarations
3801 #if CYTHON_PEP489_MULTI_PHASE_INIT
3802 if (__pyx_m) {
3803 if (__pyx_m == __pyx_pyinit_module) return 0;
3804 PyErr_SetString(PyExc_RuntimeError, "Module 'pad' has already been imported. Re-initialisation is not supported.");
3805 return -1;
3806 }
3807 #elif PY_MAJOR_VERSION >= 3
3808 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
3809 #endif
3810 #if CYTHON_REFNANNY
3811 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3812 if (!__Pyx_RefNanny) {
3813 PyErr_Clear();
3814 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3815 if (!__Pyx_RefNanny)
3816 Py_FatalError("failed to import 'refnanny' module");
3817 }
3818 #endif
3819 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_pad(void)", 0);
3820 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3821 #ifdef __Pxy_PyFrame_Initialize_Offsets
3822 __Pxy_PyFrame_Initialize_Offsets();
3823 #endif
3824 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
3825 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
3826 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
3827 #ifdef __Pyx_CyFunction_USED
3828 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3829 #endif
3830 #ifdef __Pyx_FusedFunction_USED
3831 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3832 #endif
3833 #ifdef __Pyx_Coroutine_USED
3834 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3835 #endif
3836 #ifdef __Pyx_Generator_USED
3837 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3838 #endif
3839 #ifdef __Pyx_AsyncGen_USED
3840 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3841 #endif
3842 #ifdef __Pyx_StopAsyncIteration_USED
3843 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3844 #endif
3845 /*--- Library function declarations ---*/
3846 /*--- Threads initialization code ---*/
3847 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
3848 #ifdef WITH_THREAD /* Python build with threading support? */
3849 PyEval_InitThreads();
3850 #endif
3851 #endif
3852 /*--- Module creation code ---*/
3853 #if CYTHON_PEP489_MULTI_PHASE_INIT
3854 __pyx_m = __pyx_pyinit_module;
3855 Py_INCREF(__pyx_m);
3856 #else
3857 #if PY_MAJOR_VERSION < 3
3858 __pyx_m = Py_InitModule4("pad", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
3859 #else
3860 __pyx_m = PyModule_Create(&__pyx_moduledef);
3861 #endif
3862 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3863 #endif
3864 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
3865 Py_INCREF(__pyx_d);
3866 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3867 Py_INCREF(__pyx_b);
3868 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
3869 Py_INCREF(__pyx_cython_runtime);
3870 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3871 /*--- Initialize various global constants etc. ---*/
3872 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3873 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3874 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3875 #endif
3876 if (__pyx_module_is_main_av__filter__pad) {
3877 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3878 }
3879 #if PY_MAJOR_VERSION >= 3
3880 {
3881 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
3882 if (!PyDict_GetItemString(modules, "av.filter.pad")) {
3883 if (unlikely(PyDict_SetItemString(modules, "av.filter.pad", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3884 }
3885 }
3886 #endif
3887 /*--- Builtin init code ---*/
3888 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3889 /*--- Constants init code ---*/
3890 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3891 /*--- Global type/function init code ---*/
3892 (void)__Pyx_modinit_global_init_code();
3893 (void)__Pyx_modinit_variable_export_code();
3894 if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3895 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3896 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3897 (void)__Pyx_modinit_variable_import_code();
3898 if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3899 /*--- Execution code ---*/
3900 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
3901 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3902 #endif
3903
3904 /* "av/filter/pad.pyx":4
3905 *
3906 *
3907 * cdef object _cinit_sentinel = object() # <<<<<<<<<<<<<<
3908 *
3909 *
3910 */
3911 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
3912 __Pyx_GOTREF(__pyx_t_1);
3913 __Pyx_XGOTREF(__pyx_v_2av_6filter_3pad__cinit_sentinel);
3914 __Pyx_DECREF_SET(__pyx_v_2av_6filter_3pad__cinit_sentinel, __pyx_t_1);
3915 __Pyx_GIVEREF(__pyx_t_1);
3916 __pyx_t_1 = 0;
3917
3918 /* "av/filter/pad.pyx":1
3919 * from av.filter.link cimport wrap_filter_link # <<<<<<<<<<<<<<
3920 *
3921 *
3922 */
3923 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
3924 __Pyx_GOTREF(__pyx_t_1);
3925 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3926 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3927
3928 /*--- Wrapped vars code ---*/
3929
3930 goto __pyx_L0;
3931 __pyx_L1_error:;
3932 __Pyx_XDECREF(__pyx_t_1);
3933 if (__pyx_m) {
3934 if (__pyx_d) {
3935 __Pyx_AddTraceback("init av.filter.pad", __pyx_clineno, __pyx_lineno, __pyx_filename);
3936 }
3937 Py_CLEAR(__pyx_m);
3938 } else if (!PyErr_Occurred()) {
3939 PyErr_SetString(PyExc_ImportError, "init av.filter.pad");
3940 }
3941 __pyx_L0:;
3942 __Pyx_RefNannyFinishContext();
3943 #if CYTHON_PEP489_MULTI_PHASE_INIT
3944 return (__pyx_m != NULL) ? 0 : -1;
3945 #elif PY_MAJOR_VERSION >= 3
3946 return __pyx_m;
3947 #else
3948 return;
3949 #endif
3950 }
3951
3952 /* --- Runtime support code --- */
3953 /* Refnanny */
3954 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)3955 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
3956 PyObject *m = NULL, *p = NULL;
3957 void *r = NULL;
3958 m = PyImport_ImportModule(modname);
3959 if (!m) goto end;
3960 p = PyObject_GetAttrString(m, "RefNannyAPI");
3961 if (!p) goto end;
3962 r = PyLong_AsVoidPtr(p);
3963 end:
3964 Py_XDECREF(p);
3965 Py_XDECREF(m);
3966 return (__Pyx_RefNannyAPIStruct *)r;
3967 }
3968 #endif
3969
3970 /* PyObjectGetAttrStr */
3971 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)3972 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
3973 PyTypeObject* tp = Py_TYPE(obj);
3974 if (likely(tp->tp_getattro))
3975 return tp->tp_getattro(obj, attr_name);
3976 #if PY_MAJOR_VERSION < 3
3977 if (likely(tp->tp_getattr))
3978 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
3979 #endif
3980 return PyObject_GetAttr(obj, attr_name);
3981 }
3982 #endif
3983
3984 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)3985 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
3986 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
3987 if (unlikely(!result)) {
3988 PyErr_Format(PyExc_NameError,
3989 #if PY_MAJOR_VERSION >= 3
3990 "name '%U' is not defined", name);
3991 #else
3992 "name '%.200s' is not defined", PyString_AS_STRING(name));
3993 #endif
3994 }
3995 return result;
3996 }
3997
3998 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)3999 static void __Pyx_RaiseDoubleKeywordsError(
4000 const char* func_name,
4001 PyObject* kw_name)
4002 {
4003 PyErr_Format(PyExc_TypeError,
4004 #if PY_MAJOR_VERSION >= 3
4005 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
4006 #else
4007 "%s() got multiple values for keyword argument '%s'", func_name,
4008 PyString_AsString(kw_name));
4009 #endif
4010 }
4011
4012 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)4013 static int __Pyx_ParseOptionalKeywords(
4014 PyObject *kwds,
4015 PyObject **argnames[],
4016 PyObject *kwds2,
4017 PyObject *values[],
4018 Py_ssize_t num_pos_args,
4019 const char* function_name)
4020 {
4021 PyObject *key = 0, *value = 0;
4022 Py_ssize_t pos = 0;
4023 PyObject*** name;
4024 PyObject*** first_kw_arg = argnames + num_pos_args;
4025 while (PyDict_Next(kwds, &pos, &key, &value)) {
4026 name = first_kw_arg;
4027 while (*name && (**name != key)) name++;
4028 if (*name) {
4029 values[name-argnames] = value;
4030 continue;
4031 }
4032 name = first_kw_arg;
4033 #if PY_MAJOR_VERSION < 3
4034 if (likely(PyString_Check(key))) {
4035 while (*name) {
4036 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
4037 && _PyString_Eq(**name, key)) {
4038 values[name-argnames] = value;
4039 break;
4040 }
4041 name++;
4042 }
4043 if (*name) continue;
4044 else {
4045 PyObject*** argname = argnames;
4046 while (argname != first_kw_arg) {
4047 if ((**argname == key) || (
4048 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
4049 && _PyString_Eq(**argname, key))) {
4050 goto arg_passed_twice;
4051 }
4052 argname++;
4053 }
4054 }
4055 } else
4056 #endif
4057 if (likely(PyUnicode_Check(key))) {
4058 while (*name) {
4059 int cmp = (**name == key) ? 0 :
4060 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
4061 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
4062 #endif
4063 PyUnicode_Compare(**name, key);
4064 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
4065 if (cmp == 0) {
4066 values[name-argnames] = value;
4067 break;
4068 }
4069 name++;
4070 }
4071 if (*name) continue;
4072 else {
4073 PyObject*** argname = argnames;
4074 while (argname != first_kw_arg) {
4075 int cmp = (**argname == key) ? 0 :
4076 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
4077 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
4078 #endif
4079 PyUnicode_Compare(**argname, key);
4080 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
4081 if (cmp == 0) goto arg_passed_twice;
4082 argname++;
4083 }
4084 }
4085 } else
4086 goto invalid_keyword_type;
4087 if (kwds2) {
4088 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
4089 } else {
4090 goto invalid_keyword;
4091 }
4092 }
4093 return 0;
4094 arg_passed_twice:
4095 __Pyx_RaiseDoubleKeywordsError(function_name, key);
4096 goto bad;
4097 invalid_keyword_type:
4098 PyErr_Format(PyExc_TypeError,
4099 "%.200s() keywords must be strings", function_name);
4100 goto bad;
4101 invalid_keyword:
4102 PyErr_Format(PyExc_TypeError,
4103 #if PY_MAJOR_VERSION < 3
4104 "%.200s() got an unexpected keyword argument '%.200s'",
4105 function_name, PyString_AsString(key));
4106 #else
4107 "%s() got an unexpected keyword argument '%U'",
4108 function_name, key);
4109 #endif
4110 bad:
4111 return -1;
4112 }
4113
4114 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)4115 static void __Pyx_RaiseArgtupleInvalid(
4116 const char* func_name,
4117 int exact,
4118 Py_ssize_t num_min,
4119 Py_ssize_t num_max,
4120 Py_ssize_t num_found)
4121 {
4122 Py_ssize_t num_expected;
4123 const char *more_or_less;
4124 if (num_found < num_min) {
4125 num_expected = num_min;
4126 more_or_less = "at least";
4127 } else {
4128 num_expected = num_max;
4129 more_or_less = "at most";
4130 }
4131 if (exact) {
4132 more_or_less = "exactly";
4133 }
4134 PyErr_Format(PyExc_TypeError,
4135 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
4136 func_name, more_or_less, num_expected,
4137 (num_expected == 1) ? "" : "s", num_found);
4138 }
4139
4140 /* PyObjectCall */
4141 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)4142 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
4143 PyObject *result;
4144 ternaryfunc call = func->ob_type->tp_call;
4145 if (unlikely(!call))
4146 return PyObject_Call(func, arg, kw);
4147 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
4148 return NULL;
4149 result = (*call)(func, arg, kw);
4150 Py_LeaveRecursiveCall();
4151 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4152 PyErr_SetString(
4153 PyExc_SystemError,
4154 "NULL result without error in PyObject_Call");
4155 }
4156 return result;
4157 }
4158 #endif
4159
4160 /* PyErrFetchRestore */
4161 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)4162 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
4163 PyObject *tmp_type, *tmp_value, *tmp_tb;
4164 tmp_type = tstate->curexc_type;
4165 tmp_value = tstate->curexc_value;
4166 tmp_tb = tstate->curexc_traceback;
4167 tstate->curexc_type = type;
4168 tstate->curexc_value = value;
4169 tstate->curexc_traceback = tb;
4170 Py_XDECREF(tmp_type);
4171 Py_XDECREF(tmp_value);
4172 Py_XDECREF(tmp_tb);
4173 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)4174 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
4175 *type = tstate->curexc_type;
4176 *value = tstate->curexc_value;
4177 *tb = tstate->curexc_traceback;
4178 tstate->curexc_type = 0;
4179 tstate->curexc_value = 0;
4180 tstate->curexc_traceback = 0;
4181 }
4182 #endif
4183
4184 /* RaiseException */
4185 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)4186 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
4187 CYTHON_UNUSED PyObject *cause) {
4188 __Pyx_PyThreadState_declare
4189 Py_XINCREF(type);
4190 if (!value || value == Py_None)
4191 value = NULL;
4192 else
4193 Py_INCREF(value);
4194 if (!tb || tb == Py_None)
4195 tb = NULL;
4196 else {
4197 Py_INCREF(tb);
4198 if (!PyTraceBack_Check(tb)) {
4199 PyErr_SetString(PyExc_TypeError,
4200 "raise: arg 3 must be a traceback or None");
4201 goto raise_error;
4202 }
4203 }
4204 if (PyType_Check(type)) {
4205 #if CYTHON_COMPILING_IN_PYPY
4206 if (!value) {
4207 Py_INCREF(Py_None);
4208 value = Py_None;
4209 }
4210 #endif
4211 PyErr_NormalizeException(&type, &value, &tb);
4212 } else {
4213 if (value) {
4214 PyErr_SetString(PyExc_TypeError,
4215 "instance exception may not have a separate value");
4216 goto raise_error;
4217 }
4218 value = type;
4219 type = (PyObject*) Py_TYPE(type);
4220 Py_INCREF(type);
4221 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
4222 PyErr_SetString(PyExc_TypeError,
4223 "raise: exception class must be a subclass of BaseException");
4224 goto raise_error;
4225 }
4226 }
4227 __Pyx_PyThreadState_assign
4228 __Pyx_ErrRestore(type, value, tb);
4229 return;
4230 raise_error:
4231 Py_XDECREF(value);
4232 Py_XDECREF(type);
4233 Py_XDECREF(tb);
4234 return;
4235 }
4236 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)4237 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
4238 PyObject* owned_instance = NULL;
4239 if (tb == Py_None) {
4240 tb = 0;
4241 } else if (tb && !PyTraceBack_Check(tb)) {
4242 PyErr_SetString(PyExc_TypeError,
4243 "raise: arg 3 must be a traceback or None");
4244 goto bad;
4245 }
4246 if (value == Py_None)
4247 value = 0;
4248 if (PyExceptionInstance_Check(type)) {
4249 if (value) {
4250 PyErr_SetString(PyExc_TypeError,
4251 "instance exception may not have a separate value");
4252 goto bad;
4253 }
4254 value = type;
4255 type = (PyObject*) Py_TYPE(value);
4256 } else if (PyExceptionClass_Check(type)) {
4257 PyObject *instance_class = NULL;
4258 if (value && PyExceptionInstance_Check(value)) {
4259 instance_class = (PyObject*) Py_TYPE(value);
4260 if (instance_class != type) {
4261 int is_subclass = PyObject_IsSubclass(instance_class, type);
4262 if (!is_subclass) {
4263 instance_class = NULL;
4264 } else if (unlikely(is_subclass == -1)) {
4265 goto bad;
4266 } else {
4267 type = instance_class;
4268 }
4269 }
4270 }
4271 if (!instance_class) {
4272 PyObject *args;
4273 if (!value)
4274 args = PyTuple_New(0);
4275 else if (PyTuple_Check(value)) {
4276 Py_INCREF(value);
4277 args = value;
4278 } else
4279 args = PyTuple_Pack(1, value);
4280 if (!args)
4281 goto bad;
4282 owned_instance = PyObject_Call(type, args, NULL);
4283 Py_DECREF(args);
4284 if (!owned_instance)
4285 goto bad;
4286 value = owned_instance;
4287 if (!PyExceptionInstance_Check(value)) {
4288 PyErr_Format(PyExc_TypeError,
4289 "calling %R should have returned an instance of "
4290 "BaseException, not %R",
4291 type, Py_TYPE(value));
4292 goto bad;
4293 }
4294 }
4295 } else {
4296 PyErr_SetString(PyExc_TypeError,
4297 "raise: exception class must be a subclass of BaseException");
4298 goto bad;
4299 }
4300 if (cause) {
4301 PyObject *fixed_cause;
4302 if (cause == Py_None) {
4303 fixed_cause = NULL;
4304 } else if (PyExceptionClass_Check(cause)) {
4305 fixed_cause = PyObject_CallObject(cause, NULL);
4306 if (fixed_cause == NULL)
4307 goto bad;
4308 } else if (PyExceptionInstance_Check(cause)) {
4309 fixed_cause = cause;
4310 Py_INCREF(fixed_cause);
4311 } else {
4312 PyErr_SetString(PyExc_TypeError,
4313 "exception causes must derive from "
4314 "BaseException");
4315 goto bad;
4316 }
4317 PyException_SetCause(value, fixed_cause);
4318 }
4319 PyErr_SetObject(type, value);
4320 if (tb) {
4321 #if CYTHON_COMPILING_IN_PYPY
4322 PyObject *tmp_type, *tmp_value, *tmp_tb;
4323 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
4324 Py_INCREF(tb);
4325 PyErr_Restore(tmp_type, tmp_value, tb);
4326 Py_XDECREF(tmp_tb);
4327 #else
4328 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4329 PyObject* tmp_tb = tstate->curexc_traceback;
4330 if (tb != tmp_tb) {
4331 Py_INCREF(tb);
4332 tstate->curexc_traceback = tb;
4333 Py_XDECREF(tmp_tb);
4334 }
4335 #endif
4336 }
4337 bad:
4338 Py_XDECREF(owned_instance);
4339 return;
4340 }
4341 #endif
4342
4343 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)4344 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
4345 if (unlikely(!type)) {
4346 PyErr_SetString(PyExc_SystemError, "Missing type object");
4347 return 0;
4348 }
4349 if (likely(__Pyx_TypeCheck(obj, type)))
4350 return 1;
4351 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
4352 Py_TYPE(obj)->tp_name, type->tp_name);
4353 return 0;
4354 }
4355
4356 /* PyCFunctionFastCall */
4357 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)4358 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
4359 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
4360 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
4361 PyObject *self = PyCFunction_GET_SELF(func);
4362 int flags = PyCFunction_GET_FLAGS(func);
4363 assert(PyCFunction_Check(func));
4364 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
4365 assert(nargs >= 0);
4366 assert(nargs == 0 || args != NULL);
4367 /* _PyCFunction_FastCallDict() must not be called with an exception set,
4368 because it may clear it (directly or indirectly) and so the
4369 caller loses its exception */
4370 assert(!PyErr_Occurred());
4371 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
4372 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
4373 } else {
4374 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
4375 }
4376 }
4377 #endif
4378
4379 /* PyFunctionFastCall */
4380 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)4381 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
4382 PyObject *globals) {
4383 PyFrameObject *f;
4384 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4385 PyObject **fastlocals;
4386 Py_ssize_t i;
4387 PyObject *result;
4388 assert(globals != NULL);
4389 /* XXX Perhaps we should create a specialized
4390 PyFrame_New() that doesn't take locals, but does
4391 take builtins without sanity checking them.
4392 */
4393 assert(tstate != NULL);
4394 f = PyFrame_New(tstate, co, globals, NULL);
4395 if (f == NULL) {
4396 return NULL;
4397 }
4398 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
4399 for (i = 0; i < na; i++) {
4400 Py_INCREF(*args);
4401 fastlocals[i] = *args++;
4402 }
4403 result = PyEval_EvalFrameEx(f,0);
4404 ++tstate->recursion_depth;
4405 Py_DECREF(f);
4406 --tstate->recursion_depth;
4407 return result;
4408 }
4409 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)4410 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
4411 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
4412 PyObject *globals = PyFunction_GET_GLOBALS(func);
4413 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
4414 PyObject *closure;
4415 #if PY_MAJOR_VERSION >= 3
4416 PyObject *kwdefs;
4417 #endif
4418 PyObject *kwtuple, **k;
4419 PyObject **d;
4420 Py_ssize_t nd;
4421 Py_ssize_t nk;
4422 PyObject *result;
4423 assert(kwargs == NULL || PyDict_Check(kwargs));
4424 nk = kwargs ? PyDict_Size(kwargs) : 0;
4425 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
4426 return NULL;
4427 }
4428 if (
4429 #if PY_MAJOR_VERSION >= 3
4430 co->co_kwonlyargcount == 0 &&
4431 #endif
4432 likely(kwargs == NULL || nk == 0) &&
4433 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
4434 if (argdefs == NULL && co->co_argcount == nargs) {
4435 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
4436 goto done;
4437 }
4438 else if (nargs == 0 && argdefs != NULL
4439 && co->co_argcount == Py_SIZE(argdefs)) {
4440 /* function called with no arguments, but all parameters have
4441 a default value: use default values as arguments .*/
4442 args = &PyTuple_GET_ITEM(argdefs, 0);
4443 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
4444 goto done;
4445 }
4446 }
4447 if (kwargs != NULL) {
4448 Py_ssize_t pos, i;
4449 kwtuple = PyTuple_New(2 * nk);
4450 if (kwtuple == NULL) {
4451 result = NULL;
4452 goto done;
4453 }
4454 k = &PyTuple_GET_ITEM(kwtuple, 0);
4455 pos = i = 0;
4456 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
4457 Py_INCREF(k[i]);
4458 Py_INCREF(k[i+1]);
4459 i += 2;
4460 }
4461 nk = i / 2;
4462 }
4463 else {
4464 kwtuple = NULL;
4465 k = NULL;
4466 }
4467 closure = PyFunction_GET_CLOSURE(func);
4468 #if PY_MAJOR_VERSION >= 3
4469 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
4470 #endif
4471 if (argdefs != NULL) {
4472 d = &PyTuple_GET_ITEM(argdefs, 0);
4473 nd = Py_SIZE(argdefs);
4474 }
4475 else {
4476 d = NULL;
4477 nd = 0;
4478 }
4479 #if PY_MAJOR_VERSION >= 3
4480 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
4481 args, (int)nargs,
4482 k, (int)nk,
4483 d, (int)nd, kwdefs, closure);
4484 #else
4485 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
4486 args, (int)nargs,
4487 k, (int)nk,
4488 d, (int)nd, closure);
4489 #endif
4490 Py_XDECREF(kwtuple);
4491 done:
4492 Py_LeaveRecursiveCall();
4493 return result;
4494 }
4495 #endif
4496 #endif
4497
4498 /* PyObjectCallMethO */
4499 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)4500 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
4501 PyObject *self, *result;
4502 PyCFunction cfunc;
4503 cfunc = PyCFunction_GET_FUNCTION(func);
4504 self = PyCFunction_GET_SELF(func);
4505 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
4506 return NULL;
4507 result = cfunc(self, arg);
4508 Py_LeaveRecursiveCall();
4509 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4510 PyErr_SetString(
4511 PyExc_SystemError,
4512 "NULL result without error in PyObject_Call");
4513 }
4514 return result;
4515 }
4516 #endif
4517
4518 /* PyObjectCallOneArg */
4519 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)4520 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
4521 PyObject *result;
4522 PyObject *args = PyTuple_New(1);
4523 if (unlikely(!args)) return NULL;
4524 Py_INCREF(arg);
4525 PyTuple_SET_ITEM(args, 0, arg);
4526 result = __Pyx_PyObject_Call(func, args, NULL);
4527 Py_DECREF(args);
4528 return result;
4529 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)4530 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
4531 #if CYTHON_FAST_PYCALL
4532 if (PyFunction_Check(func)) {
4533 return __Pyx_PyFunction_FastCall(func, &arg, 1);
4534 }
4535 #endif
4536 if (likely(PyCFunction_Check(func))) {
4537 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
4538 return __Pyx_PyObject_CallMethO(func, arg);
4539 #if CYTHON_FAST_PYCCALL
4540 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
4541 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
4542 #endif
4543 }
4544 }
4545 return __Pyx__PyObject_CallOneArg(func, arg);
4546 }
4547 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)4548 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
4549 PyObject *result;
4550 PyObject *args = PyTuple_Pack(1, arg);
4551 if (unlikely(!args)) return NULL;
4552 result = __Pyx_PyObject_Call(func, args, NULL);
4553 Py_DECREF(args);
4554 return result;
4555 }
4556 #endif
4557
4558 /* PyObject_GenericGetAttrNoDict */
4559 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)4560 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
4561 PyErr_Format(PyExc_AttributeError,
4562 #if PY_MAJOR_VERSION >= 3
4563 "'%.50s' object has no attribute '%U'",
4564 tp->tp_name, attr_name);
4565 #else
4566 "'%.50s' object has no attribute '%.400s'",
4567 tp->tp_name, PyString_AS_STRING(attr_name));
4568 #endif
4569 return NULL;
4570 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)4571 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
4572 PyObject *descr;
4573 PyTypeObject *tp = Py_TYPE(obj);
4574 if (unlikely(!PyString_Check(attr_name))) {
4575 return PyObject_GenericGetAttr(obj, attr_name);
4576 }
4577 assert(!tp->tp_dictoffset);
4578 descr = _PyType_Lookup(tp, attr_name);
4579 if (unlikely(!descr)) {
4580 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
4581 }
4582 Py_INCREF(descr);
4583 #if PY_MAJOR_VERSION < 3
4584 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
4585 #endif
4586 {
4587 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
4588 if (unlikely(f)) {
4589 PyObject *res = f(descr, obj, (PyObject *)tp);
4590 Py_DECREF(descr);
4591 return res;
4592 }
4593 }
4594 return descr;
4595 }
4596 #endif
4597
4598 /* PyObject_GenericGetAttr */
4599 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)4600 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
4601 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
4602 return PyObject_GenericGetAttr(obj, attr_name);
4603 }
4604 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
4605 }
4606 #endif
4607
4608 /* PyErrExceptionMatches */
4609 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)4610 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
4611 Py_ssize_t i, n;
4612 n = PyTuple_GET_SIZE(tuple);
4613 #if PY_MAJOR_VERSION >= 3
4614 for (i=0; i<n; i++) {
4615 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
4616 }
4617 #endif
4618 for (i=0; i<n; i++) {
4619 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
4620 }
4621 return 0;
4622 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)4623 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
4624 PyObject *exc_type = tstate->curexc_type;
4625 if (exc_type == err) return 1;
4626 if (unlikely(!exc_type)) return 0;
4627 if (unlikely(PyTuple_Check(err)))
4628 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
4629 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
4630 }
4631 #endif
4632
4633 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)4634 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
4635 __Pyx_PyThreadState_declare
4636 __Pyx_PyThreadState_assign
4637 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
4638 __Pyx_PyErr_Clear();
4639 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)4640 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
4641 PyObject *result;
4642 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
4643 PyTypeObject* tp = Py_TYPE(obj);
4644 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
4645 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
4646 }
4647 #endif
4648 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
4649 if (unlikely(!result)) {
4650 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
4651 }
4652 return result;
4653 }
4654
4655 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)4656 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
4657 int ret;
4658 PyObject *name_attr;
4659 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
4660 if (likely(name_attr)) {
4661 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
4662 } else {
4663 ret = -1;
4664 }
4665 if (unlikely(ret < 0)) {
4666 PyErr_Clear();
4667 ret = 0;
4668 }
4669 Py_XDECREF(name_attr);
4670 return ret;
4671 }
__Pyx_setup_reduce(PyObject * type_obj)4672 static int __Pyx_setup_reduce(PyObject* type_obj) {
4673 int ret = 0;
4674 PyObject *object_reduce = NULL;
4675 PyObject *object_reduce_ex = NULL;
4676 PyObject *reduce = NULL;
4677 PyObject *reduce_ex = NULL;
4678 PyObject *reduce_cython = NULL;
4679 PyObject *setstate = NULL;
4680 PyObject *setstate_cython = NULL;
4681 #if CYTHON_USE_PYTYPE_LOOKUP
4682 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
4683 #else
4684 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
4685 #endif
4686 #if CYTHON_USE_PYTYPE_LOOKUP
4687 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
4688 #else
4689 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
4690 #endif
4691 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
4692 if (reduce_ex == object_reduce_ex) {
4693 #if CYTHON_USE_PYTYPE_LOOKUP
4694 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
4695 #else
4696 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
4697 #endif
4698 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
4699 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
4700 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
4701 if (likely(reduce_cython)) {
4702 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
4703 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
4704 } else if (reduce == object_reduce || PyErr_Occurred()) {
4705 goto __PYX_BAD;
4706 }
4707 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
4708 if (!setstate) PyErr_Clear();
4709 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
4710 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
4711 if (likely(setstate_cython)) {
4712 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
4713 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
4714 } else if (!setstate || PyErr_Occurred()) {
4715 goto __PYX_BAD;
4716 }
4717 }
4718 PyType_Modified((PyTypeObject*)type_obj);
4719 }
4720 }
4721 goto __PYX_GOOD;
4722 __PYX_BAD:
4723 if (!PyErr_Occurred())
4724 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
4725 ret = -1;
4726 __PYX_GOOD:
4727 #if !CYTHON_USE_PYTYPE_LOOKUP
4728 Py_XDECREF(object_reduce);
4729 Py_XDECREF(object_reduce_ex);
4730 #endif
4731 Py_XDECREF(reduce);
4732 Py_XDECREF(reduce_ex);
4733 Py_XDECREF(reduce_cython);
4734 Py_XDECREF(setstate);
4735 Py_XDECREF(setstate_cython);
4736 return ret;
4737 }
4738
4739 /* TypeImport */
4740 #ifndef __PYX_HAVE_RT_ImportType
4741 #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)4742 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
4743 size_t size, enum __Pyx_ImportType_CheckSize check_size)
4744 {
4745 PyObject *result = 0;
4746 char warning[200];
4747 Py_ssize_t basicsize;
4748 #ifdef Py_LIMITED_API
4749 PyObject *py_basicsize;
4750 #endif
4751 result = PyObject_GetAttrString(module, class_name);
4752 if (!result)
4753 goto bad;
4754 if (!PyType_Check(result)) {
4755 PyErr_Format(PyExc_TypeError,
4756 "%.200s.%.200s is not a type object",
4757 module_name, class_name);
4758 goto bad;
4759 }
4760 #ifndef Py_LIMITED_API
4761 basicsize = ((PyTypeObject *)result)->tp_basicsize;
4762 #else
4763 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
4764 if (!py_basicsize)
4765 goto bad;
4766 basicsize = PyLong_AsSsize_t(py_basicsize);
4767 Py_DECREF(py_basicsize);
4768 py_basicsize = 0;
4769 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
4770 goto bad;
4771 #endif
4772 if ((size_t)basicsize < size) {
4773 PyErr_Format(PyExc_ValueError,
4774 "%.200s.%.200s size changed, may indicate binary incompatibility. "
4775 "Expected %zd from C header, got %zd from PyObject",
4776 module_name, class_name, size, basicsize);
4777 goto bad;
4778 }
4779 if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
4780 PyErr_Format(PyExc_ValueError,
4781 "%.200s.%.200s size changed, may indicate binary incompatibility. "
4782 "Expected %zd from C header, got %zd from PyObject",
4783 module_name, class_name, size, basicsize);
4784 goto bad;
4785 }
4786 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
4787 PyOS_snprintf(warning, sizeof(warning),
4788 "%s.%s size changed, may indicate binary incompatibility. "
4789 "Expected %zd from C header, got %zd from PyObject",
4790 module_name, class_name, size, basicsize);
4791 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
4792 }
4793 return (PyTypeObject *)result;
4794 bad:
4795 Py_XDECREF(result);
4796 return NULL;
4797 }
4798 #endif
4799
4800 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)4801 static void* __Pyx_GetVtable(PyObject *dict) {
4802 void* ptr;
4803 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
4804 if (!ob)
4805 goto bad;
4806 #if PY_VERSION_HEX >= 0x02070000
4807 ptr = PyCapsule_GetPointer(ob, 0);
4808 #else
4809 ptr = PyCObject_AsVoidPtr(ob);
4810 #endif
4811 if (!ptr && !PyErr_Occurred())
4812 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
4813 Py_DECREF(ob);
4814 return ptr;
4815 bad:
4816 Py_XDECREF(ob);
4817 return NULL;
4818 }
4819
4820 /* PyObjectCallNoArg */
4821 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)4822 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
4823 #if CYTHON_FAST_PYCALL
4824 if (PyFunction_Check(func)) {
4825 return __Pyx_PyFunction_FastCall(func, NULL, 0);
4826 }
4827 #endif
4828 #ifdef __Pyx_CyFunction_USED
4829 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
4830 #else
4831 if (likely(PyCFunction_Check(func)))
4832 #endif
4833 {
4834 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
4835 return __Pyx_PyObject_CallMethO(func, NULL);
4836 }
4837 }
4838 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
4839 }
4840 #endif
4841
4842 /* PyDictVersioning */
4843 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)4844 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
4845 PyObject *dict = Py_TYPE(obj)->tp_dict;
4846 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
4847 }
__Pyx_get_object_dict_version(PyObject * obj)4848 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
4849 PyObject **dictptr = NULL;
4850 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
4851 if (offset) {
4852 #if CYTHON_COMPILING_IN_CPYTHON
4853 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
4854 #else
4855 dictptr = _PyObject_GetDictPtr(obj);
4856 #endif
4857 }
4858 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
4859 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)4860 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
4861 PyObject *dict = Py_TYPE(obj)->tp_dict;
4862 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
4863 return 0;
4864 return obj_dict_version == __Pyx_get_object_dict_version(obj);
4865 }
4866 #endif
4867
4868 /* CLineInTraceback */
4869 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)4870 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
4871 PyObject *use_cline;
4872 PyObject *ptype, *pvalue, *ptraceback;
4873 #if CYTHON_COMPILING_IN_CPYTHON
4874 PyObject **cython_runtime_dict;
4875 #endif
4876 if (unlikely(!__pyx_cython_runtime)) {
4877 return c_line;
4878 }
4879 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4880 #if CYTHON_COMPILING_IN_CPYTHON
4881 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
4882 if (likely(cython_runtime_dict)) {
4883 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
4884 use_cline, *cython_runtime_dict,
4885 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
4886 } else
4887 #endif
4888 {
4889 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
4890 if (use_cline_obj) {
4891 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
4892 Py_DECREF(use_cline_obj);
4893 } else {
4894 PyErr_Clear();
4895 use_cline = NULL;
4896 }
4897 }
4898 if (!use_cline) {
4899 c_line = 0;
4900 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
4901 }
4902 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
4903 c_line = 0;
4904 }
4905 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4906 return c_line;
4907 }
4908 #endif
4909
4910 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)4911 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
4912 int start = 0, mid = 0, end = count - 1;
4913 if (end >= 0 && code_line > entries[end].code_line) {
4914 return count;
4915 }
4916 while (start < end) {
4917 mid = start + (end - start) / 2;
4918 if (code_line < entries[mid].code_line) {
4919 end = mid;
4920 } else if (code_line > entries[mid].code_line) {
4921 start = mid + 1;
4922 } else {
4923 return mid;
4924 }
4925 }
4926 if (code_line <= entries[mid].code_line) {
4927 return mid;
4928 } else {
4929 return mid + 1;
4930 }
4931 }
__pyx_find_code_object(int code_line)4932 static PyCodeObject *__pyx_find_code_object(int code_line) {
4933 PyCodeObject* code_object;
4934 int pos;
4935 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
4936 return NULL;
4937 }
4938 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
4939 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
4940 return NULL;
4941 }
4942 code_object = __pyx_code_cache.entries[pos].code_object;
4943 Py_INCREF(code_object);
4944 return code_object;
4945 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)4946 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
4947 int pos, i;
4948 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
4949 if (unlikely(!code_line)) {
4950 return;
4951 }
4952 if (unlikely(!entries)) {
4953 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
4954 if (likely(entries)) {
4955 __pyx_code_cache.entries = entries;
4956 __pyx_code_cache.max_count = 64;
4957 __pyx_code_cache.count = 1;
4958 entries[0].code_line = code_line;
4959 entries[0].code_object = code_object;
4960 Py_INCREF(code_object);
4961 }
4962 return;
4963 }
4964 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
4965 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
4966 PyCodeObject* tmp = entries[pos].code_object;
4967 entries[pos].code_object = code_object;
4968 Py_DECREF(tmp);
4969 return;
4970 }
4971 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
4972 int new_max = __pyx_code_cache.max_count + 64;
4973 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
4974 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
4975 if (unlikely(!entries)) {
4976 return;
4977 }
4978 __pyx_code_cache.entries = entries;
4979 __pyx_code_cache.max_count = new_max;
4980 }
4981 for (i=__pyx_code_cache.count; i>pos; i--) {
4982 entries[i] = entries[i-1];
4983 }
4984 entries[pos].code_line = code_line;
4985 entries[pos].code_object = code_object;
4986 __pyx_code_cache.count++;
4987 Py_INCREF(code_object);
4988 }
4989
4990 /* AddTraceback */
4991 #include "compile.h"
4992 #include "frameobject.h"
4993 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)4994 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
4995 const char *funcname, int c_line,
4996 int py_line, const char *filename) {
4997 PyCodeObject *py_code = 0;
4998 PyObject *py_srcfile = 0;
4999 PyObject *py_funcname = 0;
5000 #if PY_MAJOR_VERSION < 3
5001 py_srcfile = PyString_FromString(filename);
5002 #else
5003 py_srcfile = PyUnicode_FromString(filename);
5004 #endif
5005 if (!py_srcfile) goto bad;
5006 if (c_line) {
5007 #if PY_MAJOR_VERSION < 3
5008 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
5009 #else
5010 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
5011 #endif
5012 }
5013 else {
5014 #if PY_MAJOR_VERSION < 3
5015 py_funcname = PyString_FromString(funcname);
5016 #else
5017 py_funcname = PyUnicode_FromString(funcname);
5018 #endif
5019 }
5020 if (!py_funcname) goto bad;
5021 py_code = __Pyx_PyCode_New(
5022 0,
5023 0,
5024 0,
5025 0,
5026 0,
5027 __pyx_empty_bytes, /*PyObject *code,*/
5028 __pyx_empty_tuple, /*PyObject *consts,*/
5029 __pyx_empty_tuple, /*PyObject *names,*/
5030 __pyx_empty_tuple, /*PyObject *varnames,*/
5031 __pyx_empty_tuple, /*PyObject *freevars,*/
5032 __pyx_empty_tuple, /*PyObject *cellvars,*/
5033 py_srcfile, /*PyObject *filename,*/
5034 py_funcname, /*PyObject *name,*/
5035 py_line,
5036 __pyx_empty_bytes /*PyObject *lnotab*/
5037 );
5038 Py_DECREF(py_srcfile);
5039 Py_DECREF(py_funcname);
5040 return py_code;
5041 bad:
5042 Py_XDECREF(py_srcfile);
5043 Py_XDECREF(py_funcname);
5044 return NULL;
5045 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)5046 static void __Pyx_AddTraceback(const char *funcname, int c_line,
5047 int py_line, const char *filename) {
5048 PyCodeObject *py_code = 0;
5049 PyFrameObject *py_frame = 0;
5050 PyThreadState *tstate = __Pyx_PyThreadState_Current;
5051 if (c_line) {
5052 c_line = __Pyx_CLineForTraceback(tstate, c_line);
5053 }
5054 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
5055 if (!py_code) {
5056 py_code = __Pyx_CreateCodeObjectForTraceback(
5057 funcname, c_line, py_line, filename);
5058 if (!py_code) goto bad;
5059 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
5060 }
5061 py_frame = PyFrame_New(
5062 tstate, /*PyThreadState *tstate,*/
5063 py_code, /*PyCodeObject *code,*/
5064 __pyx_d, /*PyObject *globals,*/
5065 0 /*PyObject *locals*/
5066 );
5067 if (!py_frame) goto bad;
5068 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
5069 PyTraceBack_Here(py_frame);
5070 bad:
5071 Py_XDECREF(py_code);
5072 Py_XDECREF(py_frame);
5073 }
5074
5075 /* CIntToPy */
__Pyx_PyInt_From_int(int value)5076 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
5077 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
5078 const int is_unsigned = neg_one > const_zero;
5079 if (is_unsigned) {
5080 if (sizeof(int) < sizeof(long)) {
5081 return PyInt_FromLong((long) value);
5082 } else if (sizeof(int) <= sizeof(unsigned long)) {
5083 return PyLong_FromUnsignedLong((unsigned long) value);
5084 #ifdef HAVE_LONG_LONG
5085 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
5086 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
5087 #endif
5088 }
5089 } else {
5090 if (sizeof(int) <= sizeof(long)) {
5091 return PyInt_FromLong((long) value);
5092 #ifdef HAVE_LONG_LONG
5093 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
5094 return PyLong_FromLongLong((PY_LONG_LONG) value);
5095 #endif
5096 }
5097 }
5098 {
5099 int one = 1; int little = (int)*(unsigned char *)&one;
5100 unsigned char *bytes = (unsigned char *)&value;
5101 return _PyLong_FromByteArray(bytes, sizeof(int),
5102 little, !is_unsigned);
5103 }
5104 }
5105
5106 /* CIntToPy */
__Pyx_PyInt_From_long(long value)5107 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
5108 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
5109 const int is_unsigned = neg_one > const_zero;
5110 if (is_unsigned) {
5111 if (sizeof(long) < sizeof(long)) {
5112 return PyInt_FromLong((long) value);
5113 } else if (sizeof(long) <= sizeof(unsigned long)) {
5114 return PyLong_FromUnsignedLong((unsigned long) value);
5115 #ifdef HAVE_LONG_LONG
5116 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
5117 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
5118 #endif
5119 }
5120 } else {
5121 if (sizeof(long) <= sizeof(long)) {
5122 return PyInt_FromLong((long) value);
5123 #ifdef HAVE_LONG_LONG
5124 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
5125 return PyLong_FromLongLong((PY_LONG_LONG) value);
5126 #endif
5127 }
5128 }
5129 {
5130 int one = 1; int little = (int)*(unsigned char *)&one;
5131 unsigned char *bytes = (unsigned char *)&value;
5132 return _PyLong_FromByteArray(bytes, sizeof(long),
5133 little, !is_unsigned);
5134 }
5135 }
5136
5137 /* CIntFromPyVerify */
5138 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
5139 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
5140 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
5141 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
5142 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
5143 {\
5144 func_type value = func_value;\
5145 if (sizeof(target_type) < sizeof(func_type)) {\
5146 if (unlikely(value != (func_type) (target_type) value)) {\
5147 func_type zero = 0;\
5148 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
5149 return (target_type) -1;\
5150 if (is_unsigned && unlikely(value < zero))\
5151 goto raise_neg_overflow;\
5152 else\
5153 goto raise_overflow;\
5154 }\
5155 }\
5156 return (target_type) value;\
5157 }
5158
5159 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)5160 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
5161 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
5162 const int is_unsigned = neg_one > const_zero;
5163 #if PY_MAJOR_VERSION < 3
5164 if (likely(PyInt_Check(x))) {
5165 if (sizeof(long) < sizeof(long)) {
5166 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
5167 } else {
5168 long val = PyInt_AS_LONG(x);
5169 if (is_unsigned && unlikely(val < 0)) {
5170 goto raise_neg_overflow;
5171 }
5172 return (long) val;
5173 }
5174 } else
5175 #endif
5176 if (likely(PyLong_Check(x))) {
5177 if (is_unsigned) {
5178 #if CYTHON_USE_PYLONG_INTERNALS
5179 const digit* digits = ((PyLongObject*)x)->ob_digit;
5180 switch (Py_SIZE(x)) {
5181 case 0: return (long) 0;
5182 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
5183 case 2:
5184 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
5185 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5186 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5187 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
5188 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5189 }
5190 }
5191 break;
5192 case 3:
5193 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
5194 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5195 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5196 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
5197 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5198 }
5199 }
5200 break;
5201 case 4:
5202 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
5203 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5204 __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])))
5205 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
5206 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5207 }
5208 }
5209 break;
5210 }
5211 #endif
5212 #if CYTHON_COMPILING_IN_CPYTHON
5213 if (unlikely(Py_SIZE(x) < 0)) {
5214 goto raise_neg_overflow;
5215 }
5216 #else
5217 {
5218 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
5219 if (unlikely(result < 0))
5220 return (long) -1;
5221 if (unlikely(result == 1))
5222 goto raise_neg_overflow;
5223 }
5224 #endif
5225 if (sizeof(long) <= sizeof(unsigned long)) {
5226 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
5227 #ifdef HAVE_LONG_LONG
5228 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
5229 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
5230 #endif
5231 }
5232 } else {
5233 #if CYTHON_USE_PYLONG_INTERNALS
5234 const digit* digits = ((PyLongObject*)x)->ob_digit;
5235 switch (Py_SIZE(x)) {
5236 case 0: return (long) 0;
5237 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
5238 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
5239 case -2:
5240 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
5241 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5242 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5243 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
5244 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5245 }
5246 }
5247 break;
5248 case 2:
5249 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
5250 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5251 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5252 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
5253 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5254 }
5255 }
5256 break;
5257 case -3:
5258 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
5259 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5260 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5261 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
5262 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5263 }
5264 }
5265 break;
5266 case 3:
5267 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
5268 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5269 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5270 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
5271 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5272 }
5273 }
5274 break;
5275 case -4:
5276 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
5277 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5278 __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])))
5279 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
5280 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5281 }
5282 }
5283 break;
5284 case 4:
5285 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
5286 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5287 __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])))
5288 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
5289 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5290 }
5291 }
5292 break;
5293 }
5294 #endif
5295 if (sizeof(long) <= sizeof(long)) {
5296 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
5297 #ifdef HAVE_LONG_LONG
5298 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
5299 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
5300 #endif
5301 }
5302 }
5303 {
5304 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
5305 PyErr_SetString(PyExc_RuntimeError,
5306 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
5307 #else
5308 long val;
5309 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
5310 #if PY_MAJOR_VERSION < 3
5311 if (likely(v) && !PyLong_Check(v)) {
5312 PyObject *tmp = v;
5313 v = PyNumber_Long(tmp);
5314 Py_DECREF(tmp);
5315 }
5316 #endif
5317 if (likely(v)) {
5318 int one = 1; int is_little = (int)*(unsigned char *)&one;
5319 unsigned char *bytes = (unsigned char *)&val;
5320 int ret = _PyLong_AsByteArray((PyLongObject *)v,
5321 bytes, sizeof(val),
5322 is_little, !is_unsigned);
5323 Py_DECREF(v);
5324 if (likely(!ret))
5325 return val;
5326 }
5327 #endif
5328 return (long) -1;
5329 }
5330 } else {
5331 long val;
5332 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
5333 if (!tmp) return (long) -1;
5334 val = __Pyx_PyInt_As_long(tmp);
5335 Py_DECREF(tmp);
5336 return val;
5337 }
5338 raise_overflow:
5339 PyErr_SetString(PyExc_OverflowError,
5340 "value too large to convert to long");
5341 return (long) -1;
5342 raise_neg_overflow:
5343 PyErr_SetString(PyExc_OverflowError,
5344 "can't convert negative value to long");
5345 return (long) -1;
5346 }
5347
5348 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)5349 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
5350 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
5351 const int is_unsigned = neg_one > const_zero;
5352 #if PY_MAJOR_VERSION < 3
5353 if (likely(PyInt_Check(x))) {
5354 if (sizeof(int) < sizeof(long)) {
5355 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
5356 } else {
5357 long val = PyInt_AS_LONG(x);
5358 if (is_unsigned && unlikely(val < 0)) {
5359 goto raise_neg_overflow;
5360 }
5361 return (int) val;
5362 }
5363 } else
5364 #endif
5365 if (likely(PyLong_Check(x))) {
5366 if (is_unsigned) {
5367 #if CYTHON_USE_PYLONG_INTERNALS
5368 const digit* digits = ((PyLongObject*)x)->ob_digit;
5369 switch (Py_SIZE(x)) {
5370 case 0: return (int) 0;
5371 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
5372 case 2:
5373 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
5374 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5375 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5376 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
5377 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
5378 }
5379 }
5380 break;
5381 case 3:
5382 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
5383 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5384 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5385 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
5386 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
5387 }
5388 }
5389 break;
5390 case 4:
5391 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
5392 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5393 __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])))
5394 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
5395 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
5396 }
5397 }
5398 break;
5399 }
5400 #endif
5401 #if CYTHON_COMPILING_IN_CPYTHON
5402 if (unlikely(Py_SIZE(x) < 0)) {
5403 goto raise_neg_overflow;
5404 }
5405 #else
5406 {
5407 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
5408 if (unlikely(result < 0))
5409 return (int) -1;
5410 if (unlikely(result == 1))
5411 goto raise_neg_overflow;
5412 }
5413 #endif
5414 if (sizeof(int) <= sizeof(unsigned long)) {
5415 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
5416 #ifdef HAVE_LONG_LONG
5417 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
5418 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
5419 #endif
5420 }
5421 } else {
5422 #if CYTHON_USE_PYLONG_INTERNALS
5423 const digit* digits = ((PyLongObject*)x)->ob_digit;
5424 switch (Py_SIZE(x)) {
5425 case 0: return (int) 0;
5426 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
5427 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
5428 case -2:
5429 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
5430 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5431 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5432 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5433 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5434 }
5435 }
5436 break;
5437 case 2:
5438 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
5439 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5440 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5441 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5442 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5443 }
5444 }
5445 break;
5446 case -3:
5447 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5448 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5449 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5450 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5451 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5452 }
5453 }
5454 break;
5455 case 3:
5456 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
5457 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5458 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5459 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5460 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5461 }
5462 }
5463 break;
5464 case -4:
5465 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5466 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5467 __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])))
5468 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
5469 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5470 }
5471 }
5472 break;
5473 case 4:
5474 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
5475 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5476 __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])))
5477 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
5478 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5479 }
5480 }
5481 break;
5482 }
5483 #endif
5484 if (sizeof(int) <= sizeof(long)) {
5485 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
5486 #ifdef HAVE_LONG_LONG
5487 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
5488 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
5489 #endif
5490 }
5491 }
5492 {
5493 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
5494 PyErr_SetString(PyExc_RuntimeError,
5495 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
5496 #else
5497 int val;
5498 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
5499 #if PY_MAJOR_VERSION < 3
5500 if (likely(v) && !PyLong_Check(v)) {
5501 PyObject *tmp = v;
5502 v = PyNumber_Long(tmp);
5503 Py_DECREF(tmp);
5504 }
5505 #endif
5506 if (likely(v)) {
5507 int one = 1; int is_little = (int)*(unsigned char *)&one;
5508 unsigned char *bytes = (unsigned char *)&val;
5509 int ret = _PyLong_AsByteArray((PyLongObject *)v,
5510 bytes, sizeof(val),
5511 is_little, !is_unsigned);
5512 Py_DECREF(v);
5513 if (likely(!ret))
5514 return val;
5515 }
5516 #endif
5517 return (int) -1;
5518 }
5519 } else {
5520 int val;
5521 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
5522 if (!tmp) return (int) -1;
5523 val = __Pyx_PyInt_As_int(tmp);
5524 Py_DECREF(tmp);
5525 return val;
5526 }
5527 raise_overflow:
5528 PyErr_SetString(PyExc_OverflowError,
5529 "value too large to convert to int");
5530 return (int) -1;
5531 raise_neg_overflow:
5532 PyErr_SetString(PyExc_OverflowError,
5533 "can't convert negative value to int");
5534 return (int) -1;
5535 }
5536
5537 /* FastTypeChecks */
5538 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)5539 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
5540 while (a) {
5541 a = a->tp_base;
5542 if (a == b)
5543 return 1;
5544 }
5545 return b == &PyBaseObject_Type;
5546 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)5547 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
5548 PyObject *mro;
5549 if (a == b) return 1;
5550 mro = a->tp_mro;
5551 if (likely(mro)) {
5552 Py_ssize_t i, n;
5553 n = PyTuple_GET_SIZE(mro);
5554 for (i = 0; i < n; i++) {
5555 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
5556 return 1;
5557 }
5558 return 0;
5559 }
5560 return __Pyx_InBases(a, b);
5561 }
5562 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)5563 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
5564 PyObject *exception, *value, *tb;
5565 int res;
5566 __Pyx_PyThreadState_declare
5567 __Pyx_PyThreadState_assign
5568 __Pyx_ErrFetch(&exception, &value, &tb);
5569 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
5570 if (unlikely(res == -1)) {
5571 PyErr_WriteUnraisable(err);
5572 res = 0;
5573 }
5574 if (!res) {
5575 res = PyObject_IsSubclass(err, exc_type2);
5576 if (unlikely(res == -1)) {
5577 PyErr_WriteUnraisable(err);
5578 res = 0;
5579 }
5580 }
5581 __Pyx_ErrRestore(exception, value, tb);
5582 return res;
5583 }
5584 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)5585 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
5586 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
5587 if (!res) {
5588 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
5589 }
5590 return res;
5591 }
5592 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)5593 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
5594 Py_ssize_t i, n;
5595 assert(PyExceptionClass_Check(exc_type));
5596 n = PyTuple_GET_SIZE(tuple);
5597 #if PY_MAJOR_VERSION >= 3
5598 for (i=0; i<n; i++) {
5599 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
5600 }
5601 #endif
5602 for (i=0; i<n; i++) {
5603 PyObject *t = PyTuple_GET_ITEM(tuple, i);
5604 #if PY_MAJOR_VERSION < 3
5605 if (likely(exc_type == t)) return 1;
5606 #endif
5607 if (likely(PyExceptionClass_Check(t))) {
5608 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
5609 } else {
5610 }
5611 }
5612 return 0;
5613 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)5614 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
5615 if (likely(err == exc_type)) return 1;
5616 if (likely(PyExceptionClass_Check(err))) {
5617 if (likely(PyExceptionClass_Check(exc_type))) {
5618 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
5619 } else if (likely(PyTuple_Check(exc_type))) {
5620 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
5621 } else {
5622 }
5623 }
5624 return PyErr_GivenExceptionMatches(err, exc_type);
5625 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)5626 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
5627 assert(PyExceptionClass_Check(exc_type1));
5628 assert(PyExceptionClass_Check(exc_type2));
5629 if (likely(err == exc_type1 || err == exc_type2)) return 1;
5630 if (likely(PyExceptionClass_Check(err))) {
5631 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
5632 }
5633 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
5634 }
5635 #endif
5636
5637 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)5638 static int __Pyx_check_binary_version(void) {
5639 char ctversion[4], rtversion[4];
5640 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
5641 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
5642 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
5643 char message[200];
5644 PyOS_snprintf(message, sizeof(message),
5645 "compiletime version %s of module '%.100s' "
5646 "does not match runtime version %s",
5647 ctversion, __Pyx_MODULE_NAME, rtversion);
5648 return PyErr_WarnEx(NULL, message, 1);
5649 }
5650 return 0;
5651 }
5652
5653 /* FunctionExport */
__Pyx_ExportFunction(const char * name,void (* f)(void),const char * sig)5654 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
5655 PyObject *d = 0;
5656 PyObject *cobj = 0;
5657 union {
5658 void (*fp)(void);
5659 void *p;
5660 } tmp;
5661 d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
5662 if (!d) {
5663 PyErr_Clear();
5664 d = PyDict_New();
5665 if (!d)
5666 goto bad;
5667 Py_INCREF(d);
5668 if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
5669 goto bad;
5670 }
5671 tmp.fp = f;
5672 #if PY_VERSION_HEX >= 0x02070000
5673 cobj = PyCapsule_New(tmp.p, sig, 0);
5674 #else
5675 cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
5676 #endif
5677 if (!cobj)
5678 goto bad;
5679 if (PyDict_SetItemString(d, name, cobj) < 0)
5680 goto bad;
5681 Py_DECREF(cobj);
5682 Py_DECREF(d);
5683 return 0;
5684 bad:
5685 Py_XDECREF(cobj);
5686 Py_XDECREF(d);
5687 return -1;
5688 }
5689
5690 /* FunctionImport */
5691 #ifndef __PYX_HAVE_RT_ImportFunction
5692 #define __PYX_HAVE_RT_ImportFunction
__Pyx_ImportFunction(PyObject * module,const char * funcname,void (** f)(void),const char * sig)5693 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
5694 PyObject *d = 0;
5695 PyObject *cobj = 0;
5696 union {
5697 void (*fp)(void);
5698 void *p;
5699 } tmp;
5700 d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
5701 if (!d)
5702 goto bad;
5703 cobj = PyDict_GetItemString(d, funcname);
5704 if (!cobj) {
5705 PyErr_Format(PyExc_ImportError,
5706 "%.200s does not export expected C function %.200s",
5707 PyModule_GetName(module), funcname);
5708 goto bad;
5709 }
5710 #if PY_VERSION_HEX >= 0x02070000
5711 if (!PyCapsule_IsValid(cobj, sig)) {
5712 PyErr_Format(PyExc_TypeError,
5713 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
5714 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
5715 goto bad;
5716 }
5717 tmp.p = PyCapsule_GetPointer(cobj, sig);
5718 #else
5719 {const char *desc, *s1, *s2;
5720 desc = (const char *)PyCObject_GetDesc(cobj);
5721 if (!desc)
5722 goto bad;
5723 s1 = desc; s2 = sig;
5724 while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
5725 if (*s1 != *s2) {
5726 PyErr_Format(PyExc_TypeError,
5727 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
5728 PyModule_GetName(module), funcname, sig, desc);
5729 goto bad;
5730 }
5731 tmp.p = PyCObject_AsVoidPtr(cobj);}
5732 #endif
5733 *f = tmp.fp;
5734 if (!(*f))
5735 goto bad;
5736 Py_DECREF(d);
5737 return 0;
5738 bad:
5739 Py_XDECREF(d);
5740 return -1;
5741 }
5742 #endif
5743
5744 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)5745 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
5746 while (t->p) {
5747 #if PY_MAJOR_VERSION < 3
5748 if (t->is_unicode) {
5749 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
5750 } else if (t->intern) {
5751 *t->p = PyString_InternFromString(t->s);
5752 } else {
5753 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
5754 }
5755 #else
5756 if (t->is_unicode | t->is_str) {
5757 if (t->intern) {
5758 *t->p = PyUnicode_InternFromString(t->s);
5759 } else if (t->encoding) {
5760 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
5761 } else {
5762 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
5763 }
5764 } else {
5765 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
5766 }
5767 #endif
5768 if (!*t->p)
5769 return -1;
5770 if (PyObject_Hash(*t->p) == -1)
5771 return -1;
5772 ++t;
5773 }
5774 return 0;
5775 }
5776
__Pyx_PyUnicode_FromString(const char * c_str)5777 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
5778 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
5779 }
__Pyx_PyObject_AsString(PyObject * o)5780 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
5781 Py_ssize_t ignore;
5782 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
5783 }
5784 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
5785 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)5786 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5787 char* defenc_c;
5788 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5789 if (!defenc) return NULL;
5790 defenc_c = PyBytes_AS_STRING(defenc);
5791 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5792 {
5793 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5794 char* c;
5795 for (c = defenc_c; c < end; c++) {
5796 if ((unsigned char) (*c) >= 128) {
5797 PyUnicode_AsASCIIString(o);
5798 return NULL;
5799 }
5800 }
5801 }
5802 #endif
5803 *length = PyBytes_GET_SIZE(defenc);
5804 return defenc_c;
5805 }
5806 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)5807 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5808 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
5809 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5810 if (likely(PyUnicode_IS_ASCII(o))) {
5811 *length = PyUnicode_GET_LENGTH(o);
5812 return PyUnicode_AsUTF8(o);
5813 } else {
5814 PyUnicode_AsASCIIString(o);
5815 return NULL;
5816 }
5817 #else
5818 return PyUnicode_AsUTF8AndSize(o, length);
5819 #endif
5820 }
5821 #endif
5822 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)5823 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5824 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
5825 if (
5826 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5827 __Pyx_sys_getdefaultencoding_not_ascii &&
5828 #endif
5829 PyUnicode_Check(o)) {
5830 return __Pyx_PyUnicode_AsStringAndSize(o, length);
5831 } else
5832 #endif
5833 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
5834 if (PyByteArray_Check(o)) {
5835 *length = PyByteArray_GET_SIZE(o);
5836 return PyByteArray_AS_STRING(o);
5837 } else
5838 #endif
5839 {
5840 char* result;
5841 int r = PyBytes_AsStringAndSize(o, &result, length);
5842 if (unlikely(r < 0)) {
5843 return NULL;
5844 } else {
5845 return result;
5846 }
5847 }
5848 }
__Pyx_PyObject_IsTrue(PyObject * x)5849 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
5850 int is_true = x == Py_True;
5851 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
5852 else return PyObject_IsTrue(x);
5853 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)5854 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
5855 int retval;
5856 if (unlikely(!x)) return -1;
5857 retval = __Pyx_PyObject_IsTrue(x);
5858 Py_DECREF(x);
5859 return retval;
5860 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)5861 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
5862 #if PY_MAJOR_VERSION >= 3
5863 if (PyLong_Check(result)) {
5864 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
5865 "__int__ returned non-int (type %.200s). "
5866 "The ability to return an instance of a strict subclass of int "
5867 "is deprecated, and may be removed in a future version of Python.",
5868 Py_TYPE(result)->tp_name)) {
5869 Py_DECREF(result);
5870 return NULL;
5871 }
5872 return result;
5873 }
5874 #endif
5875 PyErr_Format(PyExc_TypeError,
5876 "__%.4s__ returned non-%.4s (type %.200s)",
5877 type_name, type_name, Py_TYPE(result)->tp_name);
5878 Py_DECREF(result);
5879 return NULL;
5880 }
__Pyx_PyNumber_IntOrLong(PyObject * x)5881 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
5882 #if CYTHON_USE_TYPE_SLOTS
5883 PyNumberMethods *m;
5884 #endif
5885 const char *name = NULL;
5886 PyObject *res = NULL;
5887 #if PY_MAJOR_VERSION < 3
5888 if (likely(PyInt_Check(x) || PyLong_Check(x)))
5889 #else
5890 if (likely(PyLong_Check(x)))
5891 #endif
5892 return __Pyx_NewRef(x);
5893 #if CYTHON_USE_TYPE_SLOTS
5894 m = Py_TYPE(x)->tp_as_number;
5895 #if PY_MAJOR_VERSION < 3
5896 if (m && m->nb_int) {
5897 name = "int";
5898 res = m->nb_int(x);
5899 }
5900 else if (m && m->nb_long) {
5901 name = "long";
5902 res = m->nb_long(x);
5903 }
5904 #else
5905 if (likely(m && m->nb_int)) {
5906 name = "int";
5907 res = m->nb_int(x);
5908 }
5909 #endif
5910 #else
5911 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
5912 res = PyNumber_Int(x);
5913 }
5914 #endif
5915 if (likely(res)) {
5916 #if PY_MAJOR_VERSION < 3
5917 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
5918 #else
5919 if (unlikely(!PyLong_CheckExact(res))) {
5920 #endif
5921 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
5922 }
5923 }
5924 else if (!PyErr_Occurred()) {
5925 PyErr_SetString(PyExc_TypeError,
5926 "an integer is required");
5927 }
5928 return res;
5929 }
5930 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
5931 Py_ssize_t ival;
5932 PyObject *x;
5933 #if PY_MAJOR_VERSION < 3
5934 if (likely(PyInt_CheckExact(b))) {
5935 if (sizeof(Py_ssize_t) >= sizeof(long))
5936 return PyInt_AS_LONG(b);
5937 else
5938 return PyInt_AsSsize_t(b);
5939 }
5940 #endif
5941 if (likely(PyLong_CheckExact(b))) {
5942 #if CYTHON_USE_PYLONG_INTERNALS
5943 const digit* digits = ((PyLongObject*)b)->ob_digit;
5944 const Py_ssize_t size = Py_SIZE(b);
5945 if (likely(__Pyx_sst_abs(size) <= 1)) {
5946 ival = likely(size) ? digits[0] : 0;
5947 if (size == -1) ival = -ival;
5948 return ival;
5949 } else {
5950 switch (size) {
5951 case 2:
5952 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
5953 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5954 }
5955 break;
5956 case -2:
5957 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
5958 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5959 }
5960 break;
5961 case 3:
5962 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
5963 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5964 }
5965 break;
5966 case -3:
5967 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
5968 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5969 }
5970 break;
5971 case 4:
5972 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
5973 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]));
5974 }
5975 break;
5976 case -4:
5977 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
5978 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]));
5979 }
5980 break;
5981 }
5982 }
5983 #endif
5984 return PyLong_AsSsize_t(b);
5985 }
5986 x = PyNumber_Index(b);
5987 if (!x) return -1;
5988 ival = PyInt_AsSsize_t(x);
5989 Py_DECREF(x);
5990 return ival;
5991 }
5992 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
5993 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
5994 }
5995 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
5996 return PyInt_FromSize_t(ival);
5997 }
5998
5999
6000 #endif /* Py_PYTHON_H */
6001