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: av_log.c
001: # This file is part of Xpra.
002: # Copyright (C) 2015-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: boundscheck=False, wraparound=False, cdivision=True, language_level=3
007: from __future__ import absolute_import
008:
+009: from xpra.os_util import bytestostr
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __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_t_2 = __Pyx_Import(__pyx_n_s_xpra_os_util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __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, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytestostr, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+010: from xpra.util import nonl
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_nonl); __Pyx_GIVEREF(__pyx_n_s_nonl); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_nonl); __pyx_t_1 = __Pyx_Import(__pyx_n_s_xpra_util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __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_nonl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_nonl, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+011: from xpra.log import Logger
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __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, 11, __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, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Logger, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+012: log = Logger("libav")
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __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, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_u_libav); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3);
013:
014:
015: cdef extern from "libavutil/error.h":
016: int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
017:
018: cdef extern from "string.h":
019: int vsnprintf(char * s, size_t n, const char * format, va_list arg)
020:
021: cdef extern from "libavutil/log.h":
022: ctypedef struct va_list:
023: pass
024: cdef int AV_LOG_FATAL
025: cdef int AV_LOG_ERROR
026: cdef int AV_LOG_WARNING
027: cdef int AV_LOG_INFO
028: cdef int AV_LOG_DEBUG
029: #this is the correct signature, but I can't get Cython to play nice with it:
030: #ctypedef void (*log_callback)(void *avcl, int level, const char *fmt, va_list vl)
031: ctypedef void* log_callback
032: void av_log_default_callback(void *avcl, int level, const char *fmt, va_list vl)
033: void av_log_set_callback(void *callback)
034:
035:
+036: cdef int ERROR_LEVEL = AV_LOG_ERROR
__pyx_v_4xpra_6codecs_12libav_common_6av_log_ERROR_LEVEL = AV_LOG_ERROR;
+037: cdef int WARNING_LEVEL = AV_LOG_WARNING
__pyx_v_4xpra_6codecs_12libav_common_6av_log_WARNING_LEVEL = AV_LOG_WARNING;
+038: cdef int INFO_LEVEL = AV_LOG_INFO
__pyx_v_4xpra_6codecs_12libav_common_6av_log_INFO_LEVEL = AV_LOG_INFO;
+039: cdef int DEBUG_LEVEL = AV_LOG_DEBUG
__pyx_v_4xpra_6codecs_12libav_common_6av_log_DEBUG_LEVEL = AV_LOG_DEBUG;
040:
+041: def suspend_nonfatal_logging():
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_12libav_common_6av_log_1suspend_nonfatal_logging(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_12libav_common_6av_log_1suspend_nonfatal_logging = {"suspend_nonfatal_logging", (PyCFunction)__pyx_pw_4xpra_6codecs_12libav_common_6av_log_1suspend_nonfatal_logging, METH_NOARGS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_12libav_common_6av_log_1suspend_nonfatal_logging(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("suspend_nonfatal_logging (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_12libav_common_6av_log_suspend_nonfatal_logging(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_12libav_common_6av_log_suspend_nonfatal_logging(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("suspend_nonfatal_logging", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_12libav_common_6av_log_1suspend_nonfatal_logging, NULL, __pyx_n_s_xpra_codecs_libav_common_av_log_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_suspend_nonfatal_logging, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* … */ __pyx_codeobj__4 = (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_libav_common_av_log, __pyx_n_s_suspend_nonfatal_logging, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 41, __pyx_L1_error)
042: global ERROR_LEVEL, WARNING_LEVEL, INFO_LEVEL, DEBUG_LEVEL
+043: ERROR_LEVEL = AV_LOG_FATAL
__pyx_v_4xpra_6codecs_12libav_common_6av_log_ERROR_LEVEL = AV_LOG_FATAL;
+044: WARNING_LEVEL = AV_LOG_FATAL
__pyx_v_4xpra_6codecs_12libav_common_6av_log_WARNING_LEVEL = AV_LOG_FATAL;
+045: INFO_LEVEL = AV_LOG_FATAL
__pyx_v_4xpra_6codecs_12libav_common_6av_log_INFO_LEVEL = AV_LOG_FATAL;
+046: DEBUG_LEVEL = AV_LOG_FATAL
__pyx_v_4xpra_6codecs_12libav_common_6av_log_DEBUG_LEVEL = AV_LOG_FATAL;
047:
+048: def resume_nonfatal_logging():
/* Python wrapper */ static PyObject *__pyx_pw_4xpra_6codecs_12libav_common_6av_log_3resume_nonfatal_logging(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_4xpra_6codecs_12libav_common_6av_log_3resume_nonfatal_logging = {"resume_nonfatal_logging", (PyCFunction)__pyx_pw_4xpra_6codecs_12libav_common_6av_log_3resume_nonfatal_logging, METH_NOARGS, 0}; static PyObject *__pyx_pw_4xpra_6codecs_12libav_common_6av_log_3resume_nonfatal_logging(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resume_nonfatal_logging (wrapper)", 0); __pyx_r = __pyx_pf_4xpra_6codecs_12libav_common_6av_log_2resume_nonfatal_logging(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_4xpra_6codecs_12libav_common_6av_log_2resume_nonfatal_logging(CYTHON_UNUSED PyObject *__pyx_self) { CYTHON_UNUSED int __pyx_v_ERROR_LEVEL; CYTHON_UNUSED int __pyx_v_WARNING_LEVEL; CYTHON_UNUSED int __pyx_v_INFO_LEVEL; CYTHON_UNUSED int __pyx_v_DEBUG_LEVEL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resume_nonfatal_logging", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_ERROR_LEVEL, __pyx_n_s_WARNING_LEVEL, __pyx_n_s_INFO_LEVEL, __pyx_n_s_DEBUG_LEVEL); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* … */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4xpra_6codecs_12libav_common_6av_log_3resume_nonfatal_logging, NULL, __pyx_n_s_xpra_codecs_libav_common_av_log_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_resume_nonfatal_logging, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+049: ERROR_LEVEL = AV_LOG_ERROR
__pyx_v_ERROR_LEVEL = AV_LOG_ERROR;
+050: WARNING_LEVEL = AV_LOG_WARNING
__pyx_v_WARNING_LEVEL = AV_LOG_WARNING;
+051: INFO_LEVEL = AV_LOG_INFO
__pyx_v_INFO_LEVEL = AV_LOG_INFO;
+052: DEBUG_LEVEL = AV_LOG_DEBUG
__pyx_v_DEBUG_LEVEL = AV_LOG_DEBUG;
053:
054:
+055: cdef av_error_str(int errnum):
static PyObject *__pyx_f_4xpra_6codecs_12libav_common_6av_log_av_error_str(int __pyx_v_errnum) { char __pyx_v_err_str[0x80]; int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("av_error_str", 0); /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("xpra.codecs.libav_common.av_log.av_error_str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
056: cdef char[128] err_str
+057: cdef int i = 0
__pyx_v_i = 0;
+058: if av_strerror(errnum, err_str, 128)==0:
__pyx_t_1 = ((av_strerror(__pyx_v_errnum, __pyx_v_err_str, 0x80) == 0) != 0); if (__pyx_t_1) { /* … */ }
+059: while i<128 and err_str[i]!=0:
while (1) { __pyx_t_2 = ((__pyx_v_i < 0x80) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = (((__pyx_v_err_str[__pyx_v_i]) != 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (!__pyx_t_1) break;
+060: i += 1
__pyx_v_i = (__pyx_v_i + 1); }
+061: return bytestostr(err_str[:i])
__Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_bytestostr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_err_str) + 0, __pyx_v_i - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0;
+062: return "error %s" % errnum
__Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errnum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_error_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0;
063:
064:
065: DEF MAX_LOG_SIZE = 4096
066:
+067: cdef void log_callback_override(void *avcl, int level, const char *fmt, va_list vl) with gil:
static void __pyx_f_4xpra_6codecs_12libav_common_6av_log_log_callback_override(CYTHON_UNUSED void *__pyx_v_avcl, int __pyx_v_level, char const *__pyx_v_fmt, va_list __pyx_v_vl) { PyObject *__pyx_v_l = NULL; char __pyx_v_buffer[0x1000]; int __pyx_v_r; PyObject *__pyx_v_s = NULL; PyObject *__pyx_v_e = NULL; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("log_callback_override", 0); /* … */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_WriteUnraisable("xpra.codecs.libav_common.av_log.log_callback_override", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF(__pyx_v_l); __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_e); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif }
+068: if level<=ERROR_LEVEL:
__pyx_t_1 = ((__pyx_v_level <= __pyx_v_4xpra_6codecs_12libav_common_6av_log_ERROR_LEVEL) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L3; }
+069: l = log.error
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_l = __pyx_t_3; __pyx_t_3 = 0;
+070: elif level<=WARNING_LEVEL:
__pyx_t_1 = ((__pyx_v_level <= __pyx_v_4xpra_6codecs_12libav_common_6av_log_WARNING_LEVEL) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L3; }
+071: l = log.warn
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_l = __pyx_t_2; __pyx_t_2 = 0;
+072: elif level<=INFO_LEVEL:
__pyx_t_1 = ((__pyx_v_level <= __pyx_v_4xpra_6codecs_12libav_common_6av_log_INFO_LEVEL) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L3; }
+073: l = log.info
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_l = __pyx_t_3; __pyx_t_3 = 0;
+074: elif level<=DEBUG_LEVEL:
__pyx_t_1 = ((__pyx_v_level <= __pyx_v_4xpra_6codecs_12libav_common_6av_log_DEBUG_LEVEL) != 0); if (__pyx_t_1) { /* … */ goto __pyx_L3; }
+075: l = log.debug
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_l = __pyx_t_2; __pyx_t_2 = 0;
076: else:
077: #don't bother
+078: return
/*else*/ { goto __pyx_L0; } __pyx_L3:;
079: #turn it into a string:
080: cdef char buffer[MAX_LOG_SIZE]
081: cdef int r
+082: try:
{ /*try:*/ { /* … */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* … */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L8_try_return:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L9_try_end:; }
+083: r = vsnprintf(buffer, MAX_LOG_SIZE, fmt, vl)
__pyx_v_r = vsnprintf(__pyx_v_buffer, 0x1000, __pyx_v_fmt, __pyx_v_vl);
+084: if r<0:
__pyx_t_1 = ((__pyx_v_r < 0) != 0); if (__pyx_t_1) { /* … */ }
+085: log.error("av_log: vsnprintf returned %i on format string '%s'", r, fmt)
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_fmt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 85, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_u_av_log_vsnprintf_returned_i_on_f, __pyx_t_3, __pyx_t_8}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L4_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_u_av_log_vsnprintf_returned_i_on_f, __pyx_t_3, __pyx_t_8}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L4_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 85, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_INCREF(__pyx_kp_u_av_log_vsnprintf_returned_i_on_f); __Pyx_GIVEREF(__pyx_kp_u_av_log_vsnprintf_returned_i_on_f); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_kp_u_av_log_vsnprintf_returned_i_on_f); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_8); __pyx_t_3 = 0; __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+086: return
goto __pyx_L8_try_return;
+087: if r>MAX_LOG_SIZE:
__pyx_t_1 = ((__pyx_v_r > 0x1000) != 0); if (__pyx_t_1) { /* … */ }
+088: log.error("av_log: vsnprintf returned more than %i characters!", MAX_LOG_SIZE)
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_kp_u_av_log_vsnprintf_returned_more_t, __pyx_int_4096); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_);
+089: r = MAX_LOG_SIZE
__pyx_v_r = 0x1000;
+090: s = nonl(bytestostr(buffer[:r]).rstrip("\n\r"))
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_nonl); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bytestostr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_buffer) + 0, __pyx_v_r - 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 90, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_12, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 90, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_rstrip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_11 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_kp_u__2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u__2); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 90, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_11); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_s = __pyx_t_2; __pyx_t_2 = 0;
+091: if s.startswith("Warning: data is not aligned!"):
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_startswith); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_11, __pyx_kp_u_Warning_data_is_not_aligned) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_u_Warning_data_is_not_aligned); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 91, __pyx_L4_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* … */ }
092: #silence this crap, since there is nothing we can do about it
+093: l = log.debug
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_l, __pyx_t_7); __pyx_t_7 = 0;
094: #l("log_callback_override(%#x, %i, %s, ..)", <unsigned long> avcl, level, fmt)
+095: l("libav: %s", s)
__Pyx_INCREF(__pyx_v_l); __pyx_t_2 = __pyx_v_l; __pyx_t_11 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_kp_u_libav_s, __pyx_v_s}; __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L4_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_kp_u_libav_s, __pyx_v_s}; __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L4_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_kp_u_libav_s); __Pyx_GIVEREF(__pyx_kp_u_libav_s); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, __pyx_kp_u_libav_s); __Pyx_INCREF(__pyx_v_s); __Pyx_GIVEREF(__pyx_v_s); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_v_s); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+096: except Exception as e:
__pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("xpra.codecs.libav_common.av_log.log_callback_override", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 96, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_v_e = __pyx_t_2; /*try:*/ { /* … */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; goto __pyx_L19; } __pyx_L18_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_10 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L6_except_error; } __pyx_L19:; } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:;
+097: log.error("Error in log callback at level %i", level)
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_log); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 97, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_level); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_kp_u_Error_in_log_callback_at_level_i, __pyx_t_8}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 97, __pyx_L18_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_kp_u_Error_in_log_callback_at_level_i, __pyx_t_8}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 97, __pyx_L18_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 97, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; } __Pyx_INCREF(__pyx_kp_u_Error_in_log_callback_at_level_i); __Pyx_GIVEREF(__pyx_kp_u_Error_in_log_callback_at_level_i); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_10, __pyx_kp_u_Error_in_log_callback_at_level_i); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_10, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 97, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+098: log.error(" on format string '%s':", nonl(fmt))
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_log); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 98, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_nonl); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = __Pyx_PyBytes_FromString(__pyx_v_fmt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_14, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_12); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_on_format_string_s, __pyx_t_9}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L18_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_on_format_string_s, __pyx_t_9}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L18_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_kp_u_on_format_string_s); __Pyx_GIVEREF(__pyx_kp_u_on_format_string_s); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_10, __pyx_kp_u_on_format_string_s); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_10, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+099: log.error(" %s: %s", type(e), e)
__Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_log); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 99, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 99, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_kp_u_s_s, ((PyObject *)Py_TYPE(__pyx_v_e)), __pyx_v_e}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L18_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_11); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_kp_u_s_s, ((PyObject *)Py_TYPE(__pyx_v_e)), __pyx_v_e}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L18_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_11); } else #endif { __pyx_t_9 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_13); __pyx_t_13 = NULL; } __Pyx_INCREF(__pyx_kp_u_s_s); __Pyx_GIVEREF(__pyx_kp_u_s_s); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_kp_u_s_s); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_e))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_e))); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, ((PyObject *)Py_TYPE(__pyx_v_e))); __Pyx_INCREF(__pyx_v_e); __Pyx_GIVEREF(__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_10, __pyx_v_e); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; }
100:
+101: cdef int nesting_level = 0
__pyx_v_4xpra_6codecs_12libav_common_6av_log_nesting_level = 0;
102:
+103: cdef override_logger():
static PyObject *__pyx_f_4xpra_6codecs_12libav_common_6av_log_override_logger(void) { void *__pyx_v_cb; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("override_logger", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
104: global nesting_level
+105: cdef void *cb = <void*> log_callback_override
__pyx_v_cb = ((void *)__pyx_f_4xpra_6codecs_12libav_common_6av_log_log_callback_override);
+106: if nesting_level==0:
__pyx_t_1 = ((__pyx_v_4xpra_6codecs_12libav_common_6av_log_nesting_level == 0) != 0); if (__pyx_t_1) { /* … */ }
+107: av_log_set_callback(cb)
av_log_set_callback(__pyx_v_cb);
+108: nesting_level += 1
__pyx_v_4xpra_6codecs_12libav_common_6av_log_nesting_level = (__pyx_v_4xpra_6codecs_12libav_common_6av_log_nesting_level + 1);
109:
+110: cdef restore_logger():
static PyObject *__pyx_f_4xpra_6codecs_12libav_common_6av_log_restore_logger(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restore_logger", 0); /* … */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
111: global nesting_level
+112: nesting_level -= 1
__pyx_v_4xpra_6codecs_12libav_common_6av_log_nesting_level = (__pyx_v_4xpra_6codecs_12libav_common_6av_log_nesting_level - 1);
+113: if nesting_level==0:
__pyx_t_1 = ((__pyx_v_4xpra_6codecs_12libav_common_6av_log_nesting_level == 0) != 0); if (__pyx_t_1) { /* … */ }
+114: av_log_set_callback(<void*> av_log_default_callback)
av_log_set_callback(((void *)av_log_default_callback));