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 "/opt/hostedtoolcache/Python/3.7.9/x64/include/python3.7m/pythread.h",
9 "/tmp/vendor/include/libavcodec/avcodec.h",
10 "/tmp/vendor/include/libavdevice/avdevice.h",
11 "/tmp/vendor/include/libavfilter/avfilter.h",
12 "/tmp/vendor/include/libavfilter/buffersink.h",
13 "/tmp/vendor/include/libavfilter/buffersrc.h",
14 "/tmp/vendor/include/libavformat/avformat.h",
15 "/tmp/vendor/include/libavutil/audio_fifo.h",
16 "/tmp/vendor/include/libavutil/avutil.h",
17 "/tmp/vendor/include/libavutil/channel_layout.h",
18 "/tmp/vendor/include/libavutil/dict.h",
19 "/tmp/vendor/include/libavutil/error.h",
20 "/tmp/vendor/include/libavutil/frame.h",
21 "/tmp/vendor/include/libavutil/imgutils.h",
22 "/tmp/vendor/include/libavutil/log.h",
23 "/tmp/vendor/include/libavutil/mathematics.h",
24 "/tmp/vendor/include/libavutil/motion_vector.h",
25 "/tmp/vendor/include/libavutil/opt.h",
26 "/tmp/vendor/include/libavutil/pixdesc.h",
27 "/tmp/vendor/include/libavutil/rational.h",
28 "/tmp/vendor/include/libavutil/samplefmt.h",
29 "/tmp/vendor/include/libswresample/swresample.h",
30 "/tmp/vendor/include/libswscale/swscale.h",
31 "build/temp.linux-x86_64-3.7/include/pyav/config.h"
32 ],
33 "include_dirs": [
34 "/tmp/vendor/include",
35 "build/temp.linux-x86_64-3.7/include",
36 "/opt/hostedtoolcache/Python/3.7.9/x64/include/python3.7m",
37 "include"
38 ],
39 "libraries": [
40 "avutil",
41 "avcodec",
42 "avdevice",
43 "swscale",
44 "swresample",
45 "avformat",
46 "avfilter"
47 ],
48 "library_dirs": [
49 "/opt/hostedtoolcache/Python/3.7.9/x64/lib",
50 "/tmp/vendor/lib"
51 ],
52 "name": "av.subtitles.subtitle",
53 "sources": [
54 "av/subtitles/subtitle.pyx"
55 ]
56 },
57 "module_name": "av.subtitles.subtitle"
58 }
59 END: Cython Metadata */
60
61 #define PY_SSIZE_T_CLEAN
62 #include "Python.h"
63 #ifndef Py_PYTHON_H
64 #error Python headers needed to compile C extensions, please install development version of Python.
65 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
66 #error Cython requires Python 2.6+ or Python 3.3+.
67 #else
68 #define CYTHON_ABI "0_29_21"
69 #define CYTHON_HEX_VERSION 0x001D15F0
70 #define CYTHON_FUTURE_DIVISION 0
71 #include <stddef.h>
72 #ifndef offsetof
73 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
74 #endif
75 #if !defined(WIN32) && !defined(MS_WINDOWS)
76 #ifndef __stdcall
77 #define __stdcall
78 #endif
79 #ifndef __cdecl
80 #define __cdecl
81 #endif
82 #ifndef __fastcall
83 #define __fastcall
84 #endif
85 #endif
86 #ifndef DL_IMPORT
87 #define DL_IMPORT(t) t
88 #endif
89 #ifndef DL_EXPORT
90 #define DL_EXPORT(t) t
91 #endif
92 #define __PYX_COMMA ,
93 #ifndef HAVE_LONG_LONG
94 #if PY_VERSION_HEX >= 0x02070000
95 #define HAVE_LONG_LONG
96 #endif
97 #endif
98 #ifndef PY_LONG_LONG
99 #define PY_LONG_LONG LONG_LONG
100 #endif
101 #ifndef Py_HUGE_VAL
102 #define Py_HUGE_VAL HUGE_VAL
103 #endif
104 #ifdef PYPY_VERSION
105 #define CYTHON_COMPILING_IN_PYPY 1
106 #define CYTHON_COMPILING_IN_PYSTON 0
107 #define CYTHON_COMPILING_IN_CPYTHON 0
108 #undef CYTHON_USE_TYPE_SLOTS
109 #define CYTHON_USE_TYPE_SLOTS 0
110 #undef CYTHON_USE_PYTYPE_LOOKUP
111 #define CYTHON_USE_PYTYPE_LOOKUP 0
112 #if PY_VERSION_HEX < 0x03050000
113 #undef CYTHON_USE_ASYNC_SLOTS
114 #define CYTHON_USE_ASYNC_SLOTS 0
115 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
116 #define CYTHON_USE_ASYNC_SLOTS 1
117 #endif
118 #undef CYTHON_USE_PYLIST_INTERNALS
119 #define CYTHON_USE_PYLIST_INTERNALS 0
120 #undef CYTHON_USE_UNICODE_INTERNALS
121 #define CYTHON_USE_UNICODE_INTERNALS 0
122 #undef CYTHON_USE_UNICODE_WRITER
123 #define CYTHON_USE_UNICODE_WRITER 0
124 #undef CYTHON_USE_PYLONG_INTERNALS
125 #define CYTHON_USE_PYLONG_INTERNALS 0
126 #undef CYTHON_AVOID_BORROWED_REFS
127 #define CYTHON_AVOID_BORROWED_REFS 1
128 #undef CYTHON_ASSUME_SAFE_MACROS
129 #define CYTHON_ASSUME_SAFE_MACROS 0
130 #undef CYTHON_UNPACK_METHODS
131 #define CYTHON_UNPACK_METHODS 0
132 #undef CYTHON_FAST_THREAD_STATE
133 #define CYTHON_FAST_THREAD_STATE 0
134 #undef CYTHON_FAST_PYCALL
135 #define CYTHON_FAST_PYCALL 0
136 #undef CYTHON_PEP489_MULTI_PHASE_INIT
137 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
138 #undef CYTHON_USE_TP_FINALIZE
139 #define CYTHON_USE_TP_FINALIZE 0
140 #undef CYTHON_USE_DICT_VERSIONS
141 #define CYTHON_USE_DICT_VERSIONS 0
142 #undef CYTHON_USE_EXC_INFO_STACK
143 #define CYTHON_USE_EXC_INFO_STACK 0
144 #elif defined(PYSTON_VERSION)
145 #define CYTHON_COMPILING_IN_PYPY 0
146 #define CYTHON_COMPILING_IN_PYSTON 1
147 #define CYTHON_COMPILING_IN_CPYTHON 0
148 #ifndef CYTHON_USE_TYPE_SLOTS
149 #define CYTHON_USE_TYPE_SLOTS 1
150 #endif
151 #undef CYTHON_USE_PYTYPE_LOOKUP
152 #define CYTHON_USE_PYTYPE_LOOKUP 0
153 #undef CYTHON_USE_ASYNC_SLOTS
154 #define CYTHON_USE_ASYNC_SLOTS 0
155 #undef CYTHON_USE_PYLIST_INTERNALS
156 #define CYTHON_USE_PYLIST_INTERNALS 0
157 #ifndef CYTHON_USE_UNICODE_INTERNALS
158 #define CYTHON_USE_UNICODE_INTERNALS 1
159 #endif
160 #undef CYTHON_USE_UNICODE_WRITER
161 #define CYTHON_USE_UNICODE_WRITER 0
162 #undef CYTHON_USE_PYLONG_INTERNALS
163 #define CYTHON_USE_PYLONG_INTERNALS 0
164 #ifndef CYTHON_AVOID_BORROWED_REFS
165 #define CYTHON_AVOID_BORROWED_REFS 0
166 #endif
167 #ifndef CYTHON_ASSUME_SAFE_MACROS
168 #define CYTHON_ASSUME_SAFE_MACROS 1
169 #endif
170 #ifndef CYTHON_UNPACK_METHODS
171 #define CYTHON_UNPACK_METHODS 1
172 #endif
173 #undef CYTHON_FAST_THREAD_STATE
174 #define CYTHON_FAST_THREAD_STATE 0
175 #undef CYTHON_FAST_PYCALL
176 #define CYTHON_FAST_PYCALL 0
177 #undef CYTHON_PEP489_MULTI_PHASE_INIT
178 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
179 #undef CYTHON_USE_TP_FINALIZE
180 #define CYTHON_USE_TP_FINALIZE 0
181 #undef CYTHON_USE_DICT_VERSIONS
182 #define CYTHON_USE_DICT_VERSIONS 0
183 #undef CYTHON_USE_EXC_INFO_STACK
184 #define CYTHON_USE_EXC_INFO_STACK 0
185 #else
186 #define CYTHON_COMPILING_IN_PYPY 0
187 #define CYTHON_COMPILING_IN_PYSTON 0
188 #define CYTHON_COMPILING_IN_CPYTHON 1
189 #ifndef CYTHON_USE_TYPE_SLOTS
190 #define CYTHON_USE_TYPE_SLOTS 1
191 #endif
192 #if PY_VERSION_HEX < 0x02070000
193 #undef CYTHON_USE_PYTYPE_LOOKUP
194 #define CYTHON_USE_PYTYPE_LOOKUP 0
195 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
196 #define CYTHON_USE_PYTYPE_LOOKUP 1
197 #endif
198 #if PY_MAJOR_VERSION < 3
199 #undef CYTHON_USE_ASYNC_SLOTS
200 #define CYTHON_USE_ASYNC_SLOTS 0
201 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
202 #define CYTHON_USE_ASYNC_SLOTS 1
203 #endif
204 #if PY_VERSION_HEX < 0x02070000
205 #undef CYTHON_USE_PYLONG_INTERNALS
206 #define CYTHON_USE_PYLONG_INTERNALS 0
207 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
208 #define CYTHON_USE_PYLONG_INTERNALS 1
209 #endif
210 #ifndef CYTHON_USE_PYLIST_INTERNALS
211 #define CYTHON_USE_PYLIST_INTERNALS 1
212 #endif
213 #ifndef CYTHON_USE_UNICODE_INTERNALS
214 #define CYTHON_USE_UNICODE_INTERNALS 1
215 #endif
216 #if PY_VERSION_HEX < 0x030300F0
217 #undef CYTHON_USE_UNICODE_WRITER
218 #define CYTHON_USE_UNICODE_WRITER 0
219 #elif !defined(CYTHON_USE_UNICODE_WRITER)
220 #define CYTHON_USE_UNICODE_WRITER 1
221 #endif
222 #ifndef CYTHON_AVOID_BORROWED_REFS
223 #define CYTHON_AVOID_BORROWED_REFS 0
224 #endif
225 #ifndef CYTHON_ASSUME_SAFE_MACROS
226 #define CYTHON_ASSUME_SAFE_MACROS 1
227 #endif
228 #ifndef CYTHON_UNPACK_METHODS
229 #define CYTHON_UNPACK_METHODS 1
230 #endif
231 #ifndef CYTHON_FAST_THREAD_STATE
232 #define CYTHON_FAST_THREAD_STATE 1
233 #endif
234 #ifndef CYTHON_FAST_PYCALL
235 #define CYTHON_FAST_PYCALL 1
236 #endif
237 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
238 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
239 #endif
240 #ifndef CYTHON_USE_TP_FINALIZE
241 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
242 #endif
243 #ifndef CYTHON_USE_DICT_VERSIONS
244 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
245 #endif
246 #ifndef CYTHON_USE_EXC_INFO_STACK
247 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
248 #endif
249 #endif
250 #if !defined(CYTHON_FAST_PYCCALL)
251 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
252 #endif
253 #if CYTHON_USE_PYLONG_INTERNALS
254 #include "longintrepr.h"
255 #undef SHIFT
256 #undef BASE
257 #undef MASK
258 #ifdef SIZEOF_VOID_P
259 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
260 #endif
261 #endif
262 #ifndef __has_attribute
263 #define __has_attribute(x) 0
264 #endif
265 #ifndef __has_cpp_attribute
266 #define __has_cpp_attribute(x) 0
267 #endif
268 #ifndef CYTHON_RESTRICT
269 #if defined(__GNUC__)
270 #define CYTHON_RESTRICT __restrict__
271 #elif defined(_MSC_VER) && _MSC_VER >= 1400
272 #define CYTHON_RESTRICT __restrict
273 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
274 #define CYTHON_RESTRICT restrict
275 #else
276 #define CYTHON_RESTRICT
277 #endif
278 #endif
279 #ifndef CYTHON_UNUSED
280 # if defined(__GNUC__)
281 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
282 # define CYTHON_UNUSED __attribute__ ((__unused__))
283 # else
284 # define CYTHON_UNUSED
285 # endif
286 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
287 # define CYTHON_UNUSED __attribute__ ((__unused__))
288 # else
289 # define CYTHON_UNUSED
290 # endif
291 #endif
292 #ifndef CYTHON_MAYBE_UNUSED_VAR
293 # if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)294 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
295 # else
296 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
297 # endif
298 #endif
299 #ifndef CYTHON_NCP_UNUSED
300 # if CYTHON_COMPILING_IN_CPYTHON
301 # define CYTHON_NCP_UNUSED
302 # else
303 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
304 # endif
305 #endif
306 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
307 #ifdef _MSC_VER
308 #ifndef _MSC_STDINT_H_
309 #if _MSC_VER < 1300
310 typedef unsigned char uint8_t;
311 typedef unsigned int uint32_t;
312 #else
313 typedef unsigned __int8 uint8_t;
314 typedef unsigned __int32 uint32_t;
315 #endif
316 #endif
317 #else
318 #include <stdint.h>
319 #endif
320 #ifndef CYTHON_FALLTHROUGH
321 #if defined(__cplusplus) && __cplusplus >= 201103L
322 #if __has_cpp_attribute(fallthrough)
323 #define CYTHON_FALLTHROUGH [[fallthrough]]
324 #elif __has_cpp_attribute(clang::fallthrough)
325 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
326 #elif __has_cpp_attribute(gnu::fallthrough)
327 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
328 #endif
329 #endif
330 #ifndef CYTHON_FALLTHROUGH
331 #if __has_attribute(fallthrough)
332 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
333 #else
334 #define CYTHON_FALLTHROUGH
335 #endif
336 #endif
337 #if defined(__clang__ ) && defined(__apple_build_version__)
338 #if __apple_build_version__ < 7000000
339 #undef CYTHON_FALLTHROUGH
340 #define CYTHON_FALLTHROUGH
341 #endif
342 #endif
343 #endif
344
345 #ifndef CYTHON_INLINE
346 #if defined(__clang__)
347 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
348 #elif defined(__GNUC__)
349 #define CYTHON_INLINE __inline__
350 #elif defined(_MSC_VER)
351 #define CYTHON_INLINE __inline
352 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
353 #define CYTHON_INLINE inline
354 #else
355 #define CYTHON_INLINE
356 #endif
357 #endif
358
359 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
360 #define Py_OptimizeFlag 0
361 #endif
362 #define __PYX_BUILD_PY_SSIZE_T "n"
363 #define CYTHON_FORMAT_SSIZE_T "z"
364 #if PY_MAJOR_VERSION < 3
365 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
366 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
367 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
368 #define __Pyx_DefaultClassType PyClass_Type
369 #else
370 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
371 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
372 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
373 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
374 #else
375 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
376 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
377 #endif
378 #define __Pyx_DefaultClassType PyType_Type
379 #endif
380 #ifndef Py_TPFLAGS_CHECKTYPES
381 #define Py_TPFLAGS_CHECKTYPES 0
382 #endif
383 #ifndef Py_TPFLAGS_HAVE_INDEX
384 #define Py_TPFLAGS_HAVE_INDEX 0
385 #endif
386 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
387 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
388 #endif
389 #ifndef Py_TPFLAGS_HAVE_FINALIZE
390 #define Py_TPFLAGS_HAVE_FINALIZE 0
391 #endif
392 #ifndef METH_STACKLESS
393 #define METH_STACKLESS 0
394 #endif
395 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
396 #ifndef METH_FASTCALL
397 #define METH_FASTCALL 0x80
398 #endif
399 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
400 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
401 Py_ssize_t nargs, PyObject *kwnames);
402 #else
403 #define __Pyx_PyCFunctionFast _PyCFunctionFast
404 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
405 #endif
406 #if CYTHON_FAST_PYCCALL
407 #define __Pyx_PyFastCFunction_Check(func)\
408 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
409 #else
410 #define __Pyx_PyFastCFunction_Check(func) 0
411 #endif
412 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
413 #define PyObject_Malloc(s) PyMem_Malloc(s)
414 #define PyObject_Free(p) PyMem_Free(p)
415 #define PyObject_Realloc(p) PyMem_Realloc(p)
416 #endif
417 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
418 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
419 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
420 #define PyMem_RawFree(p) PyMem_Free(p)
421 #endif
422 #if CYTHON_COMPILING_IN_PYSTON
423 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
424 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
425 #else
426 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
427 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
428 #endif
429 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
430 #define __Pyx_PyThreadState_Current PyThreadState_GET()
431 #elif PY_VERSION_HEX >= 0x03060000
432 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
433 #elif PY_VERSION_HEX >= 0x03000000
434 #define __Pyx_PyThreadState_Current PyThreadState_GET()
435 #else
436 #define __Pyx_PyThreadState_Current _PyThreadState_Current
437 #endif
438 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
439 #include "pythread.h"
440 #define Py_tss_NEEDS_INIT 0
441 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)442 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
443 *key = PyThread_create_key();
444 return 0;
445 }
PyThread_tss_alloc(void)446 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
447 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
448 *key = Py_tss_NEEDS_INIT;
449 return key;
450 }
PyThread_tss_free(Py_tss_t * key)451 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
452 PyObject_Free(key);
453 }
PyThread_tss_is_created(Py_tss_t * key)454 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
455 return *key != Py_tss_NEEDS_INIT;
456 }
PyThread_tss_delete(Py_tss_t * key)457 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
458 PyThread_delete_key(*key);
459 *key = Py_tss_NEEDS_INIT;
460 }
PyThread_tss_set(Py_tss_t * key,void * value)461 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
462 return PyThread_set_key_value(*key, value);
463 }
PyThread_tss_get(Py_tss_t * key)464 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
465 return PyThread_get_key_value(*key);
466 }
467 #endif
468 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
469 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
470 #else
471 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
472 #endif
473 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
474 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
475 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
476 #else
477 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
478 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
479 #endif
480 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
481 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
482 #else
483 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
484 #endif
485 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
486 #define CYTHON_PEP393_ENABLED 1
487 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
488 0 : _PyUnicode_Ready((PyObject *)(op)))
489 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
490 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
491 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
492 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
493 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
494 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
495 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
496 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
497 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
498 #else
499 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
500 #endif
501 #else
502 #define CYTHON_PEP393_ENABLED 0
503 #define PyUnicode_1BYTE_KIND 1
504 #define PyUnicode_2BYTE_KIND 2
505 #define PyUnicode_4BYTE_KIND 4
506 #define __Pyx_PyUnicode_READY(op) (0)
507 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
508 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
509 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
510 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
511 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
512 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
513 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
514 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
515 #endif
516 #if CYTHON_COMPILING_IN_PYPY
517 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
518 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
519 #else
520 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
521 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
522 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
523 #endif
524 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
525 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
526 #endif
527 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
528 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
529 #endif
530 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
531 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
532 #endif
533 #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))
534 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
535 #if PY_MAJOR_VERSION >= 3
536 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
537 #else
538 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
539 #endif
540 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
541 #define PyObject_ASCII(o) PyObject_Repr(o)
542 #endif
543 #if PY_MAJOR_VERSION >= 3
544 #define PyBaseString_Type PyUnicode_Type
545 #define PyStringObject PyUnicodeObject
546 #define PyString_Type PyUnicode_Type
547 #define PyString_Check PyUnicode_Check
548 #define PyString_CheckExact PyUnicode_CheckExact
549 #ifndef PyObject_Unicode
550 #define PyObject_Unicode PyObject_Str
551 #endif
552 #endif
553 #if PY_MAJOR_VERSION >= 3
554 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
555 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
556 #else
557 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
558 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
559 #endif
560 #ifndef PySet_CheckExact
561 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
562 #endif
563 #if PY_VERSION_HEX >= 0x030900A4
564 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
565 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
566 #else
567 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
568 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
569 #endif
570 #if CYTHON_ASSUME_SAFE_MACROS
571 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
572 #else
573 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
574 #endif
575 #if PY_MAJOR_VERSION >= 3
576 #define PyIntObject PyLongObject
577 #define PyInt_Type PyLong_Type
578 #define PyInt_Check(op) PyLong_Check(op)
579 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
580 #define PyInt_FromString PyLong_FromString
581 #define PyInt_FromUnicode PyLong_FromUnicode
582 #define PyInt_FromLong PyLong_FromLong
583 #define PyInt_FromSize_t PyLong_FromSize_t
584 #define PyInt_FromSsize_t PyLong_FromSsize_t
585 #define PyInt_AsLong PyLong_AsLong
586 #define PyInt_AS_LONG PyLong_AS_LONG
587 #define PyInt_AsSsize_t PyLong_AsSsize_t
588 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
589 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
590 #define PyNumber_Int PyNumber_Long
591 #endif
592 #if PY_MAJOR_VERSION >= 3
593 #define PyBoolObject PyLongObject
594 #endif
595 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
596 #ifndef PyUnicode_InternFromString
597 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
598 #endif
599 #endif
600 #if PY_VERSION_HEX < 0x030200A4
601 typedef long Py_hash_t;
602 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
603 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
604 #else
605 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
606 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
607 #endif
608 #if PY_MAJOR_VERSION >= 3
609 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
610 #else
611 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
612 #endif
613 #if CYTHON_USE_ASYNC_SLOTS
614 #if PY_VERSION_HEX >= 0x030500B1
615 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
616 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
617 #else
618 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
619 #endif
620 #else
621 #define __Pyx_PyType_AsAsync(obj) NULL
622 #endif
623 #ifndef __Pyx_PyAsyncMethodsStruct
624 typedef struct {
625 unaryfunc am_await;
626 unaryfunc am_aiter;
627 unaryfunc am_anext;
628 } __Pyx_PyAsyncMethodsStruct;
629 #endif
630
631 #if defined(WIN32) || defined(MS_WINDOWS)
632 #define _USE_MATH_DEFINES
633 #endif
634 #include <math.h>
635 #ifdef NAN
636 #define __PYX_NAN() ((float) NAN)
637 #else
__PYX_NAN()638 static CYTHON_INLINE float __PYX_NAN() {
639 float value;
640 memset(&value, 0xFF, sizeof(value));
641 return value;
642 }
643 #endif
644 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
645 #define __Pyx_truncl trunc
646 #else
647 #define __Pyx_truncl truncl
648 #endif
649
650 #define __PYX_MARK_ERR_POS(f_index, lineno) \
651 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
652 #define __PYX_ERR(f_index, lineno, Ln_error) \
653 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
654
655 #ifndef __PYX_EXTERN_C
656 #ifdef __cplusplus
657 #define __PYX_EXTERN_C extern "C"
658 #else
659 #define __PYX_EXTERN_C extern
660 #endif
661 #endif
662
663 #define __PYX_HAVE__av__subtitles__subtitle
664 #define __PYX_HAVE_API__av__subtitles__subtitle
665 /* Early includes */
666 #include "pyav/config.h"
667 #include <stdint.h>
668 #include "libavutil/mathematics.h"
669 #include "libavutil/rational.h"
670 #include "libavutil/avutil.h"
671 #include "libavutil/pixdesc.h"
672 #include "libavutil/channel_layout.h"
673 #include "libavutil/audio_fifo.h"
674 #include "stdarg.h"
675 #include "libavutil/opt.h"
676 #include "libavutil/imgutils.h"
677 #include "libavutil/log.h"
678 #include "libavutil/dict.h"
679 #include "libavutil/error.h"
680 #include "libavutil/frame.h"
681 #include "libavutil/samplefmt.h"
682 #include "libavutil/motion_vector.h"
683 #include "libavcodec/avcodec.h"
684 #include "libavdevice/avdevice.h"
685 #include "libavformat/avformat.h"
686 #include "libswresample/swresample.h"
687 #include "libswscale/swscale.h"
688 #include "libavfilter/avfilter.h"
689 #include "libavfilter/buffersink.h"
690 #include "libavfilter/buffersrc.h"
691 #include "stdio.h"
692 #include <string.h>
693 #include <stdio.h>
694 #include "pythread.h"
695 #ifdef _OPENMP
696 #include <omp.h>
697 #endif /* _OPENMP */
698
699 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
700 #define CYTHON_WITHOUT_ASSERTIONS
701 #endif
702
703 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
704 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
705
706 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 1
707 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
708 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
709 #define __PYX_DEFAULT_STRING_ENCODING "ascii"
710 #define __Pyx_PyObject_FromString __Pyx_PyStr_FromString
711 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyStr_FromStringAndSize
712 #define __Pyx_uchar_cast(c) ((unsigned char)c)
713 #define __Pyx_long_cast(x) ((long)x)
714 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
715 (sizeof(type) < sizeof(Py_ssize_t)) ||\
716 (sizeof(type) > sizeof(Py_ssize_t) &&\
717 likely(v < (type)PY_SSIZE_T_MAX ||\
718 v == (type)PY_SSIZE_T_MAX) &&\
719 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
720 v == (type)PY_SSIZE_T_MIN))) ||\
721 (sizeof(type) == sizeof(Py_ssize_t) &&\
722 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
723 v == (type)PY_SSIZE_T_MAX))) )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)724 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
725 return (size_t) i < (size_t) limit;
726 }
727 #if defined (__cplusplus) && __cplusplus >= 201103L
728 #include <cstdlib>
729 #define __Pyx_sst_abs(value) std::abs(value)
730 #elif SIZEOF_INT >= SIZEOF_SIZE_T
731 #define __Pyx_sst_abs(value) abs(value)
732 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
733 #define __Pyx_sst_abs(value) labs(value)
734 #elif defined (_MSC_VER)
735 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
736 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
737 #define __Pyx_sst_abs(value) llabs(value)
738 #elif defined (__GNUC__)
739 #define __Pyx_sst_abs(value) __builtin_llabs(value)
740 #else
741 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
742 #endif
743 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
744 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
745 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
746 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
747 #define __Pyx_PyBytes_FromString PyBytes_FromString
748 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
749 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
750 #if PY_MAJOR_VERSION < 3
751 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
752 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
753 #else
754 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
755 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
756 #endif
757 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
758 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
759 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
760 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
761 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
762 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
763 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
764 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
765 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
766 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
767 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
768 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
769 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
770 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
771 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
772 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)773 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
774 const Py_UNICODE *u_end = u;
775 while (*u_end++) ;
776 return (size_t)(u_end - u - 1);
777 }
778 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
779 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
780 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
781 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
782 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
783 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
784 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
785 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
786 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
787 #define __Pyx_PySequence_Tuple(obj)\
788 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
789 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
790 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
791 #if CYTHON_ASSUME_SAFE_MACROS
792 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
793 #else
794 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
795 #endif
796 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
797 #if PY_MAJOR_VERSION >= 3
798 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
799 #else
800 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
801 #endif
802 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
803 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
804 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)805 static int __Pyx_init_sys_getdefaultencoding_params(void) {
806 PyObject* sys;
807 PyObject* default_encoding = NULL;
808 PyObject* ascii_chars_u = NULL;
809 PyObject* ascii_chars_b = NULL;
810 const char* default_encoding_c;
811 sys = PyImport_ImportModule("sys");
812 if (!sys) goto bad;
813 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
814 Py_DECREF(sys);
815 if (!default_encoding) goto bad;
816 default_encoding_c = PyBytes_AsString(default_encoding);
817 if (!default_encoding_c) goto bad;
818 if (strcmp(default_encoding_c, "ascii") == 0) {
819 __Pyx_sys_getdefaultencoding_not_ascii = 0;
820 } else {
821 char ascii_chars[128];
822 int c;
823 for (c = 0; c < 128; c++) {
824 ascii_chars[c] = c;
825 }
826 __Pyx_sys_getdefaultencoding_not_ascii = 1;
827 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
828 if (!ascii_chars_u) goto bad;
829 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
830 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
831 PyErr_Format(
832 PyExc_ValueError,
833 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
834 default_encoding_c);
835 goto bad;
836 }
837 Py_DECREF(ascii_chars_u);
838 Py_DECREF(ascii_chars_b);
839 }
840 Py_DECREF(default_encoding);
841 return 0;
842 bad:
843 Py_XDECREF(default_encoding);
844 Py_XDECREF(ascii_chars_u);
845 Py_XDECREF(ascii_chars_b);
846 return -1;
847 }
848 #endif
849 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
850 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
851 #else
852 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
853 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
854 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)855 static int __Pyx_init_sys_getdefaultencoding_params(void) {
856 PyObject* sys;
857 PyObject* default_encoding = NULL;
858 char* default_encoding_c;
859 sys = PyImport_ImportModule("sys");
860 if (!sys) goto bad;
861 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
862 Py_DECREF(sys);
863 if (!default_encoding) goto bad;
864 default_encoding_c = PyBytes_AsString(default_encoding);
865 if (!default_encoding_c) goto bad;
866 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
867 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
868 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
869 Py_DECREF(default_encoding);
870 return 0;
871 bad:
872 Py_XDECREF(default_encoding);
873 return -1;
874 }
875 #endif
876 #endif
877
878
879 /* Test for GCC > 2.95 */
880 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
881 #define likely(x) __builtin_expect(!!(x), 1)
882 #define unlikely(x) __builtin_expect(!!(x), 0)
883 #else /* !__GNUC__ or GCC < 2.95 */
884 #define likely(x) (x)
885 #define unlikely(x) (x)
886 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)887 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
888
889 static PyObject *__pyx_m = NULL;
890 static PyObject *__pyx_d;
891 static PyObject *__pyx_b;
892 static PyObject *__pyx_cython_runtime = NULL;
893 static PyObject *__pyx_empty_tuple;
894 static PyObject *__pyx_empty_bytes;
895 static PyObject *__pyx_empty_unicode;
896 static int __pyx_lineno;
897 static int __pyx_clineno = 0;
898 static const char * __pyx_cfilenm= __FILE__;
899 static const char *__pyx_filename;
900
901
902 static const char *__pyx_f[] = {
903 "stringsource",
904 "av/subtitles/subtitle.pyx",
905 "av/subtitles/subtitle.pxd",
906 "av/buffer.pxd",
907 "av/bytesource.pxd",
908 "av/codec/codec.pxd",
909 "av/dictionary.pxd",
910 "av/sidedata/sidedata.pxd",
911 "av/frame.pxd",
912 "av/codec/context.pxd",
913 "av/container/streams.pxd",
914 "av/format.pxd",
915 "av/container/core.pxd",
916 "av/stream.pxd",
917 "av/packet.pxd",
918 "type.pxd",
919 "bool.pxd",
920 "complex.pxd",
921 };
922
923 /*--- Type declarations ---*/
924 struct __pyx_obj_2av_6buffer_Buffer;
925 struct __pyx_obj_2av_10bytesource_ByteSource;
926 struct __pyx_obj_2av_5codec_5codec_Codec;
927 struct __pyx_obj_2av_10dictionary__Dictionary;
928 struct __pyx_obj_2av_8sidedata_8sidedata_SideData;
929 struct __pyx_obj_2av_8sidedata_8sidedata__SideDataContainer;
930 struct __pyx_obj_2av_5frame_Frame;
931 struct __pyx_obj_2av_5codec_7context_CodecContext;
932 struct __pyx_obj_2av_9container_7streams_StreamContainer;
933 struct __pyx_obj_2av_6format_ContainerFormat;
934 struct __pyx_obj_2av_9container_4core_Container;
935 struct __pyx_obj_2av_6stream_Stream;
936 struct __pyx_obj_2av_6packet_Packet;
937 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy;
938 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet;
939 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle;
940 struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle;
941 struct __pyx_obj_2av_9subtitles_8subtitle_ASSSubtitle;
942 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle;
943 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane;
944 struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle;
945 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__;
946 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr;
947 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__;
948 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr;
949 struct __pyx_opt_args_2av_10bytesource_bytesource;
950
951 /* "av/bytesource.pxd":14
952 * cdef size_t length
953 *
954 * cdef ByteSource bytesource(object, bint allow_none=*) # <<<<<<<<<<<<<<
955 */
956 struct __pyx_opt_args_2av_10bytesource_bytesource {
957 int __pyx_n;
958 int allow_none;
959 };
960 struct __pyx_opt_args_2av_5codec_5codec_5Codec__init;
961
962 /* "av/codec/codec.pxd":10
963 * cdef readonly bint is_encoder
964 *
965 * cdef _init(self, name=?) # <<<<<<<<<<<<<<
966 *
967 *
968 */
969 struct __pyx_opt_args_2av_5codec_5codec_5Codec__init {
970 int __pyx_n;
971 PyObject *name;
972 };
973 struct __pyx_opt_args_2av_5frame_5Frame__copy_internal_attributes;
974
975 /* "av/frame.pxd":19
976 * cdef readonly int index
977 *
978 * cdef _copy_internal_attributes(self, Frame source, bint data_layout=?) # <<<<<<<<<<<<<<
979 *
980 * cdef _init_user_attributes(self)
981 */
982 struct __pyx_opt_args_2av_5frame_5Frame__copy_internal_attributes {
983 int __pyx_n;
984 int data_layout;
985 };
986 struct __pyx_opt_args_2av_5codec_7context_12CodecContext_open;
987 struct __pyx_opt_args_2av_5codec_7context_12CodecContext_close;
988 struct __pyx_opt_args_2av_5codec_7context_12CodecContext_encode;
989 struct __pyx_opt_args_2av_5codec_7context_12CodecContext_decode;
990
991 /* "av/codec/context.pxd":34
992 *
993 * # Public API.
994 * cpdef open(self, bint strict=?) # <<<<<<<<<<<<<<
995 * cpdef close(self, bint strict=?)
996 *
997 */
998 struct __pyx_opt_args_2av_5codec_7context_12CodecContext_open {
999 int __pyx_n;
1000 int strict;
1001 };
1002
1003 /* "av/codec/context.pxd":35
1004 * # Public API.
1005 * cpdef open(self, bint strict=?)
1006 * cpdef close(self, bint strict=?) # <<<<<<<<<<<<<<
1007 *
1008 * cdef _set_default_time_base(self)
1009 */
1010 struct __pyx_opt_args_2av_5codec_7context_12CodecContext_close {
1011 int __pyx_n;
1012 int strict;
1013 };
1014
1015 /* "av/codec/context.pxd":40
1016 *
1017 * # Wraps both versions of the transcode API, returning lists.
1018 * cpdef encode(self, Frame frame=?) # <<<<<<<<<<<<<<
1019 * cpdef decode(self, Packet packet=?)
1020 *
1021 */
1022 struct __pyx_opt_args_2av_5codec_7context_12CodecContext_encode {
1023 int __pyx_n;
1024 struct __pyx_obj_2av_5frame_Frame *frame;
1025 };
1026
1027 /* "av/codec/context.pxd":41
1028 * # Wraps both versions of the transcode API, returning lists.
1029 * cpdef encode(self, Frame frame=?)
1030 * cpdef decode(self, Packet packet=?) # <<<<<<<<<<<<<<
1031 *
1032 * # Used by both transcode APIs to setup user-land objects.
1033 */
1034 struct __pyx_opt_args_2av_5codec_7context_12CodecContext_decode {
1035 int __pyx_n;
1036 struct __pyx_obj_2av_6packet_Packet *packet;
1037 };
1038 struct __pyx_t_2av_9container_4core_timeout_info;
1039 typedef struct __pyx_t_2av_9container_4core_timeout_info __pyx_t_2av_9container_4core_timeout_info;
1040
1041 /* "av/container/core.pxd":10
1042 *
1043 * # Interrupt callback information, times are in seconds.
1044 * ctypedef struct timeout_info: # <<<<<<<<<<<<<<
1045 * double start_time
1046 * double timeout
1047 */
1048 struct __pyx_t_2av_9container_4core_timeout_info {
1049 double start_time;
1050 double timeout;
1051 };
1052
1053 /* "av/buffer.pxd":2
1054 *
1055 * cdef class Buffer(object): # <<<<<<<<<<<<<<
1056 *
1057 * cdef size_t _buffer_size(self)
1058 */
1059 struct __pyx_obj_2av_6buffer_Buffer {
1060 PyObject_HEAD
1061 struct __pyx_vtabstruct_2av_6buffer_Buffer *__pyx_vtab;
1062 };
1063
1064
1065 /* "av/bytesource.pxd":4
1066 *
1067 *
1068 * cdef class ByteSource(object): # <<<<<<<<<<<<<<
1069 *
1070 * cdef object owner
1071 */
1072 struct __pyx_obj_2av_10bytesource_ByteSource {
1073 PyObject_HEAD
1074 PyObject *owner;
1075 int has_view;
1076 Py_buffer view;
1077 unsigned char *ptr;
1078 size_t length;
1079 };
1080
1081
1082 /* "av/codec/codec.pxd":4
1083 *
1084 *
1085 * cdef class Codec(object): # <<<<<<<<<<<<<<
1086 *
1087 * cdef const lib.AVCodec *ptr
1088 */
1089 struct __pyx_obj_2av_5codec_5codec_Codec {
1090 PyObject_HEAD
1091 struct __pyx_vtabstruct_2av_5codec_5codec_Codec *__pyx_vtab;
1092 struct AVCodec const *ptr;
1093 struct AVCodecDescriptor const *desc;
1094 int is_encoder;
1095 };
1096
1097
1098 /* "av/dictionary.pxd":4
1099 *
1100 *
1101 * cdef class _Dictionary(object): # <<<<<<<<<<<<<<
1102 *
1103 * cdef lib.AVDictionary *ptr
1104 */
1105 struct __pyx_obj_2av_10dictionary__Dictionary {
1106 PyObject_HEAD
1107 struct __pyx_vtabstruct_2av_10dictionary__Dictionary *__pyx_vtab;
1108 AVDictionary *ptr;
1109 };
1110
1111
1112 /* "av/sidedata/sidedata.pxd":9
1113 *
1114 *
1115 * cdef class SideData(Buffer): # <<<<<<<<<<<<<<
1116 *
1117 * cdef Frame frame
1118 */
1119 struct __pyx_obj_2av_8sidedata_8sidedata_SideData {
1120 struct __pyx_obj_2av_6buffer_Buffer __pyx_base;
1121 struct __pyx_obj_2av_5frame_Frame *frame;
1122 struct AVFrameSideData *ptr;
1123 struct __pyx_obj_2av_10dictionary__Dictionary *metadata;
1124 };
1125
1126
1127 /* "av/sidedata/sidedata.pxd":18
1128 * cdef SideData wrap_side_data(Frame frame, int index)
1129 *
1130 * cdef class _SideDataContainer(object): # <<<<<<<<<<<<<<
1131 *
1132 * cdef Frame frame
1133 */
1134 struct __pyx_obj_2av_8sidedata_8sidedata__SideDataContainer {
1135 PyObject_HEAD
1136 struct __pyx_obj_2av_5frame_Frame *frame;
1137 PyObject *_by_index;
1138 PyObject *_by_type;
1139 };
1140
1141
1142 /* "av/frame.pxd":7
1143 *
1144 *
1145 * cdef class Frame(object): # <<<<<<<<<<<<<<
1146 *
1147 * cdef lib.AVFrame *ptr
1148 */
1149 struct __pyx_obj_2av_5frame_Frame {
1150 PyObject_HEAD
1151 struct __pyx_vtabstruct_2av_5frame_Frame *__pyx_vtab;
1152 struct AVFrame *ptr;
1153 AVRational _time_base;
1154 struct __pyx_obj_2av_8sidedata_8sidedata__SideDataContainer *_side_data;
1155 int index;
1156 };
1157
1158
1159 /* "av/codec/context.pxd":10
1160 *
1161 *
1162 * cdef class CodecContext(object): # <<<<<<<<<<<<<<
1163 *
1164 * cdef lib.AVCodecContext *ptr
1165 */
1166 struct __pyx_obj_2av_5codec_7context_CodecContext {
1167 PyObject_HEAD
1168 struct __pyx_vtabstruct_2av_5codec_7context_CodecContext *__pyx_vtab;
1169 struct AVCodecContext *ptr;
1170 int allocated;
1171 int stream_index;
1172 struct AVCodecParserContext *parser;
1173 struct __pyx_obj_2av_10bytesource_ByteSource *extradata_source;
1174 struct __pyx_obj_2av_5codec_5codec_Codec *codec;
1175 PyObject *options;
1176 struct __pyx_obj_2av_5frame_Frame *_next_frame;
1177 };
1178
1179
1180 /* "av/container/streams.pxd":4
1181 *
1182 *
1183 * cdef class StreamContainer(object): # <<<<<<<<<<<<<<
1184 *
1185 * cdef list _streams
1186 */
1187 struct __pyx_obj_2av_9container_7streams_StreamContainer {
1188 PyObject_HEAD
1189 struct __pyx_vtabstruct_2av_9container_7streams_StreamContainer *__pyx_vtab;
1190 PyObject *_streams;
1191 PyObject *video;
1192 PyObject *audio;
1193 PyObject *subtitles;
1194 PyObject *data;
1195 PyObject *other;
1196 };
1197
1198
1199 /* "av/format.pxd":4
1200 *
1201 *
1202 * cdef class ContainerFormat(object): # <<<<<<<<<<<<<<
1203 *
1204 * cdef readonly str name
1205 */
1206 struct __pyx_obj_2av_6format_ContainerFormat {
1207 PyObject_HEAD
1208 PyObject *name;
1209 struct AVInputFormat *iptr;
1210 struct AVOutputFormat *optr;
1211 };
1212
1213
1214 /* "av/container/core.pxd":15
1215 *
1216 *
1217 * cdef class Container(object): # <<<<<<<<<<<<<<
1218 *
1219 * cdef readonly bint writeable
1220 */
1221 struct __pyx_obj_2av_9container_4core_Container {
1222 PyObject_HEAD
1223 struct __pyx_vtabstruct_2av_9container_4core_Container *__pyx_vtab;
1224 int writeable;
1225 struct AVFormatContext *ptr;
1226 PyObject *name;
1227 PyObject *metadata_encoding;
1228 PyObject *metadata_errors;
1229 PyObject *file;
1230 PyObject *fread;
1231 PyObject *fwrite;
1232 PyObject *fseek;
1233 PyObject *ftell;
1234 struct AVIOContext *iocontext;
1235 unsigned char *buffer;
1236 long pos;
1237 int pos_is_valid;
1238 int input_was_opened;
1239 struct __pyx_obj_2av_6format_ContainerFormat *format;
1240 PyObject *options;
1241 PyObject *container_options;
1242 PyObject *stream_options;
1243 struct __pyx_obj_2av_9container_7streams_StreamContainer *streams;
1244 PyObject *metadata;
1245 PyObject *open_timeout;
1246 PyObject *read_timeout;
1247 __pyx_t_2av_9container_4core_timeout_info interrupt_callback_info;
1248 };
1249
1250
1251 /* "av/stream.pxd":10
1252 *
1253 *
1254 * cdef class Stream(object): # <<<<<<<<<<<<<<
1255 *
1256 * # Stream attributes.
1257 */
1258 struct __pyx_obj_2av_6stream_Stream {
1259 PyObject_HEAD
1260 struct __pyx_vtabstruct_2av_6stream_Stream *__pyx_vtab;
1261 struct __pyx_obj_2av_9container_4core_Container *container;
1262 struct AVStream *_stream;
1263 PyObject *metadata;
1264 struct AVCodecContext *_codec_context;
1265 struct AVCodec const *_codec;
1266 struct __pyx_obj_2av_5codec_7context_CodecContext *codec_context;
1267 };
1268
1269
1270 /* "av/packet.pxd":8
1271 *
1272 *
1273 * cdef class Packet(Buffer): # <<<<<<<<<<<<<<
1274 *
1275 * cdef lib.AVPacket struct
1276 */
1277 struct __pyx_obj_2av_6packet_Packet {
1278 struct __pyx_obj_2av_6buffer_Buffer __pyx_base;
1279 struct AVPacket __pyx_struct;
1280 struct __pyx_obj_2av_6stream_Stream *_stream;
1281 AVRational _time_base;
1282 struct __pyx_obj_2av_10bytesource_ByteSource *source;
1283 };
1284
1285
1286 /* "av/subtitles/subtitle.pxd":6
1287 *
1288 *
1289 * cdef class SubtitleProxy(object): # <<<<<<<<<<<<<<
1290 *
1291 * cdef lib.AVSubtitle struct
1292 */
1293 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy {
1294 PyObject_HEAD
1295 struct AVSubtitle __pyx_struct;
1296 };
1297
1298
1299 /* "av/subtitles/subtitle.pxd":11
1300 *
1301 *
1302 * cdef class SubtitleSet(object): # <<<<<<<<<<<<<<
1303 *
1304 * cdef readonly Packet packet
1305 */
1306 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet {
1307 PyObject_HEAD
1308 struct __pyx_obj_2av_6packet_Packet *packet;
1309 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *proxy;
1310 PyObject *rects;
1311 };
1312
1313
1314 /* "av/subtitles/subtitle.pxd":18
1315 *
1316 *
1317 * cdef class Subtitle(object): # <<<<<<<<<<<<<<
1318 *
1319 * cdef SubtitleProxy proxy
1320 */
1321 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle {
1322 PyObject_HEAD
1323 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *proxy;
1324 struct AVSubtitleRect *ptr;
1325 PyObject *type;
1326 };
1327
1328
1329 /* "av/subtitles/subtitle.pxd":24
1330 * cdef readonly bytes type
1331 *
1332 * cdef class TextSubtitle(Subtitle): # <<<<<<<<<<<<<<
1333 * pass
1334 *
1335 */
1336 struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle {
1337 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle __pyx_base;
1338 };
1339
1340
1341 /* "av/subtitles/subtitle.pxd":27
1342 * pass
1343 *
1344 * cdef class ASSSubtitle(Subtitle): # <<<<<<<<<<<<<<
1345 * pass
1346 *
1347 */
1348 struct __pyx_obj_2av_9subtitles_8subtitle_ASSSubtitle {
1349 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle __pyx_base;
1350 };
1351
1352
1353 /* "av/subtitles/subtitle.pxd":30
1354 * pass
1355 *
1356 * cdef class BitmapSubtitle(Subtitle): # <<<<<<<<<<<<<<
1357 *
1358 * cdef readonly planes
1359 */
1360 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle {
1361 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle __pyx_base;
1362 PyObject *planes;
1363 };
1364
1365
1366 /* "av/subtitles/subtitle.pxd":34
1367 * cdef readonly planes
1368 *
1369 * cdef class BitmapSubtitlePlane(object): # <<<<<<<<<<<<<<
1370 *
1371 * cdef readonly BitmapSubtitle subtitle
1372 */
1373 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane {
1374 PyObject_HEAD
1375 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *subtitle;
1376 int index;
1377 long buffer_size;
1378 void *_buffer;
1379 };
1380
1381
1382 /* "av/subtitles/subtitle.pyx":190
1383 *
1384 *
1385 * cdef class AssSubtitle(Subtitle): # <<<<<<<<<<<<<<
1386 *
1387 * def __repr__(self):
1388 */
1389 struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle {
1390 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle __pyx_base;
1391 };
1392
1393
1394 /* "av/subtitles/subtitle.pyx":11
1395 * cdef class SubtitleSet(object):
1396 *
1397 * def __cinit__(self, SubtitleProxy proxy): # <<<<<<<<<<<<<<
1398 * self.proxy = proxy
1399 * cdef int i
1400 */
1401 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ {
1402 PyObject_HEAD
1403 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self;
1404 };
1405
1406
1407 /* "av/subtitles/subtitle.pyx":14
1408 * self.proxy = proxy
1409 * cdef int i
1410 * self.rects = tuple(build_subtitle(self, i) for i in range(self.proxy.struct.num_rects)) # <<<<<<<<<<<<<<
1411 *
1412 * def __repr__(self):
1413 */
1414 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr {
1415 PyObject_HEAD
1416 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *__pyx_outer_scope;
1417 unsigned int __pyx_v_i;
1418 unsigned int __pyx_t_0;
1419 unsigned int __pyx_t_1;
1420 unsigned int __pyx_t_2;
1421 };
1422
1423
1424 /* "av/subtitles/subtitle.pyx":95
1425 * cdef class BitmapSubtitle(Subtitle):
1426 *
1427 * def __cinit__(self, SubtitleSet subtitle, int index): # <<<<<<<<<<<<<<
1428 * self.planes = tuple(
1429 * BitmapSubtitlePlane(self, i)
1430 */
1431 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ {
1432 PyObject_HEAD
1433 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self;
1434 };
1435
1436
1437 /* "av/subtitles/subtitle.pyx":97
1438 * def __cinit__(self, SubtitleSet subtitle, int index):
1439 * self.planes = tuple(
1440 * BitmapSubtitlePlane(self, i) # <<<<<<<<<<<<<<
1441 * for i in range(4)
1442 * if self.ptr.linesize[i]
1443 */
1444 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr {
1445 PyObject_HEAD
1446 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *__pyx_outer_scope;
1447 long __pyx_v_i;
1448 long __pyx_t_0;
1449 };
1450
1451
1452
1453 /* "av/buffer.pxd":2
1454 *
1455 * cdef class Buffer(object): # <<<<<<<<<<<<<<
1456 *
1457 * cdef size_t _buffer_size(self)
1458 */
1459
1460 struct __pyx_vtabstruct_2av_6buffer_Buffer {
1461 size_t (*_buffer_size)(struct __pyx_obj_2av_6buffer_Buffer *);
1462 void *(*_buffer_ptr)(struct __pyx_obj_2av_6buffer_Buffer *);
1463 int (*_buffer_writable)(struct __pyx_obj_2av_6buffer_Buffer *);
1464 };
1465 static struct __pyx_vtabstruct_2av_6buffer_Buffer *__pyx_vtabptr_2av_6buffer_Buffer;
1466
1467
1468 /* "av/codec/codec.pxd":4
1469 *
1470 *
1471 * cdef class Codec(object): # <<<<<<<<<<<<<<
1472 *
1473 * cdef const lib.AVCodec *ptr
1474 */
1475
1476 struct __pyx_vtabstruct_2av_5codec_5codec_Codec {
1477 PyObject *(*_init)(struct __pyx_obj_2av_5codec_5codec_Codec *, struct __pyx_opt_args_2av_5codec_5codec_5Codec__init *__pyx_optional_args);
1478 };
1479 static struct __pyx_vtabstruct_2av_5codec_5codec_Codec *__pyx_vtabptr_2av_5codec_5codec_Codec;
1480
1481
1482 /* "av/dictionary.pxd":4
1483 *
1484 *
1485 * cdef class _Dictionary(object): # <<<<<<<<<<<<<<
1486 *
1487 * cdef lib.AVDictionary *ptr
1488 */
1489
1490 struct __pyx_vtabstruct_2av_10dictionary__Dictionary {
1491 struct __pyx_obj_2av_10dictionary__Dictionary *(*copy)(struct __pyx_obj_2av_10dictionary__Dictionary *, int __pyx_skip_dispatch);
1492 };
1493 static struct __pyx_vtabstruct_2av_10dictionary__Dictionary *__pyx_vtabptr_2av_10dictionary__Dictionary;
1494
1495
1496 /* "av/sidedata/sidedata.pxd":9
1497 *
1498 *
1499 * cdef class SideData(Buffer): # <<<<<<<<<<<<<<
1500 *
1501 * cdef Frame frame
1502 */
1503
1504 struct __pyx_vtabstruct_2av_8sidedata_8sidedata_SideData {
1505 struct __pyx_vtabstruct_2av_6buffer_Buffer __pyx_base;
1506 };
1507 static struct __pyx_vtabstruct_2av_8sidedata_8sidedata_SideData *__pyx_vtabptr_2av_8sidedata_8sidedata_SideData;
1508
1509
1510 /* "av/frame.pxd":7
1511 *
1512 *
1513 * cdef class Frame(object): # <<<<<<<<<<<<<<
1514 *
1515 * cdef lib.AVFrame *ptr
1516 */
1517
1518 struct __pyx_vtabstruct_2av_5frame_Frame {
1519 PyObject *(*_rebase_time)(struct __pyx_obj_2av_5frame_Frame *, AVRational);
1520 PyObject *(*_copy_internal_attributes)(struct __pyx_obj_2av_5frame_Frame *, struct __pyx_obj_2av_5frame_Frame *, struct __pyx_opt_args_2av_5frame_5Frame__copy_internal_attributes *__pyx_optional_args);
1521 PyObject *(*_init_user_attributes)(struct __pyx_obj_2av_5frame_Frame *);
1522 };
1523 static struct __pyx_vtabstruct_2av_5frame_Frame *__pyx_vtabptr_2av_5frame_Frame;
1524
1525
1526 /* "av/codec/context.pxd":10
1527 *
1528 *
1529 * cdef class CodecContext(object): # <<<<<<<<<<<<<<
1530 *
1531 * cdef lib.AVCodecContext *ptr
1532 */
1533
1534 struct __pyx_vtabstruct_2av_5codec_7context_CodecContext {
1535 PyObject *(*_init)(struct __pyx_obj_2av_5codec_7context_CodecContext *, struct AVCodecContext *, struct AVCodec const *);
1536 PyObject *(*open)(struct __pyx_obj_2av_5codec_7context_CodecContext *, int __pyx_skip_dispatch, struct __pyx_opt_args_2av_5codec_7context_12CodecContext_open *__pyx_optional_args);
1537 PyObject *(*close)(struct __pyx_obj_2av_5codec_7context_CodecContext *, int __pyx_skip_dispatch, struct __pyx_opt_args_2av_5codec_7context_12CodecContext_close *__pyx_optional_args);
1538 PyObject *(*_set_default_time_base)(struct __pyx_obj_2av_5codec_7context_CodecContext *);
1539 PyObject *(*encode)(struct __pyx_obj_2av_5codec_7context_CodecContext *, int __pyx_skip_dispatch, struct __pyx_opt_args_2av_5codec_7context_12CodecContext_encode *__pyx_optional_args);
1540 PyObject *(*decode)(struct __pyx_obj_2av_5codec_7context_CodecContext *, int __pyx_skip_dispatch, struct __pyx_opt_args_2av_5codec_7context_12CodecContext_decode *__pyx_optional_args);
1541 PyObject *(*_prepare_frames_for_encode)(struct __pyx_obj_2av_5codec_7context_CodecContext *, struct __pyx_obj_2av_5frame_Frame *);
1542 PyObject *(*_setup_encoded_packet)(struct __pyx_obj_2av_5codec_7context_CodecContext *, struct __pyx_obj_2av_6packet_Packet *);
1543 PyObject *(*_setup_decoded_frame)(struct __pyx_obj_2av_5codec_7context_CodecContext *, struct __pyx_obj_2av_5frame_Frame *, struct __pyx_obj_2av_6packet_Packet *);
1544 PyObject *(*_send_frame_and_recv)(struct __pyx_obj_2av_5codec_7context_CodecContext *, struct __pyx_obj_2av_5frame_Frame *);
1545 PyObject *(*_recv_packet)(struct __pyx_obj_2av_5codec_7context_CodecContext *);
1546 PyObject *(*_send_packet_and_recv)(struct __pyx_obj_2av_5codec_7context_CodecContext *, struct __pyx_obj_2av_6packet_Packet *);
1547 PyObject *(*_recv_frame)(struct __pyx_obj_2av_5codec_7context_CodecContext *);
1548 struct __pyx_obj_2av_5frame_Frame *(*_alloc_next_frame)(struct __pyx_obj_2av_5codec_7context_CodecContext *);
1549 };
1550 static struct __pyx_vtabstruct_2av_5codec_7context_CodecContext *__pyx_vtabptr_2av_5codec_7context_CodecContext;
1551
1552
1553 /* "av/container/streams.pxd":4
1554 *
1555 *
1556 * cdef class StreamContainer(object): # <<<<<<<<<<<<<<
1557 *
1558 * cdef list _streams
1559 */
1560
1561 struct __pyx_vtabstruct_2av_9container_7streams_StreamContainer {
1562 PyObject *(*add_stream)(struct __pyx_obj_2av_9container_7streams_StreamContainer *, struct __pyx_obj_2av_6stream_Stream *);
1563 };
1564 static struct __pyx_vtabstruct_2av_9container_7streams_StreamContainer *__pyx_vtabptr_2av_9container_7streams_StreamContainer;
1565
1566
1567 /* "av/container/core.pxd":15
1568 *
1569 *
1570 * cdef class Container(object): # <<<<<<<<<<<<<<
1571 *
1572 * cdef readonly bint writeable
1573 */
1574
1575 struct __pyx_vtabstruct_2av_9container_4core_Container {
1576 int (*err_check)(struct __pyx_obj_2av_9container_4core_Container *, int);
1577 PyObject *(*set_timeout)(struct __pyx_obj_2av_9container_4core_Container *, PyObject *);
1578 PyObject *(*start_timeout)(struct __pyx_obj_2av_9container_4core_Container *);
1579 };
1580 static struct __pyx_vtabstruct_2av_9container_4core_Container *__pyx_vtabptr_2av_9container_4core_Container;
1581
1582
1583 /* "av/stream.pxd":10
1584 *
1585 *
1586 * cdef class Stream(object): # <<<<<<<<<<<<<<
1587 *
1588 * # Stream attributes.
1589 */
1590
1591 struct __pyx_vtabstruct_2av_6stream_Stream {
1592 PyObject *(*_init)(struct __pyx_obj_2av_6stream_Stream *, struct __pyx_obj_2av_9container_4core_Container *, struct AVStream *);
1593 PyObject *(*_finalize_for_output)(struct __pyx_obj_2av_6stream_Stream *);
1594 };
1595 static struct __pyx_vtabstruct_2av_6stream_Stream *__pyx_vtabptr_2av_6stream_Stream;
1596
1597
1598 /* "av/packet.pxd":8
1599 *
1600 *
1601 * cdef class Packet(Buffer): # <<<<<<<<<<<<<<
1602 *
1603 * cdef lib.AVPacket struct
1604 */
1605
1606 struct __pyx_vtabstruct_2av_6packet_Packet {
1607 struct __pyx_vtabstruct_2av_6buffer_Buffer __pyx_base;
1608 PyObject *(*_rebase_time)(struct __pyx_obj_2av_6packet_Packet *, AVRational);
1609 };
1610 static struct __pyx_vtabstruct_2av_6packet_Packet *__pyx_vtabptr_2av_6packet_Packet;
1611
1612 /* --- Runtime support code (head) --- */
1613 /* Refnanny.proto */
1614 #ifndef CYTHON_REFNANNY
1615 #define CYTHON_REFNANNY 0
1616 #endif
1617 #if CYTHON_REFNANNY
1618 typedef struct {
1619 void (*INCREF)(void*, PyObject*, int);
1620 void (*DECREF)(void*, PyObject*, int);
1621 void (*GOTREF)(void*, PyObject*, int);
1622 void (*GIVEREF)(void*, PyObject*, int);
1623 void* (*SetupContext)(const char*, int, const char*);
1624 void (*FinishContext)(void**);
1625 } __Pyx_RefNannyAPIStruct;
1626 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1627 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1628 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1629 #ifdef WITH_THREAD
1630 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1631 if (acquire_gil) {\
1632 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1633 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1634 PyGILState_Release(__pyx_gilstate_save);\
1635 } else {\
1636 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1637 }
1638 #else
1639 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1640 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1641 #endif
1642 #define __Pyx_RefNannyFinishContext()\
1643 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1644 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1645 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1646 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1647 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1648 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1649 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1650 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1651 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1652 #else
1653 #define __Pyx_RefNannyDeclarations
1654 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1655 #define __Pyx_RefNannyFinishContext()
1656 #define __Pyx_INCREF(r) Py_INCREF(r)
1657 #define __Pyx_DECREF(r) Py_DECREF(r)
1658 #define __Pyx_GOTREF(r)
1659 #define __Pyx_GIVEREF(r)
1660 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1661 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1662 #define __Pyx_XGOTREF(r)
1663 #define __Pyx_XGIVEREF(r)
1664 #endif
1665 #define __Pyx_XDECREF_SET(r, v) do {\
1666 PyObject *tmp = (PyObject *) r;\
1667 r = v; __Pyx_XDECREF(tmp);\
1668 } while (0)
1669 #define __Pyx_DECREF_SET(r, v) do {\
1670 PyObject *tmp = (PyObject *) r;\
1671 r = v; __Pyx_DECREF(tmp);\
1672 } while (0)
1673 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1674 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1675
1676 /* PyObjectGetAttrStr.proto */
1677 #if CYTHON_USE_TYPE_SLOTS
1678 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1679 #else
1680 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1681 #endif
1682
1683 /* GetBuiltinName.proto */
1684 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1685
1686 /* PyObjectCall.proto */
1687 #if CYTHON_COMPILING_IN_CPYTHON
1688 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1689 #else
1690 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1691 #endif
1692
1693 /* PyThreadStateGet.proto */
1694 #if CYTHON_FAST_THREAD_STATE
1695 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1696 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1697 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1698 #else
1699 #define __Pyx_PyThreadState_declare
1700 #define __Pyx_PyThreadState_assign
1701 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1702 #endif
1703
1704 /* PyErrFetchRestore.proto */
1705 #if CYTHON_FAST_THREAD_STATE
1706 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1707 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1708 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1709 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1710 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1711 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1712 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1713 #if CYTHON_COMPILING_IN_CPYTHON
1714 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1715 #else
1716 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1717 #endif
1718 #else
1719 #define __Pyx_PyErr_Clear() PyErr_Clear()
1720 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1721 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1722 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1723 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1724 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1725 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1726 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1727 #endif
1728
1729 /* RaiseException.proto */
1730 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1731
1732 /* RaiseDoubleKeywords.proto */
1733 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1734
1735 /* ParseKeywords.proto */
1736 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1737 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1738 const char* function_name);
1739
1740 /* RaiseArgTupleInvalid.proto */
1741 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1742 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1743
1744 /* ArgTypeTest.proto */
1745 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1746 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1747 __Pyx__ArgTypeTest(obj, type, name, exact))
1748 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1749
1750 /* None.proto */
1751 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
1752
1753 /* PyCFunctionFastCall.proto */
1754 #if CYTHON_FAST_PYCCALL
1755 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1756 #else
1757 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1758 #endif
1759
1760 /* PyFunctionFastCall.proto */
1761 #if CYTHON_FAST_PYCALL
1762 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1763 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1764 #if 1 || PY_VERSION_HEX < 0x030600B1
1765 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1766 #else
1767 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1768 #endif
1769 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1770 (sizeof(char [1 - 2*!(cond)]) - 1)
1771 #ifndef Py_MEMBER_SIZE
1772 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1773 #endif
1774 static size_t __pyx_pyframe_localsplus_offset = 0;
1775 #include "frameobject.h"
1776 #define __Pxy_PyFrame_Initialize_Offsets()\
1777 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1778 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1779 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1780 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1781 #endif
1782
1783 /* PyObjectCallMethO.proto */
1784 #if CYTHON_COMPILING_IN_CPYTHON
1785 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1786 #endif
1787
1788 /* PyObjectCallOneArg.proto */
1789 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1790
1791 /* GetItemInt.proto */
1792 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1793 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1794 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1795 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1796 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1797 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1798 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1799 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1800 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1801 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1802 int wraparound, int boundscheck);
1803 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1804 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1805 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1806 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1807 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1808 int wraparound, int boundscheck);
1809 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1810 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1811 int is_list, int wraparound, int boundscheck);
1812
1813 /* ObjectGetItem.proto */
1814 #if CYTHON_USE_TYPE_SLOTS
1815 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1816 #else
1817 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1818 #endif
1819
1820 /* IncludeStringH.proto */
1821 #include <string.h>
1822
1823 /* PyObject_GenericGetAttrNoDict.proto */
1824 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1825 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1826 #else
1827 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1828 #endif
1829
1830 /* PyObject_GenericGetAttr.proto */
1831 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1832 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1833 #else
1834 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1835 #endif
1836
1837 /* PyErrExceptionMatches.proto */
1838 #if CYTHON_FAST_THREAD_STATE
1839 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1840 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1841 #else
1842 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1843 #endif
1844
1845 /* PyObjectGetAttrStrNoError.proto */
1846 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1847
1848 /* SetupReduce.proto */
1849 static int __Pyx_setup_reduce(PyObject* type_obj);
1850
1851 /* TypeImport.proto */
1852 #ifndef __PYX_HAVE_RT_ImportType_proto
1853 #define __PYX_HAVE_RT_ImportType_proto
1854 enum __Pyx_ImportType_CheckSize {
1855 __Pyx_ImportType_CheckSize_Error = 0,
1856 __Pyx_ImportType_CheckSize_Warn = 1,
1857 __Pyx_ImportType_CheckSize_Ignore = 2
1858 };
1859 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1860 #endif
1861
1862 /* GetVTable.proto */
1863 static void* __Pyx_GetVtable(PyObject *dict);
1864
1865 /* PyDictVersioning.proto */
1866 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1867 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1868 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1869 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1870 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1871 (cache_var) = (value);
1872 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1873 static PY_UINT64_T __pyx_dict_version = 0;\
1874 static PyObject *__pyx_dict_cached_value = NULL;\
1875 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1876 (VAR) = __pyx_dict_cached_value;\
1877 } else {\
1878 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1879 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1880 }\
1881 }
1882 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1883 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1884 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1885 #else
1886 #define __PYX_GET_DICT_VERSION(dict) (0)
1887 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1888 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1889 #endif
1890
1891 /* CLineInTraceback.proto */
1892 #ifdef CYTHON_CLINE_IN_TRACEBACK
1893 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1894 #else
1895 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1896 #endif
1897
1898 /* CodeObjectCache.proto */
1899 typedef struct {
1900 PyCodeObject* code_object;
1901 int code_line;
1902 } __Pyx_CodeObjectCacheEntry;
1903 struct __Pyx_CodeObjectCache {
1904 int count;
1905 int max_count;
1906 __Pyx_CodeObjectCacheEntry* entries;
1907 };
1908 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1909 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1910 static PyCodeObject *__pyx_find_code_object(int code_line);
1911 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1912
1913 /* AddTraceback.proto */
1914 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1915 int py_line, const char *filename);
1916
1917 /* CIntToPy.proto */
1918 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
1919
1920 /* CIntToPy.proto */
1921 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value);
1922
1923 /* CIntToPy.proto */
1924 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
1925
1926 /* CIntToPy.proto */
1927 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);
1928
1929 /* CIntToPy.proto */
1930 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1931
1932 /* CIntToPy.proto */
1933 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__AVSubtitleType(enum AVSubtitleType value);
1934
1935 /* CIntToPy.proto */
1936 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1937
1938 /* CIntFromPy.proto */
1939 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1940
1941 /* CIntFromPy.proto */
1942 static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
1943
1944 /* CIntFromPy.proto */
1945 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1946
1947 /* FastTypeChecks.proto */
1948 #if CYTHON_COMPILING_IN_CPYTHON
1949 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1950 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1951 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1952 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1953 #else
1954 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1955 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1956 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1957 #endif
1958 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1959
1960 /* FetchCommonType.proto */
1961 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1962
1963 /* GetTopmostException.proto */
1964 #if CYTHON_USE_EXC_INFO_STACK
1965 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1966 #endif
1967
1968 /* SaveResetException.proto */
1969 #if CYTHON_FAST_THREAD_STATE
1970 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1971 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1972 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1973 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1974 #else
1975 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1976 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1977 #endif
1978
1979 /* SwapException.proto */
1980 #if CYTHON_FAST_THREAD_STATE
1981 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1982 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1983 #else
1984 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1985 #endif
1986
1987 /* PyObjectCall2Args.proto */
1988 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1989
1990 /* PyObjectGetMethod.proto */
1991 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1992
1993 /* PyObjectCallMethod1.proto */
1994 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
1995
1996 /* CoroutineBase.proto */
1997 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1998 #if CYTHON_USE_EXC_INFO_STACK
1999 #define __Pyx_ExcInfoStruct _PyErr_StackItem
2000 #else
2001 typedef struct {
2002 PyObject *exc_type;
2003 PyObject *exc_value;
2004 PyObject *exc_traceback;
2005 } __Pyx_ExcInfoStruct;
2006 #endif
2007 typedef struct {
2008 PyObject_HEAD
2009 __pyx_coroutine_body_t body;
2010 PyObject *closure;
2011 __Pyx_ExcInfoStruct gi_exc_state;
2012 PyObject *gi_weakreflist;
2013 PyObject *classobj;
2014 PyObject *yieldfrom;
2015 PyObject *gi_name;
2016 PyObject *gi_qualname;
2017 PyObject *gi_modulename;
2018 PyObject *gi_code;
2019 int resume_label;
2020 char is_running;
2021 } __pyx_CoroutineObject;
2022 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
2023 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2024 PyObject *name, PyObject *qualname, PyObject *module_name);
2025 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
2026 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2027 PyObject *name, PyObject *qualname, PyObject *module_name);
2028 static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
2029 static int __Pyx_Coroutine_clear(PyObject *self);
2030 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
2031 static PyObject *__Pyx_Coroutine_Close(PyObject *self);
2032 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
2033 #if CYTHON_USE_EXC_INFO_STACK
2034 #define __Pyx_Coroutine_SwapException(self)
2035 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
2036 #else
2037 #define __Pyx_Coroutine_SwapException(self) {\
2038 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
2039 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
2040 }
2041 #define __Pyx_Coroutine_ResetAndClearException(self) {\
2042 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
2043 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
2044 }
2045 #endif
2046 #if CYTHON_FAST_THREAD_STATE
2047 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2048 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
2049 #else
2050 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2051 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
2052 #endif
2053 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
2054 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
2055
2056 /* PatchModuleWithCoroutine.proto */
2057 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
2058
2059 /* PatchGeneratorABC.proto */
2060 static int __Pyx_patch_abc(void);
2061
2062 /* Generator.proto */
2063 #define __Pyx_Generator_USED
2064 static PyTypeObject *__pyx_GeneratorType = 0;
2065 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
2066 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
2067 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
2068 static PyObject *__Pyx_Generator_Next(PyObject *self);
2069 static int __pyx_Generator_init(void);
2070
2071 /* CheckBinaryVersion.proto */
2072 static int __Pyx_check_binary_version(void);
2073
2074 /* FunctionImport.proto */
2075 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
2076
2077 /* InitStrings.proto */
2078 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2079
2080
2081 /* Module declarations from 'libc.stdint' */
2082
2083 /* Module declarations from 'libav' */
2084
2085 /* Module declarations from 'av.buffer' */
2086 static PyTypeObject *__pyx_ptype_2av_6buffer_Buffer = 0;
2087
2088 /* Module declarations from 'cpython.buffer' */
2089
2090 /* Module declarations from 'av.bytesource' */
2091 static PyTypeObject *__pyx_ptype_2av_10bytesource_ByteSource = 0;
2092
2093 /* Module declarations from 'av.codec.codec' */
2094 static PyTypeObject *__pyx_ptype_2av_5codec_5codec_Codec = 0;
2095
2096 /* Module declarations from 'av.dictionary' */
2097 static PyTypeObject *__pyx_ptype_2av_10dictionary__Dictionary = 0;
2098 static struct __pyx_obj_2av_10dictionary__Dictionary *(*__pyx_f_2av_10dictionary_wrap_dictionary)(AVDictionary *); /*proto*/
2099
2100 /* Module declarations from 'av.sidedata.sidedata' */
2101 static PyTypeObject *__pyx_ptype_2av_8sidedata_8sidedata_SideData = 0;
2102 static PyTypeObject *__pyx_ptype_2av_8sidedata_8sidedata__SideDataContainer = 0;
2103
2104 /* Module declarations from 'av.frame' */
2105 static PyTypeObject *__pyx_ptype_2av_5frame_Frame = 0;
2106
2107 /* Module declarations from 'av.codec.context' */
2108 static PyTypeObject *__pyx_ptype_2av_5codec_7context_CodecContext = 0;
2109
2110 /* Module declarations from 'av.container.streams' */
2111 static PyTypeObject *__pyx_ptype_2av_9container_7streams_StreamContainer = 0;
2112
2113 /* Module declarations from 'av.format' */
2114 static PyTypeObject *__pyx_ptype_2av_6format_ContainerFormat = 0;
2115
2116 /* Module declarations from 'av.container.core' */
2117 static PyTypeObject *__pyx_ptype_2av_9container_4core_Container = 0;
2118
2119 /* Module declarations from 'av.stream' */
2120 static PyTypeObject *__pyx_ptype_2av_6stream_Stream = 0;
2121
2122 /* Module declarations from 'av.packet' */
2123 static PyTypeObject *__pyx_ptype_2av_6packet_Packet = 0;
2124
2125 /* Module declarations from 'cpython.version' */
2126
2127 /* Module declarations from '__builtin__' */
2128
2129 /* Module declarations from 'cpython.type' */
2130 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2131
2132 /* Module declarations from 'libc.string' */
2133
2134 /* Module declarations from 'libc.stdio' */
2135
2136 /* Module declarations from 'cpython.object' */
2137
2138 /* Module declarations from 'cpython.ref' */
2139
2140 /* Module declarations from 'cpython.exc' */
2141
2142 /* Module declarations from 'cpython.module' */
2143
2144 /* Module declarations from 'cpython.mem' */
2145
2146 /* Module declarations from 'cpython.tuple' */
2147
2148 /* Module declarations from 'cpython.list' */
2149
2150 /* Module declarations from 'cpython.sequence' */
2151
2152 /* Module declarations from 'cpython.mapping' */
2153
2154 /* Module declarations from 'cpython.iterator' */
2155
2156 /* Module declarations from 'cpython.number' */
2157
2158 /* Module declarations from 'cpython.int' */
2159
2160 /* Module declarations from '__builtin__' */
2161
2162 /* Module declarations from 'cpython.bool' */
2163 static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
2164
2165 /* Module declarations from 'cpython.long' */
2166
2167 /* Module declarations from 'cpython.float' */
2168
2169 /* Module declarations from '__builtin__' */
2170
2171 /* Module declarations from 'cpython.complex' */
2172 static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
2173
2174 /* Module declarations from 'cpython.string' */
2175
2176 /* Module declarations from 'cpython.unicode' */
2177
2178 /* Module declarations from 'cpython.dict' */
2179
2180 /* Module declarations from 'cpython.instance' */
2181
2182 /* Module declarations from 'cpython.function' */
2183
2184 /* Module declarations from 'cpython.method' */
2185
2186 /* Module declarations from 'cpython.weakref' */
2187
2188 /* Module declarations from 'cpython.getargs' */
2189
2190 /* Module declarations from 'cpython.pythread' */
2191
2192 /* Module declarations from 'cpython.pystate' */
2193
2194 /* Module declarations from 'cpython.cobject' */
2195
2196 /* Module declarations from 'cpython.oldbuffer' */
2197
2198 /* Module declarations from 'cpython.set' */
2199
2200 /* Module declarations from 'cpython.bytes' */
2201
2202 /* Module declarations from 'cpython.pycapsule' */
2203
2204 /* Module declarations from 'cpython' */
2205
2206 /* Module declarations from 'av.subtitles.subtitle' */
2207 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle_SubtitleProxy = 0;
2208 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle_SubtitleSet = 0;
2209 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle_Subtitle = 0;
2210 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle_TextSubtitle = 0;
2211 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle_ASSSubtitle = 0;
2212 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle_BitmapSubtitle = 0;
2213 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle_BitmapSubtitlePlane = 0;
2214 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle_AssSubtitle = 0;
2215 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ = 0;
2216 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr = 0;
2217 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ = 0;
2218 static PyTypeObject *__pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr = 0;
2219 static struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_f_2av_9subtitles_8subtitle_build_subtitle(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *, int); /*proto*/
2220 #define __Pyx_MODULE_NAME "av.subtitles.subtitle"
2221 extern int __pyx_module_is_main_av__subtitles__subtitle;
2222 int __pyx_module_is_main_av__subtitles__subtitle = 0;
2223
2224 /* Implementation of 'av.subtitles.subtitle' */
2225 static PyObject *__pyx_builtin_TypeError;
2226 static PyObject *__pyx_builtin_range;
2227 static PyObject *__pyx_builtin_id;
2228 static PyObject *__pyx_builtin_ValueError;
2229 static PyObject *__pyx_builtin_RuntimeError;
2230 static const char __pyx_k_x[] = "x";
2231 static const char __pyx_k_y[] = "y";
2232 static const char __pyx_k_id[] = "id";
2233 static const char __pyx_k_ass[] = "ass";
2234 static const char __pyx_k_args[] = "args";
2235 static const char __pyx_k_main[] = "__main__";
2236 static const char __pyx_k_name[] = "__name__";
2237 static const char __pyx_k_none[] = "none";
2238 static const char __pyx_k_send[] = "send";
2239 static const char __pyx_k_test[] = "__test__";
2240 static const char __pyx_k_text[] = "text";
2241 static const char __pyx_k_class[] = "__class__";
2242 static const char __pyx_k_close[] = "close";
2243 static const char __pyx_k_index[] = "index";
2244 static const char __pyx_k_proxy[] = "proxy";
2245 static const char __pyx_k_range[] = "range";
2246 static const char __pyx_k_throw[] = "throw";
2247 static const char __pyx_k_width[] = "width";
2248 static const char __pyx_k_bitmap[] = "bitmap";
2249 static const char __pyx_k_height[] = "height";
2250 static const char __pyx_k_module[] = "__module__";
2251 static const char __pyx_k_reduce[] = "__reduce__";
2252 static const char __pyx_k_genexpr[] = "genexpr";
2253 static const char __pyx_k_Subtitle[] = "Subtitle";
2254 static const char __pyx_k_getstate[] = "__getstate__";
2255 static const char __pyx_k_setstate[] = "__setstate__";
2256 static const char __pyx_k_subtitle[] = "subtitle";
2257 static const char __pyx_k_TypeError[] = "TypeError";
2258 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2259 static const char __pyx_k_ValueError[] = "ValueError";
2260 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2261 static const char __pyx_k_ASSSubtitle[] = "ASSSubtitle";
2262 static const char __pyx_k_AssSubtitle[] = "AssSubtitle";
2263 static const char __pyx_k_SubtitleSet[] = "SubtitleSet";
2264 static const char __pyx_k_s_s_at_0x_x[] = "<%s.%s at 0x%x>";
2265 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2266 static const char __pyx_k_TextSubtitle[] = "TextSubtitle";
2267 static const char __pyx_k_SubtitleProxy[] = "SubtitleProxy";
2268 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2269 static const char __pyx_k_s_s_r_at_0x_x[] = "<%s.%s %r at 0x%x>";
2270 static const char __pyx_k_BitmapSubtitle[] = "BitmapSubtitle";
2271 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2272 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2273 static const char __pyx_k_BitmapSubtitlePlane[] = "BitmapSubtitlePlane";
2274 static const char __pyx_k_plane_does_not_exist[] = "plane does not exist";
2275 static const char __pyx_k_av_subtitles_subtitle[] = "av.subtitles.subtitle";
2276 static const char __pyx_k_cinit___locals_genexpr[] = "__cinit__.<locals>.genexpr";
2277 static const char __pyx_k_s_s_dx_d_at_d_d_at_0x_x[] = "<%s.%s %dx%d at %d,%d; at 0x%x>";
2278 static const char __pyx_k_unknown_subtitle_type_r[] = "unknown subtitle type %r";
2279 static const char __pyx_k_self_struct_cannot_be_converted[] = "self.struct cannot be converted to a Python object for pickling";
2280 static const char __pyx_k_BitmapSubtitles_have_only_4_plan[] = "BitmapSubtitles have only 4 planes";
2281 static const char __pyx_k_accessing_non_existent_buffer_se[] = "accessing non-existent buffer segment";
2282 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2283 static const char __pyx_k_subtitle_rect_index_out_of_range[] = "subtitle rect index out of range";
2284 static PyObject *__pyx_n_s_ASSSubtitle;
2285 static PyObject *__pyx_n_s_AssSubtitle;
2286 static PyObject *__pyx_n_s_BitmapSubtitle;
2287 static PyObject *__pyx_n_s_BitmapSubtitlePlane;
2288 static PyObject *__pyx_kp_s_BitmapSubtitles_have_only_4_plan;
2289 static PyObject *__pyx_n_s_RuntimeError;
2290 static PyObject *__pyx_n_s_Subtitle;
2291 static PyObject *__pyx_n_s_SubtitleProxy;
2292 static PyObject *__pyx_n_s_SubtitleSet;
2293 static PyObject *__pyx_n_s_TextSubtitle;
2294 static PyObject *__pyx_n_s_TypeError;
2295 static PyObject *__pyx_n_s_ValueError;
2296 static PyObject *__pyx_kp_s_accessing_non_existent_buffer_se;
2297 static PyObject *__pyx_n_s_args;
2298 static PyObject *__pyx_n_b_ass;
2299 static PyObject *__pyx_n_s_ass;
2300 static PyObject *__pyx_n_s_av_subtitles_subtitle;
2301 static PyObject *__pyx_n_b_bitmap;
2302 static PyObject *__pyx_n_s_cinit___locals_genexpr;
2303 static PyObject *__pyx_n_s_class;
2304 static PyObject *__pyx_n_s_cline_in_traceback;
2305 static PyObject *__pyx_n_s_close;
2306 static PyObject *__pyx_n_s_genexpr;
2307 static PyObject *__pyx_n_s_getstate;
2308 static PyObject *__pyx_n_s_height;
2309 static PyObject *__pyx_n_s_id;
2310 static PyObject *__pyx_n_s_index;
2311 static PyObject *__pyx_n_s_main;
2312 static PyObject *__pyx_n_s_module;
2313 static PyObject *__pyx_n_s_name;
2314 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2315 static PyObject *__pyx_n_b_none;
2316 static PyObject *__pyx_kp_s_plane_does_not_exist;
2317 static PyObject *__pyx_n_s_proxy;
2318 static PyObject *__pyx_n_s_pyx_vtable;
2319 static PyObject *__pyx_n_s_range;
2320 static PyObject *__pyx_n_s_reduce;
2321 static PyObject *__pyx_n_s_reduce_cython;
2322 static PyObject *__pyx_n_s_reduce_ex;
2323 static PyObject *__pyx_kp_s_s_s_at_0x_x;
2324 static PyObject *__pyx_kp_s_s_s_dx_d_at_d_d_at_0x_x;
2325 static PyObject *__pyx_kp_s_s_s_r_at_0x_x;
2326 static PyObject *__pyx_kp_s_self_struct_cannot_be_converted;
2327 static PyObject *__pyx_n_s_send;
2328 static PyObject *__pyx_n_s_setstate;
2329 static PyObject *__pyx_n_s_setstate_cython;
2330 static PyObject *__pyx_n_s_subtitle;
2331 static PyObject *__pyx_kp_s_subtitle_rect_index_out_of_range;
2332 static PyObject *__pyx_n_s_test;
2333 static PyObject *__pyx_n_b_text;
2334 static PyObject *__pyx_n_s_text;
2335 static PyObject *__pyx_n_s_throw;
2336 static PyObject *__pyx_kp_s_unknown_subtitle_type_r;
2337 static PyObject *__pyx_n_s_width;
2338 static PyObject *__pyx_n_s_x;
2339 static PyObject *__pyx_n_s_y;
2340 static void __pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy___dealloc__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *__pyx_v_self); /* proto */
2341 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *__pyx_v_self); /* proto */
2342 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2343 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_9__cinit___genexpr(PyObject *__pyx_self); /* proto */
2344 static int __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self, struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *__pyx_v_proxy); /* proto */
2345 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_2__repr__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self); /* proto */
2346 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6format___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self); /* proto */
2347 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_18start_display_time___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self); /* proto */
2348 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_16end_display_time___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self); /* proto */
2349 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_3pts___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self); /* proto */
2350 static Py_ssize_t __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_4__len__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self); /* proto */
2351 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6__iter__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self); /* proto */
2352 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_8__getitem__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
2353 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6packet___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self); /* proto */
2354 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_5rects___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self); /* proto */
2355 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self); /* proto */
2356 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2357 static int __pyx_pf_2av_9subtitles_8subtitle_8Subtitle___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_v_self, struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_subtitle, int __pyx_v_index); /* proto */
2358 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_2__repr__(struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_v_self); /* proto */
2359 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_4type___get__(struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_v_self); /* proto */
2360 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_v_self); /* proto */
2361 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2362 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_9__cinit___genexpr(PyObject *__pyx_self); /* proto */
2363 static int __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_subtitle, CYTHON_UNUSED int __pyx_v_index); /* proto */
2364 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_2__repr__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self); /* proto */
2365 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_1x___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self); /* proto */
2366 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_1y___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self); /* proto */
2367 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_5width___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self); /* proto */
2368 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6height___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self); /* proto */
2369 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_9nb_colors___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self); /* proto */
2370 static Py_ssize_t __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_4__len__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self); /* proto */
2371 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6__iter__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self); /* proto */
2372 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_8__getitem__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
2373 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6planes___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self); /* proto */
2374 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self); /* proto */
2375 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2376 static int __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_subtitle, int __pyx_v_index); /* proto */
2377 #if PY_MAJOR_VERSION < 3
2378 static Py_ssize_t __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_2__getsegcount__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, Py_ssize_t *__pyx_v_len_out); /* proto */
2379 #endif
2380 #if PY_MAJOR_VERSION < 3
2381 static Py_ssize_t __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_4__getreadbuffer__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, Py_ssize_t __pyx_v_index, void **__pyx_v_data); /* proto */
2382 #endif
2383 #if PY_MAJOR_VERSION < 3
2384 static Py_ssize_t __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_6__getwritebuffer__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, Py_ssize_t __pyx_v_index, void **__pyx_v_data); /* proto */
2385 #endif
2386 static int __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8__getbuffer__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */
2387 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8subtitle___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self); /* proto */
2388 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5index___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self); /* proto */
2389 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11buffer_size___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self); /* proto */
2390 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self); /* proto */
2391 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2392 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle___repr__(struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *__pyx_v_self); /* proto */
2393 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_4text___get__(struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *__pyx_v_self); /* proto */
2394 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *__pyx_v_self); /* proto */
2395 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2396 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle___repr__(struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *__pyx_v_self); /* proto */
2397 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_3ass___get__(struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *__pyx_v_self); /* proto */
2398 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *__pyx_v_self); /* proto */
2399 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2400 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_SubtitleProxy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2401 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_SubtitleSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2402 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_Subtitle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2403 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_TextSubtitle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2404 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_ASSSubtitle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2405 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_BitmapSubtitle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2406 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_BitmapSubtitlePlane(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2407 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_AssSubtitle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2408 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2409 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2410 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2411 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2412 static PyObject *__pyx_tuple_;
2413 static PyObject *__pyx_tuple__2;
2414 static PyObject *__pyx_tuple__3;
2415 static PyObject *__pyx_tuple__4;
2416 static PyObject *__pyx_tuple__5;
2417 static PyObject *__pyx_tuple__6;
2418 static PyObject *__pyx_tuple__7;
2419 static PyObject *__pyx_tuple__8;
2420 static PyObject *__pyx_tuple__9;
2421 static PyObject *__pyx_tuple__10;
2422 static PyObject *__pyx_tuple__11;
2423 static PyObject *__pyx_tuple__12;
2424 static PyObject *__pyx_tuple__13;
2425 static PyObject *__pyx_tuple__14;
2426 static PyObject *__pyx_tuple__15;
2427 static PyObject *__pyx_tuple__16;
2428 static PyObject *__pyx_tuple__17;
2429 static PyObject *__pyx_tuple__18;
2430 /* Late includes */
2431
2432 /* "av/subtitles/subtitle.pyx":5
2433 *
2434 * cdef class SubtitleProxy(object):
2435 * def __dealloc__(self): # <<<<<<<<<<<<<<
2436 * lib.avsubtitle_free(&self.struct)
2437 *
2438 */
2439
2440 /* Python wrapper */
2441 static void __pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_1__dealloc__(PyObject * __pyx_v_self)2442 static void __pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_1__dealloc__(PyObject *__pyx_v_self) {
2443 __Pyx_RefNannyDeclarations
2444 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
2445 __pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy___dealloc__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *)__pyx_v_self));
2446
2447 /* function exit code */
2448 __Pyx_RefNannyFinishContext();
2449 }
2450
__pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy___dealloc__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy * __pyx_v_self)2451 static void __pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy___dealloc__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *__pyx_v_self) {
2452 __Pyx_RefNannyDeclarations
2453 __Pyx_RefNannySetupContext("__dealloc__", 0);
2454
2455 /* "av/subtitles/subtitle.pyx":6
2456 * cdef class SubtitleProxy(object):
2457 * def __dealloc__(self):
2458 * lib.avsubtitle_free(&self.struct) # <<<<<<<<<<<<<<
2459 *
2460 *
2461 */
2462 avsubtitle_free((&__pyx_v_self->__pyx_struct));
2463
2464 /* "av/subtitles/subtitle.pyx":5
2465 *
2466 * cdef class SubtitleProxy(object):
2467 * def __dealloc__(self): # <<<<<<<<<<<<<<
2468 * lib.avsubtitle_free(&self.struct)
2469 *
2470 */
2471
2472 /* function exit code */
2473 __Pyx_RefNannyFinishContext();
2474 }
2475
2476 /* "(tree fragment)":1
2477 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2478 * raise TypeError("self.struct cannot be converted to a Python object for pickling")
2479 * def __setstate_cython__(self, __pyx_state):
2480 */
2481
2482 /* Python wrapper */
2483 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2484 static char __pyx_doc_2av_9subtitles_8subtitle_13SubtitleProxy_2__reduce_cython__[] = "SubtitleProxy.__reduce_cython__()";
__pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)2485 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2486 PyObject *__pyx_r = 0;
2487 __Pyx_RefNannyDeclarations
2488 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
2489 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy_2__reduce_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *)__pyx_v_self));
2490
2491 /* function exit code */
2492 __Pyx_RefNannyFinishContext();
2493 return __pyx_r;
2494 }
2495
__pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy * __pyx_v_self)2496 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *__pyx_v_self) {
2497 PyObject *__pyx_r = NULL;
2498 __Pyx_RefNannyDeclarations
2499 PyObject *__pyx_t_1 = NULL;
2500 int __pyx_lineno = 0;
2501 const char *__pyx_filename = NULL;
2502 int __pyx_clineno = 0;
2503 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
2504
2505 /* "(tree fragment)":2
2506 * def __reduce_cython__(self):
2507 * raise TypeError("self.struct cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
2508 * def __setstate_cython__(self, __pyx_state):
2509 * raise TypeError("self.struct cannot be converted to a Python object for pickling")
2510 */
2511 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
2512 __Pyx_GOTREF(__pyx_t_1);
2513 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2514 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2515 __PYX_ERR(0, 2, __pyx_L1_error)
2516
2517 /* "(tree fragment)":1
2518 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2519 * raise TypeError("self.struct cannot be converted to a Python object for pickling")
2520 * def __setstate_cython__(self, __pyx_state):
2521 */
2522
2523 /* function exit code */
2524 __pyx_L1_error:;
2525 __Pyx_XDECREF(__pyx_t_1);
2526 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleProxy.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2527 __pyx_r = NULL;
2528 __Pyx_XGIVEREF(__pyx_r);
2529 __Pyx_RefNannyFinishContext();
2530 return __pyx_r;
2531 }
2532
2533 /* "(tree fragment)":3
2534 * def __reduce_cython__(self):
2535 * raise TypeError("self.struct cannot be converted to a Python object for pickling")
2536 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2537 * raise TypeError("self.struct cannot be converted to a Python object for pickling")
2538 */
2539
2540 /* Python wrapper */
2541 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
2542 static char __pyx_doc_2av_9subtitles_8subtitle_13SubtitleProxy_4__setstate_cython__[] = "SubtitleProxy.__setstate_cython__(__pyx_state)";
__pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)2543 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
2544 PyObject *__pyx_r = 0;
2545 __Pyx_RefNannyDeclarations
2546 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
2547 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy_4__setstate_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
2548
2549 /* function exit code */
2550 __Pyx_RefNannyFinishContext();
2551 return __pyx_r;
2552 }
2553
__pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)2554 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_13SubtitleProxy_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
2555 PyObject *__pyx_r = NULL;
2556 __Pyx_RefNannyDeclarations
2557 PyObject *__pyx_t_1 = NULL;
2558 int __pyx_lineno = 0;
2559 const char *__pyx_filename = NULL;
2560 int __pyx_clineno = 0;
2561 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
2562
2563 /* "(tree fragment)":4
2564 * raise TypeError("self.struct cannot be converted to a Python object for pickling")
2565 * def __setstate_cython__(self, __pyx_state):
2566 * raise TypeError("self.struct cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
2567 */
2568 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
2569 __Pyx_GOTREF(__pyx_t_1);
2570 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2571 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2572 __PYX_ERR(0, 4, __pyx_L1_error)
2573
2574 /* "(tree fragment)":3
2575 * def __reduce_cython__(self):
2576 * raise TypeError("self.struct cannot be converted to a Python object for pickling")
2577 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2578 * raise TypeError("self.struct cannot be converted to a Python object for pickling")
2579 */
2580
2581 /* function exit code */
2582 __pyx_L1_error:;
2583 __Pyx_XDECREF(__pyx_t_1);
2584 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleProxy.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2585 __pyx_r = NULL;
2586 __Pyx_XGIVEREF(__pyx_r);
2587 __Pyx_RefNannyFinishContext();
2588 return __pyx_r;
2589 }
2590
2591 /* "av/subtitles/subtitle.pyx":11
2592 * cdef class SubtitleSet(object):
2593 *
2594 * def __cinit__(self, SubtitleProxy proxy): # <<<<<<<<<<<<<<
2595 * self.proxy = proxy
2596 * cdef int i
2597 */
2598
2599 /* Python wrapper */
2600 static int __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2601 static int __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2602 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *__pyx_v_proxy = 0;
2603 int __pyx_lineno = 0;
2604 const char *__pyx_filename = NULL;
2605 int __pyx_clineno = 0;
2606 int __pyx_r;
2607 __Pyx_RefNannyDeclarations
2608 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2609 {
2610 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_proxy,0};
2611 PyObject* values[1] = {0};
2612 if (unlikely(__pyx_kwds)) {
2613 Py_ssize_t kw_args;
2614 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2615 switch (pos_args) {
2616 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2617 CYTHON_FALLTHROUGH;
2618 case 0: break;
2619 default: goto __pyx_L5_argtuple_error;
2620 }
2621 kw_args = PyDict_Size(__pyx_kwds);
2622 switch (pos_args) {
2623 case 0:
2624 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_proxy)) != 0)) kw_args--;
2625 else goto __pyx_L5_argtuple_error;
2626 }
2627 if (unlikely(kw_args > 0)) {
2628 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 11, __pyx_L3_error)
2629 }
2630 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2631 goto __pyx_L5_argtuple_error;
2632 } else {
2633 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2634 }
2635 __pyx_v_proxy = ((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *)values[0]);
2636 }
2637 goto __pyx_L4_argument_unpacking_done;
2638 __pyx_L5_argtuple_error:;
2639 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 11, __pyx_L3_error)
2640 __pyx_L3_error:;
2641 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2642 __Pyx_RefNannyFinishContext();
2643 return -1;
2644 __pyx_L4_argument_unpacking_done:;
2645 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_proxy), __pyx_ptype_2av_9subtitles_8subtitle_SubtitleProxy, 1, "proxy", 0))) __PYX_ERR(1, 11, __pyx_L1_error)
2646 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet___cinit__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self), __pyx_v_proxy);
2647
2648 /* function exit code */
2649 goto __pyx_L0;
2650 __pyx_L1_error:;
2651 __pyx_r = -1;
2652 __pyx_L0:;
2653 __Pyx_RefNannyFinishContext();
2654 return __pyx_r;
2655 }
2656 static PyObject *__pyx_gb_2av_9subtitles_8subtitle_11SubtitleSet_9__cinit___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
2657
2658 /* "av/subtitles/subtitle.pyx":14
2659 * self.proxy = proxy
2660 * cdef int i
2661 * self.rects = tuple(build_subtitle(self, i) for i in range(self.proxy.struct.num_rects)) # <<<<<<<<<<<<<<
2662 *
2663 * def __repr__(self):
2664 */
2665
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_9__cinit___genexpr(PyObject * __pyx_self)2666 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_9__cinit___genexpr(PyObject *__pyx_self) {
2667 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
2668 PyObject *__pyx_r = NULL;
2669 __Pyx_RefNannyDeclarations
2670 int __pyx_lineno = 0;
2671 const char *__pyx_filename = NULL;
2672 int __pyx_clineno = 0;
2673 __Pyx_RefNannySetupContext("genexpr", 0);
2674 __pyx_cur_scope = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *)__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr(__pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
2675 if (unlikely(!__pyx_cur_scope)) {
2676 __pyx_cur_scope = ((struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *)Py_None);
2677 __Pyx_INCREF(Py_None);
2678 __PYX_ERR(1, 14, __pyx_L1_error)
2679 } else {
2680 __Pyx_GOTREF(__pyx_cur_scope);
2681 }
2682 __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *) __pyx_self;
2683 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
2684 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
2685 {
2686 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2av_9subtitles_8subtitle_11SubtitleSet_9__cinit___2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cinit___locals_genexpr, __pyx_n_s_av_subtitles_subtitle); if (unlikely(!gen)) __PYX_ERR(1, 14, __pyx_L1_error)
2687 __Pyx_DECREF(__pyx_cur_scope);
2688 __Pyx_RefNannyFinishContext();
2689 return (PyObject *) gen;
2690 }
2691
2692 /* function exit code */
2693 __pyx_L1_error:;
2694 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.__cinit__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
2695 __pyx_r = NULL;
2696 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
2697 __Pyx_XGIVEREF(__pyx_r);
2698 __Pyx_RefNannyFinishContext();
2699 return __pyx_r;
2700 }
2701
__pyx_gb_2av_9subtitles_8subtitle_11SubtitleSet_9__cinit___2generator(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)2702 static PyObject *__pyx_gb_2av_9subtitles_8subtitle_11SubtitleSet_9__cinit___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
2703 {
2704 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
2705 PyObject *__pyx_r = NULL;
2706 unsigned int __pyx_t_1;
2707 unsigned int __pyx_t_2;
2708 unsigned int __pyx_t_3;
2709 PyObject *__pyx_t_4 = NULL;
2710 PyObject *__pyx_t_5 = NULL;
2711 int __pyx_lineno = 0;
2712 const char *__pyx_filename = NULL;
2713 int __pyx_clineno = 0;
2714 __Pyx_RefNannyDeclarations
2715 __Pyx_RefNannySetupContext("genexpr", 0);
2716 switch (__pyx_generator->resume_label) {
2717 case 0: goto __pyx_L3_first_run;
2718 case 1: goto __pyx_L6_resume_from_yield;
2719 default: /* CPython raises the right error here */
2720 __Pyx_RefNannyFinishContext();
2721 return NULL;
2722 }
2723 __pyx_L3_first_run:;
2724 if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 14, __pyx_L1_error)
2725 if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(1, 14, __pyx_L1_error) }
2726 __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->proxy->__pyx_struct.num_rects;
2727 __pyx_t_2 = __pyx_t_1;
2728 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2729 __pyx_cur_scope->__pyx_v_i = __pyx_t_3;
2730 if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(1, 14, __pyx_L1_error) }
2731 __pyx_t_4 = ((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self);
2732 __Pyx_INCREF(__pyx_t_4);
2733 __pyx_t_5 = ((PyObject *)__pyx_f_2av_9subtitles_8subtitle_build_subtitle(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_t_4), __pyx_cur_scope->__pyx_v_i)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
2734 __Pyx_GOTREF(__pyx_t_5);
2735 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2736 __pyx_r = __pyx_t_5;
2737 __pyx_t_5 = 0;
2738 __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
2739 __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
2740 __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
2741 __Pyx_XGIVEREF(__pyx_r);
2742 __Pyx_RefNannyFinishContext();
2743 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
2744 /* return from generator, yielding value */
2745 __pyx_generator->resume_label = 1;
2746 return __pyx_r;
2747 __pyx_L6_resume_from_yield:;
2748 __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
2749 __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
2750 __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
2751 if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 14, __pyx_L1_error)
2752 }
2753 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
2754
2755 /* function exit code */
2756 PyErr_SetNone(PyExc_StopIteration);
2757 goto __pyx_L0;
2758 __pyx_L1_error:;
2759 __Pyx_XDECREF(__pyx_t_4);
2760 __Pyx_XDECREF(__pyx_t_5);
2761 __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
2762 __pyx_L0:;
2763 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
2764 #if !CYTHON_USE_EXC_INFO_STACK
2765 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
2766 #endif
2767 __pyx_generator->resume_label = -1;
2768 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
2769 __Pyx_RefNannyFinishContext();
2770 return __pyx_r;
2771 }
2772
2773 /* "av/subtitles/subtitle.pyx":11
2774 * cdef class SubtitleSet(object):
2775 *
2776 * def __cinit__(self, SubtitleProxy proxy): # <<<<<<<<<<<<<<
2777 * self.proxy = proxy
2778 * cdef int i
2779 */
2780
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self,struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy * __pyx_v_proxy)2781 static int __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self, struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *__pyx_v_proxy) {
2782 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *__pyx_cur_scope;
2783 int __pyx_r;
2784 __Pyx_RefNannyDeclarations
2785 PyObject *__pyx_t_1 = NULL;
2786 PyObject *__pyx_t_2 = NULL;
2787 int __pyx_lineno = 0;
2788 const char *__pyx_filename = NULL;
2789 int __pyx_clineno = 0;
2790 __Pyx_RefNannySetupContext("__cinit__", 0);
2791 __pyx_cur_scope = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *)__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__(__pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__, __pyx_empty_tuple, NULL);
2792 if (unlikely(!__pyx_cur_scope)) {
2793 __pyx_cur_scope = ((struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *)Py_None);
2794 __Pyx_INCREF(Py_None);
2795 __PYX_ERR(1, 11, __pyx_L1_error)
2796 } else {
2797 __Pyx_GOTREF(__pyx_cur_scope);
2798 }
2799 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
2800 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
2801 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
2802
2803 /* "av/subtitles/subtitle.pyx":12
2804 *
2805 * def __cinit__(self, SubtitleProxy proxy):
2806 * self.proxy = proxy # <<<<<<<<<<<<<<
2807 * cdef int i
2808 * self.rects = tuple(build_subtitle(self, i) for i in range(self.proxy.struct.num_rects))
2809 */
2810 __Pyx_INCREF(((PyObject *)__pyx_v_proxy));
2811 __Pyx_GIVEREF(((PyObject *)__pyx_v_proxy));
2812 __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->proxy);
2813 __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->proxy));
2814 __pyx_cur_scope->__pyx_v_self->proxy = __pyx_v_proxy;
2815
2816 /* "av/subtitles/subtitle.pyx":14
2817 * self.proxy = proxy
2818 * cdef int i
2819 * self.rects = tuple(build_subtitle(self, i) for i in range(self.proxy.struct.num_rects)) # <<<<<<<<<<<<<<
2820 *
2821 * def __repr__(self):
2822 */
2823 __pyx_t_1 = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_9__cinit___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
2824 __Pyx_GOTREF(__pyx_t_1);
2825 __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
2826 __Pyx_GOTREF(__pyx_t_2);
2827 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2828 __Pyx_GIVEREF(__pyx_t_2);
2829 __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->rects);
2830 __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->rects);
2831 __pyx_cur_scope->__pyx_v_self->rects = ((PyObject*)__pyx_t_2);
2832 __pyx_t_2 = 0;
2833
2834 /* "av/subtitles/subtitle.pyx":11
2835 * cdef class SubtitleSet(object):
2836 *
2837 * def __cinit__(self, SubtitleProxy proxy): # <<<<<<<<<<<<<<
2838 * self.proxy = proxy
2839 * cdef int i
2840 */
2841
2842 /* function exit code */
2843 __pyx_r = 0;
2844 goto __pyx_L0;
2845 __pyx_L1_error:;
2846 __Pyx_XDECREF(__pyx_t_1);
2847 __Pyx_XDECREF(__pyx_t_2);
2848 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2849 __pyx_r = -1;
2850 __pyx_L0:;
2851 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
2852 __Pyx_RefNannyFinishContext();
2853 return __pyx_r;
2854 }
2855
2856 /* "av/subtitles/subtitle.pyx":16
2857 * self.rects = tuple(build_subtitle(self, i) for i in range(self.proxy.struct.num_rects))
2858 *
2859 * def __repr__(self): # <<<<<<<<<<<<<<
2860 * return '<%s.%s at 0x%x>' % (
2861 * self.__class__.__module__,
2862 */
2863
2864 /* Python wrapper */
2865 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_3__repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_3__repr__(PyObject * __pyx_v_self)2866 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_3__repr__(PyObject *__pyx_v_self) {
2867 PyObject *__pyx_r = 0;
2868 __Pyx_RefNannyDeclarations
2869 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
2870 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_2__repr__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self));
2871
2872 /* function exit code */
2873 __Pyx_RefNannyFinishContext();
2874 return __pyx_r;
2875 }
2876
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_2__repr__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self)2877 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_2__repr__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self) {
2878 PyObject *__pyx_r = NULL;
2879 __Pyx_RefNannyDeclarations
2880 PyObject *__pyx_t_1 = NULL;
2881 PyObject *__pyx_t_2 = NULL;
2882 PyObject *__pyx_t_3 = NULL;
2883 PyObject *__pyx_t_4 = NULL;
2884 int __pyx_lineno = 0;
2885 const char *__pyx_filename = NULL;
2886 int __pyx_clineno = 0;
2887 __Pyx_RefNannySetupContext("__repr__", 0);
2888
2889 /* "av/subtitles/subtitle.pyx":17
2890 *
2891 * def __repr__(self):
2892 * return '<%s.%s at 0x%x>' % ( # <<<<<<<<<<<<<<
2893 * self.__class__.__module__,
2894 * self.__class__.__name__,
2895 */
2896 __Pyx_XDECREF(__pyx_r);
2897
2898 /* "av/subtitles/subtitle.pyx":18
2899 * def __repr__(self):
2900 * return '<%s.%s at 0x%x>' % (
2901 * self.__class__.__module__, # <<<<<<<<<<<<<<
2902 * self.__class__.__name__,
2903 * id(self),
2904 */
2905 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error)
2906 __Pyx_GOTREF(__pyx_t_1);
2907 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __pyx_L1_error)
2908 __Pyx_GOTREF(__pyx_t_2);
2909 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2910
2911 /* "av/subtitles/subtitle.pyx":19
2912 * return '<%s.%s at 0x%x>' % (
2913 * self.__class__.__module__,
2914 * self.__class__.__name__, # <<<<<<<<<<<<<<
2915 * id(self),
2916 * )
2917 */
2918 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 19, __pyx_L1_error)
2919 __Pyx_GOTREF(__pyx_t_1);
2920 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 19, __pyx_L1_error)
2921 __Pyx_GOTREF(__pyx_t_3);
2922 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2923
2924 /* "av/subtitles/subtitle.pyx":20
2925 * self.__class__.__module__,
2926 * self.__class__.__name__,
2927 * id(self), # <<<<<<<<<<<<<<
2928 * )
2929 *
2930 */
2931 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error)
2932 __Pyx_GOTREF(__pyx_t_1);
2933
2934 /* "av/subtitles/subtitle.pyx":18
2935 * def __repr__(self):
2936 * return '<%s.%s at 0x%x>' % (
2937 * self.__class__.__module__, # <<<<<<<<<<<<<<
2938 * self.__class__.__name__,
2939 * id(self),
2940 */
2941 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 18, __pyx_L1_error)
2942 __Pyx_GOTREF(__pyx_t_4);
2943 __Pyx_GIVEREF(__pyx_t_2);
2944 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
2945 __Pyx_GIVEREF(__pyx_t_3);
2946 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
2947 __Pyx_GIVEREF(__pyx_t_1);
2948 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
2949 __pyx_t_2 = 0;
2950 __pyx_t_3 = 0;
2951 __pyx_t_1 = 0;
2952
2953 /* "av/subtitles/subtitle.pyx":17
2954 *
2955 * def __repr__(self):
2956 * return '<%s.%s at 0x%x>' % ( # <<<<<<<<<<<<<<
2957 * self.__class__.__module__,
2958 * self.__class__.__name__,
2959 */
2960 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_at_0x_x, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
2961 __Pyx_GOTREF(__pyx_t_1);
2962 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2963 __pyx_r = __pyx_t_1;
2964 __pyx_t_1 = 0;
2965 goto __pyx_L0;
2966
2967 /* "av/subtitles/subtitle.pyx":16
2968 * self.rects = tuple(build_subtitle(self, i) for i in range(self.proxy.struct.num_rects))
2969 *
2970 * def __repr__(self): # <<<<<<<<<<<<<<
2971 * return '<%s.%s at 0x%x>' % (
2972 * self.__class__.__module__,
2973 */
2974
2975 /* function exit code */
2976 __pyx_L1_error:;
2977 __Pyx_XDECREF(__pyx_t_1);
2978 __Pyx_XDECREF(__pyx_t_2);
2979 __Pyx_XDECREF(__pyx_t_3);
2980 __Pyx_XDECREF(__pyx_t_4);
2981 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2982 __pyx_r = NULL;
2983 __pyx_L0:;
2984 __Pyx_XGIVEREF(__pyx_r);
2985 __Pyx_RefNannyFinishContext();
2986 return __pyx_r;
2987 }
2988
2989 /* "av/subtitles/subtitle.pyx":24
2990 *
2991 * property format:
2992 * def __get__(self): return self.proxy.struct.format # <<<<<<<<<<<<<<
2993 * property start_display_time:
2994 * def __get__(self): return self.proxy.struct.start_display_time
2995 */
2996
2997 /* Python wrapper */
2998 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_6format_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_6format_1__get__(PyObject * __pyx_v_self)2999 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_6format_1__get__(PyObject *__pyx_v_self) {
3000 PyObject *__pyx_r = 0;
3001 __Pyx_RefNannyDeclarations
3002 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3003 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6format___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self));
3004
3005 /* function exit code */
3006 __Pyx_RefNannyFinishContext();
3007 return __pyx_r;
3008 }
3009
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6format___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self)3010 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6format___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self) {
3011 PyObject *__pyx_r = NULL;
3012 __Pyx_RefNannyDeclarations
3013 PyObject *__pyx_t_1 = NULL;
3014 int __pyx_lineno = 0;
3015 const char *__pyx_filename = NULL;
3016 int __pyx_clineno = 0;
3017 __Pyx_RefNannySetupContext("__get__", 0);
3018 __Pyx_XDECREF(__pyx_r);
3019 __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_self->proxy->__pyx_struct.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error)
3020 __Pyx_GOTREF(__pyx_t_1);
3021 __pyx_r = __pyx_t_1;
3022 __pyx_t_1 = 0;
3023 goto __pyx_L0;
3024
3025 /* function exit code */
3026 __pyx_L1_error:;
3027 __Pyx_XDECREF(__pyx_t_1);
3028 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.format.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3029 __pyx_r = NULL;
3030 __pyx_L0:;
3031 __Pyx_XGIVEREF(__pyx_r);
3032 __Pyx_RefNannyFinishContext();
3033 return __pyx_r;
3034 }
3035
3036 /* "av/subtitles/subtitle.pyx":26
3037 * def __get__(self): return self.proxy.struct.format
3038 * property start_display_time:
3039 * def __get__(self): return self.proxy.struct.start_display_time # <<<<<<<<<<<<<<
3040 * property end_display_time:
3041 * def __get__(self): return self.proxy.struct.end_display_time
3042 */
3043
3044 /* Python wrapper */
3045 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_18start_display_time_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_18start_display_time_1__get__(PyObject * __pyx_v_self)3046 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_18start_display_time_1__get__(PyObject *__pyx_v_self) {
3047 PyObject *__pyx_r = 0;
3048 __Pyx_RefNannyDeclarations
3049 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3050 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_18start_display_time___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self));
3051
3052 /* function exit code */
3053 __Pyx_RefNannyFinishContext();
3054 return __pyx_r;
3055 }
3056
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_18start_display_time___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self)3057 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_18start_display_time___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self) {
3058 PyObject *__pyx_r = NULL;
3059 __Pyx_RefNannyDeclarations
3060 PyObject *__pyx_t_1 = NULL;
3061 int __pyx_lineno = 0;
3062 const char *__pyx_filename = NULL;
3063 int __pyx_clineno = 0;
3064 __Pyx_RefNannySetupContext("__get__", 0);
3065 __Pyx_XDECREF(__pyx_r);
3066 __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->proxy->__pyx_struct.start_display_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error)
3067 __Pyx_GOTREF(__pyx_t_1);
3068 __pyx_r = __pyx_t_1;
3069 __pyx_t_1 = 0;
3070 goto __pyx_L0;
3071
3072 /* function exit code */
3073 __pyx_L1_error:;
3074 __Pyx_XDECREF(__pyx_t_1);
3075 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.start_display_time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3076 __pyx_r = NULL;
3077 __pyx_L0:;
3078 __Pyx_XGIVEREF(__pyx_r);
3079 __Pyx_RefNannyFinishContext();
3080 return __pyx_r;
3081 }
3082
3083 /* "av/subtitles/subtitle.pyx":28
3084 * def __get__(self): return self.proxy.struct.start_display_time
3085 * property end_display_time:
3086 * def __get__(self): return self.proxy.struct.end_display_time # <<<<<<<<<<<<<<
3087 * property pts:
3088 * def __get__(self): return self.proxy.struct.pts
3089 */
3090
3091 /* Python wrapper */
3092 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_16end_display_time_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_16end_display_time_1__get__(PyObject * __pyx_v_self)3093 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_16end_display_time_1__get__(PyObject *__pyx_v_self) {
3094 PyObject *__pyx_r = 0;
3095 __Pyx_RefNannyDeclarations
3096 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3097 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_16end_display_time___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self));
3098
3099 /* function exit code */
3100 __Pyx_RefNannyFinishContext();
3101 return __pyx_r;
3102 }
3103
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_16end_display_time___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self)3104 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_16end_display_time___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self) {
3105 PyObject *__pyx_r = NULL;
3106 __Pyx_RefNannyDeclarations
3107 PyObject *__pyx_t_1 = NULL;
3108 int __pyx_lineno = 0;
3109 const char *__pyx_filename = NULL;
3110 int __pyx_clineno = 0;
3111 __Pyx_RefNannySetupContext("__get__", 0);
3112 __Pyx_XDECREF(__pyx_r);
3113 __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->proxy->__pyx_struct.end_display_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error)
3114 __Pyx_GOTREF(__pyx_t_1);
3115 __pyx_r = __pyx_t_1;
3116 __pyx_t_1 = 0;
3117 goto __pyx_L0;
3118
3119 /* function exit code */
3120 __pyx_L1_error:;
3121 __Pyx_XDECREF(__pyx_t_1);
3122 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.end_display_time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3123 __pyx_r = NULL;
3124 __pyx_L0:;
3125 __Pyx_XGIVEREF(__pyx_r);
3126 __Pyx_RefNannyFinishContext();
3127 return __pyx_r;
3128 }
3129
3130 /* "av/subtitles/subtitle.pyx":30
3131 * def __get__(self): return self.proxy.struct.end_display_time
3132 * property pts:
3133 * def __get__(self): return self.proxy.struct.pts # <<<<<<<<<<<<<<
3134 *
3135 * def __len__(self):
3136 */
3137
3138 /* Python wrapper */
3139 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_3pts_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_3pts_1__get__(PyObject * __pyx_v_self)3140 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_3pts_1__get__(PyObject *__pyx_v_self) {
3141 PyObject *__pyx_r = 0;
3142 __Pyx_RefNannyDeclarations
3143 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3144 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_3pts___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self));
3145
3146 /* function exit code */
3147 __Pyx_RefNannyFinishContext();
3148 return __pyx_r;
3149 }
3150
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_3pts___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self)3151 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_3pts___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self) {
3152 PyObject *__pyx_r = NULL;
3153 __Pyx_RefNannyDeclarations
3154 PyObject *__pyx_t_1 = NULL;
3155 int __pyx_lineno = 0;
3156 const char *__pyx_filename = NULL;
3157 int __pyx_clineno = 0;
3158 __Pyx_RefNannySetupContext("__get__", 0);
3159 __Pyx_XDECREF(__pyx_r);
3160 __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->proxy->__pyx_struct.pts); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error)
3161 __Pyx_GOTREF(__pyx_t_1);
3162 __pyx_r = __pyx_t_1;
3163 __pyx_t_1 = 0;
3164 goto __pyx_L0;
3165
3166 /* function exit code */
3167 __pyx_L1_error:;
3168 __Pyx_XDECREF(__pyx_t_1);
3169 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.pts.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3170 __pyx_r = NULL;
3171 __pyx_L0:;
3172 __Pyx_XGIVEREF(__pyx_r);
3173 __Pyx_RefNannyFinishContext();
3174 return __pyx_r;
3175 }
3176
3177 /* "av/subtitles/subtitle.pyx":32
3178 * def __get__(self): return self.proxy.struct.pts
3179 *
3180 * def __len__(self): # <<<<<<<<<<<<<<
3181 * return len(self.rects)
3182 *
3183 */
3184
3185 /* Python wrapper */
3186 static Py_ssize_t __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_5__len__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_5__len__(PyObject * __pyx_v_self)3187 static Py_ssize_t __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_5__len__(PyObject *__pyx_v_self) {
3188 Py_ssize_t __pyx_r;
3189 __Pyx_RefNannyDeclarations
3190 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
3191 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_4__len__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self));
3192
3193 /* function exit code */
3194 __Pyx_RefNannyFinishContext();
3195 return __pyx_r;
3196 }
3197
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_4__len__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self)3198 static Py_ssize_t __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_4__len__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self) {
3199 Py_ssize_t __pyx_r;
3200 __Pyx_RefNannyDeclarations
3201 PyObject *__pyx_t_1 = NULL;
3202 Py_ssize_t __pyx_t_2;
3203 int __pyx_lineno = 0;
3204 const char *__pyx_filename = NULL;
3205 int __pyx_clineno = 0;
3206 __Pyx_RefNannySetupContext("__len__", 0);
3207
3208 /* "av/subtitles/subtitle.pyx":33
3209 *
3210 * def __len__(self):
3211 * return len(self.rects) # <<<<<<<<<<<<<<
3212 *
3213 * def __iter__(self):
3214 */
3215 __pyx_t_1 = __pyx_v_self->rects;
3216 __Pyx_INCREF(__pyx_t_1);
3217 if (unlikely(__pyx_t_1 == Py_None)) {
3218 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3219 __PYX_ERR(1, 33, __pyx_L1_error)
3220 }
3221 __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 33, __pyx_L1_error)
3222 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3223 __pyx_r = __pyx_t_2;
3224 goto __pyx_L0;
3225
3226 /* "av/subtitles/subtitle.pyx":32
3227 * def __get__(self): return self.proxy.struct.pts
3228 *
3229 * def __len__(self): # <<<<<<<<<<<<<<
3230 * return len(self.rects)
3231 *
3232 */
3233
3234 /* function exit code */
3235 __pyx_L1_error:;
3236 __Pyx_XDECREF(__pyx_t_1);
3237 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3238 __pyx_r = -1;
3239 __pyx_L0:;
3240 __Pyx_RefNannyFinishContext();
3241 return __pyx_r;
3242 }
3243
3244 /* "av/subtitles/subtitle.pyx":35
3245 * return len(self.rects)
3246 *
3247 * def __iter__(self): # <<<<<<<<<<<<<<
3248 * return iter(self.rects)
3249 *
3250 */
3251
3252 /* Python wrapper */
3253 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_7__iter__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_7__iter__(PyObject * __pyx_v_self)3254 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_7__iter__(PyObject *__pyx_v_self) {
3255 PyObject *__pyx_r = 0;
3256 __Pyx_RefNannyDeclarations
3257 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
3258 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6__iter__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self));
3259
3260 /* function exit code */
3261 __Pyx_RefNannyFinishContext();
3262 return __pyx_r;
3263 }
3264
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6__iter__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self)3265 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6__iter__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self) {
3266 PyObject *__pyx_r = NULL;
3267 __Pyx_RefNannyDeclarations
3268 PyObject *__pyx_t_1 = NULL;
3269 PyObject *__pyx_t_2 = NULL;
3270 int __pyx_lineno = 0;
3271 const char *__pyx_filename = NULL;
3272 int __pyx_clineno = 0;
3273 __Pyx_RefNannySetupContext("__iter__", 0);
3274
3275 /* "av/subtitles/subtitle.pyx":36
3276 *
3277 * def __iter__(self):
3278 * return iter(self.rects) # <<<<<<<<<<<<<<
3279 *
3280 * def __getitem__(self, i):
3281 */
3282 __Pyx_XDECREF(__pyx_r);
3283 __pyx_t_1 = __pyx_v_self->rects;
3284 __Pyx_INCREF(__pyx_t_1);
3285 __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error)
3286 __Pyx_GOTREF(__pyx_t_2);
3287 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3288 __pyx_r = __pyx_t_2;
3289 __pyx_t_2 = 0;
3290 goto __pyx_L0;
3291
3292 /* "av/subtitles/subtitle.pyx":35
3293 * return len(self.rects)
3294 *
3295 * def __iter__(self): # <<<<<<<<<<<<<<
3296 * return iter(self.rects)
3297 *
3298 */
3299
3300 /* function exit code */
3301 __pyx_L1_error:;
3302 __Pyx_XDECREF(__pyx_t_1);
3303 __Pyx_XDECREF(__pyx_t_2);
3304 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3305 __pyx_r = NULL;
3306 __pyx_L0:;
3307 __Pyx_XGIVEREF(__pyx_r);
3308 __Pyx_RefNannyFinishContext();
3309 return __pyx_r;
3310 }
3311
3312 /* "av/subtitles/subtitle.pyx":38
3313 * return iter(self.rects)
3314 *
3315 * def __getitem__(self, i): # <<<<<<<<<<<<<<
3316 * return self.rects[i]
3317 *
3318 */
3319
3320 /* Python wrapper */
3321 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_9__getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_i)3322 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
3323 PyObject *__pyx_r = 0;
3324 __Pyx_RefNannyDeclarations
3325 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
3326 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_8__getitem__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self), ((PyObject *)__pyx_v_i));
3327
3328 /* function exit code */
3329 __Pyx_RefNannyFinishContext();
3330 return __pyx_r;
3331 }
3332
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_8__getitem__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self,PyObject * __pyx_v_i)3333 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_8__getitem__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self, PyObject *__pyx_v_i) {
3334 PyObject *__pyx_r = NULL;
3335 __Pyx_RefNannyDeclarations
3336 PyObject *__pyx_t_1 = NULL;
3337 int __pyx_lineno = 0;
3338 const char *__pyx_filename = NULL;
3339 int __pyx_clineno = 0;
3340 __Pyx_RefNannySetupContext("__getitem__", 0);
3341
3342 /* "av/subtitles/subtitle.pyx":39
3343 *
3344 * def __getitem__(self, i):
3345 * return self.rects[i] # <<<<<<<<<<<<<<
3346 *
3347 *
3348 */
3349 __Pyx_XDECREF(__pyx_r);
3350 if (unlikely(__pyx_v_self->rects == Py_None)) {
3351 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3352 __PYX_ERR(1, 39, __pyx_L1_error)
3353 }
3354 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->rects, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 39, __pyx_L1_error)
3355 __Pyx_GOTREF(__pyx_t_1);
3356 __pyx_r = __pyx_t_1;
3357 __pyx_t_1 = 0;
3358 goto __pyx_L0;
3359
3360 /* "av/subtitles/subtitle.pyx":38
3361 * return iter(self.rects)
3362 *
3363 * def __getitem__(self, i): # <<<<<<<<<<<<<<
3364 * return self.rects[i]
3365 *
3366 */
3367
3368 /* function exit code */
3369 __pyx_L1_error:;
3370 __Pyx_XDECREF(__pyx_t_1);
3371 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3372 __pyx_r = NULL;
3373 __pyx_L0:;
3374 __Pyx_XGIVEREF(__pyx_r);
3375 __Pyx_RefNannyFinishContext();
3376 return __pyx_r;
3377 }
3378
3379 /* "av/subtitles/subtitle.pxd":13
3380 * cdef class SubtitleSet(object):
3381 *
3382 * cdef readonly Packet packet # <<<<<<<<<<<<<<
3383 * cdef SubtitleProxy proxy
3384 * cdef readonly tuple rects
3385 */
3386
3387 /* Python wrapper */
3388 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_6packet_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_6packet_1__get__(PyObject * __pyx_v_self)3389 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_6packet_1__get__(PyObject *__pyx_v_self) {
3390 PyObject *__pyx_r = 0;
3391 __Pyx_RefNannyDeclarations
3392 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3393 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6packet___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self));
3394
3395 /* function exit code */
3396 __Pyx_RefNannyFinishContext();
3397 return __pyx_r;
3398 }
3399
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6packet___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self)3400 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_6packet___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self) {
3401 PyObject *__pyx_r = NULL;
3402 __Pyx_RefNannyDeclarations
3403 __Pyx_RefNannySetupContext("__get__", 0);
3404 __Pyx_XDECREF(__pyx_r);
3405 __Pyx_INCREF(((PyObject *)__pyx_v_self->packet));
3406 __pyx_r = ((PyObject *)__pyx_v_self->packet);
3407 goto __pyx_L0;
3408
3409 /* function exit code */
3410 __pyx_L0:;
3411 __Pyx_XGIVEREF(__pyx_r);
3412 __Pyx_RefNannyFinishContext();
3413 return __pyx_r;
3414 }
3415
3416 /* "av/subtitles/subtitle.pxd":15
3417 * cdef readonly Packet packet
3418 * cdef SubtitleProxy proxy
3419 * cdef readonly tuple rects # <<<<<<<<<<<<<<
3420 *
3421 *
3422 */
3423
3424 /* Python wrapper */
3425 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_5rects_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_5rects_1__get__(PyObject * __pyx_v_self)3426 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_5rects_1__get__(PyObject *__pyx_v_self) {
3427 PyObject *__pyx_r = 0;
3428 __Pyx_RefNannyDeclarations
3429 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3430 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_5rects___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self));
3431
3432 /* function exit code */
3433 __Pyx_RefNannyFinishContext();
3434 return __pyx_r;
3435 }
3436
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_5rects___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self)3437 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_5rects___get__(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self) {
3438 PyObject *__pyx_r = NULL;
3439 __Pyx_RefNannyDeclarations
3440 __Pyx_RefNannySetupContext("__get__", 0);
3441 __Pyx_XDECREF(__pyx_r);
3442 __Pyx_INCREF(__pyx_v_self->rects);
3443 __pyx_r = __pyx_v_self->rects;
3444 goto __pyx_L0;
3445
3446 /* function exit code */
3447 __pyx_L0:;
3448 __Pyx_XGIVEREF(__pyx_r);
3449 __Pyx_RefNannyFinishContext();
3450 return __pyx_r;
3451 }
3452
3453 /* "(tree fragment)":1
3454 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3455 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3456 * def __setstate_cython__(self, __pyx_state):
3457 */
3458
3459 /* Python wrapper */
3460 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3461 static char __pyx_doc_2av_9subtitles_8subtitle_11SubtitleSet_10__reduce_cython__[] = "SubtitleSet.__reduce_cython__()";
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_11__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3462 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3463 PyObject *__pyx_r = 0;
3464 __Pyx_RefNannyDeclarations
3465 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3466 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_10__reduce_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self));
3467
3468 /* function exit code */
3469 __Pyx_RefNannyFinishContext();
3470 return __pyx_r;
3471 }
3472
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self)3473 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self) {
3474 PyObject *__pyx_r = NULL;
3475 __Pyx_RefNannyDeclarations
3476 PyObject *__pyx_t_1 = NULL;
3477 int __pyx_lineno = 0;
3478 const char *__pyx_filename = NULL;
3479 int __pyx_clineno = 0;
3480 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3481
3482 /* "(tree fragment)":2
3483 * def __reduce_cython__(self):
3484 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3485 * def __setstate_cython__(self, __pyx_state):
3486 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3487 */
3488 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
3489 __Pyx_GOTREF(__pyx_t_1);
3490 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3491 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3492 __PYX_ERR(0, 2, __pyx_L1_error)
3493
3494 /* "(tree fragment)":1
3495 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3496 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3497 * def __setstate_cython__(self, __pyx_state):
3498 */
3499
3500 /* function exit code */
3501 __pyx_L1_error:;
3502 __Pyx_XDECREF(__pyx_t_1);
3503 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3504 __pyx_r = NULL;
3505 __Pyx_XGIVEREF(__pyx_r);
3506 __Pyx_RefNannyFinishContext();
3507 return __pyx_r;
3508 }
3509
3510 /* "(tree fragment)":3
3511 * def __reduce_cython__(self):
3512 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3513 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3514 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3515 */
3516
3517 /* Python wrapper */
3518 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3519 static char __pyx_doc_2av_9subtitles_8subtitle_11SubtitleSet_12__setstate_cython__[] = "SubtitleSet.__setstate_cython__(__pyx_state)";
__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_13__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)3520 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3521 PyObject *__pyx_r = 0;
3522 __Pyx_RefNannyDeclarations
3523 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3524 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_12__setstate_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3525
3526 /* function exit code */
3527 __Pyx_RefNannyFinishContext();
3528 return __pyx_r;
3529 }
3530
__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)3531 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11SubtitleSet_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3532 PyObject *__pyx_r = NULL;
3533 __Pyx_RefNannyDeclarations
3534 PyObject *__pyx_t_1 = NULL;
3535 int __pyx_lineno = 0;
3536 const char *__pyx_filename = NULL;
3537 int __pyx_clineno = 0;
3538 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3539
3540 /* "(tree fragment)":4
3541 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3542 * def __setstate_cython__(self, __pyx_state):
3543 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3544 */
3545 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
3546 __Pyx_GOTREF(__pyx_t_1);
3547 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3548 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3549 __PYX_ERR(0, 4, __pyx_L1_error)
3550
3551 /* "(tree fragment)":3
3552 * def __reduce_cython__(self):
3553 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3554 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3555 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3556 */
3557
3558 /* function exit code */
3559 __pyx_L1_error:;
3560 __Pyx_XDECREF(__pyx_t_1);
3561 __Pyx_AddTraceback("av.subtitles.subtitle.SubtitleSet.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3562 __pyx_r = NULL;
3563 __Pyx_XGIVEREF(__pyx_r);
3564 __Pyx_RefNannyFinishContext();
3565 return __pyx_r;
3566 }
3567
3568 /* "av/subtitles/subtitle.pyx":42
3569 *
3570 *
3571 * cdef Subtitle build_subtitle(SubtitleSet subtitle, int index): # <<<<<<<<<<<<<<
3572 * """Build an av.Stream for an existing AVStream.
3573 *
3574 */
3575
__pyx_f_2av_9subtitles_8subtitle_build_subtitle(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_subtitle,int __pyx_v_index)3576 static struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_f_2av_9subtitles_8subtitle_build_subtitle(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_subtitle, int __pyx_v_index) {
3577 struct AVSubtitleRect *__pyx_v_ptr;
3578 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_r = NULL;
3579 __Pyx_RefNannyDeclarations
3580 int __pyx_t_1;
3581 int __pyx_t_2;
3582 PyObject *__pyx_t_3 = NULL;
3583 PyObject *__pyx_t_4 = NULL;
3584 int __pyx_lineno = 0;
3585 const char *__pyx_filename = NULL;
3586 int __pyx_clineno = 0;
3587 __Pyx_RefNannySetupContext("build_subtitle", 0);
3588
3589 /* "av/subtitles/subtitle.pyx":50
3590 * """
3591 *
3592 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects: # <<<<<<<<<<<<<<
3593 * raise ValueError('subtitle rect index out of range')
3594 * cdef lib.AVSubtitleRect *ptr = subtitle.proxy.struct.rects[index]
3595 */
3596 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
3597 if (!__pyx_t_2) {
3598 } else {
3599 __pyx_t_1 = __pyx_t_2;
3600 goto __pyx_L4_bool_binop_done;
3601 }
3602 __pyx_t_2 = ((((unsigned int)__pyx_v_index) >= __pyx_v_subtitle->proxy->__pyx_struct.num_rects) != 0);
3603 __pyx_t_1 = __pyx_t_2;
3604 __pyx_L4_bool_binop_done:;
3605 if (unlikely(__pyx_t_1)) {
3606
3607 /* "av/subtitles/subtitle.pyx":51
3608 *
3609 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects:
3610 * raise ValueError('subtitle rect index out of range') # <<<<<<<<<<<<<<
3611 * cdef lib.AVSubtitleRect *ptr = subtitle.proxy.struct.rects[index]
3612 *
3613 */
3614 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 51, __pyx_L1_error)
3615 __Pyx_GOTREF(__pyx_t_3);
3616 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3617 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3618 __PYX_ERR(1, 51, __pyx_L1_error)
3619
3620 /* "av/subtitles/subtitle.pyx":50
3621 * """
3622 *
3623 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects: # <<<<<<<<<<<<<<
3624 * raise ValueError('subtitle rect index out of range')
3625 * cdef lib.AVSubtitleRect *ptr = subtitle.proxy.struct.rects[index]
3626 */
3627 }
3628
3629 /* "av/subtitles/subtitle.pyx":52
3630 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects:
3631 * raise ValueError('subtitle rect index out of range')
3632 * cdef lib.AVSubtitleRect *ptr = subtitle.proxy.struct.rects[index] # <<<<<<<<<<<<<<
3633 *
3634 * if ptr.type == lib.SUBTITLE_NONE:
3635 */
3636 __pyx_v_ptr = (__pyx_v_subtitle->proxy->__pyx_struct.rects[__pyx_v_index]);
3637
3638 /* "av/subtitles/subtitle.pyx":54
3639 * cdef lib.AVSubtitleRect *ptr = subtitle.proxy.struct.rects[index]
3640 *
3641 * if ptr.type == lib.SUBTITLE_NONE: # <<<<<<<<<<<<<<
3642 * return Subtitle(subtitle, index)
3643 * elif ptr.type == lib.SUBTITLE_BITMAP:
3644 */
3645 switch (__pyx_v_ptr->type) {
3646 case SUBTITLE_NONE:
3647
3648 /* "av/subtitles/subtitle.pyx":55
3649 *
3650 * if ptr.type == lib.SUBTITLE_NONE:
3651 * return Subtitle(subtitle, index) # <<<<<<<<<<<<<<
3652 * elif ptr.type == lib.SUBTITLE_BITMAP:
3653 * return BitmapSubtitle(subtitle, index)
3654 */
3655 __Pyx_XDECREF(((PyObject *)__pyx_r));
3656 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 55, __pyx_L1_error)
3657 __Pyx_GOTREF(__pyx_t_3);
3658 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 55, __pyx_L1_error)
3659 __Pyx_GOTREF(__pyx_t_4);
3660 __Pyx_INCREF(((PyObject *)__pyx_v_subtitle));
3661 __Pyx_GIVEREF(((PyObject *)__pyx_v_subtitle));
3662 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_subtitle));
3663 __Pyx_GIVEREF(__pyx_t_3);
3664 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
3665 __pyx_t_3 = 0;
3666 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2av_9subtitles_8subtitle_Subtitle), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 55, __pyx_L1_error)
3667 __Pyx_GOTREF(__pyx_t_3);
3668 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3669 __pyx_r = ((struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)__pyx_t_3);
3670 __pyx_t_3 = 0;
3671 goto __pyx_L0;
3672
3673 /* "av/subtitles/subtitle.pyx":54
3674 * cdef lib.AVSubtitleRect *ptr = subtitle.proxy.struct.rects[index]
3675 *
3676 * if ptr.type == lib.SUBTITLE_NONE: # <<<<<<<<<<<<<<
3677 * return Subtitle(subtitle, index)
3678 * elif ptr.type == lib.SUBTITLE_BITMAP:
3679 */
3680 break;
3681 case SUBTITLE_BITMAP:
3682
3683 /* "av/subtitles/subtitle.pyx":57
3684 * return Subtitle(subtitle, index)
3685 * elif ptr.type == lib.SUBTITLE_BITMAP:
3686 * return BitmapSubtitle(subtitle, index) # <<<<<<<<<<<<<<
3687 * elif ptr.type == lib.SUBTITLE_TEXT:
3688 * return TextSubtitle(subtitle, index)
3689 */
3690 __Pyx_XDECREF(((PyObject *)__pyx_r));
3691 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 57, __pyx_L1_error)
3692 __Pyx_GOTREF(__pyx_t_3);
3693 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 57, __pyx_L1_error)
3694 __Pyx_GOTREF(__pyx_t_4);
3695 __Pyx_INCREF(((PyObject *)__pyx_v_subtitle));
3696 __Pyx_GIVEREF(((PyObject *)__pyx_v_subtitle));
3697 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_subtitle));
3698 __Pyx_GIVEREF(__pyx_t_3);
3699 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
3700 __pyx_t_3 = 0;
3701 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2av_9subtitles_8subtitle_BitmapSubtitle), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 57, __pyx_L1_error)
3702 __Pyx_GOTREF(__pyx_t_3);
3703 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3704 __pyx_r = ((struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)__pyx_t_3);
3705 __pyx_t_3 = 0;
3706 goto __pyx_L0;
3707
3708 /* "av/subtitles/subtitle.pyx":56
3709 * if ptr.type == lib.SUBTITLE_NONE:
3710 * return Subtitle(subtitle, index)
3711 * elif ptr.type == lib.SUBTITLE_BITMAP: # <<<<<<<<<<<<<<
3712 * return BitmapSubtitle(subtitle, index)
3713 * elif ptr.type == lib.SUBTITLE_TEXT:
3714 */
3715 break;
3716 case SUBTITLE_TEXT:
3717
3718 /* "av/subtitles/subtitle.pyx":59
3719 * return BitmapSubtitle(subtitle, index)
3720 * elif ptr.type == lib.SUBTITLE_TEXT:
3721 * return TextSubtitle(subtitle, index) # <<<<<<<<<<<<<<
3722 * elif ptr.type == lib.SUBTITLE_ASS:
3723 * return AssSubtitle(subtitle, index)
3724 */
3725 __Pyx_XDECREF(((PyObject *)__pyx_r));
3726 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 59, __pyx_L1_error)
3727 __Pyx_GOTREF(__pyx_t_3);
3728 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 59, __pyx_L1_error)
3729 __Pyx_GOTREF(__pyx_t_4);
3730 __Pyx_INCREF(((PyObject *)__pyx_v_subtitle));
3731 __Pyx_GIVEREF(((PyObject *)__pyx_v_subtitle));
3732 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_subtitle));
3733 __Pyx_GIVEREF(__pyx_t_3);
3734 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
3735 __pyx_t_3 = 0;
3736 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2av_9subtitles_8subtitle_TextSubtitle), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 59, __pyx_L1_error)
3737 __Pyx_GOTREF(__pyx_t_3);
3738 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3739 __pyx_r = ((struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)__pyx_t_3);
3740 __pyx_t_3 = 0;
3741 goto __pyx_L0;
3742
3743 /* "av/subtitles/subtitle.pyx":58
3744 * elif ptr.type == lib.SUBTITLE_BITMAP:
3745 * return BitmapSubtitle(subtitle, index)
3746 * elif ptr.type == lib.SUBTITLE_TEXT: # <<<<<<<<<<<<<<
3747 * return TextSubtitle(subtitle, index)
3748 * elif ptr.type == lib.SUBTITLE_ASS:
3749 */
3750 break;
3751 case SUBTITLE_ASS:
3752
3753 /* "av/subtitles/subtitle.pyx":61
3754 * return TextSubtitle(subtitle, index)
3755 * elif ptr.type == lib.SUBTITLE_ASS:
3756 * return AssSubtitle(subtitle, index) # <<<<<<<<<<<<<<
3757 * else:
3758 * raise ValueError('unknown subtitle type %r' % ptr.type)
3759 */
3760 __Pyx_XDECREF(((PyObject *)__pyx_r));
3761 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 61, __pyx_L1_error)
3762 __Pyx_GOTREF(__pyx_t_3);
3763 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 61, __pyx_L1_error)
3764 __Pyx_GOTREF(__pyx_t_4);
3765 __Pyx_INCREF(((PyObject *)__pyx_v_subtitle));
3766 __Pyx_GIVEREF(((PyObject *)__pyx_v_subtitle));
3767 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_subtitle));
3768 __Pyx_GIVEREF(__pyx_t_3);
3769 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
3770 __pyx_t_3 = 0;
3771 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2av_9subtitles_8subtitle_AssSubtitle), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 61, __pyx_L1_error)
3772 __Pyx_GOTREF(__pyx_t_3);
3773 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3774 __pyx_r = ((struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)__pyx_t_3);
3775 __pyx_t_3 = 0;
3776 goto __pyx_L0;
3777
3778 /* "av/subtitles/subtitle.pyx":60
3779 * elif ptr.type == lib.SUBTITLE_TEXT:
3780 * return TextSubtitle(subtitle, index)
3781 * elif ptr.type == lib.SUBTITLE_ASS: # <<<<<<<<<<<<<<
3782 * return AssSubtitle(subtitle, index)
3783 * else:
3784 */
3785 break;
3786 default:
3787
3788 /* "av/subtitles/subtitle.pyx":63
3789 * return AssSubtitle(subtitle, index)
3790 * else:
3791 * raise ValueError('unknown subtitle type %r' % ptr.type) # <<<<<<<<<<<<<<
3792 *
3793 *
3794 */
3795 __pyx_t_3 = __Pyx_PyInt_From_enum__AVSubtitleType(__pyx_v_ptr->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 63, __pyx_L1_error)
3796 __Pyx_GOTREF(__pyx_t_3);
3797 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_unknown_subtitle_type_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 63, __pyx_L1_error)
3798 __Pyx_GOTREF(__pyx_t_4);
3799 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3800 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 63, __pyx_L1_error)
3801 __Pyx_GOTREF(__pyx_t_3);
3802 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3803 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3804 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3805 __PYX_ERR(1, 63, __pyx_L1_error)
3806 break;
3807 }
3808
3809 /* "av/subtitles/subtitle.pyx":42
3810 *
3811 *
3812 * cdef Subtitle build_subtitle(SubtitleSet subtitle, int index): # <<<<<<<<<<<<<<
3813 * """Build an av.Stream for an existing AVStream.
3814 *
3815 */
3816
3817 /* function exit code */
3818 __pyx_L1_error:;
3819 __Pyx_XDECREF(__pyx_t_3);
3820 __Pyx_XDECREF(__pyx_t_4);
3821 __Pyx_AddTraceback("av.subtitles.subtitle.build_subtitle", __pyx_clineno, __pyx_lineno, __pyx_filename);
3822 __pyx_r = 0;
3823 __pyx_L0:;
3824 __Pyx_XGIVEREF((PyObject *)__pyx_r);
3825 __Pyx_RefNannyFinishContext();
3826 return __pyx_r;
3827 }
3828
3829 /* "av/subtitles/subtitle.pyx":68
3830 * cdef class Subtitle(object):
3831 *
3832 * def __cinit__(self, SubtitleSet subtitle, int index): # <<<<<<<<<<<<<<
3833 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects:
3834 * raise ValueError('subtitle rect index out of range')
3835 */
3836
3837 /* Python wrapper */
3838 static int __pyx_pw_2av_9subtitles_8subtitle_8Subtitle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3839 static int __pyx_pw_2av_9subtitles_8subtitle_8Subtitle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3840 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_subtitle = 0;
3841 int __pyx_v_index;
3842 int __pyx_lineno = 0;
3843 const char *__pyx_filename = NULL;
3844 int __pyx_clineno = 0;
3845 int __pyx_r;
3846 __Pyx_RefNannyDeclarations
3847 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3848 {
3849 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_subtitle,&__pyx_n_s_index,0};
3850 PyObject* values[2] = {0,0};
3851 if (unlikely(__pyx_kwds)) {
3852 Py_ssize_t kw_args;
3853 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3854 switch (pos_args) {
3855 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3856 CYTHON_FALLTHROUGH;
3857 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3858 CYTHON_FALLTHROUGH;
3859 case 0: break;
3860 default: goto __pyx_L5_argtuple_error;
3861 }
3862 kw_args = PyDict_Size(__pyx_kwds);
3863 switch (pos_args) {
3864 case 0:
3865 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subtitle)) != 0)) kw_args--;
3866 else goto __pyx_L5_argtuple_error;
3867 CYTHON_FALLTHROUGH;
3868 case 1:
3869 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
3870 else {
3871 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(1, 68, __pyx_L3_error)
3872 }
3873 }
3874 if (unlikely(kw_args > 0)) {
3875 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 68, __pyx_L3_error)
3876 }
3877 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3878 goto __pyx_L5_argtuple_error;
3879 } else {
3880 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3881 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3882 }
3883 __pyx_v_subtitle = ((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)values[0]);
3884 __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 68, __pyx_L3_error)
3885 }
3886 goto __pyx_L4_argument_unpacking_done;
3887 __pyx_L5_argtuple_error:;
3888 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 68, __pyx_L3_error)
3889 __pyx_L3_error:;
3890 __Pyx_AddTraceback("av.subtitles.subtitle.Subtitle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3891 __Pyx_RefNannyFinishContext();
3892 return -1;
3893 __pyx_L4_argument_unpacking_done:;
3894 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subtitle), __pyx_ptype_2av_9subtitles_8subtitle_SubtitleSet, 1, "subtitle", 0))) __PYX_ERR(1, 68, __pyx_L1_error)
3895 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_8Subtitle___cinit__(((struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)__pyx_v_self), __pyx_v_subtitle, __pyx_v_index);
3896
3897 /* function exit code */
3898 goto __pyx_L0;
3899 __pyx_L1_error:;
3900 __pyx_r = -1;
3901 __pyx_L0:;
3902 __Pyx_RefNannyFinishContext();
3903 return __pyx_r;
3904 }
3905
__pyx_pf_2av_9subtitles_8subtitle_8Subtitle___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle * __pyx_v_self,struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_subtitle,int __pyx_v_index)3906 static int __pyx_pf_2av_9subtitles_8subtitle_8Subtitle___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_v_self, struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_subtitle, int __pyx_v_index) {
3907 int __pyx_r;
3908 __Pyx_RefNannyDeclarations
3909 int __pyx_t_1;
3910 int __pyx_t_2;
3911 PyObject *__pyx_t_3 = NULL;
3912 PyObject *__pyx_t_4 = NULL;
3913 int __pyx_lineno = 0;
3914 const char *__pyx_filename = NULL;
3915 int __pyx_clineno = 0;
3916 __Pyx_RefNannySetupContext("__cinit__", 0);
3917
3918 /* "av/subtitles/subtitle.pyx":69
3919 *
3920 * def __cinit__(self, SubtitleSet subtitle, int index):
3921 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects: # <<<<<<<<<<<<<<
3922 * raise ValueError('subtitle rect index out of range')
3923 * self.proxy = subtitle.proxy
3924 */
3925 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
3926 if (!__pyx_t_2) {
3927 } else {
3928 __pyx_t_1 = __pyx_t_2;
3929 goto __pyx_L4_bool_binop_done;
3930 }
3931 __pyx_t_2 = ((((unsigned int)__pyx_v_index) >= __pyx_v_subtitle->proxy->__pyx_struct.num_rects) != 0);
3932 __pyx_t_1 = __pyx_t_2;
3933 __pyx_L4_bool_binop_done:;
3934 if (unlikely(__pyx_t_1)) {
3935
3936 /* "av/subtitles/subtitle.pyx":70
3937 * def __cinit__(self, SubtitleSet subtitle, int index):
3938 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects:
3939 * raise ValueError('subtitle rect index out of range') # <<<<<<<<<<<<<<
3940 * self.proxy = subtitle.proxy
3941 * self.ptr = self.proxy.struct.rects[index]
3942 */
3943 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 70, __pyx_L1_error)
3944 __Pyx_GOTREF(__pyx_t_3);
3945 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3946 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3947 __PYX_ERR(1, 70, __pyx_L1_error)
3948
3949 /* "av/subtitles/subtitle.pyx":69
3950 *
3951 * def __cinit__(self, SubtitleSet subtitle, int index):
3952 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects: # <<<<<<<<<<<<<<
3953 * raise ValueError('subtitle rect index out of range')
3954 * self.proxy = subtitle.proxy
3955 */
3956 }
3957
3958 /* "av/subtitles/subtitle.pyx":71
3959 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects:
3960 * raise ValueError('subtitle rect index out of range')
3961 * self.proxy = subtitle.proxy # <<<<<<<<<<<<<<
3962 * self.ptr = self.proxy.struct.rects[index]
3963 *
3964 */
3965 __pyx_t_3 = ((PyObject *)__pyx_v_subtitle->proxy);
3966 __Pyx_INCREF(__pyx_t_3);
3967 __Pyx_GIVEREF(__pyx_t_3);
3968 __Pyx_GOTREF(__pyx_v_self->proxy);
3969 __Pyx_DECREF(((PyObject *)__pyx_v_self->proxy));
3970 __pyx_v_self->proxy = ((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *)__pyx_t_3);
3971 __pyx_t_3 = 0;
3972
3973 /* "av/subtitles/subtitle.pyx":72
3974 * raise ValueError('subtitle rect index out of range')
3975 * self.proxy = subtitle.proxy
3976 * self.ptr = self.proxy.struct.rects[index] # <<<<<<<<<<<<<<
3977 *
3978 * if self.ptr.type == lib.SUBTITLE_NONE:
3979 */
3980 __pyx_v_self->ptr = (__pyx_v_self->proxy->__pyx_struct.rects[__pyx_v_index]);
3981
3982 /* "av/subtitles/subtitle.pyx":74
3983 * self.ptr = self.proxy.struct.rects[index]
3984 *
3985 * if self.ptr.type == lib.SUBTITLE_NONE: # <<<<<<<<<<<<<<
3986 * self.type = b'none'
3987 * elif self.ptr.type == lib.SUBTITLE_BITMAP:
3988 */
3989 switch (__pyx_v_self->ptr->type) {
3990 case SUBTITLE_NONE:
3991
3992 /* "av/subtitles/subtitle.pyx":75
3993 *
3994 * if self.ptr.type == lib.SUBTITLE_NONE:
3995 * self.type = b'none' # <<<<<<<<<<<<<<
3996 * elif self.ptr.type == lib.SUBTITLE_BITMAP:
3997 * self.type = b'bitmap'
3998 */
3999 __Pyx_INCREF(__pyx_n_b_none);
4000 __Pyx_GIVEREF(__pyx_n_b_none);
4001 __Pyx_GOTREF(__pyx_v_self->type);
4002 __Pyx_DECREF(__pyx_v_self->type);
4003 __pyx_v_self->type = __pyx_n_b_none;
4004
4005 /* "av/subtitles/subtitle.pyx":74
4006 * self.ptr = self.proxy.struct.rects[index]
4007 *
4008 * if self.ptr.type == lib.SUBTITLE_NONE: # <<<<<<<<<<<<<<
4009 * self.type = b'none'
4010 * elif self.ptr.type == lib.SUBTITLE_BITMAP:
4011 */
4012 break;
4013 case SUBTITLE_BITMAP:
4014
4015 /* "av/subtitles/subtitle.pyx":77
4016 * self.type = b'none'
4017 * elif self.ptr.type == lib.SUBTITLE_BITMAP:
4018 * self.type = b'bitmap' # <<<<<<<<<<<<<<
4019 * elif self.ptr.type == lib.SUBTITLE_TEXT:
4020 * self.type = b'text'
4021 */
4022 __Pyx_INCREF(__pyx_n_b_bitmap);
4023 __Pyx_GIVEREF(__pyx_n_b_bitmap);
4024 __Pyx_GOTREF(__pyx_v_self->type);
4025 __Pyx_DECREF(__pyx_v_self->type);
4026 __pyx_v_self->type = __pyx_n_b_bitmap;
4027
4028 /* "av/subtitles/subtitle.pyx":76
4029 * if self.ptr.type == lib.SUBTITLE_NONE:
4030 * self.type = b'none'
4031 * elif self.ptr.type == lib.SUBTITLE_BITMAP: # <<<<<<<<<<<<<<
4032 * self.type = b'bitmap'
4033 * elif self.ptr.type == lib.SUBTITLE_TEXT:
4034 */
4035 break;
4036 case SUBTITLE_TEXT:
4037
4038 /* "av/subtitles/subtitle.pyx":79
4039 * self.type = b'bitmap'
4040 * elif self.ptr.type == lib.SUBTITLE_TEXT:
4041 * self.type = b'text' # <<<<<<<<<<<<<<
4042 * elif self.ptr.type == lib.SUBTITLE_ASS:
4043 * self.type = b'ass'
4044 */
4045 __Pyx_INCREF(__pyx_n_b_text);
4046 __Pyx_GIVEREF(__pyx_n_b_text);
4047 __Pyx_GOTREF(__pyx_v_self->type);
4048 __Pyx_DECREF(__pyx_v_self->type);
4049 __pyx_v_self->type = __pyx_n_b_text;
4050
4051 /* "av/subtitles/subtitle.pyx":78
4052 * elif self.ptr.type == lib.SUBTITLE_BITMAP:
4053 * self.type = b'bitmap'
4054 * elif self.ptr.type == lib.SUBTITLE_TEXT: # <<<<<<<<<<<<<<
4055 * self.type = b'text'
4056 * elif self.ptr.type == lib.SUBTITLE_ASS:
4057 */
4058 break;
4059 case SUBTITLE_ASS:
4060
4061 /* "av/subtitles/subtitle.pyx":81
4062 * self.type = b'text'
4063 * elif self.ptr.type == lib.SUBTITLE_ASS:
4064 * self.type = b'ass' # <<<<<<<<<<<<<<
4065 * else:
4066 * raise ValueError('unknown subtitle type %r' % self.ptr.type)
4067 */
4068 __Pyx_INCREF(__pyx_n_b_ass);
4069 __Pyx_GIVEREF(__pyx_n_b_ass);
4070 __Pyx_GOTREF(__pyx_v_self->type);
4071 __Pyx_DECREF(__pyx_v_self->type);
4072 __pyx_v_self->type = __pyx_n_b_ass;
4073
4074 /* "av/subtitles/subtitle.pyx":80
4075 * elif self.ptr.type == lib.SUBTITLE_TEXT:
4076 * self.type = b'text'
4077 * elif self.ptr.type == lib.SUBTITLE_ASS: # <<<<<<<<<<<<<<
4078 * self.type = b'ass'
4079 * else:
4080 */
4081 break;
4082 default:
4083
4084 /* "av/subtitles/subtitle.pyx":83
4085 * self.type = b'ass'
4086 * else:
4087 * raise ValueError('unknown subtitle type %r' % self.ptr.type) # <<<<<<<<<<<<<<
4088 *
4089 * def __repr__(self):
4090 */
4091 __pyx_t_3 = __Pyx_PyInt_From_enum__AVSubtitleType(__pyx_v_self->ptr->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 83, __pyx_L1_error)
4092 __Pyx_GOTREF(__pyx_t_3);
4093 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_unknown_subtitle_type_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 83, __pyx_L1_error)
4094 __Pyx_GOTREF(__pyx_t_4);
4095 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4096 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 83, __pyx_L1_error)
4097 __Pyx_GOTREF(__pyx_t_3);
4098 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4099 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4100 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4101 __PYX_ERR(1, 83, __pyx_L1_error)
4102 break;
4103 }
4104
4105 /* "av/subtitles/subtitle.pyx":68
4106 * cdef class Subtitle(object):
4107 *
4108 * def __cinit__(self, SubtitleSet subtitle, int index): # <<<<<<<<<<<<<<
4109 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects:
4110 * raise ValueError('subtitle rect index out of range')
4111 */
4112
4113 /* function exit code */
4114 __pyx_r = 0;
4115 goto __pyx_L0;
4116 __pyx_L1_error:;
4117 __Pyx_XDECREF(__pyx_t_3);
4118 __Pyx_XDECREF(__pyx_t_4);
4119 __Pyx_AddTraceback("av.subtitles.subtitle.Subtitle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4120 __pyx_r = -1;
4121 __pyx_L0:;
4122 __Pyx_RefNannyFinishContext();
4123 return __pyx_r;
4124 }
4125
4126 /* "av/subtitles/subtitle.pyx":85
4127 * raise ValueError('unknown subtitle type %r' % self.ptr.type)
4128 *
4129 * def __repr__(self): # <<<<<<<<<<<<<<
4130 * return '<%s.%s at 0x%x>' % (
4131 * self.__class__.__module__,
4132 */
4133
4134 /* Python wrapper */
4135 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_3__repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_3__repr__(PyObject * __pyx_v_self)4136 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_3__repr__(PyObject *__pyx_v_self) {
4137 PyObject *__pyx_r = 0;
4138 __Pyx_RefNannyDeclarations
4139 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
4140 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_8Subtitle_2__repr__(((struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)__pyx_v_self));
4141
4142 /* function exit code */
4143 __Pyx_RefNannyFinishContext();
4144 return __pyx_r;
4145 }
4146
__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_2__repr__(struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle * __pyx_v_self)4147 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_2__repr__(struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_v_self) {
4148 PyObject *__pyx_r = NULL;
4149 __Pyx_RefNannyDeclarations
4150 PyObject *__pyx_t_1 = NULL;
4151 PyObject *__pyx_t_2 = NULL;
4152 PyObject *__pyx_t_3 = NULL;
4153 PyObject *__pyx_t_4 = NULL;
4154 int __pyx_lineno = 0;
4155 const char *__pyx_filename = NULL;
4156 int __pyx_clineno = 0;
4157 __Pyx_RefNannySetupContext("__repr__", 0);
4158
4159 /* "av/subtitles/subtitle.pyx":86
4160 *
4161 * def __repr__(self):
4162 * return '<%s.%s at 0x%x>' % ( # <<<<<<<<<<<<<<
4163 * self.__class__.__module__,
4164 * self.__class__.__name__,
4165 */
4166 __Pyx_XDECREF(__pyx_r);
4167
4168 /* "av/subtitles/subtitle.pyx":87
4169 * def __repr__(self):
4170 * return '<%s.%s at 0x%x>' % (
4171 * self.__class__.__module__, # <<<<<<<<<<<<<<
4172 * self.__class__.__name__,
4173 * id(self),
4174 */
4175 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error)
4176 __Pyx_GOTREF(__pyx_t_1);
4177 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error)
4178 __Pyx_GOTREF(__pyx_t_2);
4179 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4180
4181 /* "av/subtitles/subtitle.pyx":88
4182 * return '<%s.%s at 0x%x>' % (
4183 * self.__class__.__module__,
4184 * self.__class__.__name__, # <<<<<<<<<<<<<<
4185 * id(self),
4186 * )
4187 */
4188 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
4189 __Pyx_GOTREF(__pyx_t_1);
4190 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 88, __pyx_L1_error)
4191 __Pyx_GOTREF(__pyx_t_3);
4192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4193
4194 /* "av/subtitles/subtitle.pyx":89
4195 * self.__class__.__module__,
4196 * self.__class__.__name__,
4197 * id(self), # <<<<<<<<<<<<<<
4198 * )
4199 *
4200 */
4201 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
4202 __Pyx_GOTREF(__pyx_t_1);
4203
4204 /* "av/subtitles/subtitle.pyx":87
4205 * def __repr__(self):
4206 * return '<%s.%s at 0x%x>' % (
4207 * self.__class__.__module__, # <<<<<<<<<<<<<<
4208 * self.__class__.__name__,
4209 * id(self),
4210 */
4211 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 87, __pyx_L1_error)
4212 __Pyx_GOTREF(__pyx_t_4);
4213 __Pyx_GIVEREF(__pyx_t_2);
4214 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
4215 __Pyx_GIVEREF(__pyx_t_3);
4216 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
4217 __Pyx_GIVEREF(__pyx_t_1);
4218 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
4219 __pyx_t_2 = 0;
4220 __pyx_t_3 = 0;
4221 __pyx_t_1 = 0;
4222
4223 /* "av/subtitles/subtitle.pyx":86
4224 *
4225 * def __repr__(self):
4226 * return '<%s.%s at 0x%x>' % ( # <<<<<<<<<<<<<<
4227 * self.__class__.__module__,
4228 * self.__class__.__name__,
4229 */
4230 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_at_0x_x, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
4231 __Pyx_GOTREF(__pyx_t_1);
4232 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4233 __pyx_r = __pyx_t_1;
4234 __pyx_t_1 = 0;
4235 goto __pyx_L0;
4236
4237 /* "av/subtitles/subtitle.pyx":85
4238 * raise ValueError('unknown subtitle type %r' % self.ptr.type)
4239 *
4240 * def __repr__(self): # <<<<<<<<<<<<<<
4241 * return '<%s.%s at 0x%x>' % (
4242 * self.__class__.__module__,
4243 */
4244
4245 /* function exit code */
4246 __pyx_L1_error:;
4247 __Pyx_XDECREF(__pyx_t_1);
4248 __Pyx_XDECREF(__pyx_t_2);
4249 __Pyx_XDECREF(__pyx_t_3);
4250 __Pyx_XDECREF(__pyx_t_4);
4251 __Pyx_AddTraceback("av.subtitles.subtitle.Subtitle.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4252 __pyx_r = NULL;
4253 __pyx_L0:;
4254 __Pyx_XGIVEREF(__pyx_r);
4255 __Pyx_RefNannyFinishContext();
4256 return __pyx_r;
4257 }
4258
4259 /* "av/subtitles/subtitle.pxd":22
4260 * cdef SubtitleProxy proxy
4261 * cdef lib.AVSubtitleRect *ptr
4262 * cdef readonly bytes type # <<<<<<<<<<<<<<
4263 *
4264 * cdef class TextSubtitle(Subtitle):
4265 */
4266
4267 /* Python wrapper */
4268 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_4type_1__get__(PyObject * __pyx_v_self)4269 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_4type_1__get__(PyObject *__pyx_v_self) {
4270 PyObject *__pyx_r = 0;
4271 __Pyx_RefNannyDeclarations
4272 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4273 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_8Subtitle_4type___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)__pyx_v_self));
4274
4275 /* function exit code */
4276 __Pyx_RefNannyFinishContext();
4277 return __pyx_r;
4278 }
4279
__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_4type___get__(struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle * __pyx_v_self)4280 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_4type___get__(struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_v_self) {
4281 PyObject *__pyx_r = NULL;
4282 __Pyx_RefNannyDeclarations
4283 __Pyx_RefNannySetupContext("__get__", 0);
4284 __Pyx_XDECREF(__pyx_r);
4285 __Pyx_INCREF(__pyx_v_self->type);
4286 __pyx_r = __pyx_v_self->type;
4287 goto __pyx_L0;
4288
4289 /* function exit code */
4290 __pyx_L0:;
4291 __Pyx_XGIVEREF(__pyx_r);
4292 __Pyx_RefNannyFinishContext();
4293 return __pyx_r;
4294 }
4295
4296 /* "(tree fragment)":1
4297 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4298 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4299 * def __setstate_cython__(self, __pyx_state):
4300 */
4301
4302 /* Python wrapper */
4303 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4304 static char __pyx_doc_2av_9subtitles_8subtitle_8Subtitle_4__reduce_cython__[] = "Subtitle.__reduce_cython__()";
__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)4305 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4306 PyObject *__pyx_r = 0;
4307 __Pyx_RefNannyDeclarations
4308 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4309 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_8Subtitle_4__reduce_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)__pyx_v_self));
4310
4311 /* function exit code */
4312 __Pyx_RefNannyFinishContext();
4313 return __pyx_r;
4314 }
4315
__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle * __pyx_v_self)4316 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_v_self) {
4317 PyObject *__pyx_r = NULL;
4318 __Pyx_RefNannyDeclarations
4319 PyObject *__pyx_t_1 = NULL;
4320 int __pyx_lineno = 0;
4321 const char *__pyx_filename = NULL;
4322 int __pyx_clineno = 0;
4323 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4324
4325 /* "(tree fragment)":2
4326 * def __reduce_cython__(self):
4327 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4328 * def __setstate_cython__(self, __pyx_state):
4329 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4330 */
4331 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
4332 __Pyx_GOTREF(__pyx_t_1);
4333 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4334 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4335 __PYX_ERR(0, 2, __pyx_L1_error)
4336
4337 /* "(tree fragment)":1
4338 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4339 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4340 * def __setstate_cython__(self, __pyx_state):
4341 */
4342
4343 /* function exit code */
4344 __pyx_L1_error:;
4345 __Pyx_XDECREF(__pyx_t_1);
4346 __Pyx_AddTraceback("av.subtitles.subtitle.Subtitle.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4347 __pyx_r = NULL;
4348 __Pyx_XGIVEREF(__pyx_r);
4349 __Pyx_RefNannyFinishContext();
4350 return __pyx_r;
4351 }
4352
4353 /* "(tree fragment)":3
4354 * def __reduce_cython__(self):
4355 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4356 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4357 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4358 */
4359
4360 /* Python wrapper */
4361 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4362 static char __pyx_doc_2av_9subtitles_8subtitle_8Subtitle_6__setstate_cython__[] = "Subtitle.__setstate_cython__(__pyx_state)";
__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)4363 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4364 PyObject *__pyx_r = 0;
4365 __Pyx_RefNannyDeclarations
4366 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4367 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_8Subtitle_6__setstate_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4368
4369 /* function exit code */
4370 __Pyx_RefNannyFinishContext();
4371 return __pyx_r;
4372 }
4373
__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)4374 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_8Subtitle_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4375 PyObject *__pyx_r = NULL;
4376 __Pyx_RefNannyDeclarations
4377 PyObject *__pyx_t_1 = NULL;
4378 int __pyx_lineno = 0;
4379 const char *__pyx_filename = NULL;
4380 int __pyx_clineno = 0;
4381 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4382
4383 /* "(tree fragment)":4
4384 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4385 * def __setstate_cython__(self, __pyx_state):
4386 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4387 */
4388 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
4389 __Pyx_GOTREF(__pyx_t_1);
4390 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4391 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4392 __PYX_ERR(0, 4, __pyx_L1_error)
4393
4394 /* "(tree fragment)":3
4395 * def __reduce_cython__(self):
4396 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4397 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4398 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4399 */
4400
4401 /* function exit code */
4402 __pyx_L1_error:;
4403 __Pyx_XDECREF(__pyx_t_1);
4404 __Pyx_AddTraceback("av.subtitles.subtitle.Subtitle.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4405 __pyx_r = NULL;
4406 __Pyx_XGIVEREF(__pyx_r);
4407 __Pyx_RefNannyFinishContext();
4408 return __pyx_r;
4409 }
4410
4411 /* "av/subtitles/subtitle.pyx":95
4412 * cdef class BitmapSubtitle(Subtitle):
4413 *
4414 * def __cinit__(self, SubtitleSet subtitle, int index): # <<<<<<<<<<<<<<
4415 * self.planes = tuple(
4416 * BitmapSubtitlePlane(self, i)
4417 */
4418
4419 /* Python wrapper */
4420 static int __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4421 static int __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4422 CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_subtitle = 0;
4423 CYTHON_UNUSED int __pyx_v_index;
4424 int __pyx_lineno = 0;
4425 const char *__pyx_filename = NULL;
4426 int __pyx_clineno = 0;
4427 int __pyx_r;
4428 __Pyx_RefNannyDeclarations
4429 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4430 {
4431 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_subtitle,&__pyx_n_s_index,0};
4432 PyObject* values[2] = {0,0};
4433 if (unlikely(__pyx_kwds)) {
4434 Py_ssize_t kw_args;
4435 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4436 switch (pos_args) {
4437 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4438 CYTHON_FALLTHROUGH;
4439 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4440 CYTHON_FALLTHROUGH;
4441 case 0: break;
4442 default: goto __pyx_L5_argtuple_error;
4443 }
4444 kw_args = PyDict_Size(__pyx_kwds);
4445 switch (pos_args) {
4446 case 0:
4447 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subtitle)) != 0)) kw_args--;
4448 else goto __pyx_L5_argtuple_error;
4449 CYTHON_FALLTHROUGH;
4450 case 1:
4451 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
4452 else {
4453 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(1, 95, __pyx_L3_error)
4454 }
4455 }
4456 if (unlikely(kw_args > 0)) {
4457 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 95, __pyx_L3_error)
4458 }
4459 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4460 goto __pyx_L5_argtuple_error;
4461 } else {
4462 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4463 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4464 }
4465 __pyx_v_subtitle = ((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)values[0]);
4466 __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 95, __pyx_L3_error)
4467 }
4468 goto __pyx_L4_argument_unpacking_done;
4469 __pyx_L5_argtuple_error:;
4470 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 95, __pyx_L3_error)
4471 __pyx_L3_error:;
4472 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4473 __Pyx_RefNannyFinishContext();
4474 return -1;
4475 __pyx_L4_argument_unpacking_done:;
4476 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subtitle), __pyx_ptype_2av_9subtitles_8subtitle_SubtitleSet, 1, "subtitle", 0))) __PYX_ERR(1, 95, __pyx_L1_error)
4477 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle___cinit__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self), __pyx_v_subtitle, __pyx_v_index);
4478
4479 /* function exit code */
4480 goto __pyx_L0;
4481 __pyx_L1_error:;
4482 __pyx_r = -1;
4483 __pyx_L0:;
4484 __Pyx_RefNannyFinishContext();
4485 return __pyx_r;
4486 }
4487 static PyObject *__pyx_gb_2av_9subtitles_8subtitle_14BitmapSubtitle_9__cinit___2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
4488
4489 /* "av/subtitles/subtitle.pyx":97
4490 * def __cinit__(self, SubtitleSet subtitle, int index):
4491 * self.planes = tuple(
4492 * BitmapSubtitlePlane(self, i) # <<<<<<<<<<<<<<
4493 * for i in range(4)
4494 * if self.ptr.linesize[i]
4495 */
4496
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_9__cinit___genexpr(PyObject * __pyx_self)4497 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_9__cinit___genexpr(PyObject *__pyx_self) {
4498 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
4499 PyObject *__pyx_r = NULL;
4500 __Pyx_RefNannyDeclarations
4501 int __pyx_lineno = 0;
4502 const char *__pyx_filename = NULL;
4503 int __pyx_clineno = 0;
4504 __Pyx_RefNannySetupContext("genexpr", 0);
4505 __pyx_cur_scope = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *)__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr(__pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
4506 if (unlikely(!__pyx_cur_scope)) {
4507 __pyx_cur_scope = ((struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *)Py_None);
4508 __Pyx_INCREF(Py_None);
4509 __PYX_ERR(1, 97, __pyx_L1_error)
4510 } else {
4511 __Pyx_GOTREF(__pyx_cur_scope);
4512 }
4513 __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *) __pyx_self;
4514 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
4515 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
4516 {
4517 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2av_9subtitles_8subtitle_14BitmapSubtitle_9__cinit___2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cinit___locals_genexpr, __pyx_n_s_av_subtitles_subtitle); if (unlikely(!gen)) __PYX_ERR(1, 97, __pyx_L1_error)
4518 __Pyx_DECREF(__pyx_cur_scope);
4519 __Pyx_RefNannyFinishContext();
4520 return (PyObject *) gen;
4521 }
4522
4523 /* function exit code */
4524 __pyx_L1_error:;
4525 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.__cinit__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4526 __pyx_r = NULL;
4527 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4528 __Pyx_XGIVEREF(__pyx_r);
4529 __Pyx_RefNannyFinishContext();
4530 return __pyx_r;
4531 }
4532
__pyx_gb_2av_9subtitles_8subtitle_14BitmapSubtitle_9__cinit___2generator1(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)4533 static PyObject *__pyx_gb_2av_9subtitles_8subtitle_14BitmapSubtitle_9__cinit___2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
4534 {
4535 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
4536 PyObject *__pyx_r = NULL;
4537 long __pyx_t_1;
4538 int __pyx_t_2;
4539 PyObject *__pyx_t_3 = NULL;
4540 PyObject *__pyx_t_4 = NULL;
4541 int __pyx_lineno = 0;
4542 const char *__pyx_filename = NULL;
4543 int __pyx_clineno = 0;
4544 __Pyx_RefNannyDeclarations
4545 __Pyx_RefNannySetupContext("genexpr", 0);
4546 switch (__pyx_generator->resume_label) {
4547 case 0: goto __pyx_L3_first_run;
4548 case 1: goto __pyx_L7_resume_from_yield;
4549 default: /* CPython raises the right error here */
4550 __Pyx_RefNannyFinishContext();
4551 return NULL;
4552 }
4553 __pyx_L3_first_run:;
4554 if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 97, __pyx_L1_error)
4555
4556 /* "av/subtitles/subtitle.pyx":98
4557 * self.planes = tuple(
4558 * BitmapSubtitlePlane(self, i)
4559 * for i in range(4) # <<<<<<<<<<<<<<
4560 * if self.ptr.linesize[i]
4561 * )
4562 */
4563 for (__pyx_t_1 = 0; __pyx_t_1 < 4; __pyx_t_1+=1) {
4564 __pyx_cur_scope->__pyx_v_i = __pyx_t_1;
4565
4566 /* "av/subtitles/subtitle.pyx":99
4567 * BitmapSubtitlePlane(self, i)
4568 * for i in range(4)
4569 * if self.ptr.linesize[i] # <<<<<<<<<<<<<<
4570 * )
4571 *
4572 */
4573 if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(1, 99, __pyx_L1_error) }
4574 __pyx_t_2 = ((__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->__pyx_base.ptr->linesize[__pyx_cur_scope->__pyx_v_i]) != 0);
4575 if (__pyx_t_2) {
4576
4577 /* "av/subtitles/subtitle.pyx":97
4578 * def __cinit__(self, SubtitleSet subtitle, int index):
4579 * self.planes = tuple(
4580 * BitmapSubtitlePlane(self, i) # <<<<<<<<<<<<<<
4581 * for i in range(4)
4582 * if self.ptr.linesize[i]
4583 */
4584 if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(1, 97, __pyx_L1_error) }
4585 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 97, __pyx_L1_error)
4586 __Pyx_GOTREF(__pyx_t_3);
4587 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 97, __pyx_L1_error)
4588 __Pyx_GOTREF(__pyx_t_4);
4589 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self));
4590 __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self));
4591 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self));
4592 __Pyx_GIVEREF(__pyx_t_3);
4593 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
4594 __pyx_t_3 = 0;
4595 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2av_9subtitles_8subtitle_BitmapSubtitlePlane), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 97, __pyx_L1_error)
4596 __Pyx_GOTREF(__pyx_t_3);
4597 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4598 __pyx_r = __pyx_t_3;
4599 __pyx_t_3 = 0;
4600 __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
4601 __Pyx_XGIVEREF(__pyx_r);
4602 __Pyx_RefNannyFinishContext();
4603 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4604 /* return from generator, yielding value */
4605 __pyx_generator->resume_label = 1;
4606 return __pyx_r;
4607 __pyx_L7_resume_from_yield:;
4608 __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
4609 if (unlikely(!__pyx_sent_value)) __PYX_ERR(1, 97, __pyx_L1_error)
4610
4611 /* "av/subtitles/subtitle.pyx":99
4612 * BitmapSubtitlePlane(self, i)
4613 * for i in range(4)
4614 * if self.ptr.linesize[i] # <<<<<<<<<<<<<<
4615 * )
4616 *
4617 */
4618 }
4619 }
4620 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4621
4622 /* "av/subtitles/subtitle.pyx":97
4623 * def __cinit__(self, SubtitleSet subtitle, int index):
4624 * self.planes = tuple(
4625 * BitmapSubtitlePlane(self, i) # <<<<<<<<<<<<<<
4626 * for i in range(4)
4627 * if self.ptr.linesize[i]
4628 */
4629
4630 /* function exit code */
4631 PyErr_SetNone(PyExc_StopIteration);
4632 goto __pyx_L0;
4633 __pyx_L1_error:;
4634 __Pyx_XDECREF(__pyx_t_3);
4635 __Pyx_XDECREF(__pyx_t_4);
4636 __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4637 __pyx_L0:;
4638 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4639 #if !CYTHON_USE_EXC_INFO_STACK
4640 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4641 #endif
4642 __pyx_generator->resume_label = -1;
4643 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4644 __Pyx_RefNannyFinishContext();
4645 return __pyx_r;
4646 }
4647
4648 /* "av/subtitles/subtitle.pyx":95
4649 * cdef class BitmapSubtitle(Subtitle):
4650 *
4651 * def __cinit__(self, SubtitleSet subtitle, int index): # <<<<<<<<<<<<<<
4652 * self.planes = tuple(
4653 * BitmapSubtitlePlane(self, i)
4654 */
4655
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self,CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet * __pyx_v_subtitle,CYTHON_UNUSED int __pyx_v_index)4656 static int __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *__pyx_v_subtitle, CYTHON_UNUSED int __pyx_v_index) {
4657 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *__pyx_cur_scope;
4658 int __pyx_r;
4659 __Pyx_RefNannyDeclarations
4660 PyObject *__pyx_t_1 = NULL;
4661 PyObject *__pyx_t_2 = NULL;
4662 int __pyx_lineno = 0;
4663 const char *__pyx_filename = NULL;
4664 int __pyx_clineno = 0;
4665 __Pyx_RefNannySetupContext("__cinit__", 0);
4666 __pyx_cur_scope = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *)__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__(__pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__, __pyx_empty_tuple, NULL);
4667 if (unlikely(!__pyx_cur_scope)) {
4668 __pyx_cur_scope = ((struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *)Py_None);
4669 __Pyx_INCREF(Py_None);
4670 __PYX_ERR(1, 95, __pyx_L1_error)
4671 } else {
4672 __Pyx_GOTREF(__pyx_cur_scope);
4673 }
4674 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4675 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4676 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4677
4678 /* "av/subtitles/subtitle.pyx":97
4679 * def __cinit__(self, SubtitleSet subtitle, int index):
4680 * self.planes = tuple(
4681 * BitmapSubtitlePlane(self, i) # <<<<<<<<<<<<<<
4682 * for i in range(4)
4683 * if self.ptr.linesize[i]
4684 */
4685 __pyx_t_1 = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_9__cinit___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 97, __pyx_L1_error)
4686 __Pyx_GOTREF(__pyx_t_1);
4687
4688 /* "av/subtitles/subtitle.pyx":96
4689 *
4690 * def __cinit__(self, SubtitleSet subtitle, int index):
4691 * self.planes = tuple( # <<<<<<<<<<<<<<
4692 * BitmapSubtitlePlane(self, i)
4693 * for i in range(4)
4694 */
4695 __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 96, __pyx_L1_error)
4696 __Pyx_GOTREF(__pyx_t_2);
4697 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4698 __Pyx_GIVEREF(__pyx_t_2);
4699 __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->planes);
4700 __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->planes);
4701 __pyx_cur_scope->__pyx_v_self->planes = __pyx_t_2;
4702 __pyx_t_2 = 0;
4703
4704 /* "av/subtitles/subtitle.pyx":95
4705 * cdef class BitmapSubtitle(Subtitle):
4706 *
4707 * def __cinit__(self, SubtitleSet subtitle, int index): # <<<<<<<<<<<<<<
4708 * self.planes = tuple(
4709 * BitmapSubtitlePlane(self, i)
4710 */
4711
4712 /* function exit code */
4713 __pyx_r = 0;
4714 goto __pyx_L0;
4715 __pyx_L1_error:;
4716 __Pyx_XDECREF(__pyx_t_1);
4717 __Pyx_XDECREF(__pyx_t_2);
4718 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4719 __pyx_r = -1;
4720 __pyx_L0:;
4721 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4722 __Pyx_RefNannyFinishContext();
4723 return __pyx_r;
4724 }
4725
4726 /* "av/subtitles/subtitle.pyx":102
4727 * )
4728 *
4729 * def __repr__(self): # <<<<<<<<<<<<<<
4730 * return '<%s.%s %dx%d at %d,%d; at 0x%x>' % (
4731 * self.__class__.__module__,
4732 */
4733
4734 /* Python wrapper */
4735 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_3__repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_3__repr__(PyObject * __pyx_v_self)4736 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_3__repr__(PyObject *__pyx_v_self) {
4737 PyObject *__pyx_r = 0;
4738 __Pyx_RefNannyDeclarations
4739 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
4740 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_2__repr__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self));
4741
4742 /* function exit code */
4743 __Pyx_RefNannyFinishContext();
4744 return __pyx_r;
4745 }
4746
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_2__repr__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self)4747 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_2__repr__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self) {
4748 PyObject *__pyx_r = NULL;
4749 __Pyx_RefNannyDeclarations
4750 PyObject *__pyx_t_1 = NULL;
4751 PyObject *__pyx_t_2 = NULL;
4752 PyObject *__pyx_t_3 = NULL;
4753 PyObject *__pyx_t_4 = NULL;
4754 PyObject *__pyx_t_5 = NULL;
4755 PyObject *__pyx_t_6 = NULL;
4756 PyObject *__pyx_t_7 = NULL;
4757 PyObject *__pyx_t_8 = NULL;
4758 int __pyx_lineno = 0;
4759 const char *__pyx_filename = NULL;
4760 int __pyx_clineno = 0;
4761 __Pyx_RefNannySetupContext("__repr__", 0);
4762
4763 /* "av/subtitles/subtitle.pyx":103
4764 *
4765 * def __repr__(self):
4766 * return '<%s.%s %dx%d at %d,%d; at 0x%x>' % ( # <<<<<<<<<<<<<<
4767 * self.__class__.__module__,
4768 * self.__class__.__name__,
4769 */
4770 __Pyx_XDECREF(__pyx_r);
4771
4772 /* "av/subtitles/subtitle.pyx":104
4773 * def __repr__(self):
4774 * return '<%s.%s %dx%d at %d,%d; at 0x%x>' % (
4775 * self.__class__.__module__, # <<<<<<<<<<<<<<
4776 * self.__class__.__name__,
4777 * self.width,
4778 */
4779 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 104, __pyx_L1_error)
4780 __Pyx_GOTREF(__pyx_t_1);
4781 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error)
4782 __Pyx_GOTREF(__pyx_t_2);
4783 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4784
4785 /* "av/subtitles/subtitle.pyx":105
4786 * return '<%s.%s %dx%d at %d,%d; at 0x%x>' % (
4787 * self.__class__.__module__,
4788 * self.__class__.__name__, # <<<<<<<<<<<<<<
4789 * self.width,
4790 * self.height,
4791 */
4792 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error)
4793 __Pyx_GOTREF(__pyx_t_1);
4794 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 105, __pyx_L1_error)
4795 __Pyx_GOTREF(__pyx_t_3);
4796 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4797
4798 /* "av/subtitles/subtitle.pyx":106
4799 * self.__class__.__module__,
4800 * self.__class__.__name__,
4801 * self.width, # <<<<<<<<<<<<<<
4802 * self.height,
4803 * self.x,
4804 */
4805 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 106, __pyx_L1_error)
4806 __Pyx_GOTREF(__pyx_t_1);
4807
4808 /* "av/subtitles/subtitle.pyx":107
4809 * self.__class__.__name__,
4810 * self.width,
4811 * self.height, # <<<<<<<<<<<<<<
4812 * self.x,
4813 * self.y,
4814 */
4815 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_height); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 107, __pyx_L1_error)
4816 __Pyx_GOTREF(__pyx_t_4);
4817
4818 /* "av/subtitles/subtitle.pyx":108
4819 * self.width,
4820 * self.height,
4821 * self.x, # <<<<<<<<<<<<<<
4822 * self.y,
4823 * id(self),
4824 */
4825 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 108, __pyx_L1_error)
4826 __Pyx_GOTREF(__pyx_t_5);
4827
4828 /* "av/subtitles/subtitle.pyx":109
4829 * self.height,
4830 * self.x,
4831 * self.y, # <<<<<<<<<<<<<<
4832 * id(self),
4833 * )
4834 */
4835 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 109, __pyx_L1_error)
4836 __Pyx_GOTREF(__pyx_t_6);
4837
4838 /* "av/subtitles/subtitle.pyx":110
4839 * self.x,
4840 * self.y,
4841 * id(self), # <<<<<<<<<<<<<<
4842 * )
4843 *
4844 */
4845 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 110, __pyx_L1_error)
4846 __Pyx_GOTREF(__pyx_t_7);
4847
4848 /* "av/subtitles/subtitle.pyx":104
4849 * def __repr__(self):
4850 * return '<%s.%s %dx%d at %d,%d; at 0x%x>' % (
4851 * self.__class__.__module__, # <<<<<<<<<<<<<<
4852 * self.__class__.__name__,
4853 * self.width,
4854 */
4855 __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 104, __pyx_L1_error)
4856 __Pyx_GOTREF(__pyx_t_8);
4857 __Pyx_GIVEREF(__pyx_t_2);
4858 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
4859 __Pyx_GIVEREF(__pyx_t_3);
4860 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
4861 __Pyx_GIVEREF(__pyx_t_1);
4862 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1);
4863 __Pyx_GIVEREF(__pyx_t_4);
4864 PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4);
4865 __Pyx_GIVEREF(__pyx_t_5);
4866 PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_5);
4867 __Pyx_GIVEREF(__pyx_t_6);
4868 PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_6);
4869 __Pyx_GIVEREF(__pyx_t_7);
4870 PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_7);
4871 __pyx_t_2 = 0;
4872 __pyx_t_3 = 0;
4873 __pyx_t_1 = 0;
4874 __pyx_t_4 = 0;
4875 __pyx_t_5 = 0;
4876 __pyx_t_6 = 0;
4877 __pyx_t_7 = 0;
4878
4879 /* "av/subtitles/subtitle.pyx":103
4880 *
4881 * def __repr__(self):
4882 * return '<%s.%s %dx%d at %d,%d; at 0x%x>' % ( # <<<<<<<<<<<<<<
4883 * self.__class__.__module__,
4884 * self.__class__.__name__,
4885 */
4886 __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_s_s_dx_d_at_d_d_at_0x_x, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 103, __pyx_L1_error)
4887 __Pyx_GOTREF(__pyx_t_7);
4888 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4889 __pyx_r = __pyx_t_7;
4890 __pyx_t_7 = 0;
4891 goto __pyx_L0;
4892
4893 /* "av/subtitles/subtitle.pyx":102
4894 * )
4895 *
4896 * def __repr__(self): # <<<<<<<<<<<<<<
4897 * return '<%s.%s %dx%d at %d,%d; at 0x%x>' % (
4898 * self.__class__.__module__,
4899 */
4900
4901 /* function exit code */
4902 __pyx_L1_error:;
4903 __Pyx_XDECREF(__pyx_t_1);
4904 __Pyx_XDECREF(__pyx_t_2);
4905 __Pyx_XDECREF(__pyx_t_3);
4906 __Pyx_XDECREF(__pyx_t_4);
4907 __Pyx_XDECREF(__pyx_t_5);
4908 __Pyx_XDECREF(__pyx_t_6);
4909 __Pyx_XDECREF(__pyx_t_7);
4910 __Pyx_XDECREF(__pyx_t_8);
4911 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4912 __pyx_r = NULL;
4913 __pyx_L0:;
4914 __Pyx_XGIVEREF(__pyx_r);
4915 __Pyx_RefNannyFinishContext();
4916 return __pyx_r;
4917 }
4918
4919 /* "av/subtitles/subtitle.pyx":114
4920 *
4921 * property x:
4922 * def __get__(self): return self.ptr.x # <<<<<<<<<<<<<<
4923 * property y:
4924 * def __get__(self): return self.ptr.y
4925 */
4926
4927 /* Python wrapper */
4928 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1x_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1x_1__get__(PyObject * __pyx_v_self)4929 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1x_1__get__(PyObject *__pyx_v_self) {
4930 PyObject *__pyx_r = 0;
4931 __Pyx_RefNannyDeclarations
4932 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4933 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_1x___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self));
4934
4935 /* function exit code */
4936 __Pyx_RefNannyFinishContext();
4937 return __pyx_r;
4938 }
4939
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_1x___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self)4940 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_1x___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self) {
4941 PyObject *__pyx_r = NULL;
4942 __Pyx_RefNannyDeclarations
4943 PyObject *__pyx_t_1 = NULL;
4944 int __pyx_lineno = 0;
4945 const char *__pyx_filename = NULL;
4946 int __pyx_clineno = 0;
4947 __Pyx_RefNannySetupContext("__get__", 0);
4948 __Pyx_XDECREF(__pyx_r);
4949 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.ptr->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error)
4950 __Pyx_GOTREF(__pyx_t_1);
4951 __pyx_r = __pyx_t_1;
4952 __pyx_t_1 = 0;
4953 goto __pyx_L0;
4954
4955 /* function exit code */
4956 __pyx_L1_error:;
4957 __Pyx_XDECREF(__pyx_t_1);
4958 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4959 __pyx_r = NULL;
4960 __pyx_L0:;
4961 __Pyx_XGIVEREF(__pyx_r);
4962 __Pyx_RefNannyFinishContext();
4963 return __pyx_r;
4964 }
4965
4966 /* "av/subtitles/subtitle.pyx":116
4967 * def __get__(self): return self.ptr.x
4968 * property y:
4969 * def __get__(self): return self.ptr.y # <<<<<<<<<<<<<<
4970 * property width:
4971 * def __get__(self): return self.ptr.w
4972 */
4973
4974 /* Python wrapper */
4975 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1y_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1y_1__get__(PyObject * __pyx_v_self)4976 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1y_1__get__(PyObject *__pyx_v_self) {
4977 PyObject *__pyx_r = 0;
4978 __Pyx_RefNannyDeclarations
4979 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4980 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_1y___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self));
4981
4982 /* function exit code */
4983 __Pyx_RefNannyFinishContext();
4984 return __pyx_r;
4985 }
4986
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_1y___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self)4987 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_1y___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self) {
4988 PyObject *__pyx_r = NULL;
4989 __Pyx_RefNannyDeclarations
4990 PyObject *__pyx_t_1 = NULL;
4991 int __pyx_lineno = 0;
4992 const char *__pyx_filename = NULL;
4993 int __pyx_clineno = 0;
4994 __Pyx_RefNannySetupContext("__get__", 0);
4995 __Pyx_XDECREF(__pyx_r);
4996 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.ptr->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 116, __pyx_L1_error)
4997 __Pyx_GOTREF(__pyx_t_1);
4998 __pyx_r = __pyx_t_1;
4999 __pyx_t_1 = 0;
5000 goto __pyx_L0;
5001
5002 /* function exit code */
5003 __pyx_L1_error:;
5004 __Pyx_XDECREF(__pyx_t_1);
5005 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.y.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5006 __pyx_r = NULL;
5007 __pyx_L0:;
5008 __Pyx_XGIVEREF(__pyx_r);
5009 __Pyx_RefNannyFinishContext();
5010 return __pyx_r;
5011 }
5012
5013 /* "av/subtitles/subtitle.pyx":118
5014 * def __get__(self): return self.ptr.y
5015 * property width:
5016 * def __get__(self): return self.ptr.w # <<<<<<<<<<<<<<
5017 * property height:
5018 * def __get__(self): return self.ptr.h
5019 */
5020
5021 /* Python wrapper */
5022 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_5width_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_5width_1__get__(PyObject * __pyx_v_self)5023 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_5width_1__get__(PyObject *__pyx_v_self) {
5024 PyObject *__pyx_r = 0;
5025 __Pyx_RefNannyDeclarations
5026 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5027 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_5width___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self));
5028
5029 /* function exit code */
5030 __Pyx_RefNannyFinishContext();
5031 return __pyx_r;
5032 }
5033
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_5width___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self)5034 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_5width___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self) {
5035 PyObject *__pyx_r = NULL;
5036 __Pyx_RefNannyDeclarations
5037 PyObject *__pyx_t_1 = NULL;
5038 int __pyx_lineno = 0;
5039 const char *__pyx_filename = NULL;
5040 int __pyx_clineno = 0;
5041 __Pyx_RefNannySetupContext("__get__", 0);
5042 __Pyx_XDECREF(__pyx_r);
5043 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.ptr->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 118, __pyx_L1_error)
5044 __Pyx_GOTREF(__pyx_t_1);
5045 __pyx_r = __pyx_t_1;
5046 __pyx_t_1 = 0;
5047 goto __pyx_L0;
5048
5049 /* function exit code */
5050 __pyx_L1_error:;
5051 __Pyx_XDECREF(__pyx_t_1);
5052 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5053 __pyx_r = NULL;
5054 __pyx_L0:;
5055 __Pyx_XGIVEREF(__pyx_r);
5056 __Pyx_RefNannyFinishContext();
5057 return __pyx_r;
5058 }
5059
5060 /* "av/subtitles/subtitle.pyx":120
5061 * def __get__(self): return self.ptr.w
5062 * property height:
5063 * def __get__(self): return self.ptr.h # <<<<<<<<<<<<<<
5064 * property nb_colors:
5065 * def __get__(self): return self.ptr.nb_colors
5066 */
5067
5068 /* Python wrapper */
5069 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_6height_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_6height_1__get__(PyObject * __pyx_v_self)5070 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_6height_1__get__(PyObject *__pyx_v_self) {
5071 PyObject *__pyx_r = 0;
5072 __Pyx_RefNannyDeclarations
5073 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5074 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6height___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self));
5075
5076 /* function exit code */
5077 __Pyx_RefNannyFinishContext();
5078 return __pyx_r;
5079 }
5080
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6height___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self)5081 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6height___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self) {
5082 PyObject *__pyx_r = NULL;
5083 __Pyx_RefNannyDeclarations
5084 PyObject *__pyx_t_1 = NULL;
5085 int __pyx_lineno = 0;
5086 const char *__pyx_filename = NULL;
5087 int __pyx_clineno = 0;
5088 __Pyx_RefNannySetupContext("__get__", 0);
5089 __Pyx_XDECREF(__pyx_r);
5090 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.ptr->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 120, __pyx_L1_error)
5091 __Pyx_GOTREF(__pyx_t_1);
5092 __pyx_r = __pyx_t_1;
5093 __pyx_t_1 = 0;
5094 goto __pyx_L0;
5095
5096 /* function exit code */
5097 __pyx_L1_error:;
5098 __Pyx_XDECREF(__pyx_t_1);
5099 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5100 __pyx_r = NULL;
5101 __pyx_L0:;
5102 __Pyx_XGIVEREF(__pyx_r);
5103 __Pyx_RefNannyFinishContext();
5104 return __pyx_r;
5105 }
5106
5107 /* "av/subtitles/subtitle.pyx":122
5108 * def __get__(self): return self.ptr.h
5109 * property nb_colors:
5110 * def __get__(self): return self.ptr.nb_colors # <<<<<<<<<<<<<<
5111 *
5112 * def __len__(self):
5113 */
5114
5115 /* Python wrapper */
5116 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_9nb_colors_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_9nb_colors_1__get__(PyObject * __pyx_v_self)5117 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_9nb_colors_1__get__(PyObject *__pyx_v_self) {
5118 PyObject *__pyx_r = 0;
5119 __Pyx_RefNannyDeclarations
5120 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5121 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_9nb_colors___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self));
5122
5123 /* function exit code */
5124 __Pyx_RefNannyFinishContext();
5125 return __pyx_r;
5126 }
5127
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_9nb_colors___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self)5128 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_9nb_colors___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self) {
5129 PyObject *__pyx_r = NULL;
5130 __Pyx_RefNannyDeclarations
5131 PyObject *__pyx_t_1 = NULL;
5132 int __pyx_lineno = 0;
5133 const char *__pyx_filename = NULL;
5134 int __pyx_clineno = 0;
5135 __Pyx_RefNannySetupContext("__get__", 0);
5136 __Pyx_XDECREF(__pyx_r);
5137 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.ptr->nb_colors); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 122, __pyx_L1_error)
5138 __Pyx_GOTREF(__pyx_t_1);
5139 __pyx_r = __pyx_t_1;
5140 __pyx_t_1 = 0;
5141 goto __pyx_L0;
5142
5143 /* function exit code */
5144 __pyx_L1_error:;
5145 __Pyx_XDECREF(__pyx_t_1);
5146 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.nb_colors.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5147 __pyx_r = NULL;
5148 __pyx_L0:;
5149 __Pyx_XGIVEREF(__pyx_r);
5150 __Pyx_RefNannyFinishContext();
5151 return __pyx_r;
5152 }
5153
5154 /* "av/subtitles/subtitle.pyx":124
5155 * def __get__(self): return self.ptr.nb_colors
5156 *
5157 * def __len__(self): # <<<<<<<<<<<<<<
5158 * return len(self.planes)
5159 *
5160 */
5161
5162 /* Python wrapper */
5163 static Py_ssize_t __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_5__len__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_5__len__(PyObject * __pyx_v_self)5164 static Py_ssize_t __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_5__len__(PyObject *__pyx_v_self) {
5165 Py_ssize_t __pyx_r;
5166 __Pyx_RefNannyDeclarations
5167 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
5168 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_4__len__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self));
5169
5170 /* function exit code */
5171 __Pyx_RefNannyFinishContext();
5172 return __pyx_r;
5173 }
5174
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_4__len__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self)5175 static Py_ssize_t __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_4__len__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self) {
5176 Py_ssize_t __pyx_r;
5177 __Pyx_RefNannyDeclarations
5178 PyObject *__pyx_t_1 = NULL;
5179 Py_ssize_t __pyx_t_2;
5180 int __pyx_lineno = 0;
5181 const char *__pyx_filename = NULL;
5182 int __pyx_clineno = 0;
5183 __Pyx_RefNannySetupContext("__len__", 0);
5184
5185 /* "av/subtitles/subtitle.pyx":125
5186 *
5187 * def __len__(self):
5188 * return len(self.planes) # <<<<<<<<<<<<<<
5189 *
5190 * def __iter__(self):
5191 */
5192 __pyx_t_1 = __pyx_v_self->planes;
5193 __Pyx_INCREF(__pyx_t_1);
5194 __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 125, __pyx_L1_error)
5195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5196 __pyx_r = __pyx_t_2;
5197 goto __pyx_L0;
5198
5199 /* "av/subtitles/subtitle.pyx":124
5200 * def __get__(self): return self.ptr.nb_colors
5201 *
5202 * def __len__(self): # <<<<<<<<<<<<<<
5203 * return len(self.planes)
5204 *
5205 */
5206
5207 /* function exit code */
5208 __pyx_L1_error:;
5209 __Pyx_XDECREF(__pyx_t_1);
5210 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5211 __pyx_r = -1;
5212 __pyx_L0:;
5213 __Pyx_RefNannyFinishContext();
5214 return __pyx_r;
5215 }
5216
5217 /* "av/subtitles/subtitle.pyx":127
5218 * return len(self.planes)
5219 *
5220 * def __iter__(self): # <<<<<<<<<<<<<<
5221 * return iter(self.planes)
5222 *
5223 */
5224
5225 /* Python wrapper */
5226 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_7__iter__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_7__iter__(PyObject * __pyx_v_self)5227 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_7__iter__(PyObject *__pyx_v_self) {
5228 PyObject *__pyx_r = 0;
5229 __Pyx_RefNannyDeclarations
5230 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
5231 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6__iter__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self));
5232
5233 /* function exit code */
5234 __Pyx_RefNannyFinishContext();
5235 return __pyx_r;
5236 }
5237
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6__iter__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self)5238 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6__iter__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self) {
5239 PyObject *__pyx_r = NULL;
5240 __Pyx_RefNannyDeclarations
5241 PyObject *__pyx_t_1 = NULL;
5242 PyObject *__pyx_t_2 = NULL;
5243 int __pyx_lineno = 0;
5244 const char *__pyx_filename = NULL;
5245 int __pyx_clineno = 0;
5246 __Pyx_RefNannySetupContext("__iter__", 0);
5247
5248 /* "av/subtitles/subtitle.pyx":128
5249 *
5250 * def __iter__(self):
5251 * return iter(self.planes) # <<<<<<<<<<<<<<
5252 *
5253 * def __getitem__(self, i):
5254 */
5255 __Pyx_XDECREF(__pyx_r);
5256 __pyx_t_1 = __pyx_v_self->planes;
5257 __Pyx_INCREF(__pyx_t_1);
5258 __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 128, __pyx_L1_error)
5259 __Pyx_GOTREF(__pyx_t_2);
5260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5261 __pyx_r = __pyx_t_2;
5262 __pyx_t_2 = 0;
5263 goto __pyx_L0;
5264
5265 /* "av/subtitles/subtitle.pyx":127
5266 * return len(self.planes)
5267 *
5268 * def __iter__(self): # <<<<<<<<<<<<<<
5269 * return iter(self.planes)
5270 *
5271 */
5272
5273 /* function exit code */
5274 __pyx_L1_error:;
5275 __Pyx_XDECREF(__pyx_t_1);
5276 __Pyx_XDECREF(__pyx_t_2);
5277 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5278 __pyx_r = NULL;
5279 __pyx_L0:;
5280 __Pyx_XGIVEREF(__pyx_r);
5281 __Pyx_RefNannyFinishContext();
5282 return __pyx_r;
5283 }
5284
5285 /* "av/subtitles/subtitle.pyx":130
5286 * return iter(self.planes)
5287 *
5288 * def __getitem__(self, i): # <<<<<<<<<<<<<<
5289 * return self.planes[i]
5290 *
5291 */
5292
5293 /* Python wrapper */
5294 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_9__getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_i)5295 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
5296 PyObject *__pyx_r = 0;
5297 __Pyx_RefNannyDeclarations
5298 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
5299 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_8__getitem__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self), ((PyObject *)__pyx_v_i));
5300
5301 /* function exit code */
5302 __Pyx_RefNannyFinishContext();
5303 return __pyx_r;
5304 }
5305
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_8__getitem__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self,PyObject * __pyx_v_i)5306 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_8__getitem__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self, PyObject *__pyx_v_i) {
5307 PyObject *__pyx_r = NULL;
5308 __Pyx_RefNannyDeclarations
5309 PyObject *__pyx_t_1 = NULL;
5310 int __pyx_lineno = 0;
5311 const char *__pyx_filename = NULL;
5312 int __pyx_clineno = 0;
5313 __Pyx_RefNannySetupContext("__getitem__", 0);
5314
5315 /* "av/subtitles/subtitle.pyx":131
5316 *
5317 * def __getitem__(self, i):
5318 * return self.planes[i] # <<<<<<<<<<<<<<
5319 *
5320 *
5321 */
5322 __Pyx_XDECREF(__pyx_r);
5323 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->planes, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
5324 __Pyx_GOTREF(__pyx_t_1);
5325 __pyx_r = __pyx_t_1;
5326 __pyx_t_1 = 0;
5327 goto __pyx_L0;
5328
5329 /* "av/subtitles/subtitle.pyx":130
5330 * return iter(self.planes)
5331 *
5332 * def __getitem__(self, i): # <<<<<<<<<<<<<<
5333 * return self.planes[i]
5334 *
5335 */
5336
5337 /* function exit code */
5338 __pyx_L1_error:;
5339 __Pyx_XDECREF(__pyx_t_1);
5340 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5341 __pyx_r = NULL;
5342 __pyx_L0:;
5343 __Pyx_XGIVEREF(__pyx_r);
5344 __Pyx_RefNannyFinishContext();
5345 return __pyx_r;
5346 }
5347
5348 /* "av/subtitles/subtitle.pxd":32
5349 * cdef class BitmapSubtitle(Subtitle):
5350 *
5351 * cdef readonly planes # <<<<<<<<<<<<<<
5352 *
5353 * cdef class BitmapSubtitlePlane(object):
5354 */
5355
5356 /* Python wrapper */
5357 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_6planes_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_6planes_1__get__(PyObject * __pyx_v_self)5358 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_6planes_1__get__(PyObject *__pyx_v_self) {
5359 PyObject *__pyx_r = 0;
5360 __Pyx_RefNannyDeclarations
5361 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5362 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6planes___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self));
5363
5364 /* function exit code */
5365 __Pyx_RefNannyFinishContext();
5366 return __pyx_r;
5367 }
5368
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6planes___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self)5369 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_6planes___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self) {
5370 PyObject *__pyx_r = NULL;
5371 __Pyx_RefNannyDeclarations
5372 __Pyx_RefNannySetupContext("__get__", 0);
5373 __Pyx_XDECREF(__pyx_r);
5374 __Pyx_INCREF(__pyx_v_self->planes);
5375 __pyx_r = __pyx_v_self->planes;
5376 goto __pyx_L0;
5377
5378 /* function exit code */
5379 __pyx_L0:;
5380 __Pyx_XGIVEREF(__pyx_r);
5381 __Pyx_RefNannyFinishContext();
5382 return __pyx_r;
5383 }
5384
5385 /* "(tree fragment)":1
5386 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5387 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5388 * def __setstate_cython__(self, __pyx_state):
5389 */
5390
5391 /* Python wrapper */
5392 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5393 static char __pyx_doc_2av_9subtitles_8subtitle_14BitmapSubtitle_10__reduce_cython__[] = "BitmapSubtitle.__reduce_cython__()";
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_11__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)5394 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5395 PyObject *__pyx_r = 0;
5396 __Pyx_RefNannyDeclarations
5397 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5398 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_10__reduce_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self));
5399
5400 /* function exit code */
5401 __Pyx_RefNannyFinishContext();
5402 return __pyx_r;
5403 }
5404
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self)5405 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self) {
5406 PyObject *__pyx_r = NULL;
5407 __Pyx_RefNannyDeclarations
5408 PyObject *__pyx_t_1 = NULL;
5409 int __pyx_lineno = 0;
5410 const char *__pyx_filename = NULL;
5411 int __pyx_clineno = 0;
5412 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5413
5414 /* "(tree fragment)":2
5415 * def __reduce_cython__(self):
5416 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5417 * def __setstate_cython__(self, __pyx_state):
5418 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5419 */
5420 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
5421 __Pyx_GOTREF(__pyx_t_1);
5422 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5423 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5424 __PYX_ERR(0, 2, __pyx_L1_error)
5425
5426 /* "(tree fragment)":1
5427 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5428 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5429 * def __setstate_cython__(self, __pyx_state):
5430 */
5431
5432 /* function exit code */
5433 __pyx_L1_error:;
5434 __Pyx_XDECREF(__pyx_t_1);
5435 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5436 __pyx_r = NULL;
5437 __Pyx_XGIVEREF(__pyx_r);
5438 __Pyx_RefNannyFinishContext();
5439 return __pyx_r;
5440 }
5441
5442 /* "(tree fragment)":3
5443 * def __reduce_cython__(self):
5444 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5445 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5446 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5447 */
5448
5449 /* Python wrapper */
5450 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5451 static char __pyx_doc_2av_9subtitles_8subtitle_14BitmapSubtitle_12__setstate_cython__[] = "BitmapSubtitle.__setstate_cython__(__pyx_state)";
__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_13__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)5452 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5453 PyObject *__pyx_r = 0;
5454 __Pyx_RefNannyDeclarations
5455 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5456 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_12__setstate_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5457
5458 /* function exit code */
5459 __Pyx_RefNannyFinishContext();
5460 return __pyx_r;
5461 }
5462
__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)5463 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_14BitmapSubtitle_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5464 PyObject *__pyx_r = NULL;
5465 __Pyx_RefNannyDeclarations
5466 PyObject *__pyx_t_1 = NULL;
5467 int __pyx_lineno = 0;
5468 const char *__pyx_filename = NULL;
5469 int __pyx_clineno = 0;
5470 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5471
5472 /* "(tree fragment)":4
5473 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5474 * def __setstate_cython__(self, __pyx_state):
5475 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5476 */
5477 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
5478 __Pyx_GOTREF(__pyx_t_1);
5479 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5480 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5481 __PYX_ERR(0, 4, __pyx_L1_error)
5482
5483 /* "(tree fragment)":3
5484 * def __reduce_cython__(self):
5485 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5486 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5487 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5488 */
5489
5490 /* function exit code */
5491 __pyx_L1_error:;
5492 __Pyx_XDECREF(__pyx_t_1);
5493 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitle.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5494 __pyx_r = NULL;
5495 __Pyx_XGIVEREF(__pyx_r);
5496 __Pyx_RefNannyFinishContext();
5497 return __pyx_r;
5498 }
5499
5500 /* "av/subtitles/subtitle.pyx":136
5501 * cdef class BitmapSubtitlePlane(object):
5502 *
5503 * def __cinit__(self, BitmapSubtitle subtitle, int index): # <<<<<<<<<<<<<<
5504 *
5505 * if index >= 4:
5506 */
5507
5508 /* Python wrapper */
5509 static int __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5510 static int __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5511 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_subtitle = 0;
5512 int __pyx_v_index;
5513 int __pyx_lineno = 0;
5514 const char *__pyx_filename = NULL;
5515 int __pyx_clineno = 0;
5516 int __pyx_r;
5517 __Pyx_RefNannyDeclarations
5518 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
5519 {
5520 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_subtitle,&__pyx_n_s_index,0};
5521 PyObject* values[2] = {0,0};
5522 if (unlikely(__pyx_kwds)) {
5523 Py_ssize_t kw_args;
5524 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5525 switch (pos_args) {
5526 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5527 CYTHON_FALLTHROUGH;
5528 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5529 CYTHON_FALLTHROUGH;
5530 case 0: break;
5531 default: goto __pyx_L5_argtuple_error;
5532 }
5533 kw_args = PyDict_Size(__pyx_kwds);
5534 switch (pos_args) {
5535 case 0:
5536 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subtitle)) != 0)) kw_args--;
5537 else goto __pyx_L5_argtuple_error;
5538 CYTHON_FALLTHROUGH;
5539 case 1:
5540 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
5541 else {
5542 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(1, 136, __pyx_L3_error)
5543 }
5544 }
5545 if (unlikely(kw_args > 0)) {
5546 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 136, __pyx_L3_error)
5547 }
5548 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5549 goto __pyx_L5_argtuple_error;
5550 } else {
5551 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5552 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5553 }
5554 __pyx_v_subtitle = ((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)values[0]);
5555 __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 136, __pyx_L3_error)
5556 }
5557 goto __pyx_L4_argument_unpacking_done;
5558 __pyx_L5_argtuple_error:;
5559 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 136, __pyx_L3_error)
5560 __pyx_L3_error:;
5561 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitlePlane.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5562 __Pyx_RefNannyFinishContext();
5563 return -1;
5564 __pyx_L4_argument_unpacking_done:;
5565 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subtitle), __pyx_ptype_2av_9subtitles_8subtitle_BitmapSubtitle, 1, "subtitle", 0))) __PYX_ERR(1, 136, __pyx_L1_error)
5566 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane___cinit__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)__pyx_v_self), __pyx_v_subtitle, __pyx_v_index);
5567
5568 /* function exit code */
5569 goto __pyx_L0;
5570 __pyx_L1_error:;
5571 __pyx_r = -1;
5572 __pyx_L0:;
5573 __Pyx_RefNannyFinishContext();
5574 return __pyx_r;
5575 }
5576
__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane * __pyx_v_self,struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle * __pyx_v_subtitle,int __pyx_v_index)5577 static int __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane___cinit__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *__pyx_v_subtitle, int __pyx_v_index) {
5578 int __pyx_r;
5579 __Pyx_RefNannyDeclarations
5580 int __pyx_t_1;
5581 PyObject *__pyx_t_2 = NULL;
5582 int __pyx_lineno = 0;
5583 const char *__pyx_filename = NULL;
5584 int __pyx_clineno = 0;
5585 __Pyx_RefNannySetupContext("__cinit__", 0);
5586
5587 /* "av/subtitles/subtitle.pyx":138
5588 * def __cinit__(self, BitmapSubtitle subtitle, int index):
5589 *
5590 * if index >= 4: # <<<<<<<<<<<<<<
5591 * raise ValueError('BitmapSubtitles have only 4 planes')
5592 * if not subtitle.ptr.linesize[index]:
5593 */
5594 __pyx_t_1 = ((__pyx_v_index >= 4) != 0);
5595 if (unlikely(__pyx_t_1)) {
5596
5597 /* "av/subtitles/subtitle.pyx":139
5598 *
5599 * if index >= 4:
5600 * raise ValueError('BitmapSubtitles have only 4 planes') # <<<<<<<<<<<<<<
5601 * if not subtitle.ptr.linesize[index]:
5602 * raise ValueError('plane does not exist')
5603 */
5604 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error)
5605 __Pyx_GOTREF(__pyx_t_2);
5606 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
5607 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5608 __PYX_ERR(1, 139, __pyx_L1_error)
5609
5610 /* "av/subtitles/subtitle.pyx":138
5611 * def __cinit__(self, BitmapSubtitle subtitle, int index):
5612 *
5613 * if index >= 4: # <<<<<<<<<<<<<<
5614 * raise ValueError('BitmapSubtitles have only 4 planes')
5615 * if not subtitle.ptr.linesize[index]:
5616 */
5617 }
5618
5619 /* "av/subtitles/subtitle.pyx":140
5620 * if index >= 4:
5621 * raise ValueError('BitmapSubtitles have only 4 planes')
5622 * if not subtitle.ptr.linesize[index]: # <<<<<<<<<<<<<<
5623 * raise ValueError('plane does not exist')
5624 *
5625 */
5626 __pyx_t_1 = ((!((__pyx_v_subtitle->__pyx_base.ptr->linesize[__pyx_v_index]) != 0)) != 0);
5627 if (unlikely(__pyx_t_1)) {
5628
5629 /* "av/subtitles/subtitle.pyx":141
5630 * raise ValueError('BitmapSubtitles have only 4 planes')
5631 * if not subtitle.ptr.linesize[index]:
5632 * raise ValueError('plane does not exist') # <<<<<<<<<<<<<<
5633 *
5634 * self.subtitle = subtitle
5635 */
5636 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 141, __pyx_L1_error)
5637 __Pyx_GOTREF(__pyx_t_2);
5638 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
5639 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5640 __PYX_ERR(1, 141, __pyx_L1_error)
5641
5642 /* "av/subtitles/subtitle.pyx":140
5643 * if index >= 4:
5644 * raise ValueError('BitmapSubtitles have only 4 planes')
5645 * if not subtitle.ptr.linesize[index]: # <<<<<<<<<<<<<<
5646 * raise ValueError('plane does not exist')
5647 *
5648 */
5649 }
5650
5651 /* "av/subtitles/subtitle.pyx":143
5652 * raise ValueError('plane does not exist')
5653 *
5654 * self.subtitle = subtitle # <<<<<<<<<<<<<<
5655 * self.index = index
5656 * self.buffer_size = subtitle.ptr.w * subtitle.ptr.h
5657 */
5658 __Pyx_INCREF(((PyObject *)__pyx_v_subtitle));
5659 __Pyx_GIVEREF(((PyObject *)__pyx_v_subtitle));
5660 __Pyx_GOTREF(__pyx_v_self->subtitle);
5661 __Pyx_DECREF(((PyObject *)__pyx_v_self->subtitle));
5662 __pyx_v_self->subtitle = __pyx_v_subtitle;
5663
5664 /* "av/subtitles/subtitle.pyx":144
5665 *
5666 * self.subtitle = subtitle
5667 * self.index = index # <<<<<<<<<<<<<<
5668 * self.buffer_size = subtitle.ptr.w * subtitle.ptr.h
5669 * self._buffer = <void*>subtitle.ptr.data[index]
5670 */
5671 __pyx_v_self->index = __pyx_v_index;
5672
5673 /* "av/subtitles/subtitle.pyx":145
5674 * self.subtitle = subtitle
5675 * self.index = index
5676 * self.buffer_size = subtitle.ptr.w * subtitle.ptr.h # <<<<<<<<<<<<<<
5677 * self._buffer = <void*>subtitle.ptr.data[index]
5678 *
5679 */
5680 __pyx_v_self->buffer_size = (__pyx_v_subtitle->__pyx_base.ptr->w * __pyx_v_subtitle->__pyx_base.ptr->h);
5681
5682 /* "av/subtitles/subtitle.pyx":146
5683 * self.index = index
5684 * self.buffer_size = subtitle.ptr.w * subtitle.ptr.h
5685 * self._buffer = <void*>subtitle.ptr.data[index] # <<<<<<<<<<<<<<
5686 *
5687 * # PyBuffer_FromMemory(self.ptr.data[i], self.width * self.height)
5688 */
5689 __pyx_v_self->_buffer = ((void *)(__pyx_v_subtitle->__pyx_base.ptr->data[__pyx_v_index]));
5690
5691 /* "av/subtitles/subtitle.pyx":136
5692 * cdef class BitmapSubtitlePlane(object):
5693 *
5694 * def __cinit__(self, BitmapSubtitle subtitle, int index): # <<<<<<<<<<<<<<
5695 *
5696 * if index >= 4:
5697 */
5698
5699 /* function exit code */
5700 __pyx_r = 0;
5701 goto __pyx_L0;
5702 __pyx_L1_error:;
5703 __Pyx_XDECREF(__pyx_t_2);
5704 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitlePlane.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5705 __pyx_r = -1;
5706 __pyx_L0:;
5707 __Pyx_RefNannyFinishContext();
5708 return __pyx_r;
5709 }
5710
5711 /* "av/subtitles/subtitle.pyx":153
5712 * # See: http://docs.python.org/2/c-api/typeobj.html#PyBufferProcs
5713 *
5714 * def __getsegcount__(self, Py_ssize_t *len_out): # <<<<<<<<<<<<<<
5715 * if len_out != NULL:
5716 * len_out[0] = <Py_ssize_t>self.buffer_size
5717 */
5718
5719 /* Python wrapper */
5720 #if PY_MAJOR_VERSION < 3
5721 static Py_ssize_t __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_3__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_len_out); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_3__getsegcount__(PyObject * __pyx_v_self,Py_ssize_t * __pyx_v_len_out)5722 static Py_ssize_t __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_3__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_len_out) {
5723 Py_ssize_t __pyx_r;
5724 __Pyx_RefNannyDeclarations
5725 __Pyx_RefNannySetupContext("__getsegcount__ (wrapper)", 0);
5726 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_2__getsegcount__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)__pyx_v_self), ((Py_ssize_t *)__pyx_v_len_out));
5727
5728 /* function exit code */
5729 __Pyx_RefNannyFinishContext();
5730 return __pyx_r;
5731 }
5732 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
5733
5734 #if PY_MAJOR_VERSION < 3
__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_2__getsegcount__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane * __pyx_v_self,Py_ssize_t * __pyx_v_len_out)5735 static Py_ssize_t __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_2__getsegcount__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, Py_ssize_t *__pyx_v_len_out) {
5736 Py_ssize_t __pyx_r;
5737 __Pyx_RefNannyDeclarations
5738 int __pyx_t_1;
5739 __Pyx_RefNannySetupContext("__getsegcount__", 0);
5740
5741 /* "av/subtitles/subtitle.pyx":154
5742 *
5743 * def __getsegcount__(self, Py_ssize_t *len_out):
5744 * if len_out != NULL: # <<<<<<<<<<<<<<
5745 * len_out[0] = <Py_ssize_t>self.buffer_size
5746 * return 1
5747 */
5748 __pyx_t_1 = ((__pyx_v_len_out != NULL) != 0);
5749 if (__pyx_t_1) {
5750
5751 /* "av/subtitles/subtitle.pyx":155
5752 * def __getsegcount__(self, Py_ssize_t *len_out):
5753 * if len_out != NULL:
5754 * len_out[0] = <Py_ssize_t>self.buffer_size # <<<<<<<<<<<<<<
5755 * return 1
5756 *
5757 */
5758 (__pyx_v_len_out[0]) = ((Py_ssize_t)__pyx_v_self->buffer_size);
5759
5760 /* "av/subtitles/subtitle.pyx":154
5761 *
5762 * def __getsegcount__(self, Py_ssize_t *len_out):
5763 * if len_out != NULL: # <<<<<<<<<<<<<<
5764 * len_out[0] = <Py_ssize_t>self.buffer_size
5765 * return 1
5766 */
5767 }
5768
5769 /* "av/subtitles/subtitle.pyx":156
5770 * if len_out != NULL:
5771 * len_out[0] = <Py_ssize_t>self.buffer_size
5772 * return 1 # <<<<<<<<<<<<<<
5773 *
5774 * def __getreadbuffer__(self, Py_ssize_t index, void **data):
5775 */
5776 __pyx_r = 1;
5777 goto __pyx_L0;
5778
5779 /* "av/subtitles/subtitle.pyx":153
5780 * # See: http://docs.python.org/2/c-api/typeobj.html#PyBufferProcs
5781 *
5782 * def __getsegcount__(self, Py_ssize_t *len_out): # <<<<<<<<<<<<<<
5783 * if len_out != NULL:
5784 * len_out[0] = <Py_ssize_t>self.buffer_size
5785 */
5786
5787 /* function exit code */
5788 __pyx_L0:;
5789 __Pyx_RefNannyFinishContext();
5790 return __pyx_r;
5791 }
5792 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
5793
5794 /* "av/subtitles/subtitle.pyx":158
5795 * return 1
5796 *
5797 * def __getreadbuffer__(self, Py_ssize_t index, void **data): # <<<<<<<<<<<<<<
5798 * if index:
5799 * raise RuntimeError("accessing non-existent buffer segment")
5800 */
5801
5802 /* Python wrapper */
5803 #if PY_MAJOR_VERSION < 3
5804 static Py_ssize_t __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_index, void **__pyx_v_data); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5__getreadbuffer__(PyObject * __pyx_v_self,Py_ssize_t __pyx_v_index,void ** __pyx_v_data)5805 static Py_ssize_t __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_index, void **__pyx_v_data) {
5806 Py_ssize_t __pyx_r;
5807 __Pyx_RefNannyDeclarations
5808 __Pyx_RefNannySetupContext("__getreadbuffer__ (wrapper)", 0);
5809 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_4__getreadbuffer__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)__pyx_v_self), ((Py_ssize_t)__pyx_v_index), ((void **)__pyx_v_data));
5810
5811 /* function exit code */
5812 __Pyx_RefNannyFinishContext();
5813 return __pyx_r;
5814 }
5815 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
5816
5817 #if PY_MAJOR_VERSION < 3
__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_4__getreadbuffer__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane * __pyx_v_self,Py_ssize_t __pyx_v_index,void ** __pyx_v_data)5818 static Py_ssize_t __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_4__getreadbuffer__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, Py_ssize_t __pyx_v_index, void **__pyx_v_data) {
5819 Py_ssize_t __pyx_r;
5820 __Pyx_RefNannyDeclarations
5821 int __pyx_t_1;
5822 PyObject *__pyx_t_2 = NULL;
5823 void *__pyx_t_3;
5824 int __pyx_lineno = 0;
5825 const char *__pyx_filename = NULL;
5826 int __pyx_clineno = 0;
5827 __Pyx_RefNannySetupContext("__getreadbuffer__", 0);
5828
5829 /* "av/subtitles/subtitle.pyx":159
5830 *
5831 * def __getreadbuffer__(self, Py_ssize_t index, void **data):
5832 * if index: # <<<<<<<<<<<<<<
5833 * raise RuntimeError("accessing non-existent buffer segment")
5834 * data[0] = self._buffer
5835 */
5836 __pyx_t_1 = (__pyx_v_index != 0);
5837 if (unlikely(__pyx_t_1)) {
5838
5839 /* "av/subtitles/subtitle.pyx":160
5840 * def __getreadbuffer__(self, Py_ssize_t index, void **data):
5841 * if index:
5842 * raise RuntimeError("accessing non-existent buffer segment") # <<<<<<<<<<<<<<
5843 * data[0] = self._buffer
5844 * return <Py_ssize_t>self.buffer_size
5845 */
5846 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 160, __pyx_L1_error)
5847 __Pyx_GOTREF(__pyx_t_2);
5848 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
5849 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5850 __PYX_ERR(1, 160, __pyx_L1_error)
5851
5852 /* "av/subtitles/subtitle.pyx":159
5853 *
5854 * def __getreadbuffer__(self, Py_ssize_t index, void **data):
5855 * if index: # <<<<<<<<<<<<<<
5856 * raise RuntimeError("accessing non-existent buffer segment")
5857 * data[0] = self._buffer
5858 */
5859 }
5860
5861 /* "av/subtitles/subtitle.pyx":161
5862 * if index:
5863 * raise RuntimeError("accessing non-existent buffer segment")
5864 * data[0] = self._buffer # <<<<<<<<<<<<<<
5865 * return <Py_ssize_t>self.buffer_size
5866 *
5867 */
5868 __pyx_t_3 = __pyx_v_self->_buffer;
5869 (__pyx_v_data[0]) = __pyx_t_3;
5870
5871 /* "av/subtitles/subtitle.pyx":162
5872 * raise RuntimeError("accessing non-existent buffer segment")
5873 * data[0] = self._buffer
5874 * return <Py_ssize_t>self.buffer_size # <<<<<<<<<<<<<<
5875 *
5876 * def __getwritebuffer__(self, Py_ssize_t index, void **data):
5877 */
5878 __pyx_r = ((Py_ssize_t)__pyx_v_self->buffer_size);
5879 goto __pyx_L0;
5880
5881 /* "av/subtitles/subtitle.pyx":158
5882 * return 1
5883 *
5884 * def __getreadbuffer__(self, Py_ssize_t index, void **data): # <<<<<<<<<<<<<<
5885 * if index:
5886 * raise RuntimeError("accessing non-existent buffer segment")
5887 */
5888
5889 /* function exit code */
5890 __pyx_L1_error:;
5891 __Pyx_XDECREF(__pyx_t_2);
5892 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitlePlane.__getreadbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5893 __pyx_r = -1;
5894 __pyx_L0:;
5895 __Pyx_RefNannyFinishContext();
5896 return __pyx_r;
5897 }
5898 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
5899
5900 /* "av/subtitles/subtitle.pyx":164
5901 * return <Py_ssize_t>self.buffer_size
5902 *
5903 * def __getwritebuffer__(self, Py_ssize_t index, void **data): # <<<<<<<<<<<<<<
5904 * if index:
5905 * raise RuntimeError("accessing non-existent buffer segment")
5906 */
5907
5908 /* Python wrapper */
5909 #if PY_MAJOR_VERSION < 3
5910 static Py_ssize_t __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_7__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_index, void **__pyx_v_data); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_7__getwritebuffer__(PyObject * __pyx_v_self,Py_ssize_t __pyx_v_index,void ** __pyx_v_data)5911 static Py_ssize_t __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_7__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_index, void **__pyx_v_data) {
5912 Py_ssize_t __pyx_r;
5913 __Pyx_RefNannyDeclarations
5914 __Pyx_RefNannySetupContext("__getwritebuffer__ (wrapper)", 0);
5915 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_6__getwritebuffer__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)__pyx_v_self), ((Py_ssize_t)__pyx_v_index), ((void **)__pyx_v_data));
5916
5917 /* function exit code */
5918 __Pyx_RefNannyFinishContext();
5919 return __pyx_r;
5920 }
5921 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
5922
5923 #if PY_MAJOR_VERSION < 3
__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_6__getwritebuffer__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane * __pyx_v_self,Py_ssize_t __pyx_v_index,void ** __pyx_v_data)5924 static Py_ssize_t __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_6__getwritebuffer__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, Py_ssize_t __pyx_v_index, void **__pyx_v_data) {
5925 Py_ssize_t __pyx_r;
5926 __Pyx_RefNannyDeclarations
5927 int __pyx_t_1;
5928 PyObject *__pyx_t_2 = NULL;
5929 void *__pyx_t_3;
5930 int __pyx_lineno = 0;
5931 const char *__pyx_filename = NULL;
5932 int __pyx_clineno = 0;
5933 __Pyx_RefNannySetupContext("__getwritebuffer__", 0);
5934
5935 /* "av/subtitles/subtitle.pyx":165
5936 *
5937 * def __getwritebuffer__(self, Py_ssize_t index, void **data):
5938 * if index: # <<<<<<<<<<<<<<
5939 * raise RuntimeError("accessing non-existent buffer segment")
5940 * data[0] = self._buffer
5941 */
5942 __pyx_t_1 = (__pyx_v_index != 0);
5943 if (unlikely(__pyx_t_1)) {
5944
5945 /* "av/subtitles/subtitle.pyx":166
5946 * def __getwritebuffer__(self, Py_ssize_t index, void **data):
5947 * if index:
5948 * raise RuntimeError("accessing non-existent buffer segment") # <<<<<<<<<<<<<<
5949 * data[0] = self._buffer
5950 * return <Py_ssize_t>self.buffer_size
5951 */
5952 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 166, __pyx_L1_error)
5953 __Pyx_GOTREF(__pyx_t_2);
5954 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
5955 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5956 __PYX_ERR(1, 166, __pyx_L1_error)
5957
5958 /* "av/subtitles/subtitle.pyx":165
5959 *
5960 * def __getwritebuffer__(self, Py_ssize_t index, void **data):
5961 * if index: # <<<<<<<<<<<<<<
5962 * raise RuntimeError("accessing non-existent buffer segment")
5963 * data[0] = self._buffer
5964 */
5965 }
5966
5967 /* "av/subtitles/subtitle.pyx":167
5968 * if index:
5969 * raise RuntimeError("accessing non-existent buffer segment")
5970 * data[0] = self._buffer # <<<<<<<<<<<<<<
5971 * return <Py_ssize_t>self.buffer_size
5972 *
5973 */
5974 __pyx_t_3 = __pyx_v_self->_buffer;
5975 (__pyx_v_data[0]) = __pyx_t_3;
5976
5977 /* "av/subtitles/subtitle.pyx":168
5978 * raise RuntimeError("accessing non-existent buffer segment")
5979 * data[0] = self._buffer
5980 * return <Py_ssize_t>self.buffer_size # <<<<<<<<<<<<<<
5981 *
5982 * # New-style buffer support.
5983 */
5984 __pyx_r = ((Py_ssize_t)__pyx_v_self->buffer_size);
5985 goto __pyx_L0;
5986
5987 /* "av/subtitles/subtitle.pyx":164
5988 * return <Py_ssize_t>self.buffer_size
5989 *
5990 * def __getwritebuffer__(self, Py_ssize_t index, void **data): # <<<<<<<<<<<<<<
5991 * if index:
5992 * raise RuntimeError("accessing non-existent buffer segment")
5993 */
5994
5995 /* function exit code */
5996 __pyx_L1_error:;
5997 __Pyx_XDECREF(__pyx_t_2);
5998 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitlePlane.__getwritebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5999 __pyx_r = -1;
6000 __pyx_L0:;
6001 __Pyx_RefNannyFinishContext();
6002 return __pyx_r;
6003 }
6004 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
6005
6006 /* "av/subtitles/subtitle.pyx":172
6007 * # New-style buffer support.
6008 *
6009 * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<<
6010 * PyBuffer_FillInfo(view, self, self._buffer, self.buffer_size, 0, flags)
6011 *
6012 */
6013
6014 /* Python wrapper */
6015 static CYTHON_UNUSED int __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_9__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_9__getbuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_view,int __pyx_v_flags)6016 static CYTHON_UNUSED int __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_9__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) {
6017 int __pyx_r;
6018 __Pyx_RefNannyDeclarations
6019 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6020 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8__getbuffer__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags));
6021
6022 /* function exit code */
6023 __Pyx_RefNannyFinishContext();
6024 return __pyx_r;
6025 }
6026
__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8__getbuffer__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane * __pyx_v_self,Py_buffer * __pyx_v_view,int __pyx_v_flags)6027 static int __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8__getbuffer__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) {
6028 int __pyx_r;
6029 __Pyx_RefNannyDeclarations
6030 int __pyx_t_1;
6031 int __pyx_lineno = 0;
6032 const char *__pyx_filename = NULL;
6033 int __pyx_clineno = 0;
6034 if (__pyx_v_view == NULL) {
6035 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6036 return -1;
6037 }
6038 __Pyx_RefNannySetupContext("__getbuffer__", 0);
6039 __pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None);
6040 __Pyx_GIVEREF(__pyx_v_view->obj);
6041
6042 /* "av/subtitles/subtitle.pyx":173
6043 *
6044 * def __getbuffer__(self, Py_buffer *view, int flags):
6045 * PyBuffer_FillInfo(view, self, self._buffer, self.buffer_size, 0, flags) # <<<<<<<<<<<<<<
6046 *
6047 *
6048 */
6049 __pyx_t_1 = PyBuffer_FillInfo(__pyx_v_view, ((PyObject *)__pyx_v_self), __pyx_v_self->_buffer, __pyx_v_self->buffer_size, 0, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 173, __pyx_L1_error)
6050
6051 /* "av/subtitles/subtitle.pyx":172
6052 * # New-style buffer support.
6053 *
6054 * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<<
6055 * PyBuffer_FillInfo(view, self, self._buffer, self.buffer_size, 0, flags)
6056 *
6057 */
6058
6059 /* function exit code */
6060 __pyx_r = 0;
6061 goto __pyx_L0;
6062 __pyx_L1_error:;
6063 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitlePlane.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6064 __pyx_r = -1;
6065 if (__pyx_v_view->obj != NULL) {
6066 __Pyx_GOTREF(__pyx_v_view->obj);
6067 __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0;
6068 }
6069 goto __pyx_L2;
6070 __pyx_L0:;
6071 if (__pyx_v_view->obj == Py_None) {
6072 __Pyx_GOTREF(__pyx_v_view->obj);
6073 __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0;
6074 }
6075 __pyx_L2:;
6076 __Pyx_RefNannyFinishContext();
6077 return __pyx_r;
6078 }
6079
6080 /* "av/subtitles/subtitle.pxd":36
6081 * cdef class BitmapSubtitlePlane(object):
6082 *
6083 * cdef readonly BitmapSubtitle subtitle # <<<<<<<<<<<<<<
6084 * cdef readonly int index
6085 * cdef readonly long buffer_size
6086 */
6087
6088 /* Python wrapper */
6089 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8subtitle_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8subtitle_1__get__(PyObject * __pyx_v_self)6090 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8subtitle_1__get__(PyObject *__pyx_v_self) {
6091 PyObject *__pyx_r = 0;
6092 __Pyx_RefNannyDeclarations
6093 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6094 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8subtitle___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)__pyx_v_self));
6095
6096 /* function exit code */
6097 __Pyx_RefNannyFinishContext();
6098 return __pyx_r;
6099 }
6100
__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8subtitle___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane * __pyx_v_self)6101 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8subtitle___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self) {
6102 PyObject *__pyx_r = NULL;
6103 __Pyx_RefNannyDeclarations
6104 __Pyx_RefNannySetupContext("__get__", 0);
6105 __Pyx_XDECREF(__pyx_r);
6106 __Pyx_INCREF(((PyObject *)__pyx_v_self->subtitle));
6107 __pyx_r = ((PyObject *)__pyx_v_self->subtitle);
6108 goto __pyx_L0;
6109
6110 /* function exit code */
6111 __pyx_L0:;
6112 __Pyx_XGIVEREF(__pyx_r);
6113 __Pyx_RefNannyFinishContext();
6114 return __pyx_r;
6115 }
6116
6117 /* "av/subtitles/subtitle.pxd":37
6118 *
6119 * cdef readonly BitmapSubtitle subtitle
6120 * cdef readonly int index # <<<<<<<<<<<<<<
6121 * cdef readonly long buffer_size
6122 * cdef void *_buffer
6123 */
6124
6125 /* Python wrapper */
6126 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5index_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5index_1__get__(PyObject * __pyx_v_self)6127 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5index_1__get__(PyObject *__pyx_v_self) {
6128 PyObject *__pyx_r = 0;
6129 __Pyx_RefNannyDeclarations
6130 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6131 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5index___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)__pyx_v_self));
6132
6133 /* function exit code */
6134 __Pyx_RefNannyFinishContext();
6135 return __pyx_r;
6136 }
6137
__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5index___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane * __pyx_v_self)6138 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5index___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self) {
6139 PyObject *__pyx_r = NULL;
6140 __Pyx_RefNannyDeclarations
6141 PyObject *__pyx_t_1 = NULL;
6142 int __pyx_lineno = 0;
6143 const char *__pyx_filename = NULL;
6144 int __pyx_clineno = 0;
6145 __Pyx_RefNannySetupContext("__get__", 0);
6146 __Pyx_XDECREF(__pyx_r);
6147 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 37, __pyx_L1_error)
6148 __Pyx_GOTREF(__pyx_t_1);
6149 __pyx_r = __pyx_t_1;
6150 __pyx_t_1 = 0;
6151 goto __pyx_L0;
6152
6153 /* function exit code */
6154 __pyx_L1_error:;
6155 __Pyx_XDECREF(__pyx_t_1);
6156 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitlePlane.index.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6157 __pyx_r = NULL;
6158 __pyx_L0:;
6159 __Pyx_XGIVEREF(__pyx_r);
6160 __Pyx_RefNannyFinishContext();
6161 return __pyx_r;
6162 }
6163
6164 /* "av/subtitles/subtitle.pxd":38
6165 * cdef readonly BitmapSubtitle subtitle
6166 * cdef readonly int index
6167 * cdef readonly long buffer_size # <<<<<<<<<<<<<<
6168 * cdef void *_buffer
6169 */
6170
6171 /* Python wrapper */
6172 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11buffer_size_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11buffer_size_1__get__(PyObject * __pyx_v_self)6173 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11buffer_size_1__get__(PyObject *__pyx_v_self) {
6174 PyObject *__pyx_r = 0;
6175 __Pyx_RefNannyDeclarations
6176 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6177 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11buffer_size___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)__pyx_v_self));
6178
6179 /* function exit code */
6180 __Pyx_RefNannyFinishContext();
6181 return __pyx_r;
6182 }
6183
__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11buffer_size___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane * __pyx_v_self)6184 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11buffer_size___get__(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self) {
6185 PyObject *__pyx_r = NULL;
6186 __Pyx_RefNannyDeclarations
6187 PyObject *__pyx_t_1 = NULL;
6188 int __pyx_lineno = 0;
6189 const char *__pyx_filename = NULL;
6190 int __pyx_clineno = 0;
6191 __Pyx_RefNannySetupContext("__get__", 0);
6192 __Pyx_XDECREF(__pyx_r);
6193 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->buffer_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 38, __pyx_L1_error)
6194 __Pyx_GOTREF(__pyx_t_1);
6195 __pyx_r = __pyx_t_1;
6196 __pyx_t_1 = 0;
6197 goto __pyx_L0;
6198
6199 /* function exit code */
6200 __pyx_L1_error:;
6201 __Pyx_XDECREF(__pyx_t_1);
6202 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitlePlane.buffer_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6203 __pyx_r = NULL;
6204 __pyx_L0:;
6205 __Pyx_XGIVEREF(__pyx_r);
6206 __Pyx_RefNannyFinishContext();
6207 return __pyx_r;
6208 }
6209
6210 /* "(tree fragment)":1
6211 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6212 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6213 * def __setstate_cython__(self, __pyx_state):
6214 */
6215
6216 /* Python wrapper */
6217 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6218 static char __pyx_doc_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_10__reduce_cython__[] = "BitmapSubtitlePlane.__reduce_cython__()";
__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)6219 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6220 PyObject *__pyx_r = 0;
6221 __Pyx_RefNannyDeclarations
6222 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6223 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_10__reduce_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)__pyx_v_self));
6224
6225 /* function exit code */
6226 __Pyx_RefNannyFinishContext();
6227 return __pyx_r;
6228 }
6229
__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane * __pyx_v_self)6230 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self) {
6231 PyObject *__pyx_r = NULL;
6232 __Pyx_RefNannyDeclarations
6233 PyObject *__pyx_t_1 = NULL;
6234 int __pyx_lineno = 0;
6235 const char *__pyx_filename = NULL;
6236 int __pyx_clineno = 0;
6237 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6238
6239 /* "(tree fragment)":2
6240 * def __reduce_cython__(self):
6241 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6242 * def __setstate_cython__(self, __pyx_state):
6243 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6244 */
6245 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
6246 __Pyx_GOTREF(__pyx_t_1);
6247 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6248 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6249 __PYX_ERR(0, 2, __pyx_L1_error)
6250
6251 /* "(tree fragment)":1
6252 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6253 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6254 * def __setstate_cython__(self, __pyx_state):
6255 */
6256
6257 /* function exit code */
6258 __pyx_L1_error:;
6259 __Pyx_XDECREF(__pyx_t_1);
6260 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitlePlane.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6261 __pyx_r = NULL;
6262 __Pyx_XGIVEREF(__pyx_r);
6263 __Pyx_RefNannyFinishContext();
6264 return __pyx_r;
6265 }
6266
6267 /* "(tree fragment)":3
6268 * def __reduce_cython__(self):
6269 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6270 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6271 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6272 */
6273
6274 /* Python wrapper */
6275 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6276 static char __pyx_doc_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_12__setstate_cython__[] = "BitmapSubtitlePlane.__setstate_cython__(__pyx_state)";
__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_13__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)6277 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6278 PyObject *__pyx_r = 0;
6279 __Pyx_RefNannyDeclarations
6280 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6281 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_12__setstate_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6282
6283 /* function exit code */
6284 __Pyx_RefNannyFinishContext();
6285 return __pyx_r;
6286 }
6287
__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)6288 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6289 PyObject *__pyx_r = NULL;
6290 __Pyx_RefNannyDeclarations
6291 PyObject *__pyx_t_1 = NULL;
6292 int __pyx_lineno = 0;
6293 const char *__pyx_filename = NULL;
6294 int __pyx_clineno = 0;
6295 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6296
6297 /* "(tree fragment)":4
6298 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6299 * def __setstate_cython__(self, __pyx_state):
6300 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6301 */
6302 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
6303 __Pyx_GOTREF(__pyx_t_1);
6304 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6305 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6306 __PYX_ERR(0, 4, __pyx_L1_error)
6307
6308 /* "(tree fragment)":3
6309 * def __reduce_cython__(self):
6310 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6311 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6312 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6313 */
6314
6315 /* function exit code */
6316 __pyx_L1_error:;
6317 __Pyx_XDECREF(__pyx_t_1);
6318 __Pyx_AddTraceback("av.subtitles.subtitle.BitmapSubtitlePlane.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6319 __pyx_r = NULL;
6320 __Pyx_XGIVEREF(__pyx_r);
6321 __Pyx_RefNannyFinishContext();
6322 return __pyx_r;
6323 }
6324
6325 /* "av/subtitles/subtitle.pyx":178
6326 * cdef class TextSubtitle(Subtitle):
6327 *
6328 * def __repr__(self): # <<<<<<<<<<<<<<
6329 * return '<%s.%s %r at 0x%x>' % (
6330 * self.__class__.__module__,
6331 */
6332
6333 /* Python wrapper */
6334 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_1__repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_1__repr__(PyObject * __pyx_v_self)6335 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_1__repr__(PyObject *__pyx_v_self) {
6336 PyObject *__pyx_r = 0;
6337 __Pyx_RefNannyDeclarations
6338 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
6339 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle___repr__(((struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *)__pyx_v_self));
6340
6341 /* function exit code */
6342 __Pyx_RefNannyFinishContext();
6343 return __pyx_r;
6344 }
6345
__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle___repr__(struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle * __pyx_v_self)6346 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle___repr__(struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *__pyx_v_self) {
6347 PyObject *__pyx_r = NULL;
6348 __Pyx_RefNannyDeclarations
6349 PyObject *__pyx_t_1 = NULL;
6350 PyObject *__pyx_t_2 = NULL;
6351 PyObject *__pyx_t_3 = NULL;
6352 PyObject *__pyx_t_4 = NULL;
6353 PyObject *__pyx_t_5 = NULL;
6354 int __pyx_lineno = 0;
6355 const char *__pyx_filename = NULL;
6356 int __pyx_clineno = 0;
6357 __Pyx_RefNannySetupContext("__repr__", 0);
6358
6359 /* "av/subtitles/subtitle.pyx":179
6360 *
6361 * def __repr__(self):
6362 * return '<%s.%s %r at 0x%x>' % ( # <<<<<<<<<<<<<<
6363 * self.__class__.__module__,
6364 * self.__class__.__name__,
6365 */
6366 __Pyx_XDECREF(__pyx_r);
6367
6368 /* "av/subtitles/subtitle.pyx":180
6369 * def __repr__(self):
6370 * return '<%s.%s %r at 0x%x>' % (
6371 * self.__class__.__module__, # <<<<<<<<<<<<<<
6372 * self.__class__.__name__,
6373 * self.text,
6374 */
6375 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 180, __pyx_L1_error)
6376 __Pyx_GOTREF(__pyx_t_1);
6377 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 180, __pyx_L1_error)
6378 __Pyx_GOTREF(__pyx_t_2);
6379 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6380
6381 /* "av/subtitles/subtitle.pyx":181
6382 * return '<%s.%s %r at 0x%x>' % (
6383 * self.__class__.__module__,
6384 * self.__class__.__name__, # <<<<<<<<<<<<<<
6385 * self.text,
6386 * id(self),
6387 */
6388 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 181, __pyx_L1_error)
6389 __Pyx_GOTREF(__pyx_t_1);
6390 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 181, __pyx_L1_error)
6391 __Pyx_GOTREF(__pyx_t_3);
6392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6393
6394 /* "av/subtitles/subtitle.pyx":182
6395 * self.__class__.__module__,
6396 * self.__class__.__name__,
6397 * self.text, # <<<<<<<<<<<<<<
6398 * id(self),
6399 * )
6400 */
6401 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 182, __pyx_L1_error)
6402 __Pyx_GOTREF(__pyx_t_1);
6403
6404 /* "av/subtitles/subtitle.pyx":183
6405 * self.__class__.__name__,
6406 * self.text,
6407 * id(self), # <<<<<<<<<<<<<<
6408 * )
6409 *
6410 */
6411 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 183, __pyx_L1_error)
6412 __Pyx_GOTREF(__pyx_t_4);
6413
6414 /* "av/subtitles/subtitle.pyx":180
6415 * def __repr__(self):
6416 * return '<%s.%s %r at 0x%x>' % (
6417 * self.__class__.__module__, # <<<<<<<<<<<<<<
6418 * self.__class__.__name__,
6419 * self.text,
6420 */
6421 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 180, __pyx_L1_error)
6422 __Pyx_GOTREF(__pyx_t_5);
6423 __Pyx_GIVEREF(__pyx_t_2);
6424 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
6425 __Pyx_GIVEREF(__pyx_t_3);
6426 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
6427 __Pyx_GIVEREF(__pyx_t_1);
6428 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1);
6429 __Pyx_GIVEREF(__pyx_t_4);
6430 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
6431 __pyx_t_2 = 0;
6432 __pyx_t_3 = 0;
6433 __pyx_t_1 = 0;
6434 __pyx_t_4 = 0;
6435
6436 /* "av/subtitles/subtitle.pyx":179
6437 *
6438 * def __repr__(self):
6439 * return '<%s.%s %r at 0x%x>' % ( # <<<<<<<<<<<<<<
6440 * self.__class__.__module__,
6441 * self.__class__.__name__,
6442 */
6443 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s_r_at_0x_x, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 179, __pyx_L1_error)
6444 __Pyx_GOTREF(__pyx_t_4);
6445 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6446 __pyx_r = __pyx_t_4;
6447 __pyx_t_4 = 0;
6448 goto __pyx_L0;
6449
6450 /* "av/subtitles/subtitle.pyx":178
6451 * cdef class TextSubtitle(Subtitle):
6452 *
6453 * def __repr__(self): # <<<<<<<<<<<<<<
6454 * return '<%s.%s %r at 0x%x>' % (
6455 * self.__class__.__module__,
6456 */
6457
6458 /* function exit code */
6459 __pyx_L1_error:;
6460 __Pyx_XDECREF(__pyx_t_1);
6461 __Pyx_XDECREF(__pyx_t_2);
6462 __Pyx_XDECREF(__pyx_t_3);
6463 __Pyx_XDECREF(__pyx_t_4);
6464 __Pyx_XDECREF(__pyx_t_5);
6465 __Pyx_AddTraceback("av.subtitles.subtitle.TextSubtitle.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6466 __pyx_r = NULL;
6467 __pyx_L0:;
6468 __Pyx_XGIVEREF(__pyx_r);
6469 __Pyx_RefNannyFinishContext();
6470 return __pyx_r;
6471 }
6472
6473 /* "av/subtitles/subtitle.pyx":187
6474 *
6475 * property text:
6476 * def __get__(self): return self.ptr.text # <<<<<<<<<<<<<<
6477 *
6478 *
6479 */
6480
6481 /* Python wrapper */
6482 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_4text_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_4text_1__get__(PyObject * __pyx_v_self)6483 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_4text_1__get__(PyObject *__pyx_v_self) {
6484 PyObject *__pyx_r = 0;
6485 __Pyx_RefNannyDeclarations
6486 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6487 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_4text___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *)__pyx_v_self));
6488
6489 /* function exit code */
6490 __Pyx_RefNannyFinishContext();
6491 return __pyx_r;
6492 }
6493
__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_4text___get__(struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle * __pyx_v_self)6494 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_4text___get__(struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *__pyx_v_self) {
6495 PyObject *__pyx_r = NULL;
6496 __Pyx_RefNannyDeclarations
6497 PyObject *__pyx_t_1 = NULL;
6498 int __pyx_lineno = 0;
6499 const char *__pyx_filename = NULL;
6500 int __pyx_clineno = 0;
6501 __Pyx_RefNannySetupContext("__get__", 0);
6502 __Pyx_XDECREF(__pyx_r);
6503 __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_self->__pyx_base.ptr->text); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 187, __pyx_L1_error)
6504 __Pyx_GOTREF(__pyx_t_1);
6505 __pyx_r = __pyx_t_1;
6506 __pyx_t_1 = 0;
6507 goto __pyx_L0;
6508
6509 /* function exit code */
6510 __pyx_L1_error:;
6511 __Pyx_XDECREF(__pyx_t_1);
6512 __Pyx_AddTraceback("av.subtitles.subtitle.TextSubtitle.text.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6513 __pyx_r = NULL;
6514 __pyx_L0:;
6515 __Pyx_XGIVEREF(__pyx_r);
6516 __Pyx_RefNannyFinishContext();
6517 return __pyx_r;
6518 }
6519
6520 /* "(tree fragment)":1
6521 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6522 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6523 * def __setstate_cython__(self, __pyx_state):
6524 */
6525
6526 /* Python wrapper */
6527 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6528 static char __pyx_doc_2av_9subtitles_8subtitle_12TextSubtitle_2__reduce_cython__[] = "TextSubtitle.__reduce_cython__()";
__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)6529 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6530 PyObject *__pyx_r = 0;
6531 __Pyx_RefNannyDeclarations
6532 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6533 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_2__reduce_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *)__pyx_v_self));
6534
6535 /* function exit code */
6536 __Pyx_RefNannyFinishContext();
6537 return __pyx_r;
6538 }
6539
__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle * __pyx_v_self)6540 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *__pyx_v_self) {
6541 PyObject *__pyx_r = NULL;
6542 __Pyx_RefNannyDeclarations
6543 PyObject *__pyx_t_1 = NULL;
6544 int __pyx_lineno = 0;
6545 const char *__pyx_filename = NULL;
6546 int __pyx_clineno = 0;
6547 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6548
6549 /* "(tree fragment)":2
6550 * def __reduce_cython__(self):
6551 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6552 * def __setstate_cython__(self, __pyx_state):
6553 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6554 */
6555 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
6556 __Pyx_GOTREF(__pyx_t_1);
6557 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6558 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6559 __PYX_ERR(0, 2, __pyx_L1_error)
6560
6561 /* "(tree fragment)":1
6562 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6563 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6564 * def __setstate_cython__(self, __pyx_state):
6565 */
6566
6567 /* function exit code */
6568 __pyx_L1_error:;
6569 __Pyx_XDECREF(__pyx_t_1);
6570 __Pyx_AddTraceback("av.subtitles.subtitle.TextSubtitle.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6571 __pyx_r = NULL;
6572 __Pyx_XGIVEREF(__pyx_r);
6573 __Pyx_RefNannyFinishContext();
6574 return __pyx_r;
6575 }
6576
6577 /* "(tree fragment)":3
6578 * def __reduce_cython__(self):
6579 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6580 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6581 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6582 */
6583
6584 /* Python wrapper */
6585 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6586 static char __pyx_doc_2av_9subtitles_8subtitle_12TextSubtitle_4__setstate_cython__[] = "TextSubtitle.__setstate_cython__(__pyx_state)";
__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)6587 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6588 PyObject *__pyx_r = 0;
6589 __Pyx_RefNannyDeclarations
6590 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6591 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_4__setstate_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6592
6593 /* function exit code */
6594 __Pyx_RefNannyFinishContext();
6595 return __pyx_r;
6596 }
6597
__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)6598 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_12TextSubtitle_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6599 PyObject *__pyx_r = NULL;
6600 __Pyx_RefNannyDeclarations
6601 PyObject *__pyx_t_1 = NULL;
6602 int __pyx_lineno = 0;
6603 const char *__pyx_filename = NULL;
6604 int __pyx_clineno = 0;
6605 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6606
6607 /* "(tree fragment)":4
6608 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6609 * def __setstate_cython__(self, __pyx_state):
6610 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6611 */
6612 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
6613 __Pyx_GOTREF(__pyx_t_1);
6614 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6615 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6616 __PYX_ERR(0, 4, __pyx_L1_error)
6617
6618 /* "(tree fragment)":3
6619 * def __reduce_cython__(self):
6620 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6621 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6622 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6623 */
6624
6625 /* function exit code */
6626 __pyx_L1_error:;
6627 __Pyx_XDECREF(__pyx_t_1);
6628 __Pyx_AddTraceback("av.subtitles.subtitle.TextSubtitle.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6629 __pyx_r = NULL;
6630 __Pyx_XGIVEREF(__pyx_r);
6631 __Pyx_RefNannyFinishContext();
6632 return __pyx_r;
6633 }
6634
6635 /* "av/subtitles/subtitle.pyx":192
6636 * cdef class AssSubtitle(Subtitle):
6637 *
6638 * def __repr__(self): # <<<<<<<<<<<<<<
6639 * return '<%s.%s %r at 0x%x>' % (
6640 * self.__class__.__module__,
6641 */
6642
6643 /* Python wrapper */
6644 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_1__repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_1__repr__(PyObject * __pyx_v_self)6645 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_1__repr__(PyObject *__pyx_v_self) {
6646 PyObject *__pyx_r = 0;
6647 __Pyx_RefNannyDeclarations
6648 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
6649 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle___repr__(((struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *)__pyx_v_self));
6650
6651 /* function exit code */
6652 __Pyx_RefNannyFinishContext();
6653 return __pyx_r;
6654 }
6655
__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle___repr__(struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle * __pyx_v_self)6656 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle___repr__(struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *__pyx_v_self) {
6657 PyObject *__pyx_r = NULL;
6658 __Pyx_RefNannyDeclarations
6659 PyObject *__pyx_t_1 = NULL;
6660 PyObject *__pyx_t_2 = NULL;
6661 PyObject *__pyx_t_3 = NULL;
6662 PyObject *__pyx_t_4 = NULL;
6663 PyObject *__pyx_t_5 = NULL;
6664 int __pyx_lineno = 0;
6665 const char *__pyx_filename = NULL;
6666 int __pyx_clineno = 0;
6667 __Pyx_RefNannySetupContext("__repr__", 0);
6668
6669 /* "av/subtitles/subtitle.pyx":193
6670 *
6671 * def __repr__(self):
6672 * return '<%s.%s %r at 0x%x>' % ( # <<<<<<<<<<<<<<
6673 * self.__class__.__module__,
6674 * self.__class__.__name__,
6675 */
6676 __Pyx_XDECREF(__pyx_r);
6677
6678 /* "av/subtitles/subtitle.pyx":194
6679 * def __repr__(self):
6680 * return '<%s.%s %r at 0x%x>' % (
6681 * self.__class__.__module__, # <<<<<<<<<<<<<<
6682 * self.__class__.__name__,
6683 * self.ass,
6684 */
6685 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 194, __pyx_L1_error)
6686 __Pyx_GOTREF(__pyx_t_1);
6687 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 194, __pyx_L1_error)
6688 __Pyx_GOTREF(__pyx_t_2);
6689 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6690
6691 /* "av/subtitles/subtitle.pyx":195
6692 * return '<%s.%s %r at 0x%x>' % (
6693 * self.__class__.__module__,
6694 * self.__class__.__name__, # <<<<<<<<<<<<<<
6695 * self.ass,
6696 * id(self),
6697 */
6698 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 195, __pyx_L1_error)
6699 __Pyx_GOTREF(__pyx_t_1);
6700 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 195, __pyx_L1_error)
6701 __Pyx_GOTREF(__pyx_t_3);
6702 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6703
6704 /* "av/subtitles/subtitle.pyx":196
6705 * self.__class__.__module__,
6706 * self.__class__.__name__,
6707 * self.ass, # <<<<<<<<<<<<<<
6708 * id(self),
6709 * )
6710 */
6711 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ass); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
6712 __Pyx_GOTREF(__pyx_t_1);
6713
6714 /* "av/subtitles/subtitle.pyx":197
6715 * self.__class__.__name__,
6716 * self.ass,
6717 * id(self), # <<<<<<<<<<<<<<
6718 * )
6719 *
6720 */
6721 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 197, __pyx_L1_error)
6722 __Pyx_GOTREF(__pyx_t_4);
6723
6724 /* "av/subtitles/subtitle.pyx":194
6725 * def __repr__(self):
6726 * return '<%s.%s %r at 0x%x>' % (
6727 * self.__class__.__module__, # <<<<<<<<<<<<<<
6728 * self.__class__.__name__,
6729 * self.ass,
6730 */
6731 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 194, __pyx_L1_error)
6732 __Pyx_GOTREF(__pyx_t_5);
6733 __Pyx_GIVEREF(__pyx_t_2);
6734 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
6735 __Pyx_GIVEREF(__pyx_t_3);
6736 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
6737 __Pyx_GIVEREF(__pyx_t_1);
6738 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1);
6739 __Pyx_GIVEREF(__pyx_t_4);
6740 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
6741 __pyx_t_2 = 0;
6742 __pyx_t_3 = 0;
6743 __pyx_t_1 = 0;
6744 __pyx_t_4 = 0;
6745
6746 /* "av/subtitles/subtitle.pyx":193
6747 *
6748 * def __repr__(self):
6749 * return '<%s.%s %r at 0x%x>' % ( # <<<<<<<<<<<<<<
6750 * self.__class__.__module__,
6751 * self.__class__.__name__,
6752 */
6753 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s_r_at_0x_x, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 193, __pyx_L1_error)
6754 __Pyx_GOTREF(__pyx_t_4);
6755 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6756 __pyx_r = __pyx_t_4;
6757 __pyx_t_4 = 0;
6758 goto __pyx_L0;
6759
6760 /* "av/subtitles/subtitle.pyx":192
6761 * cdef class AssSubtitle(Subtitle):
6762 *
6763 * def __repr__(self): # <<<<<<<<<<<<<<
6764 * return '<%s.%s %r at 0x%x>' % (
6765 * self.__class__.__module__,
6766 */
6767
6768 /* function exit code */
6769 __pyx_L1_error:;
6770 __Pyx_XDECREF(__pyx_t_1);
6771 __Pyx_XDECREF(__pyx_t_2);
6772 __Pyx_XDECREF(__pyx_t_3);
6773 __Pyx_XDECREF(__pyx_t_4);
6774 __Pyx_XDECREF(__pyx_t_5);
6775 __Pyx_AddTraceback("av.subtitles.subtitle.AssSubtitle.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6776 __pyx_r = NULL;
6777 __pyx_L0:;
6778 __Pyx_XGIVEREF(__pyx_r);
6779 __Pyx_RefNannyFinishContext();
6780 return __pyx_r;
6781 }
6782
6783 /* "av/subtitles/subtitle.pyx":201
6784 *
6785 * property ass:
6786 * def __get__(self): return self.ptr.ass # <<<<<<<<<<<<<<
6787 */
6788
6789 /* Python wrapper */
6790 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_3ass_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_3ass_1__get__(PyObject * __pyx_v_self)6791 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_3ass_1__get__(PyObject *__pyx_v_self) {
6792 PyObject *__pyx_r = 0;
6793 __Pyx_RefNannyDeclarations
6794 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6795 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_3ass___get__(((struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *)__pyx_v_self));
6796
6797 /* function exit code */
6798 __Pyx_RefNannyFinishContext();
6799 return __pyx_r;
6800 }
6801
__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_3ass___get__(struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle * __pyx_v_self)6802 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_3ass___get__(struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *__pyx_v_self) {
6803 PyObject *__pyx_r = NULL;
6804 __Pyx_RefNannyDeclarations
6805 PyObject *__pyx_t_1 = NULL;
6806 int __pyx_lineno = 0;
6807 const char *__pyx_filename = NULL;
6808 int __pyx_clineno = 0;
6809 __Pyx_RefNannySetupContext("__get__", 0);
6810 __Pyx_XDECREF(__pyx_r);
6811 __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_self->__pyx_base.ptr->ass); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 201, __pyx_L1_error)
6812 __Pyx_GOTREF(__pyx_t_1);
6813 __pyx_r = __pyx_t_1;
6814 __pyx_t_1 = 0;
6815 goto __pyx_L0;
6816
6817 /* function exit code */
6818 __pyx_L1_error:;
6819 __Pyx_XDECREF(__pyx_t_1);
6820 __Pyx_AddTraceback("av.subtitles.subtitle.AssSubtitle.ass.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6821 __pyx_r = NULL;
6822 __pyx_L0:;
6823 __Pyx_XGIVEREF(__pyx_r);
6824 __Pyx_RefNannyFinishContext();
6825 return __pyx_r;
6826 }
6827
6828 /* "(tree fragment)":1
6829 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6830 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6831 * def __setstate_cython__(self, __pyx_state):
6832 */
6833
6834 /* Python wrapper */
6835 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6836 static char __pyx_doc_2av_9subtitles_8subtitle_11AssSubtitle_2__reduce_cython__[] = "AssSubtitle.__reduce_cython__()";
__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)6837 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6838 PyObject *__pyx_r = 0;
6839 __Pyx_RefNannyDeclarations
6840 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6841 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_2__reduce_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *)__pyx_v_self));
6842
6843 /* function exit code */
6844 __Pyx_RefNannyFinishContext();
6845 return __pyx_r;
6846 }
6847
__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle * __pyx_v_self)6848 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *__pyx_v_self) {
6849 PyObject *__pyx_r = NULL;
6850 __Pyx_RefNannyDeclarations
6851 PyObject *__pyx_t_1 = NULL;
6852 int __pyx_lineno = 0;
6853 const char *__pyx_filename = NULL;
6854 int __pyx_clineno = 0;
6855 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6856
6857 /* "(tree fragment)":2
6858 * def __reduce_cython__(self):
6859 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6860 * def __setstate_cython__(self, __pyx_state):
6861 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6862 */
6863 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
6864 __Pyx_GOTREF(__pyx_t_1);
6865 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6866 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6867 __PYX_ERR(0, 2, __pyx_L1_error)
6868
6869 /* "(tree fragment)":1
6870 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6871 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6872 * def __setstate_cython__(self, __pyx_state):
6873 */
6874
6875 /* function exit code */
6876 __pyx_L1_error:;
6877 __Pyx_XDECREF(__pyx_t_1);
6878 __Pyx_AddTraceback("av.subtitles.subtitle.AssSubtitle.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6879 __pyx_r = NULL;
6880 __Pyx_XGIVEREF(__pyx_r);
6881 __Pyx_RefNannyFinishContext();
6882 return __pyx_r;
6883 }
6884
6885 /* "(tree fragment)":3
6886 * def __reduce_cython__(self):
6887 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6888 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6889 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6890 */
6891
6892 /* Python wrapper */
6893 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6894 static char __pyx_doc_2av_9subtitles_8subtitle_11AssSubtitle_4__setstate_cython__[] = "AssSubtitle.__setstate_cython__(__pyx_state)";
__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)6895 static PyObject *__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6896 PyObject *__pyx_r = 0;
6897 __Pyx_RefNannyDeclarations
6898 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6899 __pyx_r = __pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_4__setstate_cython__(((struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6900
6901 /* function exit code */
6902 __Pyx_RefNannyFinishContext();
6903 return __pyx_r;
6904 }
6905
__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)6906 static PyObject *__pyx_pf_2av_9subtitles_8subtitle_11AssSubtitle_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6907 PyObject *__pyx_r = NULL;
6908 __Pyx_RefNannyDeclarations
6909 PyObject *__pyx_t_1 = NULL;
6910 int __pyx_lineno = 0;
6911 const char *__pyx_filename = NULL;
6912 int __pyx_clineno = 0;
6913 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6914
6915 /* "(tree fragment)":4
6916 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6917 * def __setstate_cython__(self, __pyx_state):
6918 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6919 */
6920 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
6921 __Pyx_GOTREF(__pyx_t_1);
6922 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6924 __PYX_ERR(0, 4, __pyx_L1_error)
6925
6926 /* "(tree fragment)":3
6927 * def __reduce_cython__(self):
6928 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6929 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6930 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6931 */
6932
6933 /* function exit code */
6934 __pyx_L1_error:;
6935 __Pyx_XDECREF(__pyx_t_1);
6936 __Pyx_AddTraceback("av.subtitles.subtitle.AssSubtitle.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6937 __pyx_r = NULL;
6938 __Pyx_XGIVEREF(__pyx_r);
6939 __Pyx_RefNannyFinishContext();
6940 return __pyx_r;
6941 }
6942
__pyx_tp_new_2av_9subtitles_8subtitle_SubtitleProxy(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)6943 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_SubtitleProxy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
6944 PyObject *o;
6945 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
6946 o = (*t->tp_alloc)(t, 0);
6947 } else {
6948 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
6949 }
6950 if (unlikely(!o)) return 0;
6951 return o;
6952 }
6953
__pyx_tp_dealloc_2av_9subtitles_8subtitle_SubtitleProxy(PyObject * o)6954 static void __pyx_tp_dealloc_2av_9subtitles_8subtitle_SubtitleProxy(PyObject *o) {
6955 #if CYTHON_USE_TP_FINALIZE
6956 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
6957 if (PyObject_CallFinalizerFromDealloc(o)) return;
6958 }
6959 #endif
6960 {
6961 PyObject *etype, *eval, *etb;
6962 PyErr_Fetch(&etype, &eval, &etb);
6963 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
6964 __pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_1__dealloc__(o);
6965 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
6966 PyErr_Restore(etype, eval, etb);
6967 }
6968 (*Py_TYPE(o)->tp_free)(o);
6969 }
6970
6971 static PyMethodDef __pyx_methods_2av_9subtitles_8subtitle_SubtitleProxy[] = {
6972 {"__reduce_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_3__reduce_cython__, METH_NOARGS, __pyx_doc_2av_9subtitles_8subtitle_13SubtitleProxy_2__reduce_cython__},
6973 {"__setstate_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_13SubtitleProxy_5__setstate_cython__, METH_O, __pyx_doc_2av_9subtitles_8subtitle_13SubtitleProxy_4__setstate_cython__},
6974 {0, 0, 0, 0}
6975 };
6976
6977 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle_SubtitleProxy = {
6978 PyVarObject_HEAD_INIT(0, 0)
6979 "av.subtitles.subtitle.SubtitleProxy", /*tp_name*/
6980 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy), /*tp_basicsize*/
6981 0, /*tp_itemsize*/
6982 __pyx_tp_dealloc_2av_9subtitles_8subtitle_SubtitleProxy, /*tp_dealloc*/
6983 #if PY_VERSION_HEX < 0x030800b4
6984 0, /*tp_print*/
6985 #endif
6986 #if PY_VERSION_HEX >= 0x030800b4
6987 0, /*tp_vectorcall_offset*/
6988 #endif
6989 0, /*tp_getattr*/
6990 0, /*tp_setattr*/
6991 #if PY_MAJOR_VERSION < 3
6992 0, /*tp_compare*/
6993 #endif
6994 #if PY_MAJOR_VERSION >= 3
6995 0, /*tp_as_async*/
6996 #endif
6997 0, /*tp_repr*/
6998 0, /*tp_as_number*/
6999 0, /*tp_as_sequence*/
7000 0, /*tp_as_mapping*/
7001 0, /*tp_hash*/
7002 0, /*tp_call*/
7003 0, /*tp_str*/
7004 0, /*tp_getattro*/
7005 0, /*tp_setattro*/
7006 0, /*tp_as_buffer*/
7007 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
7008 0, /*tp_doc*/
7009 0, /*tp_traverse*/
7010 0, /*tp_clear*/
7011 0, /*tp_richcompare*/
7012 0, /*tp_weaklistoffset*/
7013 0, /*tp_iter*/
7014 0, /*tp_iternext*/
7015 __pyx_methods_2av_9subtitles_8subtitle_SubtitleProxy, /*tp_methods*/
7016 0, /*tp_members*/
7017 0, /*tp_getset*/
7018 0, /*tp_base*/
7019 0, /*tp_dict*/
7020 0, /*tp_descr_get*/
7021 0, /*tp_descr_set*/
7022 0, /*tp_dictoffset*/
7023 0, /*tp_init*/
7024 0, /*tp_alloc*/
7025 __pyx_tp_new_2av_9subtitles_8subtitle_SubtitleProxy, /*tp_new*/
7026 0, /*tp_free*/
7027 0, /*tp_is_gc*/
7028 0, /*tp_bases*/
7029 0, /*tp_mro*/
7030 0, /*tp_cache*/
7031 0, /*tp_subclasses*/
7032 0, /*tp_weaklist*/
7033 0, /*tp_del*/
7034 0, /*tp_version_tag*/
7035 #if PY_VERSION_HEX >= 0x030400a1
7036 0, /*tp_finalize*/
7037 #endif
7038 #if PY_VERSION_HEX >= 0x030800b1
7039 0, /*tp_vectorcall*/
7040 #endif
7041 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
7042 0, /*tp_print*/
7043 #endif
7044 };
7045
__pyx_tp_new_2av_9subtitles_8subtitle_SubtitleSet(PyTypeObject * t,PyObject * a,PyObject * k)7046 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_SubtitleSet(PyTypeObject *t, PyObject *a, PyObject *k) {
7047 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *p;
7048 PyObject *o;
7049 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
7050 o = (*t->tp_alloc)(t, 0);
7051 } else {
7052 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
7053 }
7054 if (unlikely(!o)) return 0;
7055 p = ((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)o);
7056 p->packet = ((struct __pyx_obj_2av_6packet_Packet *)Py_None); Py_INCREF(Py_None);
7057 p->proxy = ((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *)Py_None); Py_INCREF(Py_None);
7058 p->rects = ((PyObject*)Py_None); Py_INCREF(Py_None);
7059 if (unlikely(__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_1__cinit__(o, a, k) < 0)) goto bad;
7060 return o;
7061 bad:
7062 Py_DECREF(o); o = 0;
7063 return NULL;
7064 }
7065
__pyx_tp_dealloc_2av_9subtitles_8subtitle_SubtitleSet(PyObject * o)7066 static void __pyx_tp_dealloc_2av_9subtitles_8subtitle_SubtitleSet(PyObject *o) {
7067 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *p = (struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)o;
7068 #if CYTHON_USE_TP_FINALIZE
7069 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
7070 if (PyObject_CallFinalizerFromDealloc(o)) return;
7071 }
7072 #endif
7073 PyObject_GC_UnTrack(o);
7074 Py_CLEAR(p->packet);
7075 Py_CLEAR(p->proxy);
7076 Py_CLEAR(p->rects);
7077 (*Py_TYPE(o)->tp_free)(o);
7078 }
7079
__pyx_tp_traverse_2av_9subtitles_8subtitle_SubtitleSet(PyObject * o,visitproc v,void * a)7080 static int __pyx_tp_traverse_2av_9subtitles_8subtitle_SubtitleSet(PyObject *o, visitproc v, void *a) {
7081 int e;
7082 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *p = (struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)o;
7083 if (p->packet) {
7084 e = (*v)(((PyObject *)p->packet), a); if (e) return e;
7085 }
7086 if (p->proxy) {
7087 e = (*v)(((PyObject *)p->proxy), a); if (e) return e;
7088 }
7089 if (p->rects) {
7090 e = (*v)(p->rects, a); if (e) return e;
7091 }
7092 return 0;
7093 }
7094
__pyx_tp_clear_2av_9subtitles_8subtitle_SubtitleSet(PyObject * o)7095 static int __pyx_tp_clear_2av_9subtitles_8subtitle_SubtitleSet(PyObject *o) {
7096 PyObject* tmp;
7097 struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *p = (struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)o;
7098 tmp = ((PyObject*)p->packet);
7099 p->packet = ((struct __pyx_obj_2av_6packet_Packet *)Py_None); Py_INCREF(Py_None);
7100 Py_XDECREF(tmp);
7101 tmp = ((PyObject*)p->proxy);
7102 p->proxy = ((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *)Py_None); Py_INCREF(Py_None);
7103 Py_XDECREF(tmp);
7104 tmp = ((PyObject*)p->rects);
7105 p->rects = ((PyObject*)Py_None); Py_INCREF(Py_None);
7106 Py_XDECREF(tmp);
7107 return 0;
7108 }
__pyx_sq_item_2av_9subtitles_8subtitle_SubtitleSet(PyObject * o,Py_ssize_t i)7109 static PyObject *__pyx_sq_item_2av_9subtitles_8subtitle_SubtitleSet(PyObject *o, Py_ssize_t i) {
7110 PyObject *r;
7111 PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
7112 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
7113 Py_DECREF(x);
7114 return r;
7115 }
7116
__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_format(PyObject * o,CYTHON_UNUSED void * x)7117 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_format(PyObject *o, CYTHON_UNUSED void *x) {
7118 return __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_6format_1__get__(o);
7119 }
7120
__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_start_display_time(PyObject * o,CYTHON_UNUSED void * x)7121 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_start_display_time(PyObject *o, CYTHON_UNUSED void *x) {
7122 return __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_18start_display_time_1__get__(o);
7123 }
7124
__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_end_display_time(PyObject * o,CYTHON_UNUSED void * x)7125 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_end_display_time(PyObject *o, CYTHON_UNUSED void *x) {
7126 return __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_16end_display_time_1__get__(o);
7127 }
7128
__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_pts(PyObject * o,CYTHON_UNUSED void * x)7129 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_pts(PyObject *o, CYTHON_UNUSED void *x) {
7130 return __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_3pts_1__get__(o);
7131 }
7132
__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_packet(PyObject * o,CYTHON_UNUSED void * x)7133 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_packet(PyObject *o, CYTHON_UNUSED void *x) {
7134 return __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_6packet_1__get__(o);
7135 }
7136
__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_rects(PyObject * o,CYTHON_UNUSED void * x)7137 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_rects(PyObject *o, CYTHON_UNUSED void *x) {
7138 return __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_5rects_1__get__(o);
7139 }
7140
7141 static PyMethodDef __pyx_methods_2av_9subtitles_8subtitle_SubtitleSet[] = {
7142 {"__reduce_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_11__reduce_cython__, METH_NOARGS, __pyx_doc_2av_9subtitles_8subtitle_11SubtitleSet_10__reduce_cython__},
7143 {"__setstate_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_13__setstate_cython__, METH_O, __pyx_doc_2av_9subtitles_8subtitle_11SubtitleSet_12__setstate_cython__},
7144 {0, 0, 0, 0}
7145 };
7146
7147 static struct PyGetSetDef __pyx_getsets_2av_9subtitles_8subtitle_SubtitleSet[] = {
7148 {(char *)"format", __pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_format, 0, (char *)0, 0},
7149 {(char *)"start_display_time", __pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_start_display_time, 0, (char *)0, 0},
7150 {(char *)"end_display_time", __pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_end_display_time, 0, (char *)0, 0},
7151 {(char *)"pts", __pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_pts, 0, (char *)0, 0},
7152 {(char *)"packet", __pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_packet, 0, (char *)0, 0},
7153 {(char *)"rects", __pyx_getprop_2av_9subtitles_8subtitle_11SubtitleSet_rects, 0, (char *)0, 0},
7154 {0, 0, 0, 0, 0}
7155 };
7156
7157 static PySequenceMethods __pyx_tp_as_sequence_SubtitleSet = {
7158 __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_5__len__, /*sq_length*/
7159 0, /*sq_concat*/
7160 0, /*sq_repeat*/
7161 __pyx_sq_item_2av_9subtitles_8subtitle_SubtitleSet, /*sq_item*/
7162 0, /*sq_slice*/
7163 0, /*sq_ass_item*/
7164 0, /*sq_ass_slice*/
7165 0, /*sq_contains*/
7166 0, /*sq_inplace_concat*/
7167 0, /*sq_inplace_repeat*/
7168 };
7169
7170 static PyMappingMethods __pyx_tp_as_mapping_SubtitleSet = {
7171 __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_5__len__, /*mp_length*/
7172 __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_9__getitem__, /*mp_subscript*/
7173 0, /*mp_ass_subscript*/
7174 };
7175
7176 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle_SubtitleSet = {
7177 PyVarObject_HEAD_INIT(0, 0)
7178 "av.subtitles.subtitle.SubtitleSet", /*tp_name*/
7179 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet), /*tp_basicsize*/
7180 0, /*tp_itemsize*/
7181 __pyx_tp_dealloc_2av_9subtitles_8subtitle_SubtitleSet, /*tp_dealloc*/
7182 #if PY_VERSION_HEX < 0x030800b4
7183 0, /*tp_print*/
7184 #endif
7185 #if PY_VERSION_HEX >= 0x030800b4
7186 0, /*tp_vectorcall_offset*/
7187 #endif
7188 0, /*tp_getattr*/
7189 0, /*tp_setattr*/
7190 #if PY_MAJOR_VERSION < 3
7191 0, /*tp_compare*/
7192 #endif
7193 #if PY_MAJOR_VERSION >= 3
7194 0, /*tp_as_async*/
7195 #endif
7196 __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_3__repr__, /*tp_repr*/
7197 0, /*tp_as_number*/
7198 &__pyx_tp_as_sequence_SubtitleSet, /*tp_as_sequence*/
7199 &__pyx_tp_as_mapping_SubtitleSet, /*tp_as_mapping*/
7200 0, /*tp_hash*/
7201 0, /*tp_call*/
7202 0, /*tp_str*/
7203 0, /*tp_getattro*/
7204 0, /*tp_setattro*/
7205 0, /*tp_as_buffer*/
7206 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
7207 0, /*tp_doc*/
7208 __pyx_tp_traverse_2av_9subtitles_8subtitle_SubtitleSet, /*tp_traverse*/
7209 __pyx_tp_clear_2av_9subtitles_8subtitle_SubtitleSet, /*tp_clear*/
7210 0, /*tp_richcompare*/
7211 0, /*tp_weaklistoffset*/
7212 __pyx_pw_2av_9subtitles_8subtitle_11SubtitleSet_7__iter__, /*tp_iter*/
7213 0, /*tp_iternext*/
7214 __pyx_methods_2av_9subtitles_8subtitle_SubtitleSet, /*tp_methods*/
7215 0, /*tp_members*/
7216 __pyx_getsets_2av_9subtitles_8subtitle_SubtitleSet, /*tp_getset*/
7217 0, /*tp_base*/
7218 0, /*tp_dict*/
7219 0, /*tp_descr_get*/
7220 0, /*tp_descr_set*/
7221 0, /*tp_dictoffset*/
7222 0, /*tp_init*/
7223 0, /*tp_alloc*/
7224 __pyx_tp_new_2av_9subtitles_8subtitle_SubtitleSet, /*tp_new*/
7225 0, /*tp_free*/
7226 0, /*tp_is_gc*/
7227 0, /*tp_bases*/
7228 0, /*tp_mro*/
7229 0, /*tp_cache*/
7230 0, /*tp_subclasses*/
7231 0, /*tp_weaklist*/
7232 0, /*tp_del*/
7233 0, /*tp_version_tag*/
7234 #if PY_VERSION_HEX >= 0x030400a1
7235 0, /*tp_finalize*/
7236 #endif
7237 #if PY_VERSION_HEX >= 0x030800b1
7238 0, /*tp_vectorcall*/
7239 #endif
7240 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
7241 0, /*tp_print*/
7242 #endif
7243 };
7244
__pyx_tp_new_2av_9subtitles_8subtitle_Subtitle(PyTypeObject * t,PyObject * a,PyObject * k)7245 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_Subtitle(PyTypeObject *t, PyObject *a, PyObject *k) {
7246 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *p;
7247 PyObject *o;
7248 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
7249 o = (*t->tp_alloc)(t, 0);
7250 } else {
7251 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
7252 }
7253 if (unlikely(!o)) return 0;
7254 p = ((struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)o);
7255 p->proxy = ((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *)Py_None); Py_INCREF(Py_None);
7256 p->type = ((PyObject*)Py_None); Py_INCREF(Py_None);
7257 if (unlikely(__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_1__cinit__(o, a, k) < 0)) goto bad;
7258 return o;
7259 bad:
7260 Py_DECREF(o); o = 0;
7261 return NULL;
7262 }
7263
__pyx_tp_dealloc_2av_9subtitles_8subtitle_Subtitle(PyObject * o)7264 static void __pyx_tp_dealloc_2av_9subtitles_8subtitle_Subtitle(PyObject *o) {
7265 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *p = (struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)o;
7266 #if CYTHON_USE_TP_FINALIZE
7267 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
7268 if (PyObject_CallFinalizerFromDealloc(o)) return;
7269 }
7270 #endif
7271 PyObject_GC_UnTrack(o);
7272 Py_CLEAR(p->proxy);
7273 Py_CLEAR(p->type);
7274 (*Py_TYPE(o)->tp_free)(o);
7275 }
7276
__pyx_tp_traverse_2av_9subtitles_8subtitle_Subtitle(PyObject * o,visitproc v,void * a)7277 static int __pyx_tp_traverse_2av_9subtitles_8subtitle_Subtitle(PyObject *o, visitproc v, void *a) {
7278 int e;
7279 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *p = (struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)o;
7280 if (p->proxy) {
7281 e = (*v)(((PyObject *)p->proxy), a); if (e) return e;
7282 }
7283 return 0;
7284 }
7285
__pyx_tp_clear_2av_9subtitles_8subtitle_Subtitle(PyObject * o)7286 static int __pyx_tp_clear_2av_9subtitles_8subtitle_Subtitle(PyObject *o) {
7287 PyObject* tmp;
7288 struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *p = (struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle *)o;
7289 tmp = ((PyObject*)p->proxy);
7290 p->proxy = ((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleProxy *)Py_None); Py_INCREF(Py_None);
7291 Py_XDECREF(tmp);
7292 return 0;
7293 }
7294
__pyx_getprop_2av_9subtitles_8subtitle_8Subtitle_type(PyObject * o,CYTHON_UNUSED void * x)7295 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_8Subtitle_type(PyObject *o, CYTHON_UNUSED void *x) {
7296 return __pyx_pw_2av_9subtitles_8subtitle_8Subtitle_4type_1__get__(o);
7297 }
7298
7299 static PyMethodDef __pyx_methods_2av_9subtitles_8subtitle_Subtitle[] = {
7300 {"__reduce_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_5__reduce_cython__, METH_NOARGS, __pyx_doc_2av_9subtitles_8subtitle_8Subtitle_4__reduce_cython__},
7301 {"__setstate_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_8Subtitle_7__setstate_cython__, METH_O, __pyx_doc_2av_9subtitles_8subtitle_8Subtitle_6__setstate_cython__},
7302 {0, 0, 0, 0}
7303 };
7304
7305 static struct PyGetSetDef __pyx_getsets_2av_9subtitles_8subtitle_Subtitle[] = {
7306 {(char *)"type", __pyx_getprop_2av_9subtitles_8subtitle_8Subtitle_type, 0, (char *)0, 0},
7307 {0, 0, 0, 0, 0}
7308 };
7309
7310 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle_Subtitle = {
7311 PyVarObject_HEAD_INIT(0, 0)
7312 "av.subtitles.subtitle.Subtitle", /*tp_name*/
7313 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle_Subtitle), /*tp_basicsize*/
7314 0, /*tp_itemsize*/
7315 __pyx_tp_dealloc_2av_9subtitles_8subtitle_Subtitle, /*tp_dealloc*/
7316 #if PY_VERSION_HEX < 0x030800b4
7317 0, /*tp_print*/
7318 #endif
7319 #if PY_VERSION_HEX >= 0x030800b4
7320 0, /*tp_vectorcall_offset*/
7321 #endif
7322 0, /*tp_getattr*/
7323 0, /*tp_setattr*/
7324 #if PY_MAJOR_VERSION < 3
7325 0, /*tp_compare*/
7326 #endif
7327 #if PY_MAJOR_VERSION >= 3
7328 0, /*tp_as_async*/
7329 #endif
7330 __pyx_pw_2av_9subtitles_8subtitle_8Subtitle_3__repr__, /*tp_repr*/
7331 0, /*tp_as_number*/
7332 0, /*tp_as_sequence*/
7333 0, /*tp_as_mapping*/
7334 0, /*tp_hash*/
7335 0, /*tp_call*/
7336 0, /*tp_str*/
7337 0, /*tp_getattro*/
7338 0, /*tp_setattro*/
7339 0, /*tp_as_buffer*/
7340 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
7341 0, /*tp_doc*/
7342 __pyx_tp_traverse_2av_9subtitles_8subtitle_Subtitle, /*tp_traverse*/
7343 __pyx_tp_clear_2av_9subtitles_8subtitle_Subtitle, /*tp_clear*/
7344 0, /*tp_richcompare*/
7345 0, /*tp_weaklistoffset*/
7346 0, /*tp_iter*/
7347 0, /*tp_iternext*/
7348 __pyx_methods_2av_9subtitles_8subtitle_Subtitle, /*tp_methods*/
7349 0, /*tp_members*/
7350 __pyx_getsets_2av_9subtitles_8subtitle_Subtitle, /*tp_getset*/
7351 0, /*tp_base*/
7352 0, /*tp_dict*/
7353 0, /*tp_descr_get*/
7354 0, /*tp_descr_set*/
7355 0, /*tp_dictoffset*/
7356 0, /*tp_init*/
7357 0, /*tp_alloc*/
7358 __pyx_tp_new_2av_9subtitles_8subtitle_Subtitle, /*tp_new*/
7359 0, /*tp_free*/
7360 0, /*tp_is_gc*/
7361 0, /*tp_bases*/
7362 0, /*tp_mro*/
7363 0, /*tp_cache*/
7364 0, /*tp_subclasses*/
7365 0, /*tp_weaklist*/
7366 0, /*tp_del*/
7367 0, /*tp_version_tag*/
7368 #if PY_VERSION_HEX >= 0x030400a1
7369 0, /*tp_finalize*/
7370 #endif
7371 #if PY_VERSION_HEX >= 0x030800b1
7372 0, /*tp_vectorcall*/
7373 #endif
7374 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
7375 0, /*tp_print*/
7376 #endif
7377 };
7378
__pyx_tp_new_2av_9subtitles_8subtitle_TextSubtitle(PyTypeObject * t,PyObject * a,PyObject * k)7379 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_TextSubtitle(PyTypeObject *t, PyObject *a, PyObject *k) {
7380 PyObject *o = __pyx_tp_new_2av_9subtitles_8subtitle_Subtitle(t, a, k);
7381 if (unlikely(!o)) return 0;
7382 return o;
7383 }
7384
__pyx_getprop_2av_9subtitles_8subtitle_12TextSubtitle_text(PyObject * o,CYTHON_UNUSED void * x)7385 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_12TextSubtitle_text(PyObject *o, CYTHON_UNUSED void *x) {
7386 return __pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_4text_1__get__(o);
7387 }
7388
7389 static PyMethodDef __pyx_methods_2av_9subtitles_8subtitle_TextSubtitle[] = {
7390 {"__reduce_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_3__reduce_cython__, METH_NOARGS, __pyx_doc_2av_9subtitles_8subtitle_12TextSubtitle_2__reduce_cython__},
7391 {"__setstate_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_5__setstate_cython__, METH_O, __pyx_doc_2av_9subtitles_8subtitle_12TextSubtitle_4__setstate_cython__},
7392 {0, 0, 0, 0}
7393 };
7394
7395 static struct PyGetSetDef __pyx_getsets_2av_9subtitles_8subtitle_TextSubtitle[] = {
7396 {(char *)"text", __pyx_getprop_2av_9subtitles_8subtitle_12TextSubtitle_text, 0, (char *)0, 0},
7397 {0, 0, 0, 0, 0}
7398 };
7399
7400 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle_TextSubtitle = {
7401 PyVarObject_HEAD_INIT(0, 0)
7402 "av.subtitles.subtitle.TextSubtitle", /*tp_name*/
7403 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle_TextSubtitle), /*tp_basicsize*/
7404 0, /*tp_itemsize*/
7405 __pyx_tp_dealloc_2av_9subtitles_8subtitle_Subtitle, /*tp_dealloc*/
7406 #if PY_VERSION_HEX < 0x030800b4
7407 0, /*tp_print*/
7408 #endif
7409 #if PY_VERSION_HEX >= 0x030800b4
7410 0, /*tp_vectorcall_offset*/
7411 #endif
7412 0, /*tp_getattr*/
7413 0, /*tp_setattr*/
7414 #if PY_MAJOR_VERSION < 3
7415 0, /*tp_compare*/
7416 #endif
7417 #if PY_MAJOR_VERSION >= 3
7418 0, /*tp_as_async*/
7419 #endif
7420 __pyx_pw_2av_9subtitles_8subtitle_12TextSubtitle_1__repr__, /*tp_repr*/
7421 0, /*tp_as_number*/
7422 0, /*tp_as_sequence*/
7423 0, /*tp_as_mapping*/
7424 0, /*tp_hash*/
7425 0, /*tp_call*/
7426 0, /*tp_str*/
7427 0, /*tp_getattro*/
7428 0, /*tp_setattro*/
7429 0, /*tp_as_buffer*/
7430 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
7431 0, /*tp_doc*/
7432 __pyx_tp_traverse_2av_9subtitles_8subtitle_Subtitle, /*tp_traverse*/
7433 __pyx_tp_clear_2av_9subtitles_8subtitle_Subtitle, /*tp_clear*/
7434 0, /*tp_richcompare*/
7435 0, /*tp_weaklistoffset*/
7436 0, /*tp_iter*/
7437 0, /*tp_iternext*/
7438 __pyx_methods_2av_9subtitles_8subtitle_TextSubtitle, /*tp_methods*/
7439 0, /*tp_members*/
7440 __pyx_getsets_2av_9subtitles_8subtitle_TextSubtitle, /*tp_getset*/
7441 0, /*tp_base*/
7442 0, /*tp_dict*/
7443 0, /*tp_descr_get*/
7444 0, /*tp_descr_set*/
7445 0, /*tp_dictoffset*/
7446 0, /*tp_init*/
7447 0, /*tp_alloc*/
7448 __pyx_tp_new_2av_9subtitles_8subtitle_TextSubtitle, /*tp_new*/
7449 0, /*tp_free*/
7450 0, /*tp_is_gc*/
7451 0, /*tp_bases*/
7452 0, /*tp_mro*/
7453 0, /*tp_cache*/
7454 0, /*tp_subclasses*/
7455 0, /*tp_weaklist*/
7456 0, /*tp_del*/
7457 0, /*tp_version_tag*/
7458 #if PY_VERSION_HEX >= 0x030400a1
7459 0, /*tp_finalize*/
7460 #endif
7461 #if PY_VERSION_HEX >= 0x030800b1
7462 0, /*tp_vectorcall*/
7463 #endif
7464 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
7465 0, /*tp_print*/
7466 #endif
7467 };
7468
__pyx_tp_new_2av_9subtitles_8subtitle_ASSSubtitle(PyTypeObject * t,PyObject * a,PyObject * k)7469 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_ASSSubtitle(PyTypeObject *t, PyObject *a, PyObject *k) {
7470 PyObject *o = __pyx_tp_new_2av_9subtitles_8subtitle_Subtitle(t, a, k);
7471 if (unlikely(!o)) return 0;
7472 return o;
7473 }
7474
7475 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle_ASSSubtitle = {
7476 PyVarObject_HEAD_INIT(0, 0)
7477 "av.subtitles.subtitle.ASSSubtitle", /*tp_name*/
7478 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle_ASSSubtitle), /*tp_basicsize*/
7479 0, /*tp_itemsize*/
7480 __pyx_tp_dealloc_2av_9subtitles_8subtitle_Subtitle, /*tp_dealloc*/
7481 #if PY_VERSION_HEX < 0x030800b4
7482 0, /*tp_print*/
7483 #endif
7484 #if PY_VERSION_HEX >= 0x030800b4
7485 0, /*tp_vectorcall_offset*/
7486 #endif
7487 0, /*tp_getattr*/
7488 0, /*tp_setattr*/
7489 #if PY_MAJOR_VERSION < 3
7490 0, /*tp_compare*/
7491 #endif
7492 #if PY_MAJOR_VERSION >= 3
7493 0, /*tp_as_async*/
7494 #endif
7495 #if CYTHON_COMPILING_IN_PYPY
7496 __pyx_pw_2av_9subtitles_8subtitle_8Subtitle_3__repr__, /*tp_repr*/
7497 #else
7498 0, /*tp_repr*/
7499 #endif
7500 0, /*tp_as_number*/
7501 0, /*tp_as_sequence*/
7502 0, /*tp_as_mapping*/
7503 0, /*tp_hash*/
7504 0, /*tp_call*/
7505 0, /*tp_str*/
7506 0, /*tp_getattro*/
7507 0, /*tp_setattro*/
7508 0, /*tp_as_buffer*/
7509 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
7510 0, /*tp_doc*/
7511 __pyx_tp_traverse_2av_9subtitles_8subtitle_Subtitle, /*tp_traverse*/
7512 __pyx_tp_clear_2av_9subtitles_8subtitle_Subtitle, /*tp_clear*/
7513 0, /*tp_richcompare*/
7514 0, /*tp_weaklistoffset*/
7515 0, /*tp_iter*/
7516 0, /*tp_iternext*/
7517 0, /*tp_methods*/
7518 0, /*tp_members*/
7519 0, /*tp_getset*/
7520 0, /*tp_base*/
7521 0, /*tp_dict*/
7522 0, /*tp_descr_get*/
7523 0, /*tp_descr_set*/
7524 0, /*tp_dictoffset*/
7525 0, /*tp_init*/
7526 0, /*tp_alloc*/
7527 __pyx_tp_new_2av_9subtitles_8subtitle_ASSSubtitle, /*tp_new*/
7528 0, /*tp_free*/
7529 0, /*tp_is_gc*/
7530 0, /*tp_bases*/
7531 0, /*tp_mro*/
7532 0, /*tp_cache*/
7533 0, /*tp_subclasses*/
7534 0, /*tp_weaklist*/
7535 0, /*tp_del*/
7536 0, /*tp_version_tag*/
7537 #if PY_VERSION_HEX >= 0x030400a1
7538 0, /*tp_finalize*/
7539 #endif
7540 #if PY_VERSION_HEX >= 0x030800b1
7541 0, /*tp_vectorcall*/
7542 #endif
7543 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
7544 0, /*tp_print*/
7545 #endif
7546 };
7547
__pyx_tp_new_2av_9subtitles_8subtitle_BitmapSubtitle(PyTypeObject * t,PyObject * a,PyObject * k)7548 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_BitmapSubtitle(PyTypeObject *t, PyObject *a, PyObject *k) {
7549 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *p;
7550 PyObject *o = __pyx_tp_new_2av_9subtitles_8subtitle_Subtitle(t, a, k);
7551 if (unlikely(!o)) return 0;
7552 p = ((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)o);
7553 p->planes = Py_None; Py_INCREF(Py_None);
7554 if (unlikely(__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1__cinit__(o, a, k) < 0)) goto bad;
7555 return o;
7556 bad:
7557 Py_DECREF(o); o = 0;
7558 return NULL;
7559 }
7560
__pyx_tp_dealloc_2av_9subtitles_8subtitle_BitmapSubtitle(PyObject * o)7561 static void __pyx_tp_dealloc_2av_9subtitles_8subtitle_BitmapSubtitle(PyObject *o) {
7562 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *p = (struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)o;
7563 #if CYTHON_USE_TP_FINALIZE
7564 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
7565 if (PyObject_CallFinalizerFromDealloc(o)) return;
7566 }
7567 #endif
7568 PyObject_GC_UnTrack(o);
7569 Py_CLEAR(p->planes);
7570 PyObject_GC_Track(o);
7571 __pyx_tp_dealloc_2av_9subtitles_8subtitle_Subtitle(o);
7572 }
7573
__pyx_tp_traverse_2av_9subtitles_8subtitle_BitmapSubtitle(PyObject * o,visitproc v,void * a)7574 static int __pyx_tp_traverse_2av_9subtitles_8subtitle_BitmapSubtitle(PyObject *o, visitproc v, void *a) {
7575 int e;
7576 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *p = (struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)o;
7577 e = __pyx_tp_traverse_2av_9subtitles_8subtitle_Subtitle(o, v, a); if (e) return e;
7578 if (p->planes) {
7579 e = (*v)(p->planes, a); if (e) return e;
7580 }
7581 return 0;
7582 }
7583
__pyx_tp_clear_2av_9subtitles_8subtitle_BitmapSubtitle(PyObject * o)7584 static int __pyx_tp_clear_2av_9subtitles_8subtitle_BitmapSubtitle(PyObject *o) {
7585 PyObject* tmp;
7586 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *p = (struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)o;
7587 __pyx_tp_clear_2av_9subtitles_8subtitle_Subtitle(o);
7588 tmp = ((PyObject*)p->planes);
7589 p->planes = Py_None; Py_INCREF(Py_None);
7590 Py_XDECREF(tmp);
7591 return 0;
7592 }
__pyx_sq_item_2av_9subtitles_8subtitle_BitmapSubtitle(PyObject * o,Py_ssize_t i)7593 static PyObject *__pyx_sq_item_2av_9subtitles_8subtitle_BitmapSubtitle(PyObject *o, Py_ssize_t i) {
7594 PyObject *r;
7595 PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
7596 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
7597 Py_DECREF(x);
7598 return r;
7599 }
7600
__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_x(PyObject * o,CYTHON_UNUSED void * x)7601 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_x(PyObject *o, CYTHON_UNUSED void *x) {
7602 return __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1x_1__get__(o);
7603 }
7604
__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_y(PyObject * o,CYTHON_UNUSED void * x)7605 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_y(PyObject *o, CYTHON_UNUSED void *x) {
7606 return __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_1y_1__get__(o);
7607 }
7608
__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_width(PyObject * o,CYTHON_UNUSED void * x)7609 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_width(PyObject *o, CYTHON_UNUSED void *x) {
7610 return __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_5width_1__get__(o);
7611 }
7612
__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_height(PyObject * o,CYTHON_UNUSED void * x)7613 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_height(PyObject *o, CYTHON_UNUSED void *x) {
7614 return __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_6height_1__get__(o);
7615 }
7616
__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_nb_colors(PyObject * o,CYTHON_UNUSED void * x)7617 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_nb_colors(PyObject *o, CYTHON_UNUSED void *x) {
7618 return __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_9nb_colors_1__get__(o);
7619 }
7620
__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_planes(PyObject * o,CYTHON_UNUSED void * x)7621 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_planes(PyObject *o, CYTHON_UNUSED void *x) {
7622 return __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_6planes_1__get__(o);
7623 }
7624
7625 static PyMethodDef __pyx_methods_2av_9subtitles_8subtitle_BitmapSubtitle[] = {
7626 {"__reduce_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_11__reduce_cython__, METH_NOARGS, __pyx_doc_2av_9subtitles_8subtitle_14BitmapSubtitle_10__reduce_cython__},
7627 {"__setstate_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_13__setstate_cython__, METH_O, __pyx_doc_2av_9subtitles_8subtitle_14BitmapSubtitle_12__setstate_cython__},
7628 {0, 0, 0, 0}
7629 };
7630
7631 static struct PyGetSetDef __pyx_getsets_2av_9subtitles_8subtitle_BitmapSubtitle[] = {
7632 {(char *)"x", __pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_x, 0, (char *)0, 0},
7633 {(char *)"y", __pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_y, 0, (char *)0, 0},
7634 {(char *)"width", __pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_width, 0, (char *)0, 0},
7635 {(char *)"height", __pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_height, 0, (char *)0, 0},
7636 {(char *)"nb_colors", __pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_nb_colors, 0, (char *)0, 0},
7637 {(char *)"planes", __pyx_getprop_2av_9subtitles_8subtitle_14BitmapSubtitle_planes, 0, (char *)0, 0},
7638 {0, 0, 0, 0, 0}
7639 };
7640
7641 static PySequenceMethods __pyx_tp_as_sequence_BitmapSubtitle = {
7642 __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_5__len__, /*sq_length*/
7643 0, /*sq_concat*/
7644 0, /*sq_repeat*/
7645 __pyx_sq_item_2av_9subtitles_8subtitle_BitmapSubtitle, /*sq_item*/
7646 0, /*sq_slice*/
7647 0, /*sq_ass_item*/
7648 0, /*sq_ass_slice*/
7649 0, /*sq_contains*/
7650 0, /*sq_inplace_concat*/
7651 0, /*sq_inplace_repeat*/
7652 };
7653
7654 static PyMappingMethods __pyx_tp_as_mapping_BitmapSubtitle = {
7655 __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_5__len__, /*mp_length*/
7656 __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_9__getitem__, /*mp_subscript*/
7657 0, /*mp_ass_subscript*/
7658 };
7659
7660 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle_BitmapSubtitle = {
7661 PyVarObject_HEAD_INIT(0, 0)
7662 "av.subtitles.subtitle.BitmapSubtitle", /*tp_name*/
7663 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle), /*tp_basicsize*/
7664 0, /*tp_itemsize*/
7665 __pyx_tp_dealloc_2av_9subtitles_8subtitle_BitmapSubtitle, /*tp_dealloc*/
7666 #if PY_VERSION_HEX < 0x030800b4
7667 0, /*tp_print*/
7668 #endif
7669 #if PY_VERSION_HEX >= 0x030800b4
7670 0, /*tp_vectorcall_offset*/
7671 #endif
7672 0, /*tp_getattr*/
7673 0, /*tp_setattr*/
7674 #if PY_MAJOR_VERSION < 3
7675 0, /*tp_compare*/
7676 #endif
7677 #if PY_MAJOR_VERSION >= 3
7678 0, /*tp_as_async*/
7679 #endif
7680 __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_3__repr__, /*tp_repr*/
7681 0, /*tp_as_number*/
7682 &__pyx_tp_as_sequence_BitmapSubtitle, /*tp_as_sequence*/
7683 &__pyx_tp_as_mapping_BitmapSubtitle, /*tp_as_mapping*/
7684 0, /*tp_hash*/
7685 0, /*tp_call*/
7686 0, /*tp_str*/
7687 0, /*tp_getattro*/
7688 0, /*tp_setattro*/
7689 0, /*tp_as_buffer*/
7690 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
7691 0, /*tp_doc*/
7692 __pyx_tp_traverse_2av_9subtitles_8subtitle_BitmapSubtitle, /*tp_traverse*/
7693 __pyx_tp_clear_2av_9subtitles_8subtitle_BitmapSubtitle, /*tp_clear*/
7694 0, /*tp_richcompare*/
7695 0, /*tp_weaklistoffset*/
7696 __pyx_pw_2av_9subtitles_8subtitle_14BitmapSubtitle_7__iter__, /*tp_iter*/
7697 0, /*tp_iternext*/
7698 __pyx_methods_2av_9subtitles_8subtitle_BitmapSubtitle, /*tp_methods*/
7699 0, /*tp_members*/
7700 __pyx_getsets_2av_9subtitles_8subtitle_BitmapSubtitle, /*tp_getset*/
7701 0, /*tp_base*/
7702 0, /*tp_dict*/
7703 0, /*tp_descr_get*/
7704 0, /*tp_descr_set*/
7705 0, /*tp_dictoffset*/
7706 0, /*tp_init*/
7707 0, /*tp_alloc*/
7708 __pyx_tp_new_2av_9subtitles_8subtitle_BitmapSubtitle, /*tp_new*/
7709 0, /*tp_free*/
7710 0, /*tp_is_gc*/
7711 0, /*tp_bases*/
7712 0, /*tp_mro*/
7713 0, /*tp_cache*/
7714 0, /*tp_subclasses*/
7715 0, /*tp_weaklist*/
7716 0, /*tp_del*/
7717 0, /*tp_version_tag*/
7718 #if PY_VERSION_HEX >= 0x030400a1
7719 0, /*tp_finalize*/
7720 #endif
7721 #if PY_VERSION_HEX >= 0x030800b1
7722 0, /*tp_vectorcall*/
7723 #endif
7724 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
7725 0, /*tp_print*/
7726 #endif
7727 };
7728
__pyx_tp_new_2av_9subtitles_8subtitle_BitmapSubtitlePlane(PyTypeObject * t,PyObject * a,PyObject * k)7729 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_BitmapSubtitlePlane(PyTypeObject *t, PyObject *a, PyObject *k) {
7730 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *p;
7731 PyObject *o;
7732 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
7733 o = (*t->tp_alloc)(t, 0);
7734 } else {
7735 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
7736 }
7737 if (unlikely(!o)) return 0;
7738 p = ((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)o);
7739 p->subtitle = ((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)Py_None); Py_INCREF(Py_None);
7740 if (unlikely(__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_1__cinit__(o, a, k) < 0)) goto bad;
7741 return o;
7742 bad:
7743 Py_DECREF(o); o = 0;
7744 return NULL;
7745 }
7746
__pyx_tp_dealloc_2av_9subtitles_8subtitle_BitmapSubtitlePlane(PyObject * o)7747 static void __pyx_tp_dealloc_2av_9subtitles_8subtitle_BitmapSubtitlePlane(PyObject *o) {
7748 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *p = (struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)o;
7749 #if CYTHON_USE_TP_FINALIZE
7750 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
7751 if (PyObject_CallFinalizerFromDealloc(o)) return;
7752 }
7753 #endif
7754 PyObject_GC_UnTrack(o);
7755 Py_CLEAR(p->subtitle);
7756 (*Py_TYPE(o)->tp_free)(o);
7757 }
7758
__pyx_tp_traverse_2av_9subtitles_8subtitle_BitmapSubtitlePlane(PyObject * o,visitproc v,void * a)7759 static int __pyx_tp_traverse_2av_9subtitles_8subtitle_BitmapSubtitlePlane(PyObject *o, visitproc v, void *a) {
7760 int e;
7761 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *p = (struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)o;
7762 if (p->subtitle) {
7763 e = (*v)(((PyObject *)p->subtitle), a); if (e) return e;
7764 }
7765 return 0;
7766 }
7767
__pyx_tp_clear_2av_9subtitles_8subtitle_BitmapSubtitlePlane(PyObject * o)7768 static int __pyx_tp_clear_2av_9subtitles_8subtitle_BitmapSubtitlePlane(PyObject *o) {
7769 PyObject* tmp;
7770 struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *p = (struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane *)o;
7771 tmp = ((PyObject*)p->subtitle);
7772 p->subtitle = ((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)Py_None); Py_INCREF(Py_None);
7773 Py_XDECREF(tmp);
7774 return 0;
7775 }
7776
__pyx_getprop_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_subtitle(PyObject * o,CYTHON_UNUSED void * x)7777 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_subtitle(PyObject *o, CYTHON_UNUSED void *x) {
7778 return __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_8subtitle_1__get__(o);
7779 }
7780
__pyx_getprop_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_index(PyObject * o,CYTHON_UNUSED void * x)7781 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_index(PyObject *o, CYTHON_UNUSED void *x) {
7782 return __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5index_1__get__(o);
7783 }
7784
__pyx_getprop_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_buffer_size(PyObject * o,CYTHON_UNUSED void * x)7785 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_buffer_size(PyObject *o, CYTHON_UNUSED void *x) {
7786 return __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11buffer_size_1__get__(o);
7787 }
7788
7789 static PyMethodDef __pyx_methods_2av_9subtitles_8subtitle_BitmapSubtitlePlane[] = {
7790 {"__reduce_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_11__reduce_cython__, METH_NOARGS, __pyx_doc_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_10__reduce_cython__},
7791 {"__setstate_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_13__setstate_cython__, METH_O, __pyx_doc_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_12__setstate_cython__},
7792 {0, 0, 0, 0}
7793 };
7794
7795 static struct PyGetSetDef __pyx_getsets_2av_9subtitles_8subtitle_BitmapSubtitlePlane[] = {
7796 {(char *)"subtitle", __pyx_getprop_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_subtitle, 0, (char *)0, 0},
7797 {(char *)"index", __pyx_getprop_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_index, 0, (char *)0, 0},
7798 {(char *)"buffer_size", __pyx_getprop_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_buffer_size, 0, (char *)0, 0},
7799 {0, 0, 0, 0, 0}
7800 };
7801
7802 static PyBufferProcs __pyx_tp_as_buffer_BitmapSubtitlePlane = {
7803 #if PY_MAJOR_VERSION < 3
7804 __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_5__getreadbuffer__, /*bf_getreadbuffer*/
7805 #endif
7806 #if PY_MAJOR_VERSION < 3
7807 __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_7__getwritebuffer__, /*bf_getwritebuffer*/
7808 #endif
7809 #if PY_MAJOR_VERSION < 3
7810 __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_3__getsegcount__, /*bf_getsegcount*/
7811 #endif
7812 #if PY_MAJOR_VERSION < 3
7813 0, /*bf_getcharbuffer*/
7814 #endif
7815 __pyx_pw_2av_9subtitles_8subtitle_19BitmapSubtitlePlane_9__getbuffer__, /*bf_getbuffer*/
7816 0, /*bf_releasebuffer*/
7817 };
7818
7819 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle_BitmapSubtitlePlane = {
7820 PyVarObject_HEAD_INIT(0, 0)
7821 "av.subtitles.subtitle.BitmapSubtitlePlane", /*tp_name*/
7822 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitlePlane), /*tp_basicsize*/
7823 0, /*tp_itemsize*/
7824 __pyx_tp_dealloc_2av_9subtitles_8subtitle_BitmapSubtitlePlane, /*tp_dealloc*/
7825 #if PY_VERSION_HEX < 0x030800b4
7826 0, /*tp_print*/
7827 #endif
7828 #if PY_VERSION_HEX >= 0x030800b4
7829 0, /*tp_vectorcall_offset*/
7830 #endif
7831 0, /*tp_getattr*/
7832 0, /*tp_setattr*/
7833 #if PY_MAJOR_VERSION < 3
7834 0, /*tp_compare*/
7835 #endif
7836 #if PY_MAJOR_VERSION >= 3
7837 0, /*tp_as_async*/
7838 #endif
7839 0, /*tp_repr*/
7840 0, /*tp_as_number*/
7841 0, /*tp_as_sequence*/
7842 0, /*tp_as_mapping*/
7843 0, /*tp_hash*/
7844 0, /*tp_call*/
7845 0, /*tp_str*/
7846 0, /*tp_getattro*/
7847 0, /*tp_setattro*/
7848 &__pyx_tp_as_buffer_BitmapSubtitlePlane, /*tp_as_buffer*/
7849 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
7850 0, /*tp_doc*/
7851 __pyx_tp_traverse_2av_9subtitles_8subtitle_BitmapSubtitlePlane, /*tp_traverse*/
7852 __pyx_tp_clear_2av_9subtitles_8subtitle_BitmapSubtitlePlane, /*tp_clear*/
7853 0, /*tp_richcompare*/
7854 0, /*tp_weaklistoffset*/
7855 0, /*tp_iter*/
7856 0, /*tp_iternext*/
7857 __pyx_methods_2av_9subtitles_8subtitle_BitmapSubtitlePlane, /*tp_methods*/
7858 0, /*tp_members*/
7859 __pyx_getsets_2av_9subtitles_8subtitle_BitmapSubtitlePlane, /*tp_getset*/
7860 0, /*tp_base*/
7861 0, /*tp_dict*/
7862 0, /*tp_descr_get*/
7863 0, /*tp_descr_set*/
7864 0, /*tp_dictoffset*/
7865 0, /*tp_init*/
7866 0, /*tp_alloc*/
7867 __pyx_tp_new_2av_9subtitles_8subtitle_BitmapSubtitlePlane, /*tp_new*/
7868 0, /*tp_free*/
7869 0, /*tp_is_gc*/
7870 0, /*tp_bases*/
7871 0, /*tp_mro*/
7872 0, /*tp_cache*/
7873 0, /*tp_subclasses*/
7874 0, /*tp_weaklist*/
7875 0, /*tp_del*/
7876 0, /*tp_version_tag*/
7877 #if PY_VERSION_HEX >= 0x030400a1
7878 0, /*tp_finalize*/
7879 #endif
7880 #if PY_VERSION_HEX >= 0x030800b1
7881 0, /*tp_vectorcall*/
7882 #endif
7883 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
7884 0, /*tp_print*/
7885 #endif
7886 };
7887
__pyx_tp_new_2av_9subtitles_8subtitle_AssSubtitle(PyTypeObject * t,PyObject * a,PyObject * k)7888 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle_AssSubtitle(PyTypeObject *t, PyObject *a, PyObject *k) {
7889 PyObject *o = __pyx_tp_new_2av_9subtitles_8subtitle_Subtitle(t, a, k);
7890 if (unlikely(!o)) return 0;
7891 return o;
7892 }
7893
__pyx_getprop_2av_9subtitles_8subtitle_11AssSubtitle_ass(PyObject * o,CYTHON_UNUSED void * x)7894 static PyObject *__pyx_getprop_2av_9subtitles_8subtitle_11AssSubtitle_ass(PyObject *o, CYTHON_UNUSED void *x) {
7895 return __pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_3ass_1__get__(o);
7896 }
7897
7898 static PyMethodDef __pyx_methods_2av_9subtitles_8subtitle_AssSubtitle[] = {
7899 {"__reduce_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_3__reduce_cython__, METH_NOARGS, __pyx_doc_2av_9subtitles_8subtitle_11AssSubtitle_2__reduce_cython__},
7900 {"__setstate_cython__", (PyCFunction)__pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_5__setstate_cython__, METH_O, __pyx_doc_2av_9subtitles_8subtitle_11AssSubtitle_4__setstate_cython__},
7901 {0, 0, 0, 0}
7902 };
7903
7904 static struct PyGetSetDef __pyx_getsets_2av_9subtitles_8subtitle_AssSubtitle[] = {
7905 {(char *)"ass", __pyx_getprop_2av_9subtitles_8subtitle_11AssSubtitle_ass, 0, (char *)0, 0},
7906 {0, 0, 0, 0, 0}
7907 };
7908
7909 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle_AssSubtitle = {
7910 PyVarObject_HEAD_INIT(0, 0)
7911 "av.subtitles.subtitle.AssSubtitle", /*tp_name*/
7912 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle_AssSubtitle), /*tp_basicsize*/
7913 0, /*tp_itemsize*/
7914 __pyx_tp_dealloc_2av_9subtitles_8subtitle_Subtitle, /*tp_dealloc*/
7915 #if PY_VERSION_HEX < 0x030800b4
7916 0, /*tp_print*/
7917 #endif
7918 #if PY_VERSION_HEX >= 0x030800b4
7919 0, /*tp_vectorcall_offset*/
7920 #endif
7921 0, /*tp_getattr*/
7922 0, /*tp_setattr*/
7923 #if PY_MAJOR_VERSION < 3
7924 0, /*tp_compare*/
7925 #endif
7926 #if PY_MAJOR_VERSION >= 3
7927 0, /*tp_as_async*/
7928 #endif
7929 __pyx_pw_2av_9subtitles_8subtitle_11AssSubtitle_1__repr__, /*tp_repr*/
7930 0, /*tp_as_number*/
7931 0, /*tp_as_sequence*/
7932 0, /*tp_as_mapping*/
7933 0, /*tp_hash*/
7934 0, /*tp_call*/
7935 0, /*tp_str*/
7936 0, /*tp_getattro*/
7937 0, /*tp_setattro*/
7938 0, /*tp_as_buffer*/
7939 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
7940 0, /*tp_doc*/
7941 __pyx_tp_traverse_2av_9subtitles_8subtitle_Subtitle, /*tp_traverse*/
7942 __pyx_tp_clear_2av_9subtitles_8subtitle_Subtitle, /*tp_clear*/
7943 0, /*tp_richcompare*/
7944 0, /*tp_weaklistoffset*/
7945 0, /*tp_iter*/
7946 0, /*tp_iternext*/
7947 __pyx_methods_2av_9subtitles_8subtitle_AssSubtitle, /*tp_methods*/
7948 0, /*tp_members*/
7949 __pyx_getsets_2av_9subtitles_8subtitle_AssSubtitle, /*tp_getset*/
7950 0, /*tp_base*/
7951 0, /*tp_dict*/
7952 0, /*tp_descr_get*/
7953 0, /*tp_descr_set*/
7954 0, /*tp_dictoffset*/
7955 0, /*tp_init*/
7956 0, /*tp_alloc*/
7957 __pyx_tp_new_2av_9subtitles_8subtitle_AssSubtitle, /*tp_new*/
7958 0, /*tp_free*/
7959 0, /*tp_is_gc*/
7960 0, /*tp_bases*/
7961 0, /*tp_mro*/
7962 0, /*tp_cache*/
7963 0, /*tp_subclasses*/
7964 0, /*tp_weaklist*/
7965 0, /*tp_del*/
7966 0, /*tp_version_tag*/
7967 #if PY_VERSION_HEX >= 0x030400a1
7968 0, /*tp_finalize*/
7969 #endif
7970 #if PY_VERSION_HEX >= 0x030800b1
7971 0, /*tp_vectorcall*/
7972 #endif
7973 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
7974 0, /*tp_print*/
7975 #endif
7976 };
7977
7978 static struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *__pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__[8];
7979 static int __pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ = 0;
7980
__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)7981 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
7982 PyObject *o;
7983 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__)))) {
7984 o = (PyObject*)__pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__[--__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__];
7985 memset(o, 0, sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__));
7986 (void) PyObject_INIT(o, t);
7987 PyObject_GC_Track(o);
7988 } else {
7989 o = (*t->tp_alloc)(t, 0);
7990 if (unlikely(!o)) return 0;
7991 }
7992 return o;
7993 }
7994
__pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__(PyObject * o)7995 static void __pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__(PyObject *o) {
7996 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *p = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *)o;
7997 PyObject_GC_UnTrack(o);
7998 Py_CLEAR(p->__pyx_v_self);
7999 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__)))) {
8000 __pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__[__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__++] = ((struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *)o);
8001 } else {
8002 (*Py_TYPE(o)->tp_free)(o);
8003 }
8004 }
8005
__pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__(PyObject * o,visitproc v,void * a)8006 static int __pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__(PyObject *o, visitproc v, void *a) {
8007 int e;
8008 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *p = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *)o;
8009 if (p->__pyx_v_self) {
8010 e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
8011 }
8012 return 0;
8013 }
8014
__pyx_tp_clear_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__(PyObject * o)8015 static int __pyx_tp_clear_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__(PyObject *o) {
8016 PyObject* tmp;
8017 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *p = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ *)o;
8018 tmp = ((PyObject*)p->__pyx_v_self);
8019 p->__pyx_v_self = ((struct __pyx_obj_2av_9subtitles_8subtitle_SubtitleSet *)Py_None); Py_INCREF(Py_None);
8020 Py_XDECREF(tmp);
8021 return 0;
8022 }
8023
8024 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ = {
8025 PyVarObject_HEAD_INIT(0, 0)
8026 "av.subtitles.subtitle.__pyx_scope_struct____cinit__", /*tp_name*/
8027 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__), /*tp_basicsize*/
8028 0, /*tp_itemsize*/
8029 __pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__, /*tp_dealloc*/
8030 #if PY_VERSION_HEX < 0x030800b4
8031 0, /*tp_print*/
8032 #endif
8033 #if PY_VERSION_HEX >= 0x030800b4
8034 0, /*tp_vectorcall_offset*/
8035 #endif
8036 0, /*tp_getattr*/
8037 0, /*tp_setattr*/
8038 #if PY_MAJOR_VERSION < 3
8039 0, /*tp_compare*/
8040 #endif
8041 #if PY_MAJOR_VERSION >= 3
8042 0, /*tp_as_async*/
8043 #endif
8044 0, /*tp_repr*/
8045 0, /*tp_as_number*/
8046 0, /*tp_as_sequence*/
8047 0, /*tp_as_mapping*/
8048 0, /*tp_hash*/
8049 0, /*tp_call*/
8050 0, /*tp_str*/
8051 0, /*tp_getattro*/
8052 0, /*tp_setattro*/
8053 0, /*tp_as_buffer*/
8054 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8055 0, /*tp_doc*/
8056 __pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__, /*tp_traverse*/
8057 __pyx_tp_clear_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__, /*tp_clear*/
8058 0, /*tp_richcompare*/
8059 0, /*tp_weaklistoffset*/
8060 0, /*tp_iter*/
8061 0, /*tp_iternext*/
8062 0, /*tp_methods*/
8063 0, /*tp_members*/
8064 0, /*tp_getset*/
8065 0, /*tp_base*/
8066 0, /*tp_dict*/
8067 0, /*tp_descr_get*/
8068 0, /*tp_descr_set*/
8069 0, /*tp_dictoffset*/
8070 0, /*tp_init*/
8071 0, /*tp_alloc*/
8072 __pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__, /*tp_new*/
8073 0, /*tp_free*/
8074 0, /*tp_is_gc*/
8075 0, /*tp_bases*/
8076 0, /*tp_mro*/
8077 0, /*tp_cache*/
8078 0, /*tp_subclasses*/
8079 0, /*tp_weaklist*/
8080 0, /*tp_del*/
8081 0, /*tp_version_tag*/
8082 #if PY_VERSION_HEX >= 0x030400a1
8083 0, /*tp_finalize*/
8084 #endif
8085 #if PY_VERSION_HEX >= 0x030800b1
8086 0, /*tp_vectorcall*/
8087 #endif
8088 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8089 0, /*tp_print*/
8090 #endif
8091 };
8092
8093 static struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *__pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr[8];
8094 static int __pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr = 0;
8095
__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)8096 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
8097 PyObject *o;
8098 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr)))) {
8099 o = (PyObject*)__pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr[--__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr];
8100 memset(o, 0, sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr));
8101 (void) PyObject_INIT(o, t);
8102 PyObject_GC_Track(o);
8103 } else {
8104 o = (*t->tp_alloc)(t, 0);
8105 if (unlikely(!o)) return 0;
8106 }
8107 return o;
8108 }
8109
__pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr(PyObject * o)8110 static void __pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr(PyObject *o) {
8111 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *)o;
8112 PyObject_GC_UnTrack(o);
8113 Py_CLEAR(p->__pyx_outer_scope);
8114 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr)))) {
8115 __pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr[__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *)o);
8116 } else {
8117 (*Py_TYPE(o)->tp_free)(o);
8118 }
8119 }
8120
__pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr(PyObject * o,visitproc v,void * a)8121 static int __pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
8122 int e;
8123 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr *)o;
8124 if (p->__pyx_outer_scope) {
8125 e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
8126 }
8127 return 0;
8128 }
8129
8130 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr = {
8131 PyVarObject_HEAD_INIT(0, 0)
8132 "av.subtitles.subtitle.__pyx_scope_struct_1_genexpr", /*tp_name*/
8133 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
8134 0, /*tp_itemsize*/
8135 __pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
8136 #if PY_VERSION_HEX < 0x030800b4
8137 0, /*tp_print*/
8138 #endif
8139 #if PY_VERSION_HEX >= 0x030800b4
8140 0, /*tp_vectorcall_offset*/
8141 #endif
8142 0, /*tp_getattr*/
8143 0, /*tp_setattr*/
8144 #if PY_MAJOR_VERSION < 3
8145 0, /*tp_compare*/
8146 #endif
8147 #if PY_MAJOR_VERSION >= 3
8148 0, /*tp_as_async*/
8149 #endif
8150 0, /*tp_repr*/
8151 0, /*tp_as_number*/
8152 0, /*tp_as_sequence*/
8153 0, /*tp_as_mapping*/
8154 0, /*tp_hash*/
8155 0, /*tp_call*/
8156 0, /*tp_str*/
8157 0, /*tp_getattro*/
8158 0, /*tp_setattro*/
8159 0, /*tp_as_buffer*/
8160 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8161 0, /*tp_doc*/
8162 __pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr, /*tp_traverse*/
8163 0, /*tp_clear*/
8164 0, /*tp_richcompare*/
8165 0, /*tp_weaklistoffset*/
8166 0, /*tp_iter*/
8167 0, /*tp_iternext*/
8168 0, /*tp_methods*/
8169 0, /*tp_members*/
8170 0, /*tp_getset*/
8171 0, /*tp_base*/
8172 0, /*tp_dict*/
8173 0, /*tp_descr_get*/
8174 0, /*tp_descr_set*/
8175 0, /*tp_dictoffset*/
8176 0, /*tp_init*/
8177 0, /*tp_alloc*/
8178 __pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr, /*tp_new*/
8179 0, /*tp_free*/
8180 0, /*tp_is_gc*/
8181 0, /*tp_bases*/
8182 0, /*tp_mro*/
8183 0, /*tp_cache*/
8184 0, /*tp_subclasses*/
8185 0, /*tp_weaklist*/
8186 0, /*tp_del*/
8187 0, /*tp_version_tag*/
8188 #if PY_VERSION_HEX >= 0x030400a1
8189 0, /*tp_finalize*/
8190 #endif
8191 #if PY_VERSION_HEX >= 0x030800b1
8192 0, /*tp_vectorcall*/
8193 #endif
8194 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8195 0, /*tp_print*/
8196 #endif
8197 };
8198
8199 static struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *__pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__[8];
8200 static int __pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ = 0;
8201
__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)8202 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
8203 PyObject *o;
8204 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__)))) {
8205 o = (PyObject*)__pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__[--__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__];
8206 memset(o, 0, sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__));
8207 (void) PyObject_INIT(o, t);
8208 PyObject_GC_Track(o);
8209 } else {
8210 o = (*t->tp_alloc)(t, 0);
8211 if (unlikely(!o)) return 0;
8212 }
8213 return o;
8214 }
8215
__pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__(PyObject * o)8216 static void __pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__(PyObject *o) {
8217 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *p = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *)o;
8218 PyObject_GC_UnTrack(o);
8219 Py_CLEAR(p->__pyx_v_self);
8220 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__)))) {
8221 __pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__[__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__++] = ((struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *)o);
8222 } else {
8223 (*Py_TYPE(o)->tp_free)(o);
8224 }
8225 }
8226
__pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__(PyObject * o,visitproc v,void * a)8227 static int __pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__(PyObject *o, visitproc v, void *a) {
8228 int e;
8229 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *p = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *)o;
8230 if (p->__pyx_v_self) {
8231 e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
8232 }
8233 return 0;
8234 }
8235
__pyx_tp_clear_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__(PyObject * o)8236 static int __pyx_tp_clear_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__(PyObject *o) {
8237 PyObject* tmp;
8238 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *p = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ *)o;
8239 tmp = ((PyObject*)p->__pyx_v_self);
8240 p->__pyx_v_self = ((struct __pyx_obj_2av_9subtitles_8subtitle_BitmapSubtitle *)Py_None); Py_INCREF(Py_None);
8241 Py_XDECREF(tmp);
8242 return 0;
8243 }
8244
8245 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ = {
8246 PyVarObject_HEAD_INIT(0, 0)
8247 "av.subtitles.subtitle.__pyx_scope_struct_2___cinit__", /*tp_name*/
8248 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__), /*tp_basicsize*/
8249 0, /*tp_itemsize*/
8250 __pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__, /*tp_dealloc*/
8251 #if PY_VERSION_HEX < 0x030800b4
8252 0, /*tp_print*/
8253 #endif
8254 #if PY_VERSION_HEX >= 0x030800b4
8255 0, /*tp_vectorcall_offset*/
8256 #endif
8257 0, /*tp_getattr*/
8258 0, /*tp_setattr*/
8259 #if PY_MAJOR_VERSION < 3
8260 0, /*tp_compare*/
8261 #endif
8262 #if PY_MAJOR_VERSION >= 3
8263 0, /*tp_as_async*/
8264 #endif
8265 0, /*tp_repr*/
8266 0, /*tp_as_number*/
8267 0, /*tp_as_sequence*/
8268 0, /*tp_as_mapping*/
8269 0, /*tp_hash*/
8270 0, /*tp_call*/
8271 0, /*tp_str*/
8272 0, /*tp_getattro*/
8273 0, /*tp_setattro*/
8274 0, /*tp_as_buffer*/
8275 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8276 0, /*tp_doc*/
8277 __pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__, /*tp_traverse*/
8278 __pyx_tp_clear_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__, /*tp_clear*/
8279 0, /*tp_richcompare*/
8280 0, /*tp_weaklistoffset*/
8281 0, /*tp_iter*/
8282 0, /*tp_iternext*/
8283 0, /*tp_methods*/
8284 0, /*tp_members*/
8285 0, /*tp_getset*/
8286 0, /*tp_base*/
8287 0, /*tp_dict*/
8288 0, /*tp_descr_get*/
8289 0, /*tp_descr_set*/
8290 0, /*tp_dictoffset*/
8291 0, /*tp_init*/
8292 0, /*tp_alloc*/
8293 __pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__, /*tp_new*/
8294 0, /*tp_free*/
8295 0, /*tp_is_gc*/
8296 0, /*tp_bases*/
8297 0, /*tp_mro*/
8298 0, /*tp_cache*/
8299 0, /*tp_subclasses*/
8300 0, /*tp_weaklist*/
8301 0, /*tp_del*/
8302 0, /*tp_version_tag*/
8303 #if PY_VERSION_HEX >= 0x030400a1
8304 0, /*tp_finalize*/
8305 #endif
8306 #if PY_VERSION_HEX >= 0x030800b1
8307 0, /*tp_vectorcall*/
8308 #endif
8309 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8310 0, /*tp_print*/
8311 #endif
8312 };
8313
8314 static struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *__pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr[8];
8315 static int __pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr = 0;
8316
__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)8317 static PyObject *__pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
8318 PyObject *o;
8319 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr)))) {
8320 o = (PyObject*)__pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr[--__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr];
8321 memset(o, 0, sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr));
8322 (void) PyObject_INIT(o, t);
8323 PyObject_GC_Track(o);
8324 } else {
8325 o = (*t->tp_alloc)(t, 0);
8326 if (unlikely(!o)) return 0;
8327 }
8328 return o;
8329 }
8330
__pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr(PyObject * o)8331 static void __pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr(PyObject *o) {
8332 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *)o;
8333 PyObject_GC_UnTrack(o);
8334 Py_CLEAR(p->__pyx_outer_scope);
8335 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr)))) {
8336 __pyx_freelist_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr[__pyx_freecount_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *)o);
8337 } else {
8338 (*Py_TYPE(o)->tp_free)(o);
8339 }
8340 }
8341
__pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr(PyObject * o,visitproc v,void * a)8342 static int __pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
8343 int e;
8344 struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr *)o;
8345 if (p->__pyx_outer_scope) {
8346 e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
8347 }
8348 return 0;
8349 }
8350
8351 static PyTypeObject __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr = {
8352 PyVarObject_HEAD_INIT(0, 0)
8353 "av.subtitles.subtitle.__pyx_scope_struct_3_genexpr", /*tp_name*/
8354 sizeof(struct __pyx_obj_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
8355 0, /*tp_itemsize*/
8356 __pyx_tp_dealloc_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
8357 #if PY_VERSION_HEX < 0x030800b4
8358 0, /*tp_print*/
8359 #endif
8360 #if PY_VERSION_HEX >= 0x030800b4
8361 0, /*tp_vectorcall_offset*/
8362 #endif
8363 0, /*tp_getattr*/
8364 0, /*tp_setattr*/
8365 #if PY_MAJOR_VERSION < 3
8366 0, /*tp_compare*/
8367 #endif
8368 #if PY_MAJOR_VERSION >= 3
8369 0, /*tp_as_async*/
8370 #endif
8371 0, /*tp_repr*/
8372 0, /*tp_as_number*/
8373 0, /*tp_as_sequence*/
8374 0, /*tp_as_mapping*/
8375 0, /*tp_hash*/
8376 0, /*tp_call*/
8377 0, /*tp_str*/
8378 0, /*tp_getattro*/
8379 0, /*tp_setattro*/
8380 0, /*tp_as_buffer*/
8381 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8382 0, /*tp_doc*/
8383 __pyx_tp_traverse_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr, /*tp_traverse*/
8384 0, /*tp_clear*/
8385 0, /*tp_richcompare*/
8386 0, /*tp_weaklistoffset*/
8387 0, /*tp_iter*/
8388 0, /*tp_iternext*/
8389 0, /*tp_methods*/
8390 0, /*tp_members*/
8391 0, /*tp_getset*/
8392 0, /*tp_base*/
8393 0, /*tp_dict*/
8394 0, /*tp_descr_get*/
8395 0, /*tp_descr_set*/
8396 0, /*tp_dictoffset*/
8397 0, /*tp_init*/
8398 0, /*tp_alloc*/
8399 __pyx_tp_new_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr, /*tp_new*/
8400 0, /*tp_free*/
8401 0, /*tp_is_gc*/
8402 0, /*tp_bases*/
8403 0, /*tp_mro*/
8404 0, /*tp_cache*/
8405 0, /*tp_subclasses*/
8406 0, /*tp_weaklist*/
8407 0, /*tp_del*/
8408 0, /*tp_version_tag*/
8409 #if PY_VERSION_HEX >= 0x030400a1
8410 0, /*tp_finalize*/
8411 #endif
8412 #if PY_VERSION_HEX >= 0x030800b1
8413 0, /*tp_vectorcall*/
8414 #endif
8415 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8416 0, /*tp_print*/
8417 #endif
8418 };
8419
8420 static PyMethodDef __pyx_methods[] = {
8421 {0, 0, 0, 0}
8422 };
8423
8424 #if PY_MAJOR_VERSION >= 3
8425 #if CYTHON_PEP489_MULTI_PHASE_INIT
8426 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
8427 static int __pyx_pymod_exec_subtitle(PyObject* module); /*proto*/
8428 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
8429 {Py_mod_create, (void*)__pyx_pymod_create},
8430 {Py_mod_exec, (void*)__pyx_pymod_exec_subtitle},
8431 {0, NULL}
8432 };
8433 #endif
8434
8435 static struct PyModuleDef __pyx_moduledef = {
8436 PyModuleDef_HEAD_INIT,
8437 "subtitle",
8438 0, /* m_doc */
8439 #if CYTHON_PEP489_MULTI_PHASE_INIT
8440 0, /* m_size */
8441 #else
8442 -1, /* m_size */
8443 #endif
8444 __pyx_methods /* m_methods */,
8445 #if CYTHON_PEP489_MULTI_PHASE_INIT
8446 __pyx_moduledef_slots, /* m_slots */
8447 #else
8448 NULL, /* m_reload */
8449 #endif
8450 NULL, /* m_traverse */
8451 NULL, /* m_clear */
8452 NULL /* m_free */
8453 };
8454 #endif
8455 #ifndef CYTHON_SMALL_CODE
8456 #if defined(__clang__)
8457 #define CYTHON_SMALL_CODE
8458 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
8459 #define CYTHON_SMALL_CODE __attribute__((cold))
8460 #else
8461 #define CYTHON_SMALL_CODE
8462 #endif
8463 #endif
8464
8465 static __Pyx_StringTabEntry __pyx_string_tab[] = {
8466 {&__pyx_n_s_ASSSubtitle, __pyx_k_ASSSubtitle, sizeof(__pyx_k_ASSSubtitle), 0, 0, 1, 1},
8467 {&__pyx_n_s_AssSubtitle, __pyx_k_AssSubtitle, sizeof(__pyx_k_AssSubtitle), 0, 0, 1, 1},
8468 {&__pyx_n_s_BitmapSubtitle, __pyx_k_BitmapSubtitle, sizeof(__pyx_k_BitmapSubtitle), 0, 0, 1, 1},
8469 {&__pyx_n_s_BitmapSubtitlePlane, __pyx_k_BitmapSubtitlePlane, sizeof(__pyx_k_BitmapSubtitlePlane), 0, 0, 1, 1},
8470 {&__pyx_kp_s_BitmapSubtitles_have_only_4_plan, __pyx_k_BitmapSubtitles_have_only_4_plan, sizeof(__pyx_k_BitmapSubtitles_have_only_4_plan), 0, 0, 1, 0},
8471 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
8472 {&__pyx_n_s_Subtitle, __pyx_k_Subtitle, sizeof(__pyx_k_Subtitle), 0, 0, 1, 1},
8473 {&__pyx_n_s_SubtitleProxy, __pyx_k_SubtitleProxy, sizeof(__pyx_k_SubtitleProxy), 0, 0, 1, 1},
8474 {&__pyx_n_s_SubtitleSet, __pyx_k_SubtitleSet, sizeof(__pyx_k_SubtitleSet), 0, 0, 1, 1},
8475 {&__pyx_n_s_TextSubtitle, __pyx_k_TextSubtitle, sizeof(__pyx_k_TextSubtitle), 0, 0, 1, 1},
8476 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
8477 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
8478 {&__pyx_kp_s_accessing_non_existent_buffer_se, __pyx_k_accessing_non_existent_buffer_se, sizeof(__pyx_k_accessing_non_existent_buffer_se), 0, 0, 1, 0},
8479 {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
8480 {&__pyx_n_b_ass, __pyx_k_ass, sizeof(__pyx_k_ass), 0, 0, 0, 1},
8481 {&__pyx_n_s_ass, __pyx_k_ass, sizeof(__pyx_k_ass), 0, 0, 1, 1},
8482 {&__pyx_n_s_av_subtitles_subtitle, __pyx_k_av_subtitles_subtitle, sizeof(__pyx_k_av_subtitles_subtitle), 0, 0, 1, 1},
8483 {&__pyx_n_b_bitmap, __pyx_k_bitmap, sizeof(__pyx_k_bitmap), 0, 0, 0, 1},
8484 {&__pyx_n_s_cinit___locals_genexpr, __pyx_k_cinit___locals_genexpr, sizeof(__pyx_k_cinit___locals_genexpr), 0, 0, 1, 1},
8485 {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
8486 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
8487 {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
8488 {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
8489 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
8490 {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
8491 {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
8492 {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
8493 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
8494 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
8495 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
8496 {&__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},
8497 {&__pyx_n_b_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 0, 0, 1},
8498 {&__pyx_kp_s_plane_does_not_exist, __pyx_k_plane_does_not_exist, sizeof(__pyx_k_plane_does_not_exist), 0, 0, 1, 0},
8499 {&__pyx_n_s_proxy, __pyx_k_proxy, sizeof(__pyx_k_proxy), 0, 0, 1, 1},
8500 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
8501 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
8502 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
8503 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
8504 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
8505 {&__pyx_kp_s_s_s_at_0x_x, __pyx_k_s_s_at_0x_x, sizeof(__pyx_k_s_s_at_0x_x), 0, 0, 1, 0},
8506 {&__pyx_kp_s_s_s_dx_d_at_d_d_at_0x_x, __pyx_k_s_s_dx_d_at_d_d_at_0x_x, sizeof(__pyx_k_s_s_dx_d_at_d_d_at_0x_x), 0, 0, 1, 0},
8507 {&__pyx_kp_s_s_s_r_at_0x_x, __pyx_k_s_s_r_at_0x_x, sizeof(__pyx_k_s_s_r_at_0x_x), 0, 0, 1, 0},
8508 {&__pyx_kp_s_self_struct_cannot_be_converted, __pyx_k_self_struct_cannot_be_converted, sizeof(__pyx_k_self_struct_cannot_be_converted), 0, 0, 1, 0},
8509 {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
8510 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
8511 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
8512 {&__pyx_n_s_subtitle, __pyx_k_subtitle, sizeof(__pyx_k_subtitle), 0, 0, 1, 1},
8513 {&__pyx_kp_s_subtitle_rect_index_out_of_range, __pyx_k_subtitle_rect_index_out_of_range, sizeof(__pyx_k_subtitle_rect_index_out_of_range), 0, 0, 1, 0},
8514 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
8515 {&__pyx_n_b_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 0, 1},
8516 {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
8517 {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
8518 {&__pyx_kp_s_unknown_subtitle_type_r, __pyx_k_unknown_subtitle_type_r, sizeof(__pyx_k_unknown_subtitle_type_r), 0, 0, 1, 0},
8519 {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
8520 {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
8521 {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
8522 {0, 0, 0, 0, 0, 0, 0}
8523 };
__Pyx_InitCachedBuiltins(void)8524 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
8525 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
8526 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 14, __pyx_L1_error)
8527 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 20, __pyx_L1_error)
8528 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 51, __pyx_L1_error)
8529 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 160, __pyx_L1_error)
8530 return 0;
8531 __pyx_L1_error:;
8532 return -1;
8533 }
8534
__Pyx_InitCachedConstants(void)8535 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
8536 __Pyx_RefNannyDeclarations
8537 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
8538
8539 /* "(tree fragment)":2
8540 * def __reduce_cython__(self):
8541 * raise TypeError("self.struct cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
8542 * def __setstate_cython__(self, __pyx_state):
8543 * raise TypeError("self.struct cannot be converted to a Python object for pickling")
8544 */
8545 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_struct_cannot_be_converted); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error)
8546 __Pyx_GOTREF(__pyx_tuple_);
8547 __Pyx_GIVEREF(__pyx_tuple_);
8548
8549 /* "(tree fragment)":4
8550 * raise TypeError("self.struct cannot be converted to a Python object for pickling")
8551 * def __setstate_cython__(self, __pyx_state):
8552 * raise TypeError("self.struct cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
8553 */
8554 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_struct_cannot_be_converted); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error)
8555 __Pyx_GOTREF(__pyx_tuple__2);
8556 __Pyx_GIVEREF(__pyx_tuple__2);
8557
8558 /* "(tree fragment)":2
8559 * def __reduce_cython__(self):
8560 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8561 * def __setstate_cython__(self, __pyx_state):
8562 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8563 */
8564 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 2, __pyx_L1_error)
8565 __Pyx_GOTREF(__pyx_tuple__3);
8566 __Pyx_GIVEREF(__pyx_tuple__3);
8567
8568 /* "(tree fragment)":4
8569 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8570 * def __setstate_cython__(self, __pyx_state):
8571 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8572 */
8573 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 4, __pyx_L1_error)
8574 __Pyx_GOTREF(__pyx_tuple__4);
8575 __Pyx_GIVEREF(__pyx_tuple__4);
8576
8577 /* "av/subtitles/subtitle.pyx":51
8578 *
8579 * if index < 0 or <unsigned int>index >= subtitle.proxy.struct.num_rects:
8580 * raise ValueError('subtitle rect index out of range') # <<<<<<<<<<<<<<
8581 * cdef lib.AVSubtitleRect *ptr = subtitle.proxy.struct.rects[index]
8582 *
8583 */
8584 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_subtitle_rect_index_out_of_range); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 51, __pyx_L1_error)
8585 __Pyx_GOTREF(__pyx_tuple__5);
8586 __Pyx_GIVEREF(__pyx_tuple__5);
8587
8588 /* "(tree fragment)":2
8589 * def __reduce_cython__(self):
8590 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8591 * def __setstate_cython__(self, __pyx_state):
8592 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8593 */
8594 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 2, __pyx_L1_error)
8595 __Pyx_GOTREF(__pyx_tuple__6);
8596 __Pyx_GIVEREF(__pyx_tuple__6);
8597
8598 /* "(tree fragment)":4
8599 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8600 * def __setstate_cython__(self, __pyx_state):
8601 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8602 */
8603 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 4, __pyx_L1_error)
8604 __Pyx_GOTREF(__pyx_tuple__7);
8605 __Pyx_GIVEREF(__pyx_tuple__7);
8606
8607 /* "(tree fragment)":2
8608 * def __reduce_cython__(self):
8609 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8610 * def __setstate_cython__(self, __pyx_state):
8611 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8612 */
8613 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 2, __pyx_L1_error)
8614 __Pyx_GOTREF(__pyx_tuple__8);
8615 __Pyx_GIVEREF(__pyx_tuple__8);
8616
8617 /* "(tree fragment)":4
8618 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8619 * def __setstate_cython__(self, __pyx_state):
8620 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8621 */
8622 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 4, __pyx_L1_error)
8623 __Pyx_GOTREF(__pyx_tuple__9);
8624 __Pyx_GIVEREF(__pyx_tuple__9);
8625
8626 /* "av/subtitles/subtitle.pyx":139
8627 *
8628 * if index >= 4:
8629 * raise ValueError('BitmapSubtitles have only 4 planes') # <<<<<<<<<<<<<<
8630 * if not subtitle.ptr.linesize[index]:
8631 * raise ValueError('plane does not exist')
8632 */
8633 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_BitmapSubtitles_have_only_4_plan); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 139, __pyx_L1_error)
8634 __Pyx_GOTREF(__pyx_tuple__10);
8635 __Pyx_GIVEREF(__pyx_tuple__10);
8636
8637 /* "av/subtitles/subtitle.pyx":141
8638 * raise ValueError('BitmapSubtitles have only 4 planes')
8639 * if not subtitle.ptr.linesize[index]:
8640 * raise ValueError('plane does not exist') # <<<<<<<<<<<<<<
8641 *
8642 * self.subtitle = subtitle
8643 */
8644 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_plane_does_not_exist); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 141, __pyx_L1_error)
8645 __Pyx_GOTREF(__pyx_tuple__11);
8646 __Pyx_GIVEREF(__pyx_tuple__11);
8647
8648 /* "av/subtitles/subtitle.pyx":160
8649 * def __getreadbuffer__(self, Py_ssize_t index, void **data):
8650 * if index:
8651 * raise RuntimeError("accessing non-existent buffer segment") # <<<<<<<<<<<<<<
8652 * data[0] = self._buffer
8653 * return <Py_ssize_t>self.buffer_size
8654 */
8655 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_accessing_non_existent_buffer_se); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 160, __pyx_L1_error)
8656 __Pyx_GOTREF(__pyx_tuple__12);
8657 __Pyx_GIVEREF(__pyx_tuple__12);
8658
8659 /* "(tree fragment)":2
8660 * def __reduce_cython__(self):
8661 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8662 * def __setstate_cython__(self, __pyx_state):
8663 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8664 */
8665 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 2, __pyx_L1_error)
8666 __Pyx_GOTREF(__pyx_tuple__13);
8667 __Pyx_GIVEREF(__pyx_tuple__13);
8668
8669 /* "(tree fragment)":4
8670 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8671 * def __setstate_cython__(self, __pyx_state):
8672 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8673 */
8674 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 4, __pyx_L1_error)
8675 __Pyx_GOTREF(__pyx_tuple__14);
8676 __Pyx_GIVEREF(__pyx_tuple__14);
8677
8678 /* "(tree fragment)":2
8679 * def __reduce_cython__(self):
8680 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8681 * def __setstate_cython__(self, __pyx_state):
8682 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8683 */
8684 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 2, __pyx_L1_error)
8685 __Pyx_GOTREF(__pyx_tuple__15);
8686 __Pyx_GIVEREF(__pyx_tuple__15);
8687
8688 /* "(tree fragment)":4
8689 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8690 * def __setstate_cython__(self, __pyx_state):
8691 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8692 */
8693 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 4, __pyx_L1_error)
8694 __Pyx_GOTREF(__pyx_tuple__16);
8695 __Pyx_GIVEREF(__pyx_tuple__16);
8696
8697 /* "(tree fragment)":2
8698 * def __reduce_cython__(self):
8699 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8700 * def __setstate_cython__(self, __pyx_state):
8701 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8702 */
8703 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 2, __pyx_L1_error)
8704 __Pyx_GOTREF(__pyx_tuple__17);
8705 __Pyx_GIVEREF(__pyx_tuple__17);
8706
8707 /* "(tree fragment)":4
8708 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8709 * def __setstate_cython__(self, __pyx_state):
8710 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8711 */
8712 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 4, __pyx_L1_error)
8713 __Pyx_GOTREF(__pyx_tuple__18);
8714 __Pyx_GIVEREF(__pyx_tuple__18);
8715 __Pyx_RefNannyFinishContext();
8716 return 0;
8717 __pyx_L1_error:;
8718 __Pyx_RefNannyFinishContext();
8719 return -1;
8720 }
8721
__Pyx_InitGlobals(void)8722 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
8723 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
8724 return 0;
8725 __pyx_L1_error:;
8726 return -1;
8727 }
8728
8729 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
8730 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
8731 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
8732 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
8733 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
8734 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
8735 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
8736
__Pyx_modinit_global_init_code(void)8737 static int __Pyx_modinit_global_init_code(void) {
8738 __Pyx_RefNannyDeclarations
8739 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
8740 /*--- Global init code ---*/
8741 __Pyx_RefNannyFinishContext();
8742 return 0;
8743 }
8744
__Pyx_modinit_variable_export_code(void)8745 static int __Pyx_modinit_variable_export_code(void) {
8746 __Pyx_RefNannyDeclarations
8747 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
8748 /*--- Variable export code ---*/
8749 __Pyx_RefNannyFinishContext();
8750 return 0;
8751 }
8752
__Pyx_modinit_function_export_code(void)8753 static int __Pyx_modinit_function_export_code(void) {
8754 __Pyx_RefNannyDeclarations
8755 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
8756 /*--- Function export code ---*/
8757 __Pyx_RefNannyFinishContext();
8758 return 0;
8759 }
8760
__Pyx_modinit_type_init_code(void)8761 static int __Pyx_modinit_type_init_code(void) {
8762 __Pyx_RefNannyDeclarations
8763 int __pyx_lineno = 0;
8764 const char *__pyx_filename = NULL;
8765 int __pyx_clineno = 0;
8766 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
8767 /*--- Type init code ---*/
8768 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle_SubtitleProxy) < 0) __PYX_ERR(1, 4, __pyx_L1_error)
8769 #if PY_VERSION_HEX < 0x030800B1
8770 __pyx_type_2av_9subtitles_8subtitle_SubtitleProxy.tp_print = 0;
8771 #endif
8772 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle_SubtitleProxy.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle_SubtitleProxy.tp_getattro == PyObject_GenericGetAttr)) {
8773 __pyx_type_2av_9subtitles_8subtitle_SubtitleProxy.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8774 }
8775 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SubtitleProxy, (PyObject *)&__pyx_type_2av_9subtitles_8subtitle_SubtitleProxy) < 0) __PYX_ERR(1, 4, __pyx_L1_error)
8776 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2av_9subtitles_8subtitle_SubtitleProxy) < 0) __PYX_ERR(1, 4, __pyx_L1_error)
8777 __pyx_ptype_2av_9subtitles_8subtitle_SubtitleProxy = &__pyx_type_2av_9subtitles_8subtitle_SubtitleProxy;
8778 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle_SubtitleSet) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
8779 #if PY_VERSION_HEX < 0x030800B1
8780 __pyx_type_2av_9subtitles_8subtitle_SubtitleSet.tp_print = 0;
8781 #endif
8782 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle_SubtitleSet.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle_SubtitleSet.tp_getattro == PyObject_GenericGetAttr)) {
8783 __pyx_type_2av_9subtitles_8subtitle_SubtitleSet.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8784 }
8785 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SubtitleSet, (PyObject *)&__pyx_type_2av_9subtitles_8subtitle_SubtitleSet) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
8786 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2av_9subtitles_8subtitle_SubtitleSet) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
8787 __pyx_ptype_2av_9subtitles_8subtitle_SubtitleSet = &__pyx_type_2av_9subtitles_8subtitle_SubtitleSet;
8788 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle_Subtitle) < 0) __PYX_ERR(1, 66, __pyx_L1_error)
8789 #if PY_VERSION_HEX < 0x030800B1
8790 __pyx_type_2av_9subtitles_8subtitle_Subtitle.tp_print = 0;
8791 #endif
8792 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle_Subtitle.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle_Subtitle.tp_getattro == PyObject_GenericGetAttr)) {
8793 __pyx_type_2av_9subtitles_8subtitle_Subtitle.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8794 }
8795 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Subtitle, (PyObject *)&__pyx_type_2av_9subtitles_8subtitle_Subtitle) < 0) __PYX_ERR(1, 66, __pyx_L1_error)
8796 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2av_9subtitles_8subtitle_Subtitle) < 0) __PYX_ERR(1, 66, __pyx_L1_error)
8797 __pyx_ptype_2av_9subtitles_8subtitle_Subtitle = &__pyx_type_2av_9subtitles_8subtitle_Subtitle;
8798 __pyx_type_2av_9subtitles_8subtitle_TextSubtitle.tp_base = __pyx_ptype_2av_9subtitles_8subtitle_Subtitle;
8799 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle_TextSubtitle) < 0) __PYX_ERR(1, 176, __pyx_L1_error)
8800 #if PY_VERSION_HEX < 0x030800B1
8801 __pyx_type_2av_9subtitles_8subtitle_TextSubtitle.tp_print = 0;
8802 #endif
8803 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle_TextSubtitle.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle_TextSubtitle.tp_getattro == PyObject_GenericGetAttr)) {
8804 __pyx_type_2av_9subtitles_8subtitle_TextSubtitle.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8805 }
8806 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TextSubtitle, (PyObject *)&__pyx_type_2av_9subtitles_8subtitle_TextSubtitle) < 0) __PYX_ERR(1, 176, __pyx_L1_error)
8807 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2av_9subtitles_8subtitle_TextSubtitle) < 0) __PYX_ERR(1, 176, __pyx_L1_error)
8808 __pyx_ptype_2av_9subtitles_8subtitle_TextSubtitle = &__pyx_type_2av_9subtitles_8subtitle_TextSubtitle;
8809 __pyx_type_2av_9subtitles_8subtitle_ASSSubtitle.tp_base = __pyx_ptype_2av_9subtitles_8subtitle_Subtitle;
8810 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle_ASSSubtitle) < 0) __PYX_ERR(2, 27, __pyx_L1_error)
8811 #if PY_VERSION_HEX < 0x030800B1
8812 __pyx_type_2av_9subtitles_8subtitle_ASSSubtitle.tp_print = 0;
8813 #endif
8814 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle_ASSSubtitle.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle_ASSSubtitle.tp_getattro == PyObject_GenericGetAttr)) {
8815 __pyx_type_2av_9subtitles_8subtitle_ASSSubtitle.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8816 }
8817 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ASSSubtitle, (PyObject *)&__pyx_type_2av_9subtitles_8subtitle_ASSSubtitle) < 0) __PYX_ERR(2, 27, __pyx_L1_error)
8818 __pyx_ptype_2av_9subtitles_8subtitle_ASSSubtitle = &__pyx_type_2av_9subtitles_8subtitle_ASSSubtitle;
8819 __pyx_type_2av_9subtitles_8subtitle_BitmapSubtitle.tp_base = __pyx_ptype_2av_9subtitles_8subtitle_Subtitle;
8820 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle_BitmapSubtitle) < 0) __PYX_ERR(1, 93, __pyx_L1_error)
8821 #if PY_VERSION_HEX < 0x030800B1
8822 __pyx_type_2av_9subtitles_8subtitle_BitmapSubtitle.tp_print = 0;
8823 #endif
8824 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle_BitmapSubtitle.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle_BitmapSubtitle.tp_getattro == PyObject_GenericGetAttr)) {
8825 __pyx_type_2av_9subtitles_8subtitle_BitmapSubtitle.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8826 }
8827 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BitmapSubtitle, (PyObject *)&__pyx_type_2av_9subtitles_8subtitle_BitmapSubtitle) < 0) __PYX_ERR(1, 93, __pyx_L1_error)
8828 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2av_9subtitles_8subtitle_BitmapSubtitle) < 0) __PYX_ERR(1, 93, __pyx_L1_error)
8829 __pyx_ptype_2av_9subtitles_8subtitle_BitmapSubtitle = &__pyx_type_2av_9subtitles_8subtitle_BitmapSubtitle;
8830 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle_BitmapSubtitlePlane) < 0) __PYX_ERR(1, 134, __pyx_L1_error)
8831 #if PY_VERSION_HEX < 0x030800B1
8832 __pyx_type_2av_9subtitles_8subtitle_BitmapSubtitlePlane.tp_print = 0;
8833 #endif
8834 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle_BitmapSubtitlePlane.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle_BitmapSubtitlePlane.tp_getattro == PyObject_GenericGetAttr)) {
8835 __pyx_type_2av_9subtitles_8subtitle_BitmapSubtitlePlane.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8836 }
8837 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BitmapSubtitlePlane, (PyObject *)&__pyx_type_2av_9subtitles_8subtitle_BitmapSubtitlePlane) < 0) __PYX_ERR(1, 134, __pyx_L1_error)
8838 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2av_9subtitles_8subtitle_BitmapSubtitlePlane) < 0) __PYX_ERR(1, 134, __pyx_L1_error)
8839 __pyx_ptype_2av_9subtitles_8subtitle_BitmapSubtitlePlane = &__pyx_type_2av_9subtitles_8subtitle_BitmapSubtitlePlane;
8840 __pyx_type_2av_9subtitles_8subtitle_AssSubtitle.tp_base = __pyx_ptype_2av_9subtitles_8subtitle_Subtitle;
8841 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle_AssSubtitle) < 0) __PYX_ERR(1, 190, __pyx_L1_error)
8842 #if PY_VERSION_HEX < 0x030800B1
8843 __pyx_type_2av_9subtitles_8subtitle_AssSubtitle.tp_print = 0;
8844 #endif
8845 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle_AssSubtitle.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle_AssSubtitle.tp_getattro == PyObject_GenericGetAttr)) {
8846 __pyx_type_2av_9subtitles_8subtitle_AssSubtitle.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8847 }
8848 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AssSubtitle, (PyObject *)&__pyx_type_2av_9subtitles_8subtitle_AssSubtitle) < 0) __PYX_ERR(1, 190, __pyx_L1_error)
8849 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2av_9subtitles_8subtitle_AssSubtitle) < 0) __PYX_ERR(1, 190, __pyx_L1_error)
8850 __pyx_ptype_2av_9subtitles_8subtitle_AssSubtitle = &__pyx_type_2av_9subtitles_8subtitle_AssSubtitle;
8851 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
8852 #if PY_VERSION_HEX < 0x030800B1
8853 __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__.tp_print = 0;
8854 #endif
8855 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__.tp_getattro == PyObject_GenericGetAttr)) {
8856 __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
8857 }
8858 __pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__ = &__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct____cinit__;
8859 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(1, 14, __pyx_L1_error)
8860 #if PY_VERSION_HEX < 0x030800B1
8861 __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr.tp_print = 0;
8862 #endif
8863 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
8864 __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
8865 }
8866 __pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr = &__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_1_genexpr;
8867 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__) < 0) __PYX_ERR(1, 95, __pyx_L1_error)
8868 #if PY_VERSION_HEX < 0x030800B1
8869 __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__.tp_print = 0;
8870 #endif
8871 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__.tp_getattro == PyObject_GenericGetAttr)) {
8872 __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
8873 }
8874 __pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__ = &__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_2___cinit__;
8875 if (PyType_Ready(&__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(1, 97, __pyx_L1_error)
8876 #if PY_VERSION_HEX < 0x030800B1
8877 __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr.tp_print = 0;
8878 #endif
8879 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
8880 __pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
8881 }
8882 __pyx_ptype_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr = &__pyx_type_2av_9subtitles_8subtitle___pyx_scope_struct_3_genexpr;
8883 __Pyx_RefNannyFinishContext();
8884 return 0;
8885 __pyx_L1_error:;
8886 __Pyx_RefNannyFinishContext();
8887 return -1;
8888 }
8889
__Pyx_modinit_type_import_code(void)8890 static int __Pyx_modinit_type_import_code(void) {
8891 __Pyx_RefNannyDeclarations
8892 PyObject *__pyx_t_1 = NULL;
8893 int __pyx_lineno = 0;
8894 const char *__pyx_filename = NULL;
8895 int __pyx_clineno = 0;
8896 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
8897 /*--- Type import code ---*/
8898 __pyx_t_1 = PyImport_ImportModule("av.buffer"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error)
8899 __Pyx_GOTREF(__pyx_t_1);
8900 __pyx_ptype_2av_6buffer_Buffer = __Pyx_ImportType(__pyx_t_1, "av.buffer", "Buffer", sizeof(struct __pyx_obj_2av_6buffer_Buffer), __Pyx_ImportType_CheckSize_Warn);
8901 if (!__pyx_ptype_2av_6buffer_Buffer) __PYX_ERR(3, 2, __pyx_L1_error)
8902 __pyx_vtabptr_2av_6buffer_Buffer = (struct __pyx_vtabstruct_2av_6buffer_Buffer*)__Pyx_GetVtable(__pyx_ptype_2av_6buffer_Buffer->tp_dict); if (unlikely(!__pyx_vtabptr_2av_6buffer_Buffer)) __PYX_ERR(3, 2, __pyx_L1_error)
8903 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8904 __pyx_t_1 = PyImport_ImportModule("av.bytesource"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
8905 __Pyx_GOTREF(__pyx_t_1);
8906 __pyx_ptype_2av_10bytesource_ByteSource = __Pyx_ImportType(__pyx_t_1, "av.bytesource", "ByteSource", sizeof(struct __pyx_obj_2av_10bytesource_ByteSource), __Pyx_ImportType_CheckSize_Warn);
8907 if (!__pyx_ptype_2av_10bytesource_ByteSource) __PYX_ERR(4, 4, __pyx_L1_error)
8908 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8909 __pyx_t_1 = PyImport_ImportModule("av.codec.codec"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4, __pyx_L1_error)
8910 __Pyx_GOTREF(__pyx_t_1);
8911 __pyx_ptype_2av_5codec_5codec_Codec = __Pyx_ImportType(__pyx_t_1, "av.codec.codec", "Codec", sizeof(struct __pyx_obj_2av_5codec_5codec_Codec), __Pyx_ImportType_CheckSize_Warn);
8912 if (!__pyx_ptype_2av_5codec_5codec_Codec) __PYX_ERR(5, 4, __pyx_L1_error)
8913 __pyx_vtabptr_2av_5codec_5codec_Codec = (struct __pyx_vtabstruct_2av_5codec_5codec_Codec*)__Pyx_GetVtable(__pyx_ptype_2av_5codec_5codec_Codec->tp_dict); if (unlikely(!__pyx_vtabptr_2av_5codec_5codec_Codec)) __PYX_ERR(5, 4, __pyx_L1_error)
8914 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8915 __pyx_t_1 = PyImport_ImportModule("av.dictionary"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 4, __pyx_L1_error)
8916 __Pyx_GOTREF(__pyx_t_1);
8917 __pyx_ptype_2av_10dictionary__Dictionary = __Pyx_ImportType(__pyx_t_1, "av.dictionary", "_Dictionary", sizeof(struct __pyx_obj_2av_10dictionary__Dictionary), __Pyx_ImportType_CheckSize_Warn);
8918 if (!__pyx_ptype_2av_10dictionary__Dictionary) __PYX_ERR(6, 4, __pyx_L1_error)
8919 __pyx_vtabptr_2av_10dictionary__Dictionary = (struct __pyx_vtabstruct_2av_10dictionary__Dictionary*)__Pyx_GetVtable(__pyx_ptype_2av_10dictionary__Dictionary->tp_dict); if (unlikely(!__pyx_vtabptr_2av_10dictionary__Dictionary)) __PYX_ERR(6, 4, __pyx_L1_error)
8920 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8921 __pyx_t_1 = PyImport_ImportModule("av.sidedata.sidedata"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 9, __pyx_L1_error)
8922 __Pyx_GOTREF(__pyx_t_1);
8923 __pyx_ptype_2av_8sidedata_8sidedata_SideData = __Pyx_ImportType(__pyx_t_1, "av.sidedata.sidedata", "SideData", sizeof(struct __pyx_obj_2av_8sidedata_8sidedata_SideData), __Pyx_ImportType_CheckSize_Warn);
8924 if (!__pyx_ptype_2av_8sidedata_8sidedata_SideData) __PYX_ERR(7, 9, __pyx_L1_error)
8925 __pyx_vtabptr_2av_8sidedata_8sidedata_SideData = (struct __pyx_vtabstruct_2av_8sidedata_8sidedata_SideData*)__Pyx_GetVtable(__pyx_ptype_2av_8sidedata_8sidedata_SideData->tp_dict); if (unlikely(!__pyx_vtabptr_2av_8sidedata_8sidedata_SideData)) __PYX_ERR(7, 9, __pyx_L1_error)
8926 __pyx_ptype_2av_8sidedata_8sidedata__SideDataContainer = __Pyx_ImportType(__pyx_t_1, "av.sidedata.sidedata", "_SideDataContainer", sizeof(struct __pyx_obj_2av_8sidedata_8sidedata__SideDataContainer), __Pyx_ImportType_CheckSize_Warn);
8927 if (!__pyx_ptype_2av_8sidedata_8sidedata__SideDataContainer) __PYX_ERR(7, 18, __pyx_L1_error)
8928 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8929 __pyx_t_1 = PyImport_ImportModule("av.frame"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 7, __pyx_L1_error)
8930 __Pyx_GOTREF(__pyx_t_1);
8931 __pyx_ptype_2av_5frame_Frame = __Pyx_ImportType(__pyx_t_1, "av.frame", "Frame", sizeof(struct __pyx_obj_2av_5frame_Frame), __Pyx_ImportType_CheckSize_Warn);
8932 if (!__pyx_ptype_2av_5frame_Frame) __PYX_ERR(8, 7, __pyx_L1_error)
8933 __pyx_vtabptr_2av_5frame_Frame = (struct __pyx_vtabstruct_2av_5frame_Frame*)__Pyx_GetVtable(__pyx_ptype_2av_5frame_Frame->tp_dict); if (unlikely(!__pyx_vtabptr_2av_5frame_Frame)) __PYX_ERR(8, 7, __pyx_L1_error)
8934 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8935 __pyx_t_1 = PyImport_ImportModule("av.codec.context"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 10, __pyx_L1_error)
8936 __Pyx_GOTREF(__pyx_t_1);
8937 __pyx_ptype_2av_5codec_7context_CodecContext = __Pyx_ImportType(__pyx_t_1, "av.codec.context", "CodecContext", sizeof(struct __pyx_obj_2av_5codec_7context_CodecContext), __Pyx_ImportType_CheckSize_Warn);
8938 if (!__pyx_ptype_2av_5codec_7context_CodecContext) __PYX_ERR(9, 10, __pyx_L1_error)
8939 __pyx_vtabptr_2av_5codec_7context_CodecContext = (struct __pyx_vtabstruct_2av_5codec_7context_CodecContext*)__Pyx_GetVtable(__pyx_ptype_2av_5codec_7context_CodecContext->tp_dict); if (unlikely(!__pyx_vtabptr_2av_5codec_7context_CodecContext)) __PYX_ERR(9, 10, __pyx_L1_error)
8940 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8941 __pyx_t_1 = PyImport_ImportModule("av.container.streams"); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 4, __pyx_L1_error)
8942 __Pyx_GOTREF(__pyx_t_1);
8943 __pyx_ptype_2av_9container_7streams_StreamContainer = __Pyx_ImportType(__pyx_t_1, "av.container.streams", "StreamContainer", sizeof(struct __pyx_obj_2av_9container_7streams_StreamContainer), __Pyx_ImportType_CheckSize_Warn);
8944 if (!__pyx_ptype_2av_9container_7streams_StreamContainer) __PYX_ERR(10, 4, __pyx_L1_error)
8945 __pyx_vtabptr_2av_9container_7streams_StreamContainer = (struct __pyx_vtabstruct_2av_9container_7streams_StreamContainer*)__Pyx_GetVtable(__pyx_ptype_2av_9container_7streams_StreamContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2av_9container_7streams_StreamContainer)) __PYX_ERR(10, 4, __pyx_L1_error)
8946 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8947 __pyx_t_1 = PyImport_ImportModule("av.format"); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 4, __pyx_L1_error)
8948 __Pyx_GOTREF(__pyx_t_1);
8949 __pyx_ptype_2av_6format_ContainerFormat = __Pyx_ImportType(__pyx_t_1, "av.format", "ContainerFormat", sizeof(struct __pyx_obj_2av_6format_ContainerFormat), __Pyx_ImportType_CheckSize_Warn);
8950 if (!__pyx_ptype_2av_6format_ContainerFormat) __PYX_ERR(11, 4, __pyx_L1_error)
8951 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8952 __pyx_t_1 = PyImport_ImportModule("av.container.core"); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 15, __pyx_L1_error)
8953 __Pyx_GOTREF(__pyx_t_1);
8954 __pyx_ptype_2av_9container_4core_Container = __Pyx_ImportType(__pyx_t_1, "av.container.core", "Container", sizeof(struct __pyx_obj_2av_9container_4core_Container), __Pyx_ImportType_CheckSize_Warn);
8955 if (!__pyx_ptype_2av_9container_4core_Container) __PYX_ERR(12, 15, __pyx_L1_error)
8956 __pyx_vtabptr_2av_9container_4core_Container = (struct __pyx_vtabstruct_2av_9container_4core_Container*)__Pyx_GetVtable(__pyx_ptype_2av_9container_4core_Container->tp_dict); if (unlikely(!__pyx_vtabptr_2av_9container_4core_Container)) __PYX_ERR(12, 15, __pyx_L1_error)
8957 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8958 __pyx_t_1 = PyImport_ImportModule("av.stream"); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 10, __pyx_L1_error)
8959 __Pyx_GOTREF(__pyx_t_1);
8960 __pyx_ptype_2av_6stream_Stream = __Pyx_ImportType(__pyx_t_1, "av.stream", "Stream", sizeof(struct __pyx_obj_2av_6stream_Stream), __Pyx_ImportType_CheckSize_Warn);
8961 if (!__pyx_ptype_2av_6stream_Stream) __PYX_ERR(13, 10, __pyx_L1_error)
8962 __pyx_vtabptr_2av_6stream_Stream = (struct __pyx_vtabstruct_2av_6stream_Stream*)__Pyx_GetVtable(__pyx_ptype_2av_6stream_Stream->tp_dict); if (unlikely(!__pyx_vtabptr_2av_6stream_Stream)) __PYX_ERR(13, 10, __pyx_L1_error)
8963 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8964 __pyx_t_1 = PyImport_ImportModule("av.packet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 8, __pyx_L1_error)
8965 __Pyx_GOTREF(__pyx_t_1);
8966 __pyx_ptype_2av_6packet_Packet = __Pyx_ImportType(__pyx_t_1, "av.packet", "Packet", sizeof(struct __pyx_obj_2av_6packet_Packet), __Pyx_ImportType_CheckSize_Warn);
8967 if (!__pyx_ptype_2av_6packet_Packet) __PYX_ERR(14, 8, __pyx_L1_error)
8968 __pyx_vtabptr_2av_6packet_Packet = (struct __pyx_vtabstruct_2av_6packet_Packet*)__Pyx_GetVtable(__pyx_ptype_2av_6packet_Packet->tp_dict); if (unlikely(!__pyx_vtabptr_2av_6packet_Packet)) __PYX_ERR(14, 8, __pyx_L1_error)
8969 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8970 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 9, __pyx_L1_error)
8971 __Pyx_GOTREF(__pyx_t_1);
8972 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
8973 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8974 sizeof(PyTypeObject),
8975 #else
8976 sizeof(PyHeapTypeObject),
8977 #endif
8978 __Pyx_ImportType_CheckSize_Warn);
8979 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(15, 9, __pyx_L1_error)
8980 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8981 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 8, __pyx_L1_error)
8982 __Pyx_GOTREF(__pyx_t_1);
8983 __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
8984 if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(16, 8, __pyx_L1_error)
8985 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8986 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 15, __pyx_L1_error)
8987 __Pyx_GOTREF(__pyx_t_1);
8988 __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
8989 if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(17, 15, __pyx_L1_error)
8990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8991 __Pyx_RefNannyFinishContext();
8992 return 0;
8993 __pyx_L1_error:;
8994 __Pyx_XDECREF(__pyx_t_1);
8995 __Pyx_RefNannyFinishContext();
8996 return -1;
8997 }
8998
__Pyx_modinit_variable_import_code(void)8999 static int __Pyx_modinit_variable_import_code(void) {
9000 __Pyx_RefNannyDeclarations
9001 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
9002 /*--- Variable import code ---*/
9003 __Pyx_RefNannyFinishContext();
9004 return 0;
9005 }
9006
__Pyx_modinit_function_import_code(void)9007 static int __Pyx_modinit_function_import_code(void) {
9008 __Pyx_RefNannyDeclarations
9009 PyObject *__pyx_t_1 = NULL;
9010 int __pyx_lineno = 0;
9011 const char *__pyx_filename = NULL;
9012 int __pyx_clineno = 0;
9013 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
9014 /*--- Function import code ---*/
9015 __pyx_t_1 = PyImport_ImportModule("av.dictionary"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error)
9016 __Pyx_GOTREF(__pyx_t_1);
9017 if (__Pyx_ImportFunction(__pyx_t_1, "wrap_dictionary", (void (**)(void))&__pyx_f_2av_10dictionary_wrap_dictionary, "struct __pyx_obj_2av_10dictionary__Dictionary *(AVDictionary *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9018 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9019 __Pyx_RefNannyFinishContext();
9020 return 0;
9021 __pyx_L1_error:;
9022 __Pyx_XDECREF(__pyx_t_1);
9023 __Pyx_RefNannyFinishContext();
9024 return -1;
9025 }
9026
9027
9028 #ifndef CYTHON_NO_PYINIT_EXPORT
9029 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
9030 #elif PY_MAJOR_VERSION < 3
9031 #ifdef __cplusplus
9032 #define __Pyx_PyMODINIT_FUNC extern "C" void
9033 #else
9034 #define __Pyx_PyMODINIT_FUNC void
9035 #endif
9036 #else
9037 #ifdef __cplusplus
9038 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
9039 #else
9040 #define __Pyx_PyMODINIT_FUNC PyObject *
9041 #endif
9042 #endif
9043
9044
9045 #if PY_MAJOR_VERSION < 3
9046 __Pyx_PyMODINIT_FUNC initsubtitle(void) CYTHON_SMALL_CODE; /*proto*/
initsubtitle(void)9047 __Pyx_PyMODINIT_FUNC initsubtitle(void)
9048 #else
9049 __Pyx_PyMODINIT_FUNC PyInit_subtitle(void) CYTHON_SMALL_CODE; /*proto*/
9050 __Pyx_PyMODINIT_FUNC PyInit_subtitle(void)
9051 #if CYTHON_PEP489_MULTI_PHASE_INIT
9052 {
9053 return PyModuleDef_Init(&__pyx_moduledef);
9054 }
9055 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
9056 #if PY_VERSION_HEX >= 0x030700A1
9057 static PY_INT64_T main_interpreter_id = -1;
9058 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
9059 if (main_interpreter_id == -1) {
9060 main_interpreter_id = current_id;
9061 return (unlikely(current_id == -1)) ? -1 : 0;
9062 } else if (unlikely(main_interpreter_id != current_id))
9063 #else
9064 static PyInterpreterState *main_interpreter = NULL;
9065 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
9066 if (!main_interpreter) {
9067 main_interpreter = current_interpreter;
9068 } else if (unlikely(main_interpreter != current_interpreter))
9069 #endif
9070 {
9071 PyErr_SetString(
9072 PyExc_ImportError,
9073 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
9074 return -1;
9075 }
9076 return 0;
9077 }
9078 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) {
9079 PyObject *value = PyObject_GetAttrString(spec, from_name);
9080 int result = 0;
9081 if (likely(value)) {
9082 if (allow_none || value != Py_None) {
9083 result = PyDict_SetItemString(moddict, to_name, value);
9084 }
9085 Py_DECREF(value);
9086 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
9087 PyErr_Clear();
9088 } else {
9089 result = -1;
9090 }
9091 return result;
9092 }
9093 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
9094 PyObject *module = NULL, *moddict, *modname;
9095 if (__Pyx_check_single_interpreter())
9096 return NULL;
9097 if (__pyx_m)
9098 return __Pyx_NewRef(__pyx_m);
9099 modname = PyObject_GetAttrString(spec, "name");
9100 if (unlikely(!modname)) goto bad;
9101 module = PyModule_NewObject(modname);
9102 Py_DECREF(modname);
9103 if (unlikely(!module)) goto bad;
9104 moddict = PyModule_GetDict(module);
9105 if (unlikely(!moddict)) goto bad;
9106 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
9107 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
9108 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
9109 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
9110 return module;
9111 bad:
9112 Py_XDECREF(module);
9113 return NULL;
9114 }
9115
9116
9117 static CYTHON_SMALL_CODE int __pyx_pymod_exec_subtitle(PyObject *__pyx_pyinit_module)
9118 #endif
9119 #endif
9120 {
9121 PyObject *__pyx_t_1 = NULL;
9122 int __pyx_lineno = 0;
9123 const char *__pyx_filename = NULL;
9124 int __pyx_clineno = 0;
9125 __Pyx_RefNannyDeclarations
9126 #if CYTHON_PEP489_MULTI_PHASE_INIT
9127 if (__pyx_m) {
9128 if (__pyx_m == __pyx_pyinit_module) return 0;
9129 PyErr_SetString(PyExc_RuntimeError, "Module 'subtitle' has already been imported. Re-initialisation is not supported.");
9130 return -1;
9131 }
9132 #elif PY_MAJOR_VERSION >= 3
9133 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
9134 #endif
9135 #if CYTHON_REFNANNY
9136 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
9137 if (!__Pyx_RefNanny) {
9138 PyErr_Clear();
9139 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
9140 if (!__Pyx_RefNanny)
9141 Py_FatalError("failed to import 'refnanny' module");
9142 }
9143 #endif
9144 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_subtitle(void)", 0);
9145 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9146 #ifdef __Pxy_PyFrame_Initialize_Offsets
9147 __Pxy_PyFrame_Initialize_Offsets();
9148 #endif
9149 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
9150 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
9151 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
9152 #ifdef __Pyx_CyFunction_USED
9153 if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9154 #endif
9155 #ifdef __Pyx_FusedFunction_USED
9156 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9157 #endif
9158 #ifdef __Pyx_Coroutine_USED
9159 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9160 #endif
9161 #ifdef __Pyx_Generator_USED
9162 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9163 #endif
9164 #ifdef __Pyx_AsyncGen_USED
9165 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9166 #endif
9167 #ifdef __Pyx_StopAsyncIteration_USED
9168 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9169 #endif
9170 /*--- Library function declarations ---*/
9171 /*--- Threads initialization code ---*/
9172 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
9173 #ifdef WITH_THREAD /* Python build with threading support? */
9174 PyEval_InitThreads();
9175 #endif
9176 #endif
9177 /*--- Module creation code ---*/
9178 #if CYTHON_PEP489_MULTI_PHASE_INIT
9179 __pyx_m = __pyx_pyinit_module;
9180 Py_INCREF(__pyx_m);
9181 #else
9182 #if PY_MAJOR_VERSION < 3
9183 __pyx_m = Py_InitModule4("subtitle", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
9184 #else
9185 __pyx_m = PyModule_Create(&__pyx_moduledef);
9186 #endif
9187 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
9188 #endif
9189 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
9190 Py_INCREF(__pyx_d);
9191 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
9192 Py_INCREF(__pyx_b);
9193 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
9194 Py_INCREF(__pyx_cython_runtime);
9195 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
9196 /*--- Initialize various global constants etc. ---*/
9197 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9198 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
9199 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9200 #endif
9201 if (__pyx_module_is_main_av__subtitles__subtitle) {
9202 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9203 }
9204 #if PY_MAJOR_VERSION >= 3
9205 {
9206 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
9207 if (!PyDict_GetItemString(modules, "av.subtitles.subtitle")) {
9208 if (unlikely(PyDict_SetItemString(modules, "av.subtitles.subtitle", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
9209 }
9210 }
9211 #endif
9212 /*--- Builtin init code ---*/
9213 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9214 /*--- Constants init code ---*/
9215 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9216 /*--- Global type/function init code ---*/
9217 (void)__Pyx_modinit_global_init_code();
9218 (void)__Pyx_modinit_variable_export_code();
9219 (void)__Pyx_modinit_function_export_code();
9220 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
9221 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
9222 (void)__Pyx_modinit_variable_import_code();
9223 if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
9224 /*--- Execution code ---*/
9225 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
9226 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9227 #endif
9228
9229 /* "av/subtitles/subtitle.pyx":1
9230 * from cpython cimport PyBuffer_FillInfo # <<<<<<<<<<<<<<
9231 *
9232 *
9233 */
9234 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
9235 __Pyx_GOTREF(__pyx_t_1);
9236 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9237 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9238
9239 /*--- Wrapped vars code ---*/
9240
9241 goto __pyx_L0;
9242 __pyx_L1_error:;
9243 __Pyx_XDECREF(__pyx_t_1);
9244 if (__pyx_m) {
9245 if (__pyx_d) {
9246 __Pyx_AddTraceback("init av.subtitles.subtitle", __pyx_clineno, __pyx_lineno, __pyx_filename);
9247 }
9248 Py_CLEAR(__pyx_m);
9249 } else if (!PyErr_Occurred()) {
9250 PyErr_SetString(PyExc_ImportError, "init av.subtitles.subtitle");
9251 }
9252 __pyx_L0:;
9253 __Pyx_RefNannyFinishContext();
9254 #if CYTHON_PEP489_MULTI_PHASE_INIT
9255 return (__pyx_m != NULL) ? 0 : -1;
9256 #elif PY_MAJOR_VERSION >= 3
9257 return __pyx_m;
9258 #else
9259 return;
9260 #endif
9261 }
9262
9263 /* --- Runtime support code --- */
9264 /* Refnanny */
9265 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)9266 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
9267 PyObject *m = NULL, *p = NULL;
9268 void *r = NULL;
9269 m = PyImport_ImportModule(modname);
9270 if (!m) goto end;
9271 p = PyObject_GetAttrString(m, "RefNannyAPI");
9272 if (!p) goto end;
9273 r = PyLong_AsVoidPtr(p);
9274 end:
9275 Py_XDECREF(p);
9276 Py_XDECREF(m);
9277 return (__Pyx_RefNannyAPIStruct *)r;
9278 }
9279 #endif
9280
9281 /* PyObjectGetAttrStr */
9282 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)9283 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
9284 PyTypeObject* tp = Py_TYPE(obj);
9285 if (likely(tp->tp_getattro))
9286 return tp->tp_getattro(obj, attr_name);
9287 #if PY_MAJOR_VERSION < 3
9288 if (likely(tp->tp_getattr))
9289 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
9290 #endif
9291 return PyObject_GetAttr(obj, attr_name);
9292 }
9293 #endif
9294
9295 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)9296 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
9297 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
9298 if (unlikely(!result)) {
9299 PyErr_Format(PyExc_NameError,
9300 #if PY_MAJOR_VERSION >= 3
9301 "name '%U' is not defined", name);
9302 #else
9303 "name '%.200s' is not defined", PyString_AS_STRING(name));
9304 #endif
9305 }
9306 return result;
9307 }
9308
9309 /* PyObjectCall */
9310 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)9311 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
9312 PyObject *result;
9313 ternaryfunc call = func->ob_type->tp_call;
9314 if (unlikely(!call))
9315 return PyObject_Call(func, arg, kw);
9316 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
9317 return NULL;
9318 result = (*call)(func, arg, kw);
9319 Py_LeaveRecursiveCall();
9320 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
9321 PyErr_SetString(
9322 PyExc_SystemError,
9323 "NULL result without error in PyObject_Call");
9324 }
9325 return result;
9326 }
9327 #endif
9328
9329 /* PyErrFetchRestore */
9330 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)9331 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9332 PyObject *tmp_type, *tmp_value, *tmp_tb;
9333 tmp_type = tstate->curexc_type;
9334 tmp_value = tstate->curexc_value;
9335 tmp_tb = tstate->curexc_traceback;
9336 tstate->curexc_type = type;
9337 tstate->curexc_value = value;
9338 tstate->curexc_traceback = tb;
9339 Py_XDECREF(tmp_type);
9340 Py_XDECREF(tmp_value);
9341 Py_XDECREF(tmp_tb);
9342 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)9343 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9344 *type = tstate->curexc_type;
9345 *value = tstate->curexc_value;
9346 *tb = tstate->curexc_traceback;
9347 tstate->curexc_type = 0;
9348 tstate->curexc_value = 0;
9349 tstate->curexc_traceback = 0;
9350 }
9351 #endif
9352
9353 /* RaiseException */
9354 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)9355 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
9356 CYTHON_UNUSED PyObject *cause) {
9357 __Pyx_PyThreadState_declare
9358 Py_XINCREF(type);
9359 if (!value || value == Py_None)
9360 value = NULL;
9361 else
9362 Py_INCREF(value);
9363 if (!tb || tb == Py_None)
9364 tb = NULL;
9365 else {
9366 Py_INCREF(tb);
9367 if (!PyTraceBack_Check(tb)) {
9368 PyErr_SetString(PyExc_TypeError,
9369 "raise: arg 3 must be a traceback or None");
9370 goto raise_error;
9371 }
9372 }
9373 if (PyType_Check(type)) {
9374 #if CYTHON_COMPILING_IN_PYPY
9375 if (!value) {
9376 Py_INCREF(Py_None);
9377 value = Py_None;
9378 }
9379 #endif
9380 PyErr_NormalizeException(&type, &value, &tb);
9381 } else {
9382 if (value) {
9383 PyErr_SetString(PyExc_TypeError,
9384 "instance exception may not have a separate value");
9385 goto raise_error;
9386 }
9387 value = type;
9388 type = (PyObject*) Py_TYPE(type);
9389 Py_INCREF(type);
9390 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
9391 PyErr_SetString(PyExc_TypeError,
9392 "raise: exception class must be a subclass of BaseException");
9393 goto raise_error;
9394 }
9395 }
9396 __Pyx_PyThreadState_assign
9397 __Pyx_ErrRestore(type, value, tb);
9398 return;
9399 raise_error:
9400 Py_XDECREF(value);
9401 Py_XDECREF(type);
9402 Py_XDECREF(tb);
9403 return;
9404 }
9405 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)9406 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
9407 PyObject* owned_instance = NULL;
9408 if (tb == Py_None) {
9409 tb = 0;
9410 } else if (tb && !PyTraceBack_Check(tb)) {
9411 PyErr_SetString(PyExc_TypeError,
9412 "raise: arg 3 must be a traceback or None");
9413 goto bad;
9414 }
9415 if (value == Py_None)
9416 value = 0;
9417 if (PyExceptionInstance_Check(type)) {
9418 if (value) {
9419 PyErr_SetString(PyExc_TypeError,
9420 "instance exception may not have a separate value");
9421 goto bad;
9422 }
9423 value = type;
9424 type = (PyObject*) Py_TYPE(value);
9425 } else if (PyExceptionClass_Check(type)) {
9426 PyObject *instance_class = NULL;
9427 if (value && PyExceptionInstance_Check(value)) {
9428 instance_class = (PyObject*) Py_TYPE(value);
9429 if (instance_class != type) {
9430 int is_subclass = PyObject_IsSubclass(instance_class, type);
9431 if (!is_subclass) {
9432 instance_class = NULL;
9433 } else if (unlikely(is_subclass == -1)) {
9434 goto bad;
9435 } else {
9436 type = instance_class;
9437 }
9438 }
9439 }
9440 if (!instance_class) {
9441 PyObject *args;
9442 if (!value)
9443 args = PyTuple_New(0);
9444 else if (PyTuple_Check(value)) {
9445 Py_INCREF(value);
9446 args = value;
9447 } else
9448 args = PyTuple_Pack(1, value);
9449 if (!args)
9450 goto bad;
9451 owned_instance = PyObject_Call(type, args, NULL);
9452 Py_DECREF(args);
9453 if (!owned_instance)
9454 goto bad;
9455 value = owned_instance;
9456 if (!PyExceptionInstance_Check(value)) {
9457 PyErr_Format(PyExc_TypeError,
9458 "calling %R should have returned an instance of "
9459 "BaseException, not %R",
9460 type, Py_TYPE(value));
9461 goto bad;
9462 }
9463 }
9464 } else {
9465 PyErr_SetString(PyExc_TypeError,
9466 "raise: exception class must be a subclass of BaseException");
9467 goto bad;
9468 }
9469 if (cause) {
9470 PyObject *fixed_cause;
9471 if (cause == Py_None) {
9472 fixed_cause = NULL;
9473 } else if (PyExceptionClass_Check(cause)) {
9474 fixed_cause = PyObject_CallObject(cause, NULL);
9475 if (fixed_cause == NULL)
9476 goto bad;
9477 } else if (PyExceptionInstance_Check(cause)) {
9478 fixed_cause = cause;
9479 Py_INCREF(fixed_cause);
9480 } else {
9481 PyErr_SetString(PyExc_TypeError,
9482 "exception causes must derive from "
9483 "BaseException");
9484 goto bad;
9485 }
9486 PyException_SetCause(value, fixed_cause);
9487 }
9488 PyErr_SetObject(type, value);
9489 if (tb) {
9490 #if CYTHON_COMPILING_IN_PYPY
9491 PyObject *tmp_type, *tmp_value, *tmp_tb;
9492 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
9493 Py_INCREF(tb);
9494 PyErr_Restore(tmp_type, tmp_value, tb);
9495 Py_XDECREF(tmp_tb);
9496 #else
9497 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9498 PyObject* tmp_tb = tstate->curexc_traceback;
9499 if (tb != tmp_tb) {
9500 Py_INCREF(tb);
9501 tstate->curexc_traceback = tb;
9502 Py_XDECREF(tmp_tb);
9503 }
9504 #endif
9505 }
9506 bad:
9507 Py_XDECREF(owned_instance);
9508 return;
9509 }
9510 #endif
9511
9512 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)9513 static void __Pyx_RaiseDoubleKeywordsError(
9514 const char* func_name,
9515 PyObject* kw_name)
9516 {
9517 PyErr_Format(PyExc_TypeError,
9518 #if PY_MAJOR_VERSION >= 3
9519 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
9520 #else
9521 "%s() got multiple values for keyword argument '%s'", func_name,
9522 PyString_AsString(kw_name));
9523 #endif
9524 }
9525
9526 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)9527 static int __Pyx_ParseOptionalKeywords(
9528 PyObject *kwds,
9529 PyObject **argnames[],
9530 PyObject *kwds2,
9531 PyObject *values[],
9532 Py_ssize_t num_pos_args,
9533 const char* function_name)
9534 {
9535 PyObject *key = 0, *value = 0;
9536 Py_ssize_t pos = 0;
9537 PyObject*** name;
9538 PyObject*** first_kw_arg = argnames + num_pos_args;
9539 while (PyDict_Next(kwds, &pos, &key, &value)) {
9540 name = first_kw_arg;
9541 while (*name && (**name != key)) name++;
9542 if (*name) {
9543 values[name-argnames] = value;
9544 continue;
9545 }
9546 name = first_kw_arg;
9547 #if PY_MAJOR_VERSION < 3
9548 if (likely(PyString_Check(key))) {
9549 while (*name) {
9550 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
9551 && _PyString_Eq(**name, key)) {
9552 values[name-argnames] = value;
9553 break;
9554 }
9555 name++;
9556 }
9557 if (*name) continue;
9558 else {
9559 PyObject*** argname = argnames;
9560 while (argname != first_kw_arg) {
9561 if ((**argname == key) || (
9562 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
9563 && _PyString_Eq(**argname, key))) {
9564 goto arg_passed_twice;
9565 }
9566 argname++;
9567 }
9568 }
9569 } else
9570 #endif
9571 if (likely(PyUnicode_Check(key))) {
9572 while (*name) {
9573 int cmp = (**name == key) ? 0 :
9574 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
9575 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
9576 #endif
9577 PyUnicode_Compare(**name, key);
9578 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9579 if (cmp == 0) {
9580 values[name-argnames] = value;
9581 break;
9582 }
9583 name++;
9584 }
9585 if (*name) continue;
9586 else {
9587 PyObject*** argname = argnames;
9588 while (argname != first_kw_arg) {
9589 int cmp = (**argname == key) ? 0 :
9590 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
9591 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
9592 #endif
9593 PyUnicode_Compare(**argname, key);
9594 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9595 if (cmp == 0) goto arg_passed_twice;
9596 argname++;
9597 }
9598 }
9599 } else
9600 goto invalid_keyword_type;
9601 if (kwds2) {
9602 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
9603 } else {
9604 goto invalid_keyword;
9605 }
9606 }
9607 return 0;
9608 arg_passed_twice:
9609 __Pyx_RaiseDoubleKeywordsError(function_name, key);
9610 goto bad;
9611 invalid_keyword_type:
9612 PyErr_Format(PyExc_TypeError,
9613 "%.200s() keywords must be strings", function_name);
9614 goto bad;
9615 invalid_keyword:
9616 PyErr_Format(PyExc_TypeError,
9617 #if PY_MAJOR_VERSION < 3
9618 "%.200s() got an unexpected keyword argument '%.200s'",
9619 function_name, PyString_AsString(key));
9620 #else
9621 "%s() got an unexpected keyword argument '%U'",
9622 function_name, key);
9623 #endif
9624 bad:
9625 return -1;
9626 }
9627
9628 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)9629 static void __Pyx_RaiseArgtupleInvalid(
9630 const char* func_name,
9631 int exact,
9632 Py_ssize_t num_min,
9633 Py_ssize_t num_max,
9634 Py_ssize_t num_found)
9635 {
9636 Py_ssize_t num_expected;
9637 const char *more_or_less;
9638 if (num_found < num_min) {
9639 num_expected = num_min;
9640 more_or_less = "at least";
9641 } else {
9642 num_expected = num_max;
9643 more_or_less = "at most";
9644 }
9645 if (exact) {
9646 more_or_less = "exactly";
9647 }
9648 PyErr_Format(PyExc_TypeError,
9649 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
9650 func_name, more_or_less, num_expected,
9651 (num_expected == 1) ? "" : "s", num_found);
9652 }
9653
9654 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)9655 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
9656 {
9657 if (unlikely(!type)) {
9658 PyErr_SetString(PyExc_SystemError, "Missing type object");
9659 return 0;
9660 }
9661 else if (exact) {
9662 #if PY_MAJOR_VERSION == 2
9663 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
9664 #endif
9665 }
9666 else {
9667 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
9668 }
9669 PyErr_Format(PyExc_TypeError,
9670 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
9671 name, type->tp_name, Py_TYPE(obj)->tp_name);
9672 return 0;
9673 }
9674
9675 /* None */
__Pyx_RaiseClosureNameError(const char * varname)9676 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
9677 PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
9678 }
9679
9680 /* PyCFunctionFastCall */
9681 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)9682 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
9683 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
9684 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
9685 PyObject *self = PyCFunction_GET_SELF(func);
9686 int flags = PyCFunction_GET_FLAGS(func);
9687 assert(PyCFunction_Check(func));
9688 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
9689 assert(nargs >= 0);
9690 assert(nargs == 0 || args != NULL);
9691 /* _PyCFunction_FastCallDict() must not be called with an exception set,
9692 because it may clear it (directly or indirectly) and so the
9693 caller loses its exception */
9694 assert(!PyErr_Occurred());
9695 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
9696 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
9697 } else {
9698 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
9699 }
9700 }
9701 #endif
9702
9703 /* PyFunctionFastCall */
9704 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)9705 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
9706 PyObject *globals) {
9707 PyFrameObject *f;
9708 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9709 PyObject **fastlocals;
9710 Py_ssize_t i;
9711 PyObject *result;
9712 assert(globals != NULL);
9713 /* XXX Perhaps we should create a specialized
9714 PyFrame_New() that doesn't take locals, but does
9715 take builtins without sanity checking them.
9716 */
9717 assert(tstate != NULL);
9718 f = PyFrame_New(tstate, co, globals, NULL);
9719 if (f == NULL) {
9720 return NULL;
9721 }
9722 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
9723 for (i = 0; i < na; i++) {
9724 Py_INCREF(*args);
9725 fastlocals[i] = *args++;
9726 }
9727 result = PyEval_EvalFrameEx(f,0);
9728 ++tstate->recursion_depth;
9729 Py_DECREF(f);
9730 --tstate->recursion_depth;
9731 return result;
9732 }
9733 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)9734 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
9735 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
9736 PyObject *globals = PyFunction_GET_GLOBALS(func);
9737 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
9738 PyObject *closure;
9739 #if PY_MAJOR_VERSION >= 3
9740 PyObject *kwdefs;
9741 #endif
9742 PyObject *kwtuple, **k;
9743 PyObject **d;
9744 Py_ssize_t nd;
9745 Py_ssize_t nk;
9746 PyObject *result;
9747 assert(kwargs == NULL || PyDict_Check(kwargs));
9748 nk = kwargs ? PyDict_Size(kwargs) : 0;
9749 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
9750 return NULL;
9751 }
9752 if (
9753 #if PY_MAJOR_VERSION >= 3
9754 co->co_kwonlyargcount == 0 &&
9755 #endif
9756 likely(kwargs == NULL || nk == 0) &&
9757 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
9758 if (argdefs == NULL && co->co_argcount == nargs) {
9759 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
9760 goto done;
9761 }
9762 else if (nargs == 0 && argdefs != NULL
9763 && co->co_argcount == Py_SIZE(argdefs)) {
9764 /* function called with no arguments, but all parameters have
9765 a default value: use default values as arguments .*/
9766 args = &PyTuple_GET_ITEM(argdefs, 0);
9767 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
9768 goto done;
9769 }
9770 }
9771 if (kwargs != NULL) {
9772 Py_ssize_t pos, i;
9773 kwtuple = PyTuple_New(2 * nk);
9774 if (kwtuple == NULL) {
9775 result = NULL;
9776 goto done;
9777 }
9778 k = &PyTuple_GET_ITEM(kwtuple, 0);
9779 pos = i = 0;
9780 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
9781 Py_INCREF(k[i]);
9782 Py_INCREF(k[i+1]);
9783 i += 2;
9784 }
9785 nk = i / 2;
9786 }
9787 else {
9788 kwtuple = NULL;
9789 k = NULL;
9790 }
9791 closure = PyFunction_GET_CLOSURE(func);
9792 #if PY_MAJOR_VERSION >= 3
9793 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
9794 #endif
9795 if (argdefs != NULL) {
9796 d = &PyTuple_GET_ITEM(argdefs, 0);
9797 nd = Py_SIZE(argdefs);
9798 }
9799 else {
9800 d = NULL;
9801 nd = 0;
9802 }
9803 #if PY_MAJOR_VERSION >= 3
9804 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
9805 args, (int)nargs,
9806 k, (int)nk,
9807 d, (int)nd, kwdefs, closure);
9808 #else
9809 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
9810 args, (int)nargs,
9811 k, (int)nk,
9812 d, (int)nd, closure);
9813 #endif
9814 Py_XDECREF(kwtuple);
9815 done:
9816 Py_LeaveRecursiveCall();
9817 return result;
9818 }
9819 #endif
9820 #endif
9821
9822 /* PyObjectCallMethO */
9823 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)9824 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
9825 PyObject *self, *result;
9826 PyCFunction cfunc;
9827 cfunc = PyCFunction_GET_FUNCTION(func);
9828 self = PyCFunction_GET_SELF(func);
9829 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
9830 return NULL;
9831 result = cfunc(self, arg);
9832 Py_LeaveRecursiveCall();
9833 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
9834 PyErr_SetString(
9835 PyExc_SystemError,
9836 "NULL result without error in PyObject_Call");
9837 }
9838 return result;
9839 }
9840 #endif
9841
9842 /* PyObjectCallOneArg */
9843 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)9844 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
9845 PyObject *result;
9846 PyObject *args = PyTuple_New(1);
9847 if (unlikely(!args)) return NULL;
9848 Py_INCREF(arg);
9849 PyTuple_SET_ITEM(args, 0, arg);
9850 result = __Pyx_PyObject_Call(func, args, NULL);
9851 Py_DECREF(args);
9852 return result;
9853 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)9854 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
9855 #if CYTHON_FAST_PYCALL
9856 if (PyFunction_Check(func)) {
9857 return __Pyx_PyFunction_FastCall(func, &arg, 1);
9858 }
9859 #endif
9860 if (likely(PyCFunction_Check(func))) {
9861 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
9862 return __Pyx_PyObject_CallMethO(func, arg);
9863 #if CYTHON_FAST_PYCCALL
9864 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
9865 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
9866 #endif
9867 }
9868 }
9869 return __Pyx__PyObject_CallOneArg(func, arg);
9870 }
9871 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)9872 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
9873 PyObject *result;
9874 PyObject *args = PyTuple_Pack(1, arg);
9875 if (unlikely(!args)) return NULL;
9876 result = __Pyx_PyObject_Call(func, args, NULL);
9877 Py_DECREF(args);
9878 return result;
9879 }
9880 #endif
9881
9882 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)9883 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
9884 PyObject *r;
9885 if (!j) return NULL;
9886 r = PyObject_GetItem(o, j);
9887 Py_DECREF(j);
9888 return r;
9889 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)9890 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
9891 CYTHON_NCP_UNUSED int wraparound,
9892 CYTHON_NCP_UNUSED int boundscheck) {
9893 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9894 Py_ssize_t wrapped_i = i;
9895 if (wraparound & unlikely(i < 0)) {
9896 wrapped_i += PyList_GET_SIZE(o);
9897 }
9898 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
9899 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
9900 Py_INCREF(r);
9901 return r;
9902 }
9903 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9904 #else
9905 return PySequence_GetItem(o, i);
9906 #endif
9907 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)9908 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
9909 CYTHON_NCP_UNUSED int wraparound,
9910 CYTHON_NCP_UNUSED int boundscheck) {
9911 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9912 Py_ssize_t wrapped_i = i;
9913 if (wraparound & unlikely(i < 0)) {
9914 wrapped_i += PyTuple_GET_SIZE(o);
9915 }
9916 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
9917 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
9918 Py_INCREF(r);
9919 return r;
9920 }
9921 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9922 #else
9923 return PySequence_GetItem(o, i);
9924 #endif
9925 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)9926 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
9927 CYTHON_NCP_UNUSED int wraparound,
9928 CYTHON_NCP_UNUSED int boundscheck) {
9929 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
9930 if (is_list || PyList_CheckExact(o)) {
9931 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
9932 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
9933 PyObject *r = PyList_GET_ITEM(o, n);
9934 Py_INCREF(r);
9935 return r;
9936 }
9937 }
9938 else if (PyTuple_CheckExact(o)) {
9939 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
9940 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
9941 PyObject *r = PyTuple_GET_ITEM(o, n);
9942 Py_INCREF(r);
9943 return r;
9944 }
9945 } else {
9946 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
9947 if (likely(m && m->sq_item)) {
9948 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
9949 Py_ssize_t l = m->sq_length(o);
9950 if (likely(l >= 0)) {
9951 i += l;
9952 } else {
9953 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
9954 return NULL;
9955 PyErr_Clear();
9956 }
9957 }
9958 return m->sq_item(o, i);
9959 }
9960 }
9961 #else
9962 if (is_list || PySequence_Check(o)) {
9963 return PySequence_GetItem(o, i);
9964 }
9965 #endif
9966 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9967 }
9968
9969 /* ObjectGetItem */
9970 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)9971 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
9972 PyObject *runerr;
9973 Py_ssize_t key_value;
9974 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
9975 if (unlikely(!(m && m->sq_item))) {
9976 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
9977 return NULL;
9978 }
9979 key_value = __Pyx_PyIndex_AsSsize_t(index);
9980 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
9981 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
9982 }
9983 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
9984 PyErr_Clear();
9985 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
9986 }
9987 return NULL;
9988 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)9989 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
9990 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
9991 if (likely(m && m->mp_subscript)) {
9992 return m->mp_subscript(obj, key);
9993 }
9994 return __Pyx_PyObject_GetIndex(obj, key);
9995 }
9996 #endif
9997
9998 /* PyObject_GenericGetAttrNoDict */
9999 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)10000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
10001 PyErr_Format(PyExc_AttributeError,
10002 #if PY_MAJOR_VERSION >= 3
10003 "'%.50s' object has no attribute '%U'",
10004 tp->tp_name, attr_name);
10005 #else
10006 "'%.50s' object has no attribute '%.400s'",
10007 tp->tp_name, PyString_AS_STRING(attr_name));
10008 #endif
10009 return NULL;
10010 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)10011 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
10012 PyObject *descr;
10013 PyTypeObject *tp = Py_TYPE(obj);
10014 if (unlikely(!PyString_Check(attr_name))) {
10015 return PyObject_GenericGetAttr(obj, attr_name);
10016 }
10017 assert(!tp->tp_dictoffset);
10018 descr = _PyType_Lookup(tp, attr_name);
10019 if (unlikely(!descr)) {
10020 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
10021 }
10022 Py_INCREF(descr);
10023 #if PY_MAJOR_VERSION < 3
10024 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
10025 #endif
10026 {
10027 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
10028 if (unlikely(f)) {
10029 PyObject *res = f(descr, obj, (PyObject *)tp);
10030 Py_DECREF(descr);
10031 return res;
10032 }
10033 }
10034 return descr;
10035 }
10036 #endif
10037
10038 /* PyObject_GenericGetAttr */
10039 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)10040 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
10041 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
10042 return PyObject_GenericGetAttr(obj, attr_name);
10043 }
10044 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
10045 }
10046 #endif
10047
10048 /* PyErrExceptionMatches */
10049 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)10050 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
10051 Py_ssize_t i, n;
10052 n = PyTuple_GET_SIZE(tuple);
10053 #if PY_MAJOR_VERSION >= 3
10054 for (i=0; i<n; i++) {
10055 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
10056 }
10057 #endif
10058 for (i=0; i<n; i++) {
10059 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
10060 }
10061 return 0;
10062 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)10063 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
10064 PyObject *exc_type = tstate->curexc_type;
10065 if (exc_type == err) return 1;
10066 if (unlikely(!exc_type)) return 0;
10067 if (unlikely(PyTuple_Check(err)))
10068 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
10069 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
10070 }
10071 #endif
10072
10073 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)10074 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
10075 __Pyx_PyThreadState_declare
10076 __Pyx_PyThreadState_assign
10077 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
10078 __Pyx_PyErr_Clear();
10079 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)10080 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
10081 PyObject *result;
10082 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
10083 PyTypeObject* tp = Py_TYPE(obj);
10084 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
10085 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
10086 }
10087 #endif
10088 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
10089 if (unlikely(!result)) {
10090 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
10091 }
10092 return result;
10093 }
10094
10095 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)10096 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
10097 int ret;
10098 PyObject *name_attr;
10099 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
10100 if (likely(name_attr)) {
10101 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
10102 } else {
10103 ret = -1;
10104 }
10105 if (unlikely(ret < 0)) {
10106 PyErr_Clear();
10107 ret = 0;
10108 }
10109 Py_XDECREF(name_attr);
10110 return ret;
10111 }
__Pyx_setup_reduce(PyObject * type_obj)10112 static int __Pyx_setup_reduce(PyObject* type_obj) {
10113 int ret = 0;
10114 PyObject *object_reduce = NULL;
10115 PyObject *object_reduce_ex = NULL;
10116 PyObject *reduce = NULL;
10117 PyObject *reduce_ex = NULL;
10118 PyObject *reduce_cython = NULL;
10119 PyObject *setstate = NULL;
10120 PyObject *setstate_cython = NULL;
10121 #if CYTHON_USE_PYTYPE_LOOKUP
10122 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
10123 #else
10124 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
10125 #endif
10126 #if CYTHON_USE_PYTYPE_LOOKUP
10127 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
10128 #else
10129 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
10130 #endif
10131 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
10132 if (reduce_ex == object_reduce_ex) {
10133 #if CYTHON_USE_PYTYPE_LOOKUP
10134 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
10135 #else
10136 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
10137 #endif
10138 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
10139 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
10140 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
10141 if (likely(reduce_cython)) {
10142 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
10143 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
10144 } else if (reduce == object_reduce || PyErr_Occurred()) {
10145 goto __PYX_BAD;
10146 }
10147 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
10148 if (!setstate) PyErr_Clear();
10149 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
10150 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
10151 if (likely(setstate_cython)) {
10152 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
10153 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
10154 } else if (!setstate || PyErr_Occurred()) {
10155 goto __PYX_BAD;
10156 }
10157 }
10158 PyType_Modified((PyTypeObject*)type_obj);
10159 }
10160 }
10161 goto __PYX_GOOD;
10162 __PYX_BAD:
10163 if (!PyErr_Occurred())
10164 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
10165 ret = -1;
10166 __PYX_GOOD:
10167 #if !CYTHON_USE_PYTYPE_LOOKUP
10168 Py_XDECREF(object_reduce);
10169 Py_XDECREF(object_reduce_ex);
10170 #endif
10171 Py_XDECREF(reduce);
10172 Py_XDECREF(reduce_ex);
10173 Py_XDECREF(reduce_cython);
10174 Py_XDECREF(setstate);
10175 Py_XDECREF(setstate_cython);
10176 return ret;
10177 }
10178
10179 /* TypeImport */
10180 #ifndef __PYX_HAVE_RT_ImportType
10181 #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)10182 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
10183 size_t size, enum __Pyx_ImportType_CheckSize check_size)
10184 {
10185 PyObject *result = 0;
10186 char warning[200];
10187 Py_ssize_t basicsize;
10188 #ifdef Py_LIMITED_API
10189 PyObject *py_basicsize;
10190 #endif
10191 result = PyObject_GetAttrString(module, class_name);
10192 if (!result)
10193 goto bad;
10194 if (!PyType_Check(result)) {
10195 PyErr_Format(PyExc_TypeError,
10196 "%.200s.%.200s is not a type object",
10197 module_name, class_name);
10198 goto bad;
10199 }
10200 #ifndef Py_LIMITED_API
10201 basicsize = ((PyTypeObject *)result)->tp_basicsize;
10202 #else
10203 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
10204 if (!py_basicsize)
10205 goto bad;
10206 basicsize = PyLong_AsSsize_t(py_basicsize);
10207 Py_DECREF(py_basicsize);
10208 py_basicsize = 0;
10209 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
10210 goto bad;
10211 #endif
10212 if ((size_t)basicsize < size) {
10213 PyErr_Format(PyExc_ValueError,
10214 "%.200s.%.200s size changed, may indicate binary incompatibility. "
10215 "Expected %zd from C header, got %zd from PyObject",
10216 module_name, class_name, size, basicsize);
10217 goto bad;
10218 }
10219 if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
10220 PyErr_Format(PyExc_ValueError,
10221 "%.200s.%.200s size changed, may indicate binary incompatibility. "
10222 "Expected %zd from C header, got %zd from PyObject",
10223 module_name, class_name, size, basicsize);
10224 goto bad;
10225 }
10226 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
10227 PyOS_snprintf(warning, sizeof(warning),
10228 "%s.%s size changed, may indicate binary incompatibility. "
10229 "Expected %zd from C header, got %zd from PyObject",
10230 module_name, class_name, size, basicsize);
10231 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
10232 }
10233 return (PyTypeObject *)result;
10234 bad:
10235 Py_XDECREF(result);
10236 return NULL;
10237 }
10238 #endif
10239
10240 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)10241 static void* __Pyx_GetVtable(PyObject *dict) {
10242 void* ptr;
10243 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
10244 if (!ob)
10245 goto bad;
10246 #if PY_VERSION_HEX >= 0x02070000
10247 ptr = PyCapsule_GetPointer(ob, 0);
10248 #else
10249 ptr = PyCObject_AsVoidPtr(ob);
10250 #endif
10251 if (!ptr && !PyErr_Occurred())
10252 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
10253 Py_DECREF(ob);
10254 return ptr;
10255 bad:
10256 Py_XDECREF(ob);
10257 return NULL;
10258 }
10259
10260 /* PyDictVersioning */
10261 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)10262 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
10263 PyObject *dict = Py_TYPE(obj)->tp_dict;
10264 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
10265 }
__Pyx_get_object_dict_version(PyObject * obj)10266 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
10267 PyObject **dictptr = NULL;
10268 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
10269 if (offset) {
10270 #if CYTHON_COMPILING_IN_CPYTHON
10271 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
10272 #else
10273 dictptr = _PyObject_GetDictPtr(obj);
10274 #endif
10275 }
10276 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
10277 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)10278 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
10279 PyObject *dict = Py_TYPE(obj)->tp_dict;
10280 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
10281 return 0;
10282 return obj_dict_version == __Pyx_get_object_dict_version(obj);
10283 }
10284 #endif
10285
10286 /* CLineInTraceback */
10287 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)10288 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
10289 PyObject *use_cline;
10290 PyObject *ptype, *pvalue, *ptraceback;
10291 #if CYTHON_COMPILING_IN_CPYTHON
10292 PyObject **cython_runtime_dict;
10293 #endif
10294 if (unlikely(!__pyx_cython_runtime)) {
10295 return c_line;
10296 }
10297 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
10298 #if CYTHON_COMPILING_IN_CPYTHON
10299 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
10300 if (likely(cython_runtime_dict)) {
10301 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
10302 use_cline, *cython_runtime_dict,
10303 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
10304 } else
10305 #endif
10306 {
10307 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
10308 if (use_cline_obj) {
10309 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
10310 Py_DECREF(use_cline_obj);
10311 } else {
10312 PyErr_Clear();
10313 use_cline = NULL;
10314 }
10315 }
10316 if (!use_cline) {
10317 c_line = 0;
10318 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
10319 }
10320 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
10321 c_line = 0;
10322 }
10323 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
10324 return c_line;
10325 }
10326 #endif
10327
10328 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)10329 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
10330 int start = 0, mid = 0, end = count - 1;
10331 if (end >= 0 && code_line > entries[end].code_line) {
10332 return count;
10333 }
10334 while (start < end) {
10335 mid = start + (end - start) / 2;
10336 if (code_line < entries[mid].code_line) {
10337 end = mid;
10338 } else if (code_line > entries[mid].code_line) {
10339 start = mid + 1;
10340 } else {
10341 return mid;
10342 }
10343 }
10344 if (code_line <= entries[mid].code_line) {
10345 return mid;
10346 } else {
10347 return mid + 1;
10348 }
10349 }
__pyx_find_code_object(int code_line)10350 static PyCodeObject *__pyx_find_code_object(int code_line) {
10351 PyCodeObject* code_object;
10352 int pos;
10353 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
10354 return NULL;
10355 }
10356 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
10357 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
10358 return NULL;
10359 }
10360 code_object = __pyx_code_cache.entries[pos].code_object;
10361 Py_INCREF(code_object);
10362 return code_object;
10363 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)10364 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
10365 int pos, i;
10366 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
10367 if (unlikely(!code_line)) {
10368 return;
10369 }
10370 if (unlikely(!entries)) {
10371 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
10372 if (likely(entries)) {
10373 __pyx_code_cache.entries = entries;
10374 __pyx_code_cache.max_count = 64;
10375 __pyx_code_cache.count = 1;
10376 entries[0].code_line = code_line;
10377 entries[0].code_object = code_object;
10378 Py_INCREF(code_object);
10379 }
10380 return;
10381 }
10382 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
10383 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
10384 PyCodeObject* tmp = entries[pos].code_object;
10385 entries[pos].code_object = code_object;
10386 Py_DECREF(tmp);
10387 return;
10388 }
10389 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
10390 int new_max = __pyx_code_cache.max_count + 64;
10391 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
10392 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
10393 if (unlikely(!entries)) {
10394 return;
10395 }
10396 __pyx_code_cache.entries = entries;
10397 __pyx_code_cache.max_count = new_max;
10398 }
10399 for (i=__pyx_code_cache.count; i>pos; i--) {
10400 entries[i] = entries[i-1];
10401 }
10402 entries[pos].code_line = code_line;
10403 entries[pos].code_object = code_object;
10404 __pyx_code_cache.count++;
10405 Py_INCREF(code_object);
10406 }
10407
10408 /* AddTraceback */
10409 #include "compile.h"
10410 #include "frameobject.h"
10411 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)10412 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
10413 const char *funcname, int c_line,
10414 int py_line, const char *filename) {
10415 PyCodeObject *py_code = 0;
10416 PyObject *py_srcfile = 0;
10417 PyObject *py_funcname = 0;
10418 #if PY_MAJOR_VERSION < 3
10419 py_srcfile = PyString_FromString(filename);
10420 #else
10421 py_srcfile = PyUnicode_FromString(filename);
10422 #endif
10423 if (!py_srcfile) goto bad;
10424 if (c_line) {
10425 #if PY_MAJOR_VERSION < 3
10426 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10427 #else
10428 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10429 #endif
10430 }
10431 else {
10432 #if PY_MAJOR_VERSION < 3
10433 py_funcname = PyString_FromString(funcname);
10434 #else
10435 py_funcname = PyUnicode_FromString(funcname);
10436 #endif
10437 }
10438 if (!py_funcname) goto bad;
10439 py_code = __Pyx_PyCode_New(
10440 0,
10441 0,
10442 0,
10443 0,
10444 0,
10445 __pyx_empty_bytes, /*PyObject *code,*/
10446 __pyx_empty_tuple, /*PyObject *consts,*/
10447 __pyx_empty_tuple, /*PyObject *names,*/
10448 __pyx_empty_tuple, /*PyObject *varnames,*/
10449 __pyx_empty_tuple, /*PyObject *freevars,*/
10450 __pyx_empty_tuple, /*PyObject *cellvars,*/
10451 py_srcfile, /*PyObject *filename,*/
10452 py_funcname, /*PyObject *name,*/
10453 py_line,
10454 __pyx_empty_bytes /*PyObject *lnotab*/
10455 );
10456 Py_DECREF(py_srcfile);
10457 Py_DECREF(py_funcname);
10458 return py_code;
10459 bad:
10460 Py_XDECREF(py_srcfile);
10461 Py_XDECREF(py_funcname);
10462 return NULL;
10463 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)10464 static void __Pyx_AddTraceback(const char *funcname, int c_line,
10465 int py_line, const char *filename) {
10466 PyCodeObject *py_code = 0;
10467 PyFrameObject *py_frame = 0;
10468 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10469 if (c_line) {
10470 c_line = __Pyx_CLineForTraceback(tstate, c_line);
10471 }
10472 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
10473 if (!py_code) {
10474 py_code = __Pyx_CreateCodeObjectForTraceback(
10475 funcname, c_line, py_line, filename);
10476 if (!py_code) goto bad;
10477 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
10478 }
10479 py_frame = PyFrame_New(
10480 tstate, /*PyThreadState *tstate,*/
10481 py_code, /*PyCodeObject *code,*/
10482 __pyx_d, /*PyObject *globals,*/
10483 0 /*PyObject *locals*/
10484 );
10485 if (!py_frame) goto bad;
10486 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
10487 PyTraceBack_Here(py_frame);
10488 bad:
10489 Py_XDECREF(py_code);
10490 Py_XDECREF(py_frame);
10491 }
10492
10493 /* CIntFromPyVerify */
10494 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
10495 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
10496 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
10497 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
10498 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
10499 {\
10500 func_type value = func_value;\
10501 if (sizeof(target_type) < sizeof(func_type)) {\
10502 if (unlikely(value != (func_type) (target_type) value)) {\
10503 func_type zero = 0;\
10504 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
10505 return (target_type) -1;\
10506 if (is_unsigned && unlikely(value < zero))\
10507 goto raise_neg_overflow;\
10508 else\
10509 goto raise_overflow;\
10510 }\
10511 }\
10512 return (target_type) value;\
10513 }
10514
10515 /* CIntToPy */
__Pyx_PyInt_From_unsigned_int(unsigned int value)10516 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
10517 const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0;
10518 const int is_unsigned = neg_one > const_zero;
10519 if (is_unsigned) {
10520 if (sizeof(unsigned int) < sizeof(long)) {
10521 return PyInt_FromLong((long) value);
10522 } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
10523 return PyLong_FromUnsignedLong((unsigned long) value);
10524 #ifdef HAVE_LONG_LONG
10525 } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
10526 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10527 #endif
10528 }
10529 } else {
10530 if (sizeof(unsigned int) <= sizeof(long)) {
10531 return PyInt_FromLong((long) value);
10532 #ifdef HAVE_LONG_LONG
10533 } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
10534 return PyLong_FromLongLong((PY_LONG_LONG) value);
10535 #endif
10536 }
10537 }
10538 {
10539 int one = 1; int little = (int)*(unsigned char *)&one;
10540 unsigned char *bytes = (unsigned char *)&value;
10541 return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
10542 little, !is_unsigned);
10543 }
10544 }
10545
10546 /* CIntToPy */
__Pyx_PyInt_From_uint16_t(uint16_t value)10547 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) {
10548 const uint16_t neg_one = (uint16_t) ((uint16_t) 0 - (uint16_t) 1), const_zero = (uint16_t) 0;
10549 const int is_unsigned = neg_one > const_zero;
10550 if (is_unsigned) {
10551 if (sizeof(uint16_t) < sizeof(long)) {
10552 return PyInt_FromLong((long) value);
10553 } else if (sizeof(uint16_t) <= sizeof(unsigned long)) {
10554 return PyLong_FromUnsignedLong((unsigned long) value);
10555 #ifdef HAVE_LONG_LONG
10556 } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) {
10557 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10558 #endif
10559 }
10560 } else {
10561 if (sizeof(uint16_t) <= sizeof(long)) {
10562 return PyInt_FromLong((long) value);
10563 #ifdef HAVE_LONG_LONG
10564 } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) {
10565 return PyLong_FromLongLong((PY_LONG_LONG) value);
10566 #endif
10567 }
10568 }
10569 {
10570 int one = 1; int little = (int)*(unsigned char *)&one;
10571 unsigned char *bytes = (unsigned char *)&value;
10572 return _PyLong_FromByteArray(bytes, sizeof(uint16_t),
10573 little, !is_unsigned);
10574 }
10575 }
10576
10577 /* CIntToPy */
__Pyx_PyInt_From_uint32_t(uint32_t value)10578 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
10579 const uint32_t neg_one = (uint32_t) ((uint32_t) 0 - (uint32_t) 1), const_zero = (uint32_t) 0;
10580 const int is_unsigned = neg_one > const_zero;
10581 if (is_unsigned) {
10582 if (sizeof(uint32_t) < sizeof(long)) {
10583 return PyInt_FromLong((long) value);
10584 } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
10585 return PyLong_FromUnsignedLong((unsigned long) value);
10586 #ifdef HAVE_LONG_LONG
10587 } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
10588 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10589 #endif
10590 }
10591 } else {
10592 if (sizeof(uint32_t) <= sizeof(long)) {
10593 return PyInt_FromLong((long) value);
10594 #ifdef HAVE_LONG_LONG
10595 } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
10596 return PyLong_FromLongLong((PY_LONG_LONG) value);
10597 #endif
10598 }
10599 }
10600 {
10601 int one = 1; int little = (int)*(unsigned char *)&one;
10602 unsigned char *bytes = (unsigned char *)&value;
10603 return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
10604 little, !is_unsigned);
10605 }
10606 }
10607
10608 /* CIntToPy */
__Pyx_PyInt_From_int64_t(int64_t value)10609 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
10610 const int64_t neg_one = (int64_t) ((int64_t) 0 - (int64_t) 1), const_zero = (int64_t) 0;
10611 const int is_unsigned = neg_one > const_zero;
10612 if (is_unsigned) {
10613 if (sizeof(int64_t) < sizeof(long)) {
10614 return PyInt_FromLong((long) value);
10615 } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
10616 return PyLong_FromUnsignedLong((unsigned long) value);
10617 #ifdef HAVE_LONG_LONG
10618 } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
10619 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10620 #endif
10621 }
10622 } else {
10623 if (sizeof(int64_t) <= sizeof(long)) {
10624 return PyInt_FromLong((long) value);
10625 #ifdef HAVE_LONG_LONG
10626 } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
10627 return PyLong_FromLongLong((PY_LONG_LONG) value);
10628 #endif
10629 }
10630 }
10631 {
10632 int one = 1; int little = (int)*(unsigned char *)&one;
10633 unsigned char *bytes = (unsigned char *)&value;
10634 return _PyLong_FromByteArray(bytes, sizeof(int64_t),
10635 little, !is_unsigned);
10636 }
10637 }
10638
10639 /* CIntToPy */
__Pyx_PyInt_From_int(int value)10640 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
10641 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
10642 const int is_unsigned = neg_one > const_zero;
10643 if (is_unsigned) {
10644 if (sizeof(int) < sizeof(long)) {
10645 return PyInt_FromLong((long) value);
10646 } else if (sizeof(int) <= sizeof(unsigned long)) {
10647 return PyLong_FromUnsignedLong((unsigned long) value);
10648 #ifdef HAVE_LONG_LONG
10649 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
10650 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10651 #endif
10652 }
10653 } else {
10654 if (sizeof(int) <= sizeof(long)) {
10655 return PyInt_FromLong((long) value);
10656 #ifdef HAVE_LONG_LONG
10657 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
10658 return PyLong_FromLongLong((PY_LONG_LONG) value);
10659 #endif
10660 }
10661 }
10662 {
10663 int one = 1; int little = (int)*(unsigned char *)&one;
10664 unsigned char *bytes = (unsigned char *)&value;
10665 return _PyLong_FromByteArray(bytes, sizeof(int),
10666 little, !is_unsigned);
10667 }
10668 }
10669
10670 /* CIntToPy */
__Pyx_PyInt_From_enum__AVSubtitleType(enum AVSubtitleType value)10671 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__AVSubtitleType(enum AVSubtitleType value) {
10672 const enum AVSubtitleType neg_one = (enum AVSubtitleType) ((enum AVSubtitleType) 0 - (enum AVSubtitleType) 1), const_zero = (enum AVSubtitleType) 0;
10673 const int is_unsigned = neg_one > const_zero;
10674 if (is_unsigned) {
10675 if (sizeof(enum AVSubtitleType) < sizeof(long)) {
10676 return PyInt_FromLong((long) value);
10677 } else if (sizeof(enum AVSubtitleType) <= sizeof(unsigned long)) {
10678 return PyLong_FromUnsignedLong((unsigned long) value);
10679 #ifdef HAVE_LONG_LONG
10680 } else if (sizeof(enum AVSubtitleType) <= sizeof(unsigned PY_LONG_LONG)) {
10681 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10682 #endif
10683 }
10684 } else {
10685 if (sizeof(enum AVSubtitleType) <= sizeof(long)) {
10686 return PyInt_FromLong((long) value);
10687 #ifdef HAVE_LONG_LONG
10688 } else if (sizeof(enum AVSubtitleType) <= sizeof(PY_LONG_LONG)) {
10689 return PyLong_FromLongLong((PY_LONG_LONG) value);
10690 #endif
10691 }
10692 }
10693 {
10694 int one = 1; int little = (int)*(unsigned char *)&one;
10695 unsigned char *bytes = (unsigned char *)&value;
10696 return _PyLong_FromByteArray(bytes, sizeof(enum AVSubtitleType),
10697 little, !is_unsigned);
10698 }
10699 }
10700
10701 /* CIntToPy */
__Pyx_PyInt_From_long(long value)10702 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
10703 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
10704 const int is_unsigned = neg_one > const_zero;
10705 if (is_unsigned) {
10706 if (sizeof(long) < sizeof(long)) {
10707 return PyInt_FromLong((long) value);
10708 } else if (sizeof(long) <= sizeof(unsigned long)) {
10709 return PyLong_FromUnsignedLong((unsigned long) value);
10710 #ifdef HAVE_LONG_LONG
10711 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
10712 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10713 #endif
10714 }
10715 } else {
10716 if (sizeof(long) <= sizeof(long)) {
10717 return PyInt_FromLong((long) value);
10718 #ifdef HAVE_LONG_LONG
10719 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
10720 return PyLong_FromLongLong((PY_LONG_LONG) value);
10721 #endif
10722 }
10723 }
10724 {
10725 int one = 1; int little = (int)*(unsigned char *)&one;
10726 unsigned char *bytes = (unsigned char *)&value;
10727 return _PyLong_FromByteArray(bytes, sizeof(long),
10728 little, !is_unsigned);
10729 }
10730 }
10731
10732 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)10733 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
10734 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
10735 const int is_unsigned = neg_one > const_zero;
10736 #if PY_MAJOR_VERSION < 3
10737 if (likely(PyInt_Check(x))) {
10738 if (sizeof(int) < sizeof(long)) {
10739 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
10740 } else {
10741 long val = PyInt_AS_LONG(x);
10742 if (is_unsigned && unlikely(val < 0)) {
10743 goto raise_neg_overflow;
10744 }
10745 return (int) val;
10746 }
10747 } else
10748 #endif
10749 if (likely(PyLong_Check(x))) {
10750 if (is_unsigned) {
10751 #if CYTHON_USE_PYLONG_INTERNALS
10752 const digit* digits = ((PyLongObject*)x)->ob_digit;
10753 switch (Py_SIZE(x)) {
10754 case 0: return (int) 0;
10755 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
10756 case 2:
10757 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
10758 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10759 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10760 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
10761 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10762 }
10763 }
10764 break;
10765 case 3:
10766 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
10767 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10768 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10769 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
10770 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10771 }
10772 }
10773 break;
10774 case 4:
10775 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
10776 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10777 __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])))
10778 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
10779 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10780 }
10781 }
10782 break;
10783 }
10784 #endif
10785 #if CYTHON_COMPILING_IN_CPYTHON
10786 if (unlikely(Py_SIZE(x) < 0)) {
10787 goto raise_neg_overflow;
10788 }
10789 #else
10790 {
10791 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10792 if (unlikely(result < 0))
10793 return (int) -1;
10794 if (unlikely(result == 1))
10795 goto raise_neg_overflow;
10796 }
10797 #endif
10798 if (sizeof(int) <= sizeof(unsigned long)) {
10799 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
10800 #ifdef HAVE_LONG_LONG
10801 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
10802 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10803 #endif
10804 }
10805 } else {
10806 #if CYTHON_USE_PYLONG_INTERNALS
10807 const digit* digits = ((PyLongObject*)x)->ob_digit;
10808 switch (Py_SIZE(x)) {
10809 case 0: return (int) 0;
10810 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
10811 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
10812 case -2:
10813 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
10814 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10815 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10816 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10817 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10818 }
10819 }
10820 break;
10821 case 2:
10822 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
10823 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10824 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10825 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10826 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10827 }
10828 }
10829 break;
10830 case -3:
10831 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10832 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10833 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10834 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10835 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10836 }
10837 }
10838 break;
10839 case 3:
10840 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
10841 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10842 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10843 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10844 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10845 }
10846 }
10847 break;
10848 case -4:
10849 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10850 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10851 __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])))
10852 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
10853 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10854 }
10855 }
10856 break;
10857 case 4:
10858 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
10859 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10860 __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])))
10861 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
10862 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10863 }
10864 }
10865 break;
10866 }
10867 #endif
10868 if (sizeof(int) <= sizeof(long)) {
10869 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
10870 #ifdef HAVE_LONG_LONG
10871 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
10872 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
10873 #endif
10874 }
10875 }
10876 {
10877 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
10878 PyErr_SetString(PyExc_RuntimeError,
10879 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
10880 #else
10881 int val;
10882 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
10883 #if PY_MAJOR_VERSION < 3
10884 if (likely(v) && !PyLong_Check(v)) {
10885 PyObject *tmp = v;
10886 v = PyNumber_Long(tmp);
10887 Py_DECREF(tmp);
10888 }
10889 #endif
10890 if (likely(v)) {
10891 int one = 1; int is_little = (int)*(unsigned char *)&one;
10892 unsigned char *bytes = (unsigned char *)&val;
10893 int ret = _PyLong_AsByteArray((PyLongObject *)v,
10894 bytes, sizeof(val),
10895 is_little, !is_unsigned);
10896 Py_DECREF(v);
10897 if (likely(!ret))
10898 return val;
10899 }
10900 #endif
10901 return (int) -1;
10902 }
10903 } else {
10904 int val;
10905 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10906 if (!tmp) return (int) -1;
10907 val = __Pyx_PyInt_As_int(tmp);
10908 Py_DECREF(tmp);
10909 return val;
10910 }
10911 raise_overflow:
10912 PyErr_SetString(PyExc_OverflowError,
10913 "value too large to convert to int");
10914 return (int) -1;
10915 raise_neg_overflow:
10916 PyErr_SetString(PyExc_OverflowError,
10917 "can't convert negative value to int");
10918 return (int) -1;
10919 }
10920
10921 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_int(PyObject * x)10922 static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
10923 const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0;
10924 const int is_unsigned = neg_one > const_zero;
10925 #if PY_MAJOR_VERSION < 3
10926 if (likely(PyInt_Check(x))) {
10927 if (sizeof(unsigned int) < sizeof(long)) {
10928 __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
10929 } else {
10930 long val = PyInt_AS_LONG(x);
10931 if (is_unsigned && unlikely(val < 0)) {
10932 goto raise_neg_overflow;
10933 }
10934 return (unsigned int) val;
10935 }
10936 } else
10937 #endif
10938 if (likely(PyLong_Check(x))) {
10939 if (is_unsigned) {
10940 #if CYTHON_USE_PYLONG_INTERNALS
10941 const digit* digits = ((PyLongObject*)x)->ob_digit;
10942 switch (Py_SIZE(x)) {
10943 case 0: return (unsigned int) 0;
10944 case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
10945 case 2:
10946 if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
10947 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10948 __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10949 } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
10950 return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
10951 }
10952 }
10953 break;
10954 case 3:
10955 if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
10956 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10957 __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10958 } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
10959 return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
10960 }
10961 }
10962 break;
10963 case 4:
10964 if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
10965 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10966 __PYX_VERIFY_RETURN_INT(unsigned 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])))
10967 } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
10968 return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
10969 }
10970 }
10971 break;
10972 }
10973 #endif
10974 #if CYTHON_COMPILING_IN_CPYTHON
10975 if (unlikely(Py_SIZE(x) < 0)) {
10976 goto raise_neg_overflow;
10977 }
10978 #else
10979 {
10980 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10981 if (unlikely(result < 0))
10982 return (unsigned int) -1;
10983 if (unlikely(result == 1))
10984 goto raise_neg_overflow;
10985 }
10986 #endif
10987 if (sizeof(unsigned int) <= sizeof(unsigned long)) {
10988 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
10989 #ifdef HAVE_LONG_LONG
10990 } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
10991 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10992 #endif
10993 }
10994 } else {
10995 #if CYTHON_USE_PYLONG_INTERNALS
10996 const digit* digits = ((PyLongObject*)x)->ob_digit;
10997 switch (Py_SIZE(x)) {
10998 case 0: return (unsigned int) 0;
10999 case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
11000 case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0])
11001 case -2:
11002 if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
11003 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11004 __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11005 } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
11006 return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
11007 }
11008 }
11009 break;
11010 case 2:
11011 if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
11012 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11013 __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11014 } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
11015 return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
11016 }
11017 }
11018 break;
11019 case -3:
11020 if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
11021 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11022 __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11023 } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
11024 return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
11025 }
11026 }
11027 break;
11028 case 3:
11029 if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
11030 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11031 __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11032 } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
11033 return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
11034 }
11035 }
11036 break;
11037 case -4:
11038 if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
11039 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11040 __PYX_VERIFY_RETURN_INT(unsigned 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])))
11041 } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
11042 return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
11043 }
11044 }
11045 break;
11046 case 4:
11047 if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
11048 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11049 __PYX_VERIFY_RETURN_INT(unsigned 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])))
11050 } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
11051 return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
11052 }
11053 }
11054 break;
11055 }
11056 #endif
11057 if (sizeof(unsigned int) <= sizeof(long)) {
11058 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
11059 #ifdef HAVE_LONG_LONG
11060 } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
11061 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
11062 #endif
11063 }
11064 }
11065 {
11066 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
11067 PyErr_SetString(PyExc_RuntimeError,
11068 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
11069 #else
11070 unsigned int val;
11071 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
11072 #if PY_MAJOR_VERSION < 3
11073 if (likely(v) && !PyLong_Check(v)) {
11074 PyObject *tmp = v;
11075 v = PyNumber_Long(tmp);
11076 Py_DECREF(tmp);
11077 }
11078 #endif
11079 if (likely(v)) {
11080 int one = 1; int is_little = (int)*(unsigned char *)&one;
11081 unsigned char *bytes = (unsigned char *)&val;
11082 int ret = _PyLong_AsByteArray((PyLongObject *)v,
11083 bytes, sizeof(val),
11084 is_little, !is_unsigned);
11085 Py_DECREF(v);
11086 if (likely(!ret))
11087 return val;
11088 }
11089 #endif
11090 return (unsigned int) -1;
11091 }
11092 } else {
11093 unsigned int val;
11094 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
11095 if (!tmp) return (unsigned int) -1;
11096 val = __Pyx_PyInt_As_unsigned_int(tmp);
11097 Py_DECREF(tmp);
11098 return val;
11099 }
11100 raise_overflow:
11101 PyErr_SetString(PyExc_OverflowError,
11102 "value too large to convert to unsigned int");
11103 return (unsigned int) -1;
11104 raise_neg_overflow:
11105 PyErr_SetString(PyExc_OverflowError,
11106 "can't convert negative value to unsigned int");
11107 return (unsigned int) -1;
11108 }
11109
11110 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)11111 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
11112 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
11113 const int is_unsigned = neg_one > const_zero;
11114 #if PY_MAJOR_VERSION < 3
11115 if (likely(PyInt_Check(x))) {
11116 if (sizeof(long) < sizeof(long)) {
11117 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
11118 } else {
11119 long val = PyInt_AS_LONG(x);
11120 if (is_unsigned && unlikely(val < 0)) {
11121 goto raise_neg_overflow;
11122 }
11123 return (long) val;
11124 }
11125 } else
11126 #endif
11127 if (likely(PyLong_Check(x))) {
11128 if (is_unsigned) {
11129 #if CYTHON_USE_PYLONG_INTERNALS
11130 const digit* digits = ((PyLongObject*)x)->ob_digit;
11131 switch (Py_SIZE(x)) {
11132 case 0: return (long) 0;
11133 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
11134 case 2:
11135 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
11136 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11137 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11138 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
11139 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11140 }
11141 }
11142 break;
11143 case 3:
11144 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
11145 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11146 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11147 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
11148 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11149 }
11150 }
11151 break;
11152 case 4:
11153 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
11154 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11155 __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])))
11156 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
11157 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11158 }
11159 }
11160 break;
11161 }
11162 #endif
11163 #if CYTHON_COMPILING_IN_CPYTHON
11164 if (unlikely(Py_SIZE(x) < 0)) {
11165 goto raise_neg_overflow;
11166 }
11167 #else
11168 {
11169 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11170 if (unlikely(result < 0))
11171 return (long) -1;
11172 if (unlikely(result == 1))
11173 goto raise_neg_overflow;
11174 }
11175 #endif
11176 if (sizeof(long) <= sizeof(unsigned long)) {
11177 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
11178 #ifdef HAVE_LONG_LONG
11179 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
11180 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11181 #endif
11182 }
11183 } else {
11184 #if CYTHON_USE_PYLONG_INTERNALS
11185 const digit* digits = ((PyLongObject*)x)->ob_digit;
11186 switch (Py_SIZE(x)) {
11187 case 0: return (long) 0;
11188 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
11189 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
11190 case -2:
11191 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
11192 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11193 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11194 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11195 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11196 }
11197 }
11198 break;
11199 case 2:
11200 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
11201 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11202 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11203 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11204 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11205 }
11206 }
11207 break;
11208 case -3:
11209 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11210 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11211 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11212 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
11213 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11214 }
11215 }
11216 break;
11217 case 3:
11218 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
11219 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11220 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11221 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
11222 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11223 }
11224 }
11225 break;
11226 case -4:
11227 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
11228 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11229 __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])))
11230 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
11231 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11232 }
11233 }
11234 break;
11235 case 4:
11236 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
11237 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11238 __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])))
11239 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
11240 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11241 }
11242 }
11243 break;
11244 }
11245 #endif
11246 if (sizeof(long) <= sizeof(long)) {
11247 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
11248 #ifdef HAVE_LONG_LONG
11249 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
11250 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
11251 #endif
11252 }
11253 }
11254 {
11255 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
11256 PyErr_SetString(PyExc_RuntimeError,
11257 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
11258 #else
11259 long val;
11260 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
11261 #if PY_MAJOR_VERSION < 3
11262 if (likely(v) && !PyLong_Check(v)) {
11263 PyObject *tmp = v;
11264 v = PyNumber_Long(tmp);
11265 Py_DECREF(tmp);
11266 }
11267 #endif
11268 if (likely(v)) {
11269 int one = 1; int is_little = (int)*(unsigned char *)&one;
11270 unsigned char *bytes = (unsigned char *)&val;
11271 int ret = _PyLong_AsByteArray((PyLongObject *)v,
11272 bytes, sizeof(val),
11273 is_little, !is_unsigned);
11274 Py_DECREF(v);
11275 if (likely(!ret))
11276 return val;
11277 }
11278 #endif
11279 return (long) -1;
11280 }
11281 } else {
11282 long val;
11283 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
11284 if (!tmp) return (long) -1;
11285 val = __Pyx_PyInt_As_long(tmp);
11286 Py_DECREF(tmp);
11287 return val;
11288 }
11289 raise_overflow:
11290 PyErr_SetString(PyExc_OverflowError,
11291 "value too large to convert to long");
11292 return (long) -1;
11293 raise_neg_overflow:
11294 PyErr_SetString(PyExc_OverflowError,
11295 "can't convert negative value to long");
11296 return (long) -1;
11297 }
11298
11299 /* FastTypeChecks */
11300 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)11301 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
11302 while (a) {
11303 a = a->tp_base;
11304 if (a == b)
11305 return 1;
11306 }
11307 return b == &PyBaseObject_Type;
11308 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)11309 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
11310 PyObject *mro;
11311 if (a == b) return 1;
11312 mro = a->tp_mro;
11313 if (likely(mro)) {
11314 Py_ssize_t i, n;
11315 n = PyTuple_GET_SIZE(mro);
11316 for (i = 0; i < n; i++) {
11317 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
11318 return 1;
11319 }
11320 return 0;
11321 }
11322 return __Pyx_InBases(a, b);
11323 }
11324 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)11325 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
11326 PyObject *exception, *value, *tb;
11327 int res;
11328 __Pyx_PyThreadState_declare
11329 __Pyx_PyThreadState_assign
11330 __Pyx_ErrFetch(&exception, &value, &tb);
11331 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
11332 if (unlikely(res == -1)) {
11333 PyErr_WriteUnraisable(err);
11334 res = 0;
11335 }
11336 if (!res) {
11337 res = PyObject_IsSubclass(err, exc_type2);
11338 if (unlikely(res == -1)) {
11339 PyErr_WriteUnraisable(err);
11340 res = 0;
11341 }
11342 }
11343 __Pyx_ErrRestore(exception, value, tb);
11344 return res;
11345 }
11346 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)11347 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
11348 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
11349 if (!res) {
11350 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
11351 }
11352 return res;
11353 }
11354 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)11355 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
11356 Py_ssize_t i, n;
11357 assert(PyExceptionClass_Check(exc_type));
11358 n = PyTuple_GET_SIZE(tuple);
11359 #if PY_MAJOR_VERSION >= 3
11360 for (i=0; i<n; i++) {
11361 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
11362 }
11363 #endif
11364 for (i=0; i<n; i++) {
11365 PyObject *t = PyTuple_GET_ITEM(tuple, i);
11366 #if PY_MAJOR_VERSION < 3
11367 if (likely(exc_type == t)) return 1;
11368 #endif
11369 if (likely(PyExceptionClass_Check(t))) {
11370 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
11371 } else {
11372 }
11373 }
11374 return 0;
11375 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)11376 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
11377 if (likely(err == exc_type)) return 1;
11378 if (likely(PyExceptionClass_Check(err))) {
11379 if (likely(PyExceptionClass_Check(exc_type))) {
11380 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
11381 } else if (likely(PyTuple_Check(exc_type))) {
11382 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
11383 } else {
11384 }
11385 }
11386 return PyErr_GivenExceptionMatches(err, exc_type);
11387 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)11388 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
11389 assert(PyExceptionClass_Check(exc_type1));
11390 assert(PyExceptionClass_Check(exc_type2));
11391 if (likely(err == exc_type1 || err == exc_type2)) return 1;
11392 if (likely(PyExceptionClass_Check(err))) {
11393 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
11394 }
11395 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
11396 }
11397 #endif
11398
11399 /* FetchCommonType */
__Pyx_FetchCommonType(PyTypeObject * type)11400 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
11401 PyObject* fake_module;
11402 PyTypeObject* cached_type = NULL;
11403 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
11404 if (!fake_module) return NULL;
11405 Py_INCREF(fake_module);
11406 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
11407 if (cached_type) {
11408 if (!PyType_Check((PyObject*)cached_type)) {
11409 PyErr_Format(PyExc_TypeError,
11410 "Shared Cython type %.200s is not a type object",
11411 type->tp_name);
11412 goto bad;
11413 }
11414 if (cached_type->tp_basicsize != type->tp_basicsize) {
11415 PyErr_Format(PyExc_TypeError,
11416 "Shared Cython type %.200s has the wrong size, try recompiling",
11417 type->tp_name);
11418 goto bad;
11419 }
11420 } else {
11421 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
11422 PyErr_Clear();
11423 if (PyType_Ready(type) < 0) goto bad;
11424 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
11425 goto bad;
11426 Py_INCREF(type);
11427 cached_type = type;
11428 }
11429 done:
11430 Py_DECREF(fake_module);
11431 return cached_type;
11432 bad:
11433 Py_XDECREF(cached_type);
11434 cached_type = NULL;
11435 goto done;
11436 }
11437
11438 /* GetTopmostException */
11439 #if CYTHON_USE_EXC_INFO_STACK
11440 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)11441 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
11442 {
11443 _PyErr_StackItem *exc_info = tstate->exc_info;
11444 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
11445 exc_info->previous_item != NULL)
11446 {
11447 exc_info = exc_info->previous_item;
11448 }
11449 return exc_info;
11450 }
11451 #endif
11452
11453 /* SaveResetException */
11454 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)11455 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11456 #if CYTHON_USE_EXC_INFO_STACK
11457 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
11458 *type = exc_info->exc_type;
11459 *value = exc_info->exc_value;
11460 *tb = exc_info->exc_traceback;
11461 #else
11462 *type = tstate->exc_type;
11463 *value = tstate->exc_value;
11464 *tb = tstate->exc_traceback;
11465 #endif
11466 Py_XINCREF(*type);
11467 Py_XINCREF(*value);
11468 Py_XINCREF(*tb);
11469 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)11470 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
11471 PyObject *tmp_type, *tmp_value, *tmp_tb;
11472 #if CYTHON_USE_EXC_INFO_STACK
11473 _PyErr_StackItem *exc_info = tstate->exc_info;
11474 tmp_type = exc_info->exc_type;
11475 tmp_value = exc_info->exc_value;
11476 tmp_tb = exc_info->exc_traceback;
11477 exc_info->exc_type = type;
11478 exc_info->exc_value = value;
11479 exc_info->exc_traceback = tb;
11480 #else
11481 tmp_type = tstate->exc_type;
11482 tmp_value = tstate->exc_value;
11483 tmp_tb = tstate->exc_traceback;
11484 tstate->exc_type = type;
11485 tstate->exc_value = value;
11486 tstate->exc_traceback = tb;
11487 #endif
11488 Py_XDECREF(tmp_type);
11489 Py_XDECREF(tmp_value);
11490 Py_XDECREF(tmp_tb);
11491 }
11492 #endif
11493
11494 /* SwapException */
11495 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)11496 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11497 PyObject *tmp_type, *tmp_value, *tmp_tb;
11498 #if CYTHON_USE_EXC_INFO_STACK
11499 _PyErr_StackItem *exc_info = tstate->exc_info;
11500 tmp_type = exc_info->exc_type;
11501 tmp_value = exc_info->exc_value;
11502 tmp_tb = exc_info->exc_traceback;
11503 exc_info->exc_type = *type;
11504 exc_info->exc_value = *value;
11505 exc_info->exc_traceback = *tb;
11506 #else
11507 tmp_type = tstate->exc_type;
11508 tmp_value = tstate->exc_value;
11509 tmp_tb = tstate->exc_traceback;
11510 tstate->exc_type = *type;
11511 tstate->exc_value = *value;
11512 tstate->exc_traceback = *tb;
11513 #endif
11514 *type = tmp_type;
11515 *value = tmp_value;
11516 *tb = tmp_tb;
11517 }
11518 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)11519 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
11520 PyObject *tmp_type, *tmp_value, *tmp_tb;
11521 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
11522 PyErr_SetExcInfo(*type, *value, *tb);
11523 *type = tmp_type;
11524 *value = tmp_value;
11525 *tb = tmp_tb;
11526 }
11527 #endif
11528
11529 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)11530 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
11531 PyObject *args, *result = NULL;
11532 #if CYTHON_FAST_PYCALL
11533 if (PyFunction_Check(function)) {
11534 PyObject *args[2] = {arg1, arg2};
11535 return __Pyx_PyFunction_FastCall(function, args, 2);
11536 }
11537 #endif
11538 #if CYTHON_FAST_PYCCALL
11539 if (__Pyx_PyFastCFunction_Check(function)) {
11540 PyObject *args[2] = {arg1, arg2};
11541 return __Pyx_PyCFunction_FastCall(function, args, 2);
11542 }
11543 #endif
11544 args = PyTuple_New(2);
11545 if (unlikely(!args)) goto done;
11546 Py_INCREF(arg1);
11547 PyTuple_SET_ITEM(args, 0, arg1);
11548 Py_INCREF(arg2);
11549 PyTuple_SET_ITEM(args, 1, arg2);
11550 Py_INCREF(function);
11551 result = __Pyx_PyObject_Call(function, args, NULL);
11552 Py_DECREF(args);
11553 Py_DECREF(function);
11554 done:
11555 return result;
11556 }
11557
11558 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)11559 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
11560 PyObject *attr;
11561 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
11562 PyTypeObject *tp = Py_TYPE(obj);
11563 PyObject *descr;
11564 descrgetfunc f = NULL;
11565 PyObject **dictptr, *dict;
11566 int meth_found = 0;
11567 assert (*method == NULL);
11568 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
11569 attr = __Pyx_PyObject_GetAttrStr(obj, name);
11570 goto try_unpack;
11571 }
11572 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
11573 return 0;
11574 }
11575 descr = _PyType_Lookup(tp, name);
11576 if (likely(descr != NULL)) {
11577 Py_INCREF(descr);
11578 #if PY_MAJOR_VERSION >= 3
11579 #ifdef __Pyx_CyFunction_USED
11580 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
11581 #else
11582 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
11583 #endif
11584 #else
11585 #ifdef __Pyx_CyFunction_USED
11586 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
11587 #else
11588 if (likely(PyFunction_Check(descr)))
11589 #endif
11590 #endif
11591 {
11592 meth_found = 1;
11593 } else {
11594 f = Py_TYPE(descr)->tp_descr_get;
11595 if (f != NULL && PyDescr_IsData(descr)) {
11596 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
11597 Py_DECREF(descr);
11598 goto try_unpack;
11599 }
11600 }
11601 }
11602 dictptr = _PyObject_GetDictPtr(obj);
11603 if (dictptr != NULL && (dict = *dictptr) != NULL) {
11604 Py_INCREF(dict);
11605 attr = __Pyx_PyDict_GetItemStr(dict, name);
11606 if (attr != NULL) {
11607 Py_INCREF(attr);
11608 Py_DECREF(dict);
11609 Py_XDECREF(descr);
11610 goto try_unpack;
11611 }
11612 Py_DECREF(dict);
11613 }
11614 if (meth_found) {
11615 *method = descr;
11616 return 1;
11617 }
11618 if (f != NULL) {
11619 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
11620 Py_DECREF(descr);
11621 goto try_unpack;
11622 }
11623 if (descr != NULL) {
11624 *method = descr;
11625 return 0;
11626 }
11627 PyErr_Format(PyExc_AttributeError,
11628 #if PY_MAJOR_VERSION >= 3
11629 "'%.50s' object has no attribute '%U'",
11630 tp->tp_name, name);
11631 #else
11632 "'%.50s' object has no attribute '%.400s'",
11633 tp->tp_name, PyString_AS_STRING(name));
11634 #endif
11635 return 0;
11636 #else
11637 attr = __Pyx_PyObject_GetAttrStr(obj, name);
11638 goto try_unpack;
11639 #endif
11640 try_unpack:
11641 #if CYTHON_UNPACK_METHODS
11642 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
11643 PyObject *function = PyMethod_GET_FUNCTION(attr);
11644 Py_INCREF(function);
11645 Py_DECREF(attr);
11646 *method = function;
11647 return 1;
11648 }
11649 #endif
11650 *method = attr;
11651 return 0;
11652 }
11653
11654 /* PyObjectCallMethod1 */
__Pyx__PyObject_CallMethod1(PyObject * method,PyObject * arg)11655 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
11656 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
11657 Py_DECREF(method);
11658 return result;
11659 }
__Pyx_PyObject_CallMethod1(PyObject * obj,PyObject * method_name,PyObject * arg)11660 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
11661 PyObject *method = NULL, *result;
11662 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
11663 if (likely(is_method)) {
11664 result = __Pyx_PyObject_Call2Args(method, obj, arg);
11665 Py_DECREF(method);
11666 return result;
11667 }
11668 if (unlikely(!method)) return NULL;
11669 return __Pyx__PyObject_CallMethod1(method, arg);
11670 }
11671
11672 /* CoroutineBase */
11673 #include <structmember.h>
11674 #include <frameobject.h>
11675 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
__Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject ** pvalue)11676 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
11677 PyObject *et, *ev, *tb;
11678 PyObject *value = NULL;
11679 __Pyx_ErrFetch(&et, &ev, &tb);
11680 if (!et) {
11681 Py_XDECREF(tb);
11682 Py_XDECREF(ev);
11683 Py_INCREF(Py_None);
11684 *pvalue = Py_None;
11685 return 0;
11686 }
11687 if (likely(et == PyExc_StopIteration)) {
11688 if (!ev) {
11689 Py_INCREF(Py_None);
11690 value = Py_None;
11691 }
11692 #if PY_VERSION_HEX >= 0x030300A0
11693 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
11694 value = ((PyStopIterationObject *)ev)->value;
11695 Py_INCREF(value);
11696 Py_DECREF(ev);
11697 }
11698 #endif
11699 else if (unlikely(PyTuple_Check(ev))) {
11700 if (PyTuple_GET_SIZE(ev) >= 1) {
11701 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11702 value = PyTuple_GET_ITEM(ev, 0);
11703 Py_INCREF(value);
11704 #else
11705 value = PySequence_ITEM(ev, 0);
11706 #endif
11707 } else {
11708 Py_INCREF(Py_None);
11709 value = Py_None;
11710 }
11711 Py_DECREF(ev);
11712 }
11713 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
11714 value = ev;
11715 }
11716 if (likely(value)) {
11717 Py_XDECREF(tb);
11718 Py_DECREF(et);
11719 *pvalue = value;
11720 return 0;
11721 }
11722 } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
11723 __Pyx_ErrRestore(et, ev, tb);
11724 return -1;
11725 }
11726 PyErr_NormalizeException(&et, &ev, &tb);
11727 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
11728 __Pyx_ErrRestore(et, ev, tb);
11729 return -1;
11730 }
11731 Py_XDECREF(tb);
11732 Py_DECREF(et);
11733 #if PY_VERSION_HEX >= 0x030300A0
11734 value = ((PyStopIterationObject *)ev)->value;
11735 Py_INCREF(value);
11736 Py_DECREF(ev);
11737 #else
11738 {
11739 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
11740 Py_DECREF(ev);
11741 if (likely(args)) {
11742 value = PySequence_GetItem(args, 0);
11743 Py_DECREF(args);
11744 }
11745 if (unlikely(!value)) {
11746 __Pyx_ErrRestore(NULL, NULL, NULL);
11747 Py_INCREF(Py_None);
11748 value = Py_None;
11749 }
11750 }
11751 #endif
11752 *pvalue = value;
11753 return 0;
11754 }
11755 static CYTHON_INLINE
__Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct * exc_state)11756 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
11757 PyObject *t, *v, *tb;
11758 t = exc_state->exc_type;
11759 v = exc_state->exc_value;
11760 tb = exc_state->exc_traceback;
11761 exc_state->exc_type = NULL;
11762 exc_state->exc_value = NULL;
11763 exc_state->exc_traceback = NULL;
11764 Py_XDECREF(t);
11765 Py_XDECREF(v);
11766 Py_XDECREF(tb);
11767 }
11768 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
__Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject * gen)11769 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
11770 const char *msg;
11771 if ((0)) {
11772 #ifdef __Pyx_Coroutine_USED
11773 } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
11774 msg = "coroutine already executing";
11775 #endif
11776 #ifdef __Pyx_AsyncGen_USED
11777 } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
11778 msg = "async generator already executing";
11779 #endif
11780 } else {
11781 msg = "generator already executing";
11782 }
11783 PyErr_SetString(PyExc_ValueError, msg);
11784 }
11785 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
__Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject * gen)11786 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
11787 const char *msg;
11788 if ((0)) {
11789 #ifdef __Pyx_Coroutine_USED
11790 } else if (__Pyx_Coroutine_Check(gen)) {
11791 msg = "can't send non-None value to a just-started coroutine";
11792 #endif
11793 #ifdef __Pyx_AsyncGen_USED
11794 } else if (__Pyx_AsyncGen_CheckExact(gen)) {
11795 msg = "can't send non-None value to a just-started async generator";
11796 #endif
11797 } else {
11798 msg = "can't send non-None value to a just-started generator";
11799 }
11800 PyErr_SetString(PyExc_TypeError, msg);
11801 }
11802 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
__Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject * gen,PyObject * value,CYTHON_UNUSED int closing)11803 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
11804 #ifdef __Pyx_Coroutine_USED
11805 if (!closing && __Pyx_Coroutine_Check(gen)) {
11806 PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
11807 } else
11808 #endif
11809 if (value) {
11810 #ifdef __Pyx_AsyncGen_USED
11811 if (__Pyx_AsyncGen_CheckExact(gen))
11812 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
11813 else
11814 #endif
11815 PyErr_SetNone(PyExc_StopIteration);
11816 }
11817 }
11818 static
__Pyx_Coroutine_SendEx(__pyx_CoroutineObject * self,PyObject * value,int closing)11819 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
11820 __Pyx_PyThreadState_declare
11821 PyThreadState *tstate;
11822 __Pyx_ExcInfoStruct *exc_state;
11823 PyObject *retval;
11824 assert(!self->is_running);
11825 if (unlikely(self->resume_label == 0)) {
11826 if (unlikely(value && value != Py_None)) {
11827 return __Pyx_Coroutine_NotStartedError((PyObject*)self);
11828 }
11829 }
11830 if (unlikely(self->resume_label == -1)) {
11831 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
11832 }
11833 #if CYTHON_FAST_THREAD_STATE
11834 __Pyx_PyThreadState_assign
11835 tstate = __pyx_tstate;
11836 #else
11837 tstate = __Pyx_PyThreadState_Current;
11838 #endif
11839 exc_state = &self->gi_exc_state;
11840 if (exc_state->exc_type) {
11841 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
11842 #else
11843 if (exc_state->exc_traceback) {
11844 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
11845 PyFrameObject *f = tb->tb_frame;
11846 Py_XINCREF(tstate->frame);
11847 assert(f->f_back == NULL);
11848 f->f_back = tstate->frame;
11849 }
11850 #endif
11851 }
11852 #if CYTHON_USE_EXC_INFO_STACK
11853 exc_state->previous_item = tstate->exc_info;
11854 tstate->exc_info = exc_state;
11855 #else
11856 if (exc_state->exc_type) {
11857 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
11858 } else {
11859 __Pyx_Coroutine_ExceptionClear(exc_state);
11860 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
11861 }
11862 #endif
11863 self->is_running = 1;
11864 retval = self->body((PyObject *) self, tstate, value);
11865 self->is_running = 0;
11866 #if CYTHON_USE_EXC_INFO_STACK
11867 exc_state = &self->gi_exc_state;
11868 tstate->exc_info = exc_state->previous_item;
11869 exc_state->previous_item = NULL;
11870 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
11871 #endif
11872 return retval;
11873 }
__Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct * exc_state)11874 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
11875 PyObject *exc_tb = exc_state->exc_traceback;
11876 if (likely(exc_tb)) {
11877 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
11878 #else
11879 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
11880 PyFrameObject *f = tb->tb_frame;
11881 Py_CLEAR(f->f_back);
11882 #endif
11883 }
11884 }
11885 static CYTHON_INLINE
__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject * gen,PyObject * retval)11886 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
11887 if (unlikely(!retval)) {
11888 __Pyx_PyThreadState_declare
11889 __Pyx_PyThreadState_assign
11890 if (!__Pyx_PyErr_Occurred()) {
11891 PyObject *exc = PyExc_StopIteration;
11892 #ifdef __Pyx_AsyncGen_USED
11893 if (__Pyx_AsyncGen_CheckExact(gen))
11894 exc = __Pyx_PyExc_StopAsyncIteration;
11895 #endif
11896 __Pyx_PyErr_SetNone(exc);
11897 }
11898 }
11899 return retval;
11900 }
11901 static CYTHON_INLINE
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject * gen)11902 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
11903 PyObject *ret;
11904 PyObject *val = NULL;
11905 __Pyx_Coroutine_Undelegate(gen);
11906 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
11907 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
11908 Py_XDECREF(val);
11909 return ret;
11910 }
__Pyx_Coroutine_Send(PyObject * self,PyObject * value)11911 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
11912 PyObject *retval;
11913 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
11914 PyObject *yf = gen->yieldfrom;
11915 if (unlikely(gen->is_running))
11916 return __Pyx_Coroutine_AlreadyRunningError(gen);
11917 if (yf) {
11918 PyObject *ret;
11919 gen->is_running = 1;
11920 #ifdef __Pyx_Generator_USED
11921 if (__Pyx_Generator_CheckExact(yf)) {
11922 ret = __Pyx_Coroutine_Send(yf, value);
11923 } else
11924 #endif
11925 #ifdef __Pyx_Coroutine_USED
11926 if (__Pyx_Coroutine_Check(yf)) {
11927 ret = __Pyx_Coroutine_Send(yf, value);
11928 } else
11929 #endif
11930 #ifdef __Pyx_AsyncGen_USED
11931 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
11932 ret = __Pyx_async_gen_asend_send(yf, value);
11933 } else
11934 #endif
11935 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
11936 if (PyGen_CheckExact(yf)) {
11937 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
11938 } else
11939 #endif
11940 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
11941 if (PyCoro_CheckExact(yf)) {
11942 ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
11943 } else
11944 #endif
11945 {
11946 if (value == Py_None)
11947 ret = Py_TYPE(yf)->tp_iternext(yf);
11948 else
11949 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
11950 }
11951 gen->is_running = 0;
11952 if (likely(ret)) {
11953 return ret;
11954 }
11955 retval = __Pyx_Coroutine_FinishDelegation(gen);
11956 } else {
11957 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
11958 }
11959 return __Pyx_Coroutine_MethodReturn(self, retval);
11960 }
__Pyx_Coroutine_CloseIter(__pyx_CoroutineObject * gen,PyObject * yf)11961 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
11962 PyObject *retval = NULL;
11963 int err = 0;
11964 #ifdef __Pyx_Generator_USED
11965 if (__Pyx_Generator_CheckExact(yf)) {
11966 retval = __Pyx_Coroutine_Close(yf);
11967 if (!retval)
11968 return -1;
11969 } else
11970 #endif
11971 #ifdef __Pyx_Coroutine_USED
11972 if (__Pyx_Coroutine_Check(yf)) {
11973 retval = __Pyx_Coroutine_Close(yf);
11974 if (!retval)
11975 return -1;
11976 } else
11977 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
11978 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
11979 if (!retval)
11980 return -1;
11981 } else
11982 #endif
11983 #ifdef __Pyx_AsyncGen_USED
11984 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
11985 retval = __Pyx_async_gen_asend_close(yf, NULL);
11986 } else
11987 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
11988 retval = __Pyx_async_gen_athrow_close(yf, NULL);
11989 } else
11990 #endif
11991 {
11992 PyObject *meth;
11993 gen->is_running = 1;
11994 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
11995 if (unlikely(!meth)) {
11996 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
11997 PyErr_WriteUnraisable(yf);
11998 }
11999 PyErr_Clear();
12000 } else {
12001 retval = PyObject_CallFunction(meth, NULL);
12002 Py_DECREF(meth);
12003 if (!retval)
12004 err = -1;
12005 }
12006 gen->is_running = 0;
12007 }
12008 Py_XDECREF(retval);
12009 return err;
12010 }
__Pyx_Generator_Next(PyObject * self)12011 static PyObject *__Pyx_Generator_Next(PyObject *self) {
12012 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
12013 PyObject *yf = gen->yieldfrom;
12014 if (unlikely(gen->is_running))
12015 return __Pyx_Coroutine_AlreadyRunningError(gen);
12016 if (yf) {
12017 PyObject *ret;
12018 gen->is_running = 1;
12019 #ifdef __Pyx_Generator_USED
12020 if (__Pyx_Generator_CheckExact(yf)) {
12021 ret = __Pyx_Generator_Next(yf);
12022 } else
12023 #endif
12024 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
12025 if (PyGen_CheckExact(yf)) {
12026 ret = _PyGen_Send((PyGenObject*)yf, NULL);
12027 } else
12028 #endif
12029 #ifdef __Pyx_Coroutine_USED
12030 if (__Pyx_Coroutine_Check(yf)) {
12031 ret = __Pyx_Coroutine_Send(yf, Py_None);
12032 } else
12033 #endif
12034 ret = Py_TYPE(yf)->tp_iternext(yf);
12035 gen->is_running = 0;
12036 if (likely(ret)) {
12037 return ret;
12038 }
12039 return __Pyx_Coroutine_FinishDelegation(gen);
12040 }
12041 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
12042 }
__Pyx_Coroutine_Close_Method(PyObject * self,CYTHON_UNUSED PyObject * arg)12043 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
12044 return __Pyx_Coroutine_Close(self);
12045 }
__Pyx_Coroutine_Close(PyObject * self)12046 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
12047 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
12048 PyObject *retval, *raised_exception;
12049 PyObject *yf = gen->yieldfrom;
12050 int err = 0;
12051 if (unlikely(gen->is_running))
12052 return __Pyx_Coroutine_AlreadyRunningError(gen);
12053 if (yf) {
12054 Py_INCREF(yf);
12055 err = __Pyx_Coroutine_CloseIter(gen, yf);
12056 __Pyx_Coroutine_Undelegate(gen);
12057 Py_DECREF(yf);
12058 }
12059 if (err == 0)
12060 PyErr_SetNone(PyExc_GeneratorExit);
12061 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
12062 if (unlikely(retval)) {
12063 const char *msg;
12064 Py_DECREF(retval);
12065 if ((0)) {
12066 #ifdef __Pyx_Coroutine_USED
12067 } else if (__Pyx_Coroutine_Check(self)) {
12068 msg = "coroutine ignored GeneratorExit";
12069 #endif
12070 #ifdef __Pyx_AsyncGen_USED
12071 } else if (__Pyx_AsyncGen_CheckExact(self)) {
12072 #if PY_VERSION_HEX < 0x03060000
12073 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
12074 #else
12075 msg = "async generator ignored GeneratorExit";
12076 #endif
12077 #endif
12078 } else {
12079 msg = "generator ignored GeneratorExit";
12080 }
12081 PyErr_SetString(PyExc_RuntimeError, msg);
12082 return NULL;
12083 }
12084 raised_exception = PyErr_Occurred();
12085 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
12086 if (raised_exception) PyErr_Clear();
12087 Py_INCREF(Py_None);
12088 return Py_None;
12089 }
12090 return NULL;
12091 }
__Pyx__Coroutine_Throw(PyObject * self,PyObject * typ,PyObject * val,PyObject * tb,PyObject * args,int close_on_genexit)12092 static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
12093 PyObject *args, int close_on_genexit) {
12094 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
12095 PyObject *yf = gen->yieldfrom;
12096 if (unlikely(gen->is_running))
12097 return __Pyx_Coroutine_AlreadyRunningError(gen);
12098 if (yf) {
12099 PyObject *ret;
12100 Py_INCREF(yf);
12101 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
12102 int err = __Pyx_Coroutine_CloseIter(gen, yf);
12103 Py_DECREF(yf);
12104 __Pyx_Coroutine_Undelegate(gen);
12105 if (err < 0)
12106 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
12107 goto throw_here;
12108 }
12109 gen->is_running = 1;
12110 if (0
12111 #ifdef __Pyx_Generator_USED
12112 || __Pyx_Generator_CheckExact(yf)
12113 #endif
12114 #ifdef __Pyx_Coroutine_USED
12115 || __Pyx_Coroutine_Check(yf)
12116 #endif
12117 ) {
12118 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
12119 #ifdef __Pyx_Coroutine_USED
12120 } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
12121 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
12122 #endif
12123 } else {
12124 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
12125 if (unlikely(!meth)) {
12126 Py_DECREF(yf);
12127 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
12128 gen->is_running = 0;
12129 return NULL;
12130 }
12131 PyErr_Clear();
12132 __Pyx_Coroutine_Undelegate(gen);
12133 gen->is_running = 0;
12134 goto throw_here;
12135 }
12136 if (likely(args)) {
12137 ret = PyObject_CallObject(meth, args);
12138 } else {
12139 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
12140 }
12141 Py_DECREF(meth);
12142 }
12143 gen->is_running = 0;
12144 Py_DECREF(yf);
12145 if (!ret) {
12146 ret = __Pyx_Coroutine_FinishDelegation(gen);
12147 }
12148 return __Pyx_Coroutine_MethodReturn(self, ret);
12149 }
12150 throw_here:
12151 __Pyx_Raise(typ, val, tb, NULL);
12152 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
12153 }
__Pyx_Coroutine_Throw(PyObject * self,PyObject * args)12154 static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
12155 PyObject *typ;
12156 PyObject *val = NULL;
12157 PyObject *tb = NULL;
12158 if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
12159 return NULL;
12160 return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
12161 }
__Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * exc_state,visitproc visit,void * arg)12162 static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
12163 Py_VISIT(exc_state->exc_type);
12164 Py_VISIT(exc_state->exc_value);
12165 Py_VISIT(exc_state->exc_traceback);
12166 return 0;
12167 }
__Pyx_Coroutine_traverse(__pyx_CoroutineObject * gen,visitproc visit,void * arg)12168 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
12169 Py_VISIT(gen->closure);
12170 Py_VISIT(gen->classobj);
12171 Py_VISIT(gen->yieldfrom);
12172 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
12173 }
__Pyx_Coroutine_clear(PyObject * self)12174 static int __Pyx_Coroutine_clear(PyObject *self) {
12175 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
12176 Py_CLEAR(gen->closure);
12177 Py_CLEAR(gen->classobj);
12178 Py_CLEAR(gen->yieldfrom);
12179 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
12180 #ifdef __Pyx_AsyncGen_USED
12181 if (__Pyx_AsyncGen_CheckExact(self)) {
12182 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
12183 }
12184 #endif
12185 Py_CLEAR(gen->gi_code);
12186 Py_CLEAR(gen->gi_name);
12187 Py_CLEAR(gen->gi_qualname);
12188 Py_CLEAR(gen->gi_modulename);
12189 return 0;
12190 }
__Pyx_Coroutine_dealloc(PyObject * self)12191 static void __Pyx_Coroutine_dealloc(PyObject *self) {
12192 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
12193 PyObject_GC_UnTrack(gen);
12194 if (gen->gi_weakreflist != NULL)
12195 PyObject_ClearWeakRefs(self);
12196 if (gen->resume_label >= 0) {
12197 PyObject_GC_Track(self);
12198 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
12199 if (PyObject_CallFinalizerFromDealloc(self))
12200 #else
12201 Py_TYPE(gen)->tp_del(self);
12202 if (self->ob_refcnt > 0)
12203 #endif
12204 {
12205 return;
12206 }
12207 PyObject_GC_UnTrack(self);
12208 }
12209 #ifdef __Pyx_AsyncGen_USED
12210 if (__Pyx_AsyncGen_CheckExact(self)) {
12211 /* We have to handle this case for asynchronous generators
12212 right here, because this code has to be between UNTRACK
12213 and GC_Del. */
12214 Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
12215 }
12216 #endif
12217 __Pyx_Coroutine_clear(self);
12218 PyObject_GC_Del(gen);
12219 }
__Pyx_Coroutine_del(PyObject * self)12220 static void __Pyx_Coroutine_del(PyObject *self) {
12221 PyObject *error_type, *error_value, *error_traceback;
12222 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
12223 __Pyx_PyThreadState_declare
12224 if (gen->resume_label < 0) {
12225 return;
12226 }
12227 #if !CYTHON_USE_TP_FINALIZE
12228 assert(self->ob_refcnt == 0);
12229 self->ob_refcnt = 1;
12230 #endif
12231 __Pyx_PyThreadState_assign
12232 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
12233 #ifdef __Pyx_AsyncGen_USED
12234 if (__Pyx_AsyncGen_CheckExact(self)) {
12235 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
12236 PyObject *finalizer = agen->ag_finalizer;
12237 if (finalizer && !agen->ag_closed) {
12238 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
12239 if (unlikely(!res)) {
12240 PyErr_WriteUnraisable(self);
12241 } else {
12242 Py_DECREF(res);
12243 }
12244 __Pyx_ErrRestore(error_type, error_value, error_traceback);
12245 return;
12246 }
12247 }
12248 #endif
12249 if (unlikely(gen->resume_label == 0 && !error_value)) {
12250 #ifdef __Pyx_Coroutine_USED
12251 #ifdef __Pyx_Generator_USED
12252 if (!__Pyx_Generator_CheckExact(self))
12253 #endif
12254 {
12255 PyObject_GC_UnTrack(self);
12256 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
12257 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
12258 PyErr_WriteUnraisable(self);
12259 #else
12260 {PyObject *msg;
12261 char *cmsg;
12262 #if CYTHON_COMPILING_IN_PYPY
12263 msg = NULL;
12264 cmsg = (char*) "coroutine was never awaited";
12265 #else
12266 char *cname;
12267 PyObject *qualname;
12268 qualname = gen->gi_qualname;
12269 cname = PyString_AS_STRING(qualname);
12270 msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
12271 if (unlikely(!msg)) {
12272 PyErr_Clear();
12273 cmsg = (char*) "coroutine was never awaited";
12274 } else {
12275 cmsg = PyString_AS_STRING(msg);
12276 }
12277 #endif
12278 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
12279 PyErr_WriteUnraisable(self);
12280 Py_XDECREF(msg);}
12281 #endif
12282 PyObject_GC_Track(self);
12283 }
12284 #endif
12285 } else {
12286 PyObject *res = __Pyx_Coroutine_Close(self);
12287 if (unlikely(!res)) {
12288 if (PyErr_Occurred())
12289 PyErr_WriteUnraisable(self);
12290 } else {
12291 Py_DECREF(res);
12292 }
12293 }
12294 __Pyx_ErrRestore(error_type, error_value, error_traceback);
12295 #if !CYTHON_USE_TP_FINALIZE
12296 assert(self->ob_refcnt > 0);
12297 if (--self->ob_refcnt == 0) {
12298 return;
12299 }
12300 {
12301 Py_ssize_t refcnt = self->ob_refcnt;
12302 _Py_NewReference(self);
12303 self->ob_refcnt = refcnt;
12304 }
12305 #if CYTHON_COMPILING_IN_CPYTHON
12306 assert(PyType_IS_GC(self->ob_type) &&
12307 _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
12308 _Py_DEC_REFTOTAL;
12309 #endif
12310 #ifdef COUNT_ALLOCS
12311 --Py_TYPE(self)->tp_frees;
12312 --Py_TYPE(self)->tp_allocs;
12313 #endif
12314 #endif
12315 }
12316 static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject * self,CYTHON_UNUSED void * context)12317 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
12318 {
12319 PyObject *name = self->gi_name;
12320 if (unlikely(!name)) name = Py_None;
12321 Py_INCREF(name);
12322 return name;
12323 }
12324 static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject * self,PyObject * value,CYTHON_UNUSED void * context)12325 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
12326 {
12327 PyObject *tmp;
12328 #if PY_MAJOR_VERSION >= 3
12329 if (unlikely(value == NULL || !PyUnicode_Check(value)))
12330 #else
12331 if (unlikely(value == NULL || !PyString_Check(value)))
12332 #endif
12333 {
12334 PyErr_SetString(PyExc_TypeError,
12335 "__name__ must be set to a string object");
12336 return -1;
12337 }
12338 tmp = self->gi_name;
12339 Py_INCREF(value);
12340 self->gi_name = value;
12341 Py_XDECREF(tmp);
12342 return 0;
12343 }
12344 static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject * self,CYTHON_UNUSED void * context)12345 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
12346 {
12347 PyObject *name = self->gi_qualname;
12348 if (unlikely(!name)) name = Py_None;
12349 Py_INCREF(name);
12350 return name;
12351 }
12352 static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject * self,PyObject * value,CYTHON_UNUSED void * context)12353 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
12354 {
12355 PyObject *tmp;
12356 #if PY_MAJOR_VERSION >= 3
12357 if (unlikely(value == NULL || !PyUnicode_Check(value)))
12358 #else
12359 if (unlikely(value == NULL || !PyString_Check(value)))
12360 #endif
12361 {
12362 PyErr_SetString(PyExc_TypeError,
12363 "__qualname__ must be set to a string object");
12364 return -1;
12365 }
12366 tmp = self->gi_qualname;
12367 Py_INCREF(value);
12368 self->gi_qualname = value;
12369 Py_XDECREF(tmp);
12370 return 0;
12371 }
__Pyx__Coroutine_New(PyTypeObject * type,__pyx_coroutine_body_t body,PyObject * code,PyObject * closure,PyObject * name,PyObject * qualname,PyObject * module_name)12372 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
12373 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
12374 PyObject *name, PyObject *qualname, PyObject *module_name) {
12375 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
12376 if (unlikely(!gen))
12377 return NULL;
12378 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
12379 }
__Pyx__Coroutine_NewInit(__pyx_CoroutineObject * gen,__pyx_coroutine_body_t body,PyObject * code,PyObject * closure,PyObject * name,PyObject * qualname,PyObject * module_name)12380 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
12381 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
12382 PyObject *name, PyObject *qualname, PyObject *module_name) {
12383 gen->body = body;
12384 gen->closure = closure;
12385 Py_XINCREF(closure);
12386 gen->is_running = 0;
12387 gen->resume_label = 0;
12388 gen->classobj = NULL;
12389 gen->yieldfrom = NULL;
12390 gen->gi_exc_state.exc_type = NULL;
12391 gen->gi_exc_state.exc_value = NULL;
12392 gen->gi_exc_state.exc_traceback = NULL;
12393 #if CYTHON_USE_EXC_INFO_STACK
12394 gen->gi_exc_state.previous_item = NULL;
12395 #endif
12396 gen->gi_weakreflist = NULL;
12397 Py_XINCREF(qualname);
12398 gen->gi_qualname = qualname;
12399 Py_XINCREF(name);
12400 gen->gi_name = name;
12401 Py_XINCREF(module_name);
12402 gen->gi_modulename = module_name;
12403 Py_XINCREF(code);
12404 gen->gi_code = code;
12405 PyObject_GC_Track(gen);
12406 return gen;
12407 }
12408
12409 /* PatchModuleWithCoroutine */
__Pyx_Coroutine_patch_module(PyObject * module,const char * py_code)12410 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
12411 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
12412 int result;
12413 PyObject *globals, *result_obj;
12414 globals = PyDict_New(); if (unlikely(!globals)) goto ignore;
12415 result = PyDict_SetItemString(globals, "_cython_coroutine_type",
12416 #ifdef __Pyx_Coroutine_USED
12417 (PyObject*)__pyx_CoroutineType);
12418 #else
12419 Py_None);
12420 #endif
12421 if (unlikely(result < 0)) goto ignore;
12422 result = PyDict_SetItemString(globals, "_cython_generator_type",
12423 #ifdef __Pyx_Generator_USED
12424 (PyObject*)__pyx_GeneratorType);
12425 #else
12426 Py_None);
12427 #endif
12428 if (unlikely(result < 0)) goto ignore;
12429 if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
12430 if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
12431 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
12432 if (unlikely(!result_obj)) goto ignore;
12433 Py_DECREF(result_obj);
12434 Py_DECREF(globals);
12435 return module;
12436 ignore:
12437 Py_XDECREF(globals);
12438 PyErr_WriteUnraisable(module);
12439 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
12440 Py_DECREF(module);
12441 module = NULL;
12442 }
12443 #else
12444 py_code++;
12445 #endif
12446 return module;
12447 }
12448
12449 /* PatchGeneratorABC */
12450 #ifndef CYTHON_REGISTER_ABCS
12451 #define CYTHON_REGISTER_ABCS 1
12452 #endif
12453 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
12454 static PyObject* __Pyx_patch_abc_module(PyObject *module);
__Pyx_patch_abc_module(PyObject * module)12455 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
12456 module = __Pyx_Coroutine_patch_module(
12457 module, ""
12458 "if _cython_generator_type is not None:\n"
12459 " try: Generator = _module.Generator\n"
12460 " except AttributeError: pass\n"
12461 " else: Generator.register(_cython_generator_type)\n"
12462 "if _cython_coroutine_type is not None:\n"
12463 " try: Coroutine = _module.Coroutine\n"
12464 " except AttributeError: pass\n"
12465 " else: Coroutine.register(_cython_coroutine_type)\n"
12466 );
12467 return module;
12468 }
12469 #endif
__Pyx_patch_abc(void)12470 static int __Pyx_patch_abc(void) {
12471 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
12472 static int abc_patched = 0;
12473 if (CYTHON_REGISTER_ABCS && !abc_patched) {
12474 PyObject *module;
12475 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
12476 if (!module) {
12477 PyErr_WriteUnraisable(NULL);
12478 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
12479 ((PY_MAJOR_VERSION >= 3) ?
12480 "Cython module failed to register with collections.abc module" :
12481 "Cython module failed to register with collections module"), 1) < 0)) {
12482 return -1;
12483 }
12484 } else {
12485 module = __Pyx_patch_abc_module(module);
12486 abc_patched = 1;
12487 if (unlikely(!module))
12488 return -1;
12489 Py_DECREF(module);
12490 }
12491 module = PyImport_ImportModule("backports_abc");
12492 if (module) {
12493 module = __Pyx_patch_abc_module(module);
12494 Py_XDECREF(module);
12495 }
12496 if (!module) {
12497 PyErr_Clear();
12498 }
12499 }
12500 #else
12501 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
12502 #endif
12503 return 0;
12504 }
12505
12506 /* Generator */
12507 static PyMethodDef __pyx_Generator_methods[] = {
12508 {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
12509 (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
12510 {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
12511 (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
12512 {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
12513 (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
12514 {0, 0, 0, 0}
12515 };
12516 static PyMemberDef __pyx_Generator_memberlist[] = {
12517 {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
12518 {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
12519 (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
12520 {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
12521 {0, 0, 0, 0, 0}
12522 };
12523 static PyGetSetDef __pyx_Generator_getsets[] = {
12524 {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
12525 (char*) PyDoc_STR("name of the generator"), 0},
12526 {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
12527 (char*) PyDoc_STR("qualified name of the generator"), 0},
12528 {0, 0, 0, 0, 0}
12529 };
12530 static PyTypeObject __pyx_GeneratorType_type = {
12531 PyVarObject_HEAD_INIT(0, 0)
12532 "generator",
12533 sizeof(__pyx_CoroutineObject),
12534 0,
12535 (destructor) __Pyx_Coroutine_dealloc,
12536 0,
12537 0,
12538 0,
12539 0,
12540 0,
12541 0,
12542 0,
12543 0,
12544 0,
12545 0,
12546 0,
12547 0,
12548 0,
12549 0,
12550 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
12551 0,
12552 (traverseproc) __Pyx_Coroutine_traverse,
12553 0,
12554 0,
12555 offsetof(__pyx_CoroutineObject, gi_weakreflist),
12556 0,
12557 (iternextfunc) __Pyx_Generator_Next,
12558 __pyx_Generator_methods,
12559 __pyx_Generator_memberlist,
12560 __pyx_Generator_getsets,
12561 0,
12562 0,
12563 0,
12564 0,
12565 0,
12566 0,
12567 0,
12568 0,
12569 0,
12570 0,
12571 0,
12572 0,
12573 0,
12574 0,
12575 0,
12576 #if CYTHON_USE_TP_FINALIZE
12577 0,
12578 #else
12579 __Pyx_Coroutine_del,
12580 #endif
12581 0,
12582 #if CYTHON_USE_TP_FINALIZE
12583 __Pyx_Coroutine_del,
12584 #elif PY_VERSION_HEX >= 0x030400a1
12585 0,
12586 #endif
12587 #if PY_VERSION_HEX >= 0x030800b1
12588 0,
12589 #endif
12590 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
12591 0,
12592 #endif
12593 };
__pyx_Generator_init(void)12594 static int __pyx_Generator_init(void) {
12595 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
12596 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
12597 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
12598 if (unlikely(!__pyx_GeneratorType)) {
12599 return -1;
12600 }
12601 return 0;
12602 }
12603
12604 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)12605 static int __Pyx_check_binary_version(void) {
12606 char ctversion[4], rtversion[4];
12607 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
12608 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
12609 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
12610 char message[200];
12611 PyOS_snprintf(message, sizeof(message),
12612 "compiletime version %s of module '%.100s' "
12613 "does not match runtime version %s",
12614 ctversion, __Pyx_MODULE_NAME, rtversion);
12615 return PyErr_WarnEx(NULL, message, 1);
12616 }
12617 return 0;
12618 }
12619
12620 /* FunctionImport */
12621 #ifndef __PYX_HAVE_RT_ImportFunction
12622 #define __PYX_HAVE_RT_ImportFunction
__Pyx_ImportFunction(PyObject * module,const char * funcname,void (** f)(void),const char * sig)12623 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
12624 PyObject *d = 0;
12625 PyObject *cobj = 0;
12626 union {
12627 void (*fp)(void);
12628 void *p;
12629 } tmp;
12630 d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
12631 if (!d)
12632 goto bad;
12633 cobj = PyDict_GetItemString(d, funcname);
12634 if (!cobj) {
12635 PyErr_Format(PyExc_ImportError,
12636 "%.200s does not export expected C function %.200s",
12637 PyModule_GetName(module), funcname);
12638 goto bad;
12639 }
12640 #if PY_VERSION_HEX >= 0x02070000
12641 if (!PyCapsule_IsValid(cobj, sig)) {
12642 PyErr_Format(PyExc_TypeError,
12643 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
12644 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
12645 goto bad;
12646 }
12647 tmp.p = PyCapsule_GetPointer(cobj, sig);
12648 #else
12649 {const char *desc, *s1, *s2;
12650 desc = (const char *)PyCObject_GetDesc(cobj);
12651 if (!desc)
12652 goto bad;
12653 s1 = desc; s2 = sig;
12654 while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
12655 if (*s1 != *s2) {
12656 PyErr_Format(PyExc_TypeError,
12657 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
12658 PyModule_GetName(module), funcname, sig, desc);
12659 goto bad;
12660 }
12661 tmp.p = PyCObject_AsVoidPtr(cobj);}
12662 #endif
12663 *f = tmp.fp;
12664 if (!(*f))
12665 goto bad;
12666 Py_DECREF(d);
12667 return 0;
12668 bad:
12669 Py_XDECREF(d);
12670 return -1;
12671 }
12672 #endif
12673
12674 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)12675 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
12676 while (t->p) {
12677 #if PY_MAJOR_VERSION < 3
12678 if (t->is_unicode) {
12679 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
12680 } else if (t->intern) {
12681 *t->p = PyString_InternFromString(t->s);
12682 } else {
12683 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
12684 }
12685 #else
12686 if (t->is_unicode | t->is_str) {
12687 if (t->intern) {
12688 *t->p = PyUnicode_InternFromString(t->s);
12689 } else if (t->encoding) {
12690 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
12691 } else {
12692 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
12693 }
12694 } else {
12695 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
12696 }
12697 #endif
12698 if (!*t->p)
12699 return -1;
12700 if (PyObject_Hash(*t->p) == -1)
12701 return -1;
12702 ++t;
12703 }
12704 return 0;
12705 }
12706
__Pyx_PyUnicode_FromString(const char * c_str)12707 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
12708 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
12709 }
__Pyx_PyObject_AsString(PyObject * o)12710 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
12711 Py_ssize_t ignore;
12712 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
12713 }
12714 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
12715 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)12716 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12717 char* defenc_c;
12718 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
12719 if (!defenc) return NULL;
12720 defenc_c = PyBytes_AS_STRING(defenc);
12721 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12722 {
12723 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
12724 char* c;
12725 for (c = defenc_c; c < end; c++) {
12726 if ((unsigned char) (*c) >= 128) {
12727 PyUnicode_AsASCIIString(o);
12728 return NULL;
12729 }
12730 }
12731 }
12732 #endif
12733 *length = PyBytes_GET_SIZE(defenc);
12734 return defenc_c;
12735 }
12736 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)12737 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12738 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
12739 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12740 if (likely(PyUnicode_IS_ASCII(o))) {
12741 *length = PyUnicode_GET_LENGTH(o);
12742 return PyUnicode_AsUTF8(o);
12743 } else {
12744 PyUnicode_AsASCIIString(o);
12745 return NULL;
12746 }
12747 #else
12748 return PyUnicode_AsUTF8AndSize(o, length);
12749 #endif
12750 }
12751 #endif
12752 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)12753 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12754 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
12755 if (
12756 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12757 __Pyx_sys_getdefaultencoding_not_ascii &&
12758 #endif
12759 PyUnicode_Check(o)) {
12760 return __Pyx_PyUnicode_AsStringAndSize(o, length);
12761 } else
12762 #endif
12763 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
12764 if (PyByteArray_Check(o)) {
12765 *length = PyByteArray_GET_SIZE(o);
12766 return PyByteArray_AS_STRING(o);
12767 } else
12768 #endif
12769 {
12770 char* result;
12771 int r = PyBytes_AsStringAndSize(o, &result, length);
12772 if (unlikely(r < 0)) {
12773 return NULL;
12774 } else {
12775 return result;
12776 }
12777 }
12778 }
__Pyx_PyObject_IsTrue(PyObject * x)12779 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
12780 int is_true = x == Py_True;
12781 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
12782 else return PyObject_IsTrue(x);
12783 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)12784 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
12785 int retval;
12786 if (unlikely(!x)) return -1;
12787 retval = __Pyx_PyObject_IsTrue(x);
12788 Py_DECREF(x);
12789 return retval;
12790 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)12791 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
12792 #if PY_MAJOR_VERSION >= 3
12793 if (PyLong_Check(result)) {
12794 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
12795 "__int__ returned non-int (type %.200s). "
12796 "The ability to return an instance of a strict subclass of int "
12797 "is deprecated, and may be removed in a future version of Python.",
12798 Py_TYPE(result)->tp_name)) {
12799 Py_DECREF(result);
12800 return NULL;
12801 }
12802 return result;
12803 }
12804 #endif
12805 PyErr_Format(PyExc_TypeError,
12806 "__%.4s__ returned non-%.4s (type %.200s)",
12807 type_name, type_name, Py_TYPE(result)->tp_name);
12808 Py_DECREF(result);
12809 return NULL;
12810 }
__Pyx_PyNumber_IntOrLong(PyObject * x)12811 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
12812 #if CYTHON_USE_TYPE_SLOTS
12813 PyNumberMethods *m;
12814 #endif
12815 const char *name = NULL;
12816 PyObject *res = NULL;
12817 #if PY_MAJOR_VERSION < 3
12818 if (likely(PyInt_Check(x) || PyLong_Check(x)))
12819 #else
12820 if (likely(PyLong_Check(x)))
12821 #endif
12822 return __Pyx_NewRef(x);
12823 #if CYTHON_USE_TYPE_SLOTS
12824 m = Py_TYPE(x)->tp_as_number;
12825 #if PY_MAJOR_VERSION < 3
12826 if (m && m->nb_int) {
12827 name = "int";
12828 res = m->nb_int(x);
12829 }
12830 else if (m && m->nb_long) {
12831 name = "long";
12832 res = m->nb_long(x);
12833 }
12834 #else
12835 if (likely(m && m->nb_int)) {
12836 name = "int";
12837 res = m->nb_int(x);
12838 }
12839 #endif
12840 #else
12841 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
12842 res = PyNumber_Int(x);
12843 }
12844 #endif
12845 if (likely(res)) {
12846 #if PY_MAJOR_VERSION < 3
12847 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
12848 #else
12849 if (unlikely(!PyLong_CheckExact(res))) {
12850 #endif
12851 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
12852 }
12853 }
12854 else if (!PyErr_Occurred()) {
12855 PyErr_SetString(PyExc_TypeError,
12856 "an integer is required");
12857 }
12858 return res;
12859 }
12860 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
12861 Py_ssize_t ival;
12862 PyObject *x;
12863 #if PY_MAJOR_VERSION < 3
12864 if (likely(PyInt_CheckExact(b))) {
12865 if (sizeof(Py_ssize_t) >= sizeof(long))
12866 return PyInt_AS_LONG(b);
12867 else
12868 return PyInt_AsSsize_t(b);
12869 }
12870 #endif
12871 if (likely(PyLong_CheckExact(b))) {
12872 #if CYTHON_USE_PYLONG_INTERNALS
12873 const digit* digits = ((PyLongObject*)b)->ob_digit;
12874 const Py_ssize_t size = Py_SIZE(b);
12875 if (likely(__Pyx_sst_abs(size) <= 1)) {
12876 ival = likely(size) ? digits[0] : 0;
12877 if (size == -1) ival = -ival;
12878 return ival;
12879 } else {
12880 switch (size) {
12881 case 2:
12882 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
12883 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12884 }
12885 break;
12886 case -2:
12887 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
12888 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12889 }
12890 break;
12891 case 3:
12892 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
12893 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12894 }
12895 break;
12896 case -3:
12897 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
12898 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12899 }
12900 break;
12901 case 4:
12902 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
12903 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]));
12904 }
12905 break;
12906 case -4:
12907 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
12908 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]));
12909 }
12910 break;
12911 }
12912 }
12913 #endif
12914 return PyLong_AsSsize_t(b);
12915 }
12916 x = PyNumber_Index(b);
12917 if (!x) return -1;
12918 ival = PyInt_AsSsize_t(x);
12919 Py_DECREF(x);
12920 return ival;
12921 }
12922 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
12923 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
12924 }
12925 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
12926 return PyInt_FromSize_t(ival);
12927 }
12928
12929
12930 #endif /* Py_PYTHON_H */
12931