Generated by Cython 0.29
Yellow lines hint at Python interaction.
Click on a line that starts with a "+
" to see the C code that Cython generated for it.
Raw output: decoder.c
001: # This file is part of Xpra.
002: # Copyright (C) 2012-2018 Antoine Martin <antoine@devloop.org.uk>
003: # Xpra is released under the terms of the GNU GPL v2, or, at your option, any
004: # later version. See the file COPYING for details.
005:
006: #cython: auto_pickle=False, wraparound=False, cdivision=True, language_level=3
007: from __future__ import absolute_import
008:
+009: import os
__pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+010: import sys
__pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+011: import time
__pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
012:
+013: from xpra.log import Logger
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_Logger); __Pyx_GIVEREF(__pyx_n_s_Logger); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Logger); __pyx_t_2 = __Pyx_Import(__pyx_n_s_xpra_log, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Logger, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+014: log = Logger("decoder", "vpx")
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_log, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_u_decoder, __pyx_n_u_vpx); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4);
015:
+016: from xpra.codecs.codec_constants import get_subsampling_divs
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_get_subsampling_divs); __Pyx_GIVEREF(__pyx_n_s_get_subsampling_divs); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_subsampling_divs); __pyx_t_2 = __Pyx_Import(__pyx_n_s_xpra_codecs_codec_constants, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_subsampling_divs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_subsampling_divs, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+017: from xpra.codecs.image_wrapper import ImageWrapper
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_ImageWrapper); __Pyx_GIVEREF(__pyx_n_s_ImageWrapper); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ImageWrapper); __pyx_t_1 = __Pyx_Import(__pyx_n_s_xpra_codecs_image_wrapper, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ImageWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ImageWrapper, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
018: from xpra.buffers.membuf cimport padbuf, MemBuf, memalign, object_as_buffer, memory_as_pybuffer
+019: from xpra.os_util import bytestostr, OSX
__pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_bytestostr); __Pyx_GIVEREF(__pyx_n_s_bytestostr); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_bytestostr); __Pyx_INCREF(__pyx_n_s_OSX); __Pyx_GIVEREF(__pyx_n_s_OSX); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_OSX); __pyx_t_2 = __Pyx_Import(__pyx_n_s_xpra_os_util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytestostr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytestostr, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_OSX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_OSX, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+020: from xpra.util import envint
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_envint); __Pyx_GIVEREF(__pyx_n_s_envint); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_envint); __pyx_t_1 = __Pyx_Import(__pyx_n_s_xpra_util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_envint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_envint, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
021:
022: from libc.stdint cimport uint8_t, int64_t
023: from xpra.monotonic_time cimport monotonic_time
024:
025:
026: #sensible default:
+027: cpus = 2
if (PyDict_SetItem(__pyx_d, __pyx_n_s_cpus, __pyx_int_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
+028: try:
{ /*try:*/ { /* … */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_try_end; __pyx_L2_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L3_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L7_try_end:; }
+029: cpus = os.cpu_count()
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cpu_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_cpus, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L2_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+030: except:
/*except:*/ { __Pyx_AddTraceback("xpra.codecs.vpx.decoder", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_6) < 0) __PYX_ERR(0, 30, __pyx_L4_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_6);
+031: try:
{ /*try:*/ { /* … */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L17_try_end; __pyx_L10_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+032: import multiprocessing
__pyx_t_10 = __Pyx_Import(__pyx_n_s_multiprocessing, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_d, __pyx_n_s_multiprocessing, __pyx_t_10) < 0) __PYX_ERR(0, 32, __pyx_L10_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+033: cpus = multiprocessing.cpu_count()
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 33, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_cpu_count); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 33, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 33, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_cpus, __pyx_t_10) < 0) __PYX_ERR(0, 33, __pyx_L10_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+034: except:
/*except:*/ { __Pyx_ErrRestore(0,0,0); goto __pyx_L11_exception_handled; } __pyx_L11_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L17_try_end:; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L3_exception_handled; } __pyx_L4_except_error:;
035: pass
+036: cdef int VPX_THREADS = envint("XPRA_VPX_THREADS", max(1, cpus-1))
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_envint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cpus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = 1; __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyObject_RichCompare(__pyx_t_1, __pyx_t_10, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_13) { __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_11 = __Pyx_PyInt_From_long(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = __pyx_t_11; __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_u_XPRA_VPX_THREADS); __Pyx_GIVEREF(__pyx_n_u_XPRA_VPX_THREADS); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_XPRA_VPX_THREADS); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_4xpra_6codecs_3vpx_7decoder_VPX_THREADS = __pyx_t_14;
037:
+038: cdef inline int roundup(int n, int m):
static CYTHON_INLINE int __pyx_f_4xpra_6codecs_3vpx_7decoder_roundup(int __pyx_v_n, int __pyx_v_m) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("roundup", 0); /* … */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+039: return (n + m - 1) & ~(m - 1)
__pyx_r = (((__pyx_v_n + __pyx_v_m) - 1) & (~(__pyx_v_m - 1))); goto __pyx_L0;
040:
041:
042: cdef extern from "stdlib.h":
043: void* malloc(size_t __size)
044:
045: cdef extern from "string.h":
046: void *memcpy(void * destination, void * source, size_t num) nogil
047: void *memset(void * ptr, int value, size_t num) nogil
048:
049: ctypedef long vpx_img_fmt_t
+050: ctypedef void vpx_codec_iface_t
typedef void __pyx_t_4xpra_6codecs_3vpx_7decoder_vpx_codec_iface_t;
051:
052:
053: cdef extern from "vpx/vpx_codec.h":
054: ctypedef const void *vpx_codec_iter_t
055: ctypedef long vpx_codec_flags_t
056: ctypedef int vpx_codec_err_t
057: ctypedef struct vpx_codec_ctx_t:
058: pass
059: const char *vpx_codec_error(vpx_codec_ctx_t *ctx)
060: vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx)
061: const char *vpx_codec_version_str()
062: const char *vpx_codec_build_config()
063:
064: cdef extern from "vpx/vpx_image.h":
065: cdef int VPX_IMG_FMT_I420
066: ctypedef struct vpx_image_t:
067: unsigned int w
068: unsigned int h
069: unsigned int d_w
070: unsigned int d_h
071: vpx_img_fmt_t fmt
072: unsigned char *planes[4]
073: int stride[4]
074: int bps
075: unsigned int x_chroma_shift
076: unsigned int y_chroma_shift
077:
078: cdef extern from "vpx/vp8dx.h":
079: const vpx_codec_iface_t *vpx_codec_vp8_dx()
080: const vpx_codec_iface_t *vpx_codec_vp9_dx()
081:
082: cdef extern from "vpx/vpx_decoder.h":
083: ctypedef struct vpx_codec_enc_cfg_t:
084: unsigned int rc_target_bitrate
085: unsigned int g_lag_in_frames
086: unsigned int rc_dropframe_thresh
087: unsigned int rc_resize_allowed
088: unsigned int g_w
089: unsigned int g_h
090: unsigned int g_error_resilient
091: ctypedef struct vpx_codec_dec_cfg_t:
092: unsigned int threads
093: unsigned int w
094: unsigned int h
095: cdef int VPX_CODEC_OK
096: cdef int VPX_DECODER_ABI_VERSION
097:
098: vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, vpx_codec_iface_t *iface,
099: vpx_codec_dec_cfg_t *cfg, vpx_codec_flags_t flags, int ver)
100:
101: vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, const uint8_t *data,
102: unsigned int data_sz, void *user_priv, long deadline) nogil
103:
104: vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter) nogil
105:
106:
107: #https://groups.google.com/a/webmproject.org/forum/?fromgroups#!msg/webm-discuss/f5Rmi-Cu63k/IXIzwVoXt_wJ
108: #"RGB is not supported. You need to convert your source to YUV, and then compress that."
+109: COLORSPACES = {}
__pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_COLORSPACES, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+110: CODECS = ["vp8", "vp9"]
__pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_u_vp8); __Pyx_GIVEREF(__pyx_n_u_vp8); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_vp8); __Pyx_INCREF(__pyx_n_u_vp9); __Pyx_GIVEREF(__pyx_n_u_vp9); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_vp9); if (PyDict_SetItem(__pyx_d, __pyx_n_s_CODECS, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+111: COLORSPACES["vp8"] = ["YUV420P"]
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_u_YUV420P); __Pyx_GIVEREF(__pyx_n_u_YUV420P); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_YUV420P); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_COLORSPACES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_vp8, __pyx_t_2) < 0)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+112: vp9_cs = ["YUV420P"]
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_u_YUV420P); __Pyx_GIVEREF(__pyx_n_u_YUV420P); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_YUV420P); if (PyDict_SetItem(__pyx_d, __pyx_n_s_vp9_cs, __pyx_t_2) < 0) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
113: #this is the ABI version with libvpx 1.4.0:
+114: if VPX_DECODER_ABI_VERSION>=9:
__pyx_t_13 = ((VPX_DECODER_ABI_VERSION >= 9) != 0); if (__pyx_t_13) { /* … */ goto __pyx_L18; }
+115: vp9_cs.append("YUV444P")
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_vp9_cs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_n_u_YUV444P); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
116: else:
+117: if OSX:
/*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_OSX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_13) { goto __pyx_L19; }
118: pass #cannot build libvpx 1.4 on osx... so skip warning
119: else:
+120: log.warn("Warning: libvpx ABI version %s is too old:", VPX_DECODER_ABI_VERSION)
/*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(VPX_DECODER_ABI_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_kp_u_Warning_libvpx_ABI_version_s_is); __Pyx_GIVEREF(__pyx_kp_u_Warning_libvpx_ABI_version_s_is); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_Warning_libvpx_ABI_version_s_is); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+121: log.warn(" disabling YUV444P support with VP9")
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L19:; } __pyx_L18:; /* … */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_disabling_YUV444P_support_with); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5);
+122: COLORSPACES["vp9"] = vp9_cs
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_vp9_cs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_COLORSPACES); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_vp9, __pyx_t_2) < 0)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
123:
124:
+125: def init_module():
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_1init_module(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_3vpx_7decoder_1init_module = {"init_module", (PyCFunction)__pyx_pw_4xpra_6codecs_3vpx_7decoder_1init_module, METH_NOARGS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_1init_module(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init_module (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_init_module(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_init_module(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init_module", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.init_module", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_3vpx_7decoder_1init_module, NULL, __pyx_n_s_xpra_codecs_vpx_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_module, __pyx_t_2) < 0) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_xpra_codecs_vpx_decoder_pyx, __pyx_n_s_init_module, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 125, __pyx_L1_error)
+126: log("vpx.decoder.init_module() info=%s", get_info())
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_u_vpx_decoder_init_module_info_s, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_u_vpx_decoder_init_module_info_s, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_kp_u_vpx_decoder_init_module_info_s); __Pyx_GIVEREF(__pyx_kp_u_vpx_decoder_init_module_info_s); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_kp_u_vpx_decoder_init_module_info_s); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+127: log("supported codecs: %s", CODECS)
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CODECS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_supported_codecs_s, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_supported_codecs_s, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_kp_u_supported_codecs_s); __Pyx_GIVEREF(__pyx_kp_u_supported_codecs_s); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_kp_u_supported_codecs_s); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+128: log("supported colorspaces: %s", COLORSPACES)
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_COLORSPACES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_u_supported_colorspaces_s, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_u_supported_colorspaces_s, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_kp_u_supported_colorspaces_s); __Pyx_GIVEREF(__pyx_kp_u_supported_colorspaces_s); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_kp_u_supported_colorspaces_s); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
129:
+130: def cleanup_module():
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_3cleanup_module(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_3vpx_7decoder_3cleanup_module = {"cleanup_module", (PyCFunction)__pyx_pw_4xpra_6codecs_3vpx_7decoder_3cleanup_module, METH_NOARGS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_3cleanup_module(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cleanup_module (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_2cleanup_module(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_2cleanup_module(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cleanup_module", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.cleanup_module", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_3vpx_7decoder_3cleanup_module, NULL, __pyx_n_s_xpra_codecs_vpx_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_cleanup_module, __pyx_t_2) < 0) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_xpra_codecs_vpx_decoder_pyx, __pyx_n_s_cleanup_module, 130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 130, __pyx_L1_error)
+131: log("vpx.decoder.cleanup_module()")
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_vpx_decoder_cleanup_module) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_vpx_decoder_cleanup_module); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
132:
+133: def get_abi_version():
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_5get_abi_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_3vpx_7decoder_5get_abi_version = {"get_abi_version", (PyCFunction)__pyx_pw_4xpra_6codecs_3vpx_7decoder_5get_abi_version, METH_NOARGS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_5get_abi_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_abi_version (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_4get_abi_version(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_4get_abi_version(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_abi_version", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.get_abi_version", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_3vpx_7decoder_5get_abi_version, NULL, __pyx_n_s_xpra_codecs_vpx_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_abi_version, __pyx_t_2) < 0) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_xpra_codecs_vpx_decoder_pyx, __pyx_n_s_get_abi_version, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 133, __pyx_L1_error)
+134: return VPX_DECODER_ABI_VERSION
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(VPX_DECODER_ABI_VERSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
135:
+136: def get_version():
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_3vpx_7decoder_7get_version = {"get_version", (PyCFunction)__pyx_pw_4xpra_6codecs_3vpx_7decoder_7get_version, METH_NOARGS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_version (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_6get_version(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_6get_version(CYTHON_UNUSED PyObject *__pyx_self) { char const *__pyx_v_v; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_version", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.get_version", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_v); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* … */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_3vpx_7decoder_7get_version, NULL, __pyx_n_s_xpra_codecs_vpx_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_version, __pyx_t_2) < 0) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_xpra_codecs_vpx_decoder_pyx, __pyx_n_s_get_version, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 136, __pyx_L1_error)
+137: v = vpx_codec_version_str()
__pyx_v_v = vpx_codec_version_str();
+138: return bytestostr(v)
__Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_bytestostr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
139:
+140: def get_type():
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_9get_type(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_3vpx_7decoder_9get_type = {"get_type", (PyCFunction)__pyx_pw_4xpra_6codecs_3vpx_7decoder_9get_type, METH_NOARGS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_9get_type(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_type (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_8get_type(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_8get_type(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_type", 0); /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_3vpx_7decoder_9get_type, NULL, __pyx_n_s_xpra_codecs_vpx_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_type, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_xpra_codecs_vpx_decoder_pyx, __pyx_n_s_get_type, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 140, __pyx_L1_error)
+141: return "vpx"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_u_vpx); __pyx_r = __pyx_n_u_vpx; goto __pyx_L0;
142:
+143: def get_encodings():
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_11get_encodings(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_3vpx_7decoder_11get_encodings = {"get_encodings", (PyCFunction)__pyx_pw_4xpra_6codecs_3vpx_7decoder_11get_encodings, METH_NOARGS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_11get_encodings(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_encodings (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_10get_encodings(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_10get_encodings(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_encodings", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.get_encodings", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_3vpx_7decoder_11get_encodings, NULL, __pyx_n_s_xpra_codecs_vpx_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_encodings, __pyx_t_2) < 0) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_xpra_codecs_vpx_decoder_pyx, __pyx_n_s_get_encodings, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 143, __pyx_L1_error)
+144: return CODECS
__Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CODECS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
145:
+146: def get_input_colorspaces(encoding):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_13get_input_colorspaces(PyObject *__pyx_self, PyObject *__pyx_v_encoding); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_3vpx_7decoder_13get_input_colorspaces = {"get_input_colorspaces", (PyCFunction)__pyx_pw_4xpra_6codecs_3vpx_7decoder_13get_input_colorspaces, METH_O, 0}; static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_13get_input_colorspaces(PyObject *__pyx_self, PyObject *__pyx_v_encoding) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_input_colorspaces (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_12get_input_colorspaces(__pyx_self, ((PyObject *)__pyx_v_encoding)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_12get_input_colorspaces(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_input_colorspaces", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.get_input_colorspaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* … */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_3vpx_7decoder_13get_input_colorspaces, NULL, __pyx_n_s_xpra_codecs_vpx_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_input_colorspaces, __pyx_t_2) < 0) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_xpra_codecs_vpx_decoder_pyx, __pyx_n_s_get_input_colorspaces, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 146, __pyx_L1_error)
+147: assert encoding in CODECS
#ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CODECS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_encoding, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 147, __pyx_L1_error) } } #endif
+148: return COLORSPACES.get(encoding)
__Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_COLORSPACES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_encoding) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_encoding); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
149:
+150: def get_output_colorspace(encoding, csc):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_15get_output_colorspace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_3vpx_7decoder_15get_output_colorspace = {"get_output_colorspace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4xpra_6codecs_3vpx_7decoder_15get_output_colorspace, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_15get_output_colorspace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_encoding = 0; PyObject *__pyx_v_csc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_output_colorspace (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,&__pyx_n_s_csc,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csc)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_output_colorspace", 1, 2, 2, 1); __PYX_ERR(0, 150, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_output_colorspace") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_encoding = values[0]; __pyx_v_csc = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_output_colorspace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 150, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("xpra.codecs.vpx.decoder.get_output_colorspace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_14get_output_colorspace(__pyx_self, __pyx_v_encoding, __pyx_v_csc); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_14get_output_colorspace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_encoding, PyObject *__pyx_v_csc) { PyObject *__pyx_v_colorspaces = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_output_colorspace", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.get_output_colorspace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_colorspaces); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_encoding, __pyx_n_s_csc, __pyx_n_s_colorspaces); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* … */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_3vpx_7decoder_15get_output_colorspace, NULL, __pyx_n_s_xpra_codecs_vpx_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_output_colorspace, __pyx_t_2) < 0) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_xpra_codecs_vpx_decoder_pyx, __pyx_n_s_get_output_colorspace, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 150, __pyx_L1_error)
151: #same as input
+152: assert encoding in CODECS
#ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CODECS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_encoding, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 152, __pyx_L1_error) } } #endif
+153: colorspaces = COLORSPACES.get(encoding)
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_COLORSPACES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_encoding) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_encoding); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_colorspaces = __pyx_t_1; __pyx_t_1 = 0;
+154: assert csc in colorspaces, "invalid colorspace '%s' for encoding '%s' (must be one of %s)" % (csc, encoding, colorspaces)
#ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_csc, __pyx_v_colorspaces, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 154, __pyx_L1_error) if (unlikely(!(__pyx_t_2 != 0))) { __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_kp_u_invalid_colorspace); __pyx_t_5 += 20; __Pyx_GIVEREF(__pyx_kp_u_invalid_colorspace); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_invalid_colorspace); __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_csc), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_for_encoding); __pyx_t_5 += 16; __Pyx_GIVEREF(__pyx_kp_u_for_encoding); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_for_encoding); __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_encoding), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_must_be_one_of); __pyx_t_5 += 18; __Pyx_GIVEREF(__pyx_kp_u_must_be_one_of); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_must_be_one_of); __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_colorspaces), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_); __pyx_t_5 += 1; __Pyx_GIVEREF(__pyx_kp_u_); PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 154, __pyx_L1_error) } } #endif
+155: return csc
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_csc); __pyx_r = __pyx_v_csc; goto __pyx_L0;
156:
157:
+158: def get_info():
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_17get_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_3vpx_7decoder_17get_info = {"get_info", (PyCFunction)__pyx_pw_4xpra_6codecs_3vpx_7decoder_17get_info, METH_NOARGS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_17get_info(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_info (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_16get_info(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_16get_info(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_v_info = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_info", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.get_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_info); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_info, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* … */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_3vpx_7decoder_17get_info, NULL, __pyx_n_s_xpra_codecs_vpx_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_info, __pyx_t_2) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_xpra_codecs_vpx_decoder_pyx, __pyx_n_s_get_info, 158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 158, __pyx_L1_error)
159: global CODECS
160: info = {
+161: "version" : get_version(),
__pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_version, __pyx_t_2) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+162: "encodings" : CODECS,
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CODECS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_encodings, __pyx_t_2) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+163: "abi_version" : get_abi_version(),
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_abi_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_abi_version, __pyx_t_2) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+164: "build_config" : vpx_codec_build_config(),
__pyx_t_2 = __Pyx_PyBytes_FromString(vpx_codec_build_config()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_build_config, __pyx_t_2) < 0) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_info = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
165: }
+166: for k,v in COLORSPACES.items():
__pyx_t_5 = 0; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_COLORSPACES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 166, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_t_2, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_3, &__pyx_t_2, NULL, __pyx_t_7); if (unlikely(__pyx_t_8 == 0)) break; if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2); __pyx_t_2 = 0;
+167: info["%s.colorspaces" % k] = v
__pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_colorspaces, __pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyDict_SetItem(__pyx_v_info, __pyx_t_2, __pyx_v_v) < 0)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+168: return info
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_info); __pyx_r = __pyx_v_info; goto __pyx_L0;
169:
170:
+171: cdef const vpx_codec_iface_t *make_codec_dx(encoding):
static __pyx_t_4xpra_6codecs_3vpx_7decoder_vpx_codec_iface_t const *__pyx_f_4xpra_6codecs_3vpx_7decoder_make_codec_dx(PyObject *__pyx_v_encoding) { __pyx_t_4xpra_6codecs_3vpx_7decoder_vpx_codec_iface_t const *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("make_codec_dx", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("xpra.codecs.vpx.decoder.make_codec_dx", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+172: if encoding=="vp8":
__pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_n_u_vp8, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 172, __pyx_L1_error) if (__pyx_t_1) { /* … */ }
+173: return vpx_codec_vp8_dx()
__pyx_r = vpx_codec_vp8_dx(); goto __pyx_L0;
+174: if encoding=="vp9":
__pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_encoding, __pyx_n_u_vp9, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 174, __pyx_L1_error) if (__pyx_t_1) { /* … */ }
+175: return vpx_codec_vp9_dx()
__pyx_r = vpx_codec_vp9_dx(); goto __pyx_L0;
+176: raise Exception("unsupported encoding: %s" % encoding)
__pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unsupported_encoding_s, __pyx_v_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 176, __pyx_L1_error)
177:
+178: cdef vpx_img_fmt_t get_vpx_colorspace(colorspace):
static __pyx_t_4xpra_6codecs_3vpx_7decoder_vpx_img_fmt_t __pyx_f_4xpra_6codecs_3vpx_7decoder_get_vpx_colorspace(CYTHON_UNUSED PyObject *__pyx_v_colorspace) { __pyx_t_4xpra_6codecs_3vpx_7decoder_vpx_img_fmt_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_vpx_colorspace", 0); /* … */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; }
+179: return VPX_IMG_FMT_I420
__pyx_r = VPX_IMG_FMT_I420; goto __pyx_L0;
180:
181:
+182: cdef class Decoder:
struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder { PyObject_HEAD vpx_codec_ctx_t *context; unsigned int width; unsigned int height; unsigned int max_threads; unsigned long frames; __pyx_t_4xpra_6codecs_3vpx_7decoder_vpx_img_fmt_t pixfmt; PyObject *dst_format; PyObject *encoding; PyObject *__weakref__; };
183:
184: cdef vpx_codec_ctx_t *context
185: cdef unsigned int width
186: cdef unsigned int height
187: cdef unsigned int max_threads
188: cdef unsigned long frames
189: cdef vpx_img_fmt_t pixfmt
190: cdef object dst_format
191: cdef object encoding
192:
193: cdef object __weakref__
194:
+195: def init_context(self, encoding, width, height, colorspace):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_1init_context(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_1init_context(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_encoding = 0; PyObject *__pyx_v_width = 0; PyObject *__pyx_v_height = 0; PyObject *__pyx_v_colorspace = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init_context (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,&__pyx_n_s_width,&__pyx_n_s_height,&__pyx_n_s_colorspace,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("init_context", 1, 4, 4, 1); __PYX_ERR(0, 195, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("init_context", 1, 4, 4, 2); __PYX_ERR(0, 195, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colorspace)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("init_context", 1, 4, 4, 3); __PYX_ERR(0, 195, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init_context") < 0)) __PYX_ERR(0, 195, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_encoding = values[0]; __pyx_v_width = values[1]; __pyx_v_height = values[2]; __pyx_v_colorspace = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("init_context", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("xpra.codecs.vpx.decoder.Decoder.init_context", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_init_context(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self), __pyx_v_encoding, __pyx_v_width, __pyx_v_height, __pyx_v_colorspace); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_init_context(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self, PyObject *__pyx_v_encoding, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_colorspace) { int __pyx_v_flags; __pyx_t_4xpra_6codecs_3vpx_7decoder_vpx_codec_iface_t const *__pyx_v_codec_iface; vpx_codec_dec_cfg_t __pyx_v_dec_cfg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init_context", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.Decoder.init_context", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+196: assert encoding in CODECS
#ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CODECS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_encoding, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 196, __pyx_L1_error) } } #endif
+197: assert colorspace in get_input_colorspaces(encoding)
#ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_input_colorspaces); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_encoding) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_encoding); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_colorspace, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 197, __pyx_L1_error) } } #endif
+198: cdef int flags = 0
__pyx_v_flags = 0;
+199: cdef const vpx_codec_iface_t *codec_iface = make_codec_dx(encoding)
__pyx_v_codec_iface = __pyx_f_4xpra_6codecs_3vpx_7decoder_make_codec_dx(__pyx_v_encoding);
+200: self.encoding = encoding
__Pyx_INCREF(__pyx_v_encoding); __Pyx_GIVEREF(__pyx_v_encoding); __Pyx_GOTREF(__pyx_v_self->encoding); __Pyx_DECREF(__pyx_v_self->encoding); __pyx_v_self->encoding = __pyx_v_encoding;
+201: self.dst_format = bytestostr(colorspace)
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bytestostr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_colorspace) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_colorspace); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->dst_format); __Pyx_DECREF(__pyx_v_self->dst_format); __pyx_v_self->dst_format = __pyx_t_1; __pyx_t_1 = 0;
+202: self.pixfmt = get_vpx_colorspace(self.dst_format)
__pyx_t_1 = __pyx_v_self->dst_format; __Pyx_INCREF(__pyx_t_1); __pyx_v_self->pixfmt = __pyx_f_4xpra_6codecs_3vpx_7decoder_get_vpx_colorspace(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+203: self.width = width
__pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_v_width); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_v_self->width = __pyx_t_5;
+204: self.height = height
__pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_v_height); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error) __pyx_v_self->height = __pyx_t_5;
+205: try:
{ /*try:*/ { /* … */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L8_try_end:; }
206: #no point having too many threads if the height is small, also avoids a warning:
+207: self.max_threads = max(0, min(int(VPX_THREADS), roundup(height, 32)//32*2))
__pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L3_error) __pyx_t_10 = ((__pyx_f_4xpra_6codecs_3vpx_7decoder_roundup(__pyx_t_9, 32) / 32) * 2); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_4xpra_6codecs_3vpx_7decoder_VPX_THREADS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_2) { __pyx_t_11 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_1 = __pyx_t_11; __pyx_t_11 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = 0; __pyx_t_11 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_11, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; } else { __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L3_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->max_threads = __pyx_t_5;
+208: except:
/*except:*/ { __Pyx_AddTraceback("xpra.codecs.vpx.decoder.Decoder.init_context", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 208, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4);
+209: self.max_threads = 1
__pyx_v_self->max_threads = 1; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_exception_handled; } __pyx_L5_except_error:;
+210: self.context = <vpx_codec_ctx_t *> malloc(sizeof(vpx_codec_ctx_t))
__pyx_v_self->context = ((vpx_codec_ctx_t *)malloc((sizeof(vpx_codec_ctx_t))));
+211: assert self.context!=NULL
#ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_self->context != NULL) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 211, __pyx_L1_error) } } #endif
+212: memset(self.context, 0, sizeof(vpx_codec_ctx_t))
(void)(memset(__pyx_v_self->context, 0, (sizeof(vpx_codec_ctx_t))));
213: cdef vpx_codec_dec_cfg_t dec_cfg
+214: dec_cfg.w = width
__pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_v_width); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L1_error) __pyx_v_dec_cfg.w = __pyx_t_5;
+215: dec_cfg.h = height
__pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_v_height); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L1_error) __pyx_v_dec_cfg.h = __pyx_t_5;
+216: dec_cfg.threads = self.max_threads
__pyx_t_5 = __pyx_v_self->max_threads; __pyx_v_dec_cfg.threads = __pyx_t_5;
+217: if vpx_codec_dec_init_ver(self.context, codec_iface, &dec_cfg,
if (unlikely(__pyx_t_2)) { /* … */ }
+218: flags, VPX_DECODER_ABI_VERSION)!=VPX_CODEC_OK:
__pyx_t_2 = ((vpx_codec_dec_init_ver(__pyx_v_self->context, __pyx_v_codec_iface, (&__pyx_v_dec_cfg), __pyx_v_flags, VPX_DECODER_ABI_VERSION) != VPX_CODEC_OK) != 0);
+219: raise Exception("failed to instantiate %s decoder with ABI version %s: %s" % (encoding, VPX_DECODER_ABI_VERSION, bytestostr(vpx_codec_error(self.context))))
__pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = 0; __pyx_t_13 = 127; __Pyx_INCREF(__pyx_kp_u_failed_to_instantiate); __pyx_t_12 += 22; __Pyx_GIVEREF(__pyx_kp_u_failed_to_instantiate); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_failed_to_instantiate); __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_encoding), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_13; __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u_decoder_with_ABI_version); __pyx_t_12 += 26; __Pyx_GIVEREF(__pyx_kp_u_decoder_with_ABI_version); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_decoder_with_ABI_version); __pyx_t_3 = __Pyx_PyUnicode_From_int(VPX_DECODER_ABI_VERSION, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_kp_u__2); __pyx_t_12 += 2; __Pyx_GIVEREF(__pyx_kp_u__2); PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u__2); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bytestostr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyBytes_FromString(vpx_codec_error(__pyx_v_self->context)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_3 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_14, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_11); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_13; __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 6, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 219, __pyx_L1_error)
+220: log("vpx_codec_dec_init_ver for %s succeeded with ABI version %s", encoding, VPX_DECODER_ABI_VERSION)
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_log); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_From_int(VPX_DECODER_ABI_VERSION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_kp_u_vpx_codec_dec_init_ver_for_s_suc, __pyx_v_encoding, __pyx_t_3}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_kp_u_vpx_codec_dec_init_ver_for_s_suc, __pyx_v_encoding, __pyx_t_3}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_14 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_kp_u_vpx_codec_dec_init_ver_for_s_suc); __Pyx_GIVEREF(__pyx_kp_u_vpx_codec_dec_init_ver_for_s_suc); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_9, __pyx_kp_u_vpx_codec_dec_init_ver_for_s_suc); __Pyx_INCREF(__pyx_v_encoding); __Pyx_GIVEREF(__pyx_v_encoding); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_9, __pyx_v_encoding); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_9, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
221:
+222: def __repr__(self):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_3__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_3__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_2__repr__(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_2__repr__(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.Decoder.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+223: return "vpx.Decoder(%s)" % self.encoding
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_vpx_Decoder_s, __pyx_v_self->encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
224:
+225: def get_info(self): #@DuplicatedSignature
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_5get_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_5get_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_info (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_4get_info(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_4get_info(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_info", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.Decoder.get_info", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+226: return {
__Pyx_XDECREF(__pyx_r);
+227: "type" : self.get_type(),
__pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_type, __pyx_t_2) < 0) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+228: "width" : self.get_width(),
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_width, __pyx_t_2) < 0) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+229: "height" : self.get_height(),
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_height, __pyx_t_2) < 0) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+230: "encoding" : self.encoding,
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_encoding, __pyx_v_self->encoding) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
+231: "frames" : int(self.frames),
__pyx_t_2 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_frames, __pyx_t_3) < 0) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+232: "colorspace": self.get_colorspace(),
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_colorspace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_colorspace, __pyx_t_3) < 0) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+233: "max_threads" : self.max_threads,
__pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->max_threads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_max_threads, __pyx_t_3) < 0) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
234: }
235:
+236: def get_colorspace(self):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_7get_colorspace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_7get_colorspace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_colorspace (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_6get_colorspace(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_6get_colorspace(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_colorspace", 0); /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+237: return self.dst_format
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->dst_format); __pyx_r = __pyx_v_self->dst_format; goto __pyx_L0;
238:
+239: def get_width(self):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_9get_width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_9get_width(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_width (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_8get_width(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_8get_width(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_width", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.Decoder.get_width", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+240: return self.width
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
241:
+242: def get_height(self):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_11get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_11get_height(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_height (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_10get_height(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_10get_height(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_height", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.Decoder.get_height", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+243: return self.height
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
244:
+245: def is_closed(self):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_13is_closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_13is_closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_closed (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_12is_closed(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_12is_closed(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_closed", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.Decoder.is_closed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+246: return self.context==NULL
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->context == NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
247:
+248: def get_encoding(self):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_15get_encoding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_15get_encoding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_encoding (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_14get_encoding(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_14get_encoding(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_encoding", 0); /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+249: return self.encoding
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->encoding); __pyx_r = __pyx_v_self->encoding; goto __pyx_L0;
250:
+251: def get_type(self): #@DuplicatedSignature
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_17get_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_17get_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_type (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_16get_type(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_16get_type(CYTHON_UNUSED struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_type", 0); /* … */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+252: return "vpx"
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_u_vpx); __pyx_r = __pyx_n_u_vpx; goto __pyx_L0;
253:
+254: def __dealloc__(self):
/* Python wrapper */ static void __pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_19__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_19__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_18__dealloc__(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_18__dealloc__(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* … */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("xpra.codecs.vpx.decoder.Decoder.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); }
+255: self.clean()
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clean); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
256:
+257: def clean(self):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_21clean(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_21clean(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clean (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_20clean(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_20clean(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clean", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
+258: if self.context!=NULL:
__pyx_t_1 = ((__pyx_v_self->context != NULL) != 0); if (__pyx_t_1) { /* … */ }
+259: vpx_codec_destroy(self.context)
(void)(vpx_codec_destroy(__pyx_v_self->context));
+260: self.context = NULL
__pyx_v_self->context = NULL;
+261: self.width = 0
__pyx_v_self->width = 0;
+262: self.height = 0
__pyx_v_self->height = 0;
+263: self.max_threads = 0
__pyx_v_self->max_threads = 0;
+264: self.pixfmt = 0
__pyx_v_self->pixfmt = 0;
+265: self.dst_format = ""
__Pyx_INCREF(__pyx_kp_u__3); __Pyx_GIVEREF(__pyx_kp_u__3); __Pyx_GOTREF(__pyx_v_self->dst_format); __Pyx_DECREF(__pyx_v_self->dst_format); __pyx_v_self->dst_format = __pyx_kp_u__3;
+266: self.encoding = ""
__Pyx_INCREF(__pyx_kp_u__3); __Pyx_GIVEREF(__pyx_kp_u__3); __Pyx_GOTREF(__pyx_v_self->encoding); __Pyx_DECREF(__pyx_v_self->encoding); __pyx_v_self->encoding = __pyx_kp_u__3;
267:
268:
+269: def decompress_image(self, input, options):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_23decompress_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_7Decoder_23decompress_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_input = 0; CYTHON_UNUSED PyObject *__pyx_v_options = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress_image (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input,&__pyx_n_s_options,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("decompress_image", 1, 2, 2, 1); __PYX_ERR(0, 269, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decompress_image") < 0)) __PYX_ERR(0, 269, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_input = values[0]; __pyx_v_options = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decompress_image", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 269, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("xpra.codecs.vpx.decoder.Decoder.decompress_image", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_22decompress_image(((struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *)__pyx_v_self), __pyx_v_input, __pyx_v_options); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_7Decoder_22decompress_image(struct __pyx_obj_4xpra_6codecs_3vpx_7decoder_Decoder *__pyx_v_self, PyObject *__pyx_v_input, CYTHON_UNUSED PyObject *__pyx_v_options) { vpx_image_t *__pyx_v_img; vpx_codec_iter_t __pyx_v_iter; unsigned char const *__pyx_v_buf; Py_ssize_t __pyx_v_buf_len; vpx_codec_err_t __pyx_v_ret; int __pyx_v_i; struct __pyx_obj_4xpra_7buffers_6membuf_MemBuf *__pyx_v_output_buf = 0; void *__pyx_v_output; Py_ssize_t __pyx_v_plane_len; uint8_t __pyx_v_dy; unsigned int __pyx_v_height; int __pyx_v_stride; double __pyx_v_start; PyObject *__pyx_v_strides = NULL; PyObject *__pyx_v_pixels = NULL; PyObject *__pyx_v_divs = NULL; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; double __pyx_v_elapsed; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decompress_image", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.Decoder.decompress_image", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_output_buf); __Pyx_XDECREF(__pyx_v_strides); __Pyx_XDECREF(__pyx_v_pixels); __Pyx_XDECREF(__pyx_v_divs); __Pyx_XDECREF(__pyx_v__); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
270: cdef vpx_image_t *img
+271: cdef vpx_codec_iter_t iter = NULL
__pyx_v_iter = NULL;
+272: cdef const unsigned char * buf = NULL
__pyx_v_buf = NULL;
+273: cdef Py_ssize_t buf_len = 0
__pyx_v_buf_len = 0;
274: cdef vpx_codec_err_t ret
+275: cdef int i = 0
__pyx_v_i = 0;
276: cdef object image
277: cdef MemBuf output_buf
278: cdef void *output
+279: cdef Py_ssize_t plane_len = 0
__pyx_v_plane_len = 0;
280: cdef uint8_t dx, dy
281: cdef unsigned int height
282: cdef int stride
+283: assert self.context!=NULL
#ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_self->context != NULL) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 283, __pyx_L1_error) } } #endif
284:
+285: cdef double start = monotonic_time()
__pyx_v_start = __pyx_f_4xpra_14monotonic_time_monotonic_time();
+286: assert object_as_buffer(input, <const void**> &buf, &buf_len)==0
#ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_f_4xpra_7buffers_6membuf_object_as_buffer(__pyx_v_input, ((void const **)(&__pyx_v_buf)), (&__pyx_v_buf_len)) == 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 286, __pyx_L1_error) } } #endif
287:
+288: with nogil:
{ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* … */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } }
+289: ret = vpx_codec_decode(self.context, buf, buf_len, NULL, 0)
__pyx_v_ret = vpx_codec_decode(__pyx_v_self->context, __pyx_v_buf, __pyx_v_buf_len, NULL, 0); }
+290: if ret!=VPX_CODEC_OK:
__pyx_t_1 = ((__pyx_v_ret != VPX_CODEC_OK) != 0); if (__pyx_t_1) { /* … */ }
+291: log.error("Error: vpx_codec_decode: %s", bytestostr(vpx_codec_error(self.context)))
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_bytestostr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyBytes_FromString(vpx_codec_error(__pyx_v_self->context)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_u_Error_vpx_codec_decode_s, __pyx_t_3}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_u_Error_vpx_codec_decode_s, __pyx_t_3}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_kp_u_Error_vpx_codec_decode_s); __Pyx_GIVEREF(__pyx_kp_u_Error_vpx_codec_decode_s); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_kp_u_Error_vpx_codec_decode_s); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+292: return None
__Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0;
+293: with nogil:
{ #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* … */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } }
+294: img = vpx_codec_get_frame(self.context, &iter)
__pyx_v_img = vpx_codec_get_frame(__pyx_v_self->context, (&__pyx_v_iter)); }
+295: if img==NULL:
__pyx_t_1 = ((__pyx_v_img == NULL) != 0); if (__pyx_t_1) { /* … */ }
+296: log.error("Error: vpx_codec_get_frame: %s", bytestostr(vpx_codec_error(self.context)))
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bytestostr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyBytes_FromString(vpx_codec_error(__pyx_v_self->context)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_Error_vpx_codec_get_frame_s, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_Error_vpx_codec_get_frame_s, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_kp_u_Error_vpx_codec_get_frame_s); __Pyx_GIVEREF(__pyx_kp_u_Error_vpx_codec_get_frame_s); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_kp_u_Error_vpx_codec_get_frame_s); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+297: return None
__Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0;
+298: strides = []
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_strides = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0;
+299: pixels = []
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_pixels = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0;
+300: divs = get_subsampling_divs(self.get_colorspace())
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_get_subsampling_divs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_colorspace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_divs = __pyx_t_2; __pyx_t_2 = 0;
+301: for i in range(3):
for (__pyx_t_8 = 0; __pyx_t_8 < 3; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8;
+302: _, dy = divs[i]
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_divs, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 302, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 2) < 0) __PYX_ERR(0, 302, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L14_unpacking_done; __pyx_L13_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 302, __pyx_L1_error) __pyx_L14_unpacking_done:; } __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_6); __pyx_t_6 = 0; __pyx_v_dy = __pyx_t_10;
+303: if dy==1:
switch (__pyx_v_dy) { case 1: /* … */ break; case 2:
+304: height = self.height
__pyx_t_11 = __pyx_v_self->height; __pyx_v_height = __pyx_t_11;
+305: elif dy==2:
break; default:
+306: height = (self.height+1)>>1
__pyx_v_height = ((__pyx_v_self->height + 1) >> 1);
307: else:
+308: raise Exception("invalid height divisor %s" % dy)
__pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_invalid_height_divisor_s, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 308, __pyx_L1_error) break; }
+309: stride = img.stride[i]
__pyx_v_stride = (__pyx_v_img->stride[__pyx_v_i]);
+310: strides.append(stride)
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_stride); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_strides, __pyx_t_2); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
311:
+312: plane_len = height * stride
__pyx_v_plane_len = (__pyx_v_height * __pyx_v_stride);
313: #add one extra line of padding:
+314: output_buf = padbuf(plane_len, stride)
__pyx_t_2 = __pyx_f_4xpra_7buffers_6membuf_padbuf(__pyx_v_plane_len, __pyx_v_stride); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4xpra_7buffers_6membuf_MemBuf))))) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_output_buf, ((struct __pyx_obj_4xpra_7buffers_6membuf_MemBuf *)__pyx_t_2)); __pyx_t_2 = 0;
+315: output = <void *>output_buf.get_mem()
__pyx_v_output = ((void *)((struct __pyx_vtabstruct_4xpra_7buffers_6membuf_MemBuf *)__pyx_v_output_buf->__pyx_vtab)->get_mem(__pyx_v_output_buf));
+316: memcpy(output, <void *>img.planes[i], plane_len)
(void)(memcpy(__pyx_v_output, ((void *)(__pyx_v_img->planes[__pyx_v_i])), __pyx_v_plane_len));
+317: memset(<void *>((<char *>output)+plane_len), 0, stride)
(void)(memset(((void *)(((char *)__pyx_v_output) + __pyx_v_plane_len)), 0, __pyx_v_stride));
318:
+319: pixels.append(memoryview(output_buf))
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_memoryview); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_output_buf)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_pixels, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; }
+320: self.frames += 1
__pyx_v_self->frames = (__pyx_v_self->frames + 1);
+321: cdef double elapsed = 1000*(monotonic_time()-start)
__pyx_v_elapsed = (1000.0 * (__pyx_f_4xpra_14monotonic_time_monotonic_time() - __pyx_v_start));
+322: log("%s frame %4i decoded in %3ims", self.encoding, self.frames, elapsed)
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->frames); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyFloat_FromDouble(__pyx_v_elapsed); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_kp_u_s_frame_4i_decoded_in_3ims, __pyx_v_self->encoding, __pyx_t_6, __pyx_t_4}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_kp_u_s_frame_4i_decoded_in_3ims, __pyx_v_self->encoding, __pyx_t_6, __pyx_t_4}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_kp_u_s_frame_4i_decoded_in_3ims); __Pyx_GIVEREF(__pyx_kp_u_s_frame_4i_decoded_in_3ims); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_kp_u_s_frame_4i_decoded_in_3ims); __Pyx_INCREF(__pyx_v_self->encoding); __Pyx_GIVEREF(__pyx_v_self->encoding); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_self->encoding); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+323: return ImageWrapper(0, 0, self.width, self.height, pixels, self.get_colorspace(), 24, strides, 1, ImageWrapper._3_PLANES)
__Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ImageWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->width); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->height); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_colorspace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_6 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ImageWrapper); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_3_PLANES); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[11] = {__pyx_t_3, __pyx_int_0, __pyx_int_0, __pyx_t_7, __pyx_t_4, __pyx_v_pixels, __pyx_t_6, __pyx_int_24, __pyx_v_strides, __pyx_int_1, __pyx_t_13}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 10+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[11] = {__pyx_t_3, __pyx_int_0, __pyx_int_0, __pyx_t_7, __pyx_t_4, __pyx_v_pixels, __pyx_t_6, __pyx_int_24, __pyx_v_strides, __pyx_int_1, __pyx_t_13}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 10+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } else #endif { __pyx_t_14 = PyTuple_New(10+__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_8, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_8, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_8, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_v_pixels); __Pyx_GIVEREF(__pyx_v_pixels); PyTuple_SET_ITEM(__pyx_t_14, 4+__pyx_t_8, __pyx_v_pixels); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_14, 5+__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_int_24); __Pyx_GIVEREF(__pyx_int_24); PyTuple_SET_ITEM(__pyx_t_14, 6+__pyx_t_8, __pyx_int_24); __Pyx_INCREF(__pyx_v_strides); __Pyx_GIVEREF(__pyx_v_strides); PyTuple_SET_ITEM(__pyx_t_14, 7+__pyx_t_8, __pyx_v_strides); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_14, 8+__pyx_t_8, __pyx_int_1); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 9+__pyx_t_8, __pyx_t_13); __pyx_t_7 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_13 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0;
324:
325:
+326: def selftest(full=False):
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_19selftest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_3vpx_7decoder_19selftest = {"selftest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4xpra_6codecs_3vpx_7decoder_19selftest, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_3vpx_7decoder_19selftest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_full = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("selftest (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_full,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_full); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "selftest") < 0)) __PYX_ERR(0, 326, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_full = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("selftest", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 326, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("xpra.codecs.vpx.decoder.selftest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_4xpra_6codecs_3vpx_7decoder_18selftest(__pyx_self, __pyx_v_full); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_3vpx_7decoder_18selftest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_full) { PyObject *__pyx_v_testdecoder = NULL; PyObject *__pyx_v_decoder = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("selftest", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("xpra.codecs.vpx.decoder.selftest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_testdecoder); __Pyx_XDECREF(__pyx_v_decoder); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_full, __pyx_n_s_testdecoder, __pyx_n_s_decoder); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* … */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_3vpx_7decoder_19selftest, NULL, __pyx_n_s_xpra_codecs_vpx_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_selftest, __pyx_t_2) < 0) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
327: global CODECS
+328: from xpra.codecs.codec_checks import testdecoder
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_testdecoder); __Pyx_GIVEREF(__pyx_n_s_testdecoder); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_testdecoder); __pyx_t_2 = __Pyx_Import(__pyx_n_s_xpra_codecs_codec_checks, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_testdecoder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_testdecoder = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+329: from xpra.codecs.vpx import decoder
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_decoder); __Pyx_GIVEREF(__pyx_n_s_decoder); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_decoder); __pyx_t_1 = __Pyx_Import(__pyx_n_s_xpra_codecs_vpx, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_decoder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v_decoder = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+330: CODECS = testdecoder(decoder, full)
__Pyx_INCREF(__pyx_v_testdecoder); __pyx_t_2 = __pyx_v_testdecoder; __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_decoder, __pyx_v_full}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_decoder, __pyx_v_full}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_decoder); __Pyx_GIVEREF(__pyx_v_decoder); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_decoder); __Pyx_INCREF(__pyx_v_full); __Pyx_GIVEREF(__pyx_v_full); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_full); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_CODECS, __pyx_t_1) < 0) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;