kodi: update to 18.0, adopt package
also enable ppc64 as proposed by @q66 [skip ci]
This commit is contained in:
parent
c3166c669f
commit
d85a7c14ec
|
@ -1 +0,0 @@
|
|||
../../kodi/files/swig.nojava-17.6
|
|
@ -1,496 +0,0 @@
|
|||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2005-2013 Team XBMC
|
||||
* http://xbmc.org
|
||||
*
|
||||
* This Program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This Program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with XBMC; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
// ************************************************************************
|
||||
// This file was generated by xbmc compile process. DO NOT EDIT!!
|
||||
// It was created by running the code generator on the spec file for
|
||||
// the module "xbmcaddon" on the template file PythonSwig.template.cpp
|
||||
// ************************************************************************
|
||||
|
||||
|
||||
|
||||
#include <Python.h>
|
||||
#include <string>
|
||||
#include "interfaces/python/LanguageHook.h"
|
||||
#include "interfaces/python/swig.h"
|
||||
#include "interfaces/python/PyContext.h"
|
||||
|
||||
|
||||
#include "interfaces/legacy/Addon.h"
|
||||
|
||||
using namespace XBMCAddon;
|
||||
using namespace xbmcaddon;
|
||||
|
||||
#if defined(__GNUG__) && (__GNUC__>4) || (__GNUC__==4 && __GNUC_MINOR__>=2)
|
||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace PythonBindings
|
||||
{
|
||||
|
||||
//=========================================================================
|
||||
// These variables will hold the Python Type information for XBMCAddon::xbmcaddon::Addon
|
||||
TypeInfo TyXBMCAddon_xbmcaddon_Addon_Type(typeid(XBMCAddon::xbmcaddon::Addon));
|
||||
//=========================================================================
|
||||
|
||||
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_New (PyTypeObject* pytype , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
char * id = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"|s",
|
||||
(char**)keywords,
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XBMCAddon::xbmcaddon::Addon * apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::PythonLanguageHook::GetIfExists(PyThreadState_Get()->interp).get());
|
||||
apiResult = (XBMCAddon::xbmcaddon::Addon *)new XBMCAddon::xbmcaddon::Addon( id );
|
||||
prepareForReturn(apiResult);
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"new XBMCAddon::xbmcaddon::Addon\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"new XBMCAddon::xbmcaddon::Addon\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = makePythonInstance(apiResult,pytype,false);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_getLocalizedString (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
int id ;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"i",
|
||||
(char**)keywords,
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::string apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = (std::string )((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"getLocalizedString","XBMCAddon::xbmcaddon::Addon"))-> getLocalizedString( id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"getLocalizedString\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"getLocalizedString\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = PyUnicode_DecodeUTF8(apiResult.c_str(),apiResult.size(),"replace");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSetting (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
char * id ;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"s",
|
||||
(char**)keywords,
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::string apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = (std::string )((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"getSetting","XBMCAddon::xbmcaddon::Addon"))-> getSetting( id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"getSetting\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"getSetting\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = PyString_FromStringAndSize(apiResult.c_str(), apiResult.length());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSetting (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
"value",
|
||||
NULL};
|
||||
|
||||
char * id ;
|
||||
std::string value ;
|
||||
PyObject* pyvalue = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"sO",
|
||||
(char**)keywords,
|
||||
&id,
|
||||
&pyvalue
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
if (pyvalue) PyXBMCGetUnicodeString(value,pyvalue,false,"value","setSetting");
|
||||
|
||||
((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"setSetting","XBMCAddon::xbmcaddon::Addon"))-> setSetting( id, value );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"setSetting\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"setSetting\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
Py_INCREF(Py_None);
|
||||
result = Py_None;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_openSettings (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"openSettings","XBMCAddon::xbmcaddon::Addon"))-> openSettings( );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"openSettings\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"openSettings\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
Py_INCREF(Py_None);
|
||||
result = Py_None;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_getAddonInfo (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
char * id ;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"s",
|
||||
(char**)keywords,
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::string apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = (std::string )((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"getAddonInfo","XBMCAddon::xbmcaddon::Addon"))-> getAddonInfo( id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"getAddonInfo\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"getAddonInfo\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = PyString_FromStringAndSize(apiResult.c_str(), apiResult.length());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void xbmcaddon_XBMCAddon_xbmcaddon_Addon_Dealloc (PyHolder* self )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
XBMCAddon::xbmcaddon::Addon* theObj = (XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"~XBMCAddon::xbmcaddon::Addon","XBMCAddon::xbmcaddon::Addon");
|
||||
cleanForDealloc(theObj);
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"XBMCAddon::xbmcaddon::Addon\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"XBMCAddon::xbmcaddon::Addon\"");
|
||||
}
|
||||
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
|
||||
}
|
||||
//=========================================================================
|
||||
// This section contains the initialization for the
|
||||
// Python extention for the Api class XBMCAddon::xbmcaddon::Addon
|
||||
//=========================================================================
|
||||
// All of the methods on this class
|
||||
static PyMethodDef XBMCAddon_xbmcaddon_Addon_methods[] = {
|
||||
{(char*)"getLocalizedString", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_getLocalizedString, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"getSetting", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSetting, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"setSetting", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSetting, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"openSettings", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_openSettings, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"getAddonInfo", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_getAddonInfo, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// This method initializes the above mentioned Python Type structure
|
||||
static void initPyXBMCAddon_xbmcaddon_Addon_Type()
|
||||
{
|
||||
|
||||
|
||||
PyTypeObject& pythonType = TyXBMCAddon_xbmcaddon_Addon_Type.pythonType;
|
||||
pythonType.tp_name = (char*)"xbmcaddon.Addon";
|
||||
pythonType.tp_basicsize = sizeof(PyHolder);
|
||||
pythonType.tp_dealloc = (destructor)xbmcaddon_XBMCAddon_xbmcaddon_Addon_Dealloc;
|
||||
|
||||
|
||||
pythonType.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE;
|
||||
|
||||
pythonType.tp_doc = NULL;
|
||||
pythonType.tp_methods = XBMCAddon_xbmcaddon_Addon_methods;
|
||||
|
||||
pythonType.tp_base = NULL;
|
||||
pythonType.tp_new = xbmcaddon_XBMCAddon_xbmcaddon_Addon_New;
|
||||
|
||||
TyXBMCAddon_xbmcaddon_Addon_Type.swigType="p.XBMCAddon::xbmcaddon::Addon";
|
||||
registerAddonClassTypeInformation(&TyXBMCAddon_xbmcaddon_Addon_Type);
|
||||
|
||||
}
|
||||
//=========================================================================
|
||||
|
||||
|
||||
static PyMethodDef xbmcaddon_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
// This is the call that will call all of the other initializes
|
||||
// for all of the classes in this module
|
||||
static void initTypes()
|
||||
{
|
||||
static bool typesAlreadyInitialized = false;
|
||||
if (!typesAlreadyInitialized)
|
||||
{
|
||||
typesAlreadyInitialized = true;
|
||||
|
||||
initPyXBMCAddon_xbmcaddon_Addon_Type();
|
||||
if (PyType_Ready(&(TyXBMCAddon_xbmcaddon_Addon_Type.pythonType)) < 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void initModule_xbmcaddon()
|
||||
{
|
||||
initTypes();
|
||||
|
||||
// init general xbmcaddon modules
|
||||
PyObject* module;
|
||||
|
||||
|
||||
Py_INCREF(&(TyXBMCAddon_xbmcaddon_Addon_Type.pythonType));
|
||||
|
||||
module = Py_InitModule((char*)"xbmcaddon", xbmcaddon_methods);
|
||||
if (module == NULL) return;
|
||||
|
||||
|
||||
PyModule_AddObject(module, (char*)"Addon", (PyObject*)(&(TyXBMCAddon_xbmcaddon_Addon_Type.pythonType)));
|
||||
|
||||
// constants
|
||||
PyModule_AddStringConstant(module, (char*)"__author__", (char*)"Team Kodi <http://kodi.tv>");
|
||||
PyModule_AddStringConstant(module, (char*)"__date__", (char*)"Wed Nov 15 19:05:05 GMT 2017");
|
||||
PyModule_AddStringConstant(module, (char*)"__version__", (char*)"2.25.0");
|
||||
PyModule_AddStringConstant(module, (char*)"__credits__", (char*)"Team Kodi");
|
||||
PyModule_AddStringConstant(module, (char*)"__platform__", (char*)"ALL");
|
||||
|
||||
// need to handle constants
|
||||
|
||||
}
|
||||
|
||||
} // end PythonBindings namespace for python type definitions
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,941 @@
|
|||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2005-2018 Team Kodi
|
||||
* This file is part of Kodi - https://kodi.tv
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
* See LICENSES/README.md for more information.
|
||||
*/
|
||||
|
||||
// ************************************************************************
|
||||
// This file was generated by xbmc compile process. DO NOT EDIT!!
|
||||
// It was created by running the code generator on the spec file for
|
||||
// the module "xbmcaddon" on the template file PythonSwig.template.cpp
|
||||
// ************************************************************************
|
||||
|
||||
|
||||
|
||||
#include <Python.h>
|
||||
#include <string>
|
||||
#include "interfaces/python/LanguageHook.h"
|
||||
#include "interfaces/python/swig.h"
|
||||
#include "interfaces/python/PyContext.h"
|
||||
|
||||
|
||||
#if defined(TARGET_WINDOWS)
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "interfaces/legacy/Addon.h"
|
||||
|
||||
using namespace XBMCAddon;
|
||||
using namespace xbmcaddon;
|
||||
|
||||
#if defined(__GNUG__)
|
||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace PythonBindings
|
||||
{
|
||||
|
||||
//=========================================================================
|
||||
// These variables will hold the Python Type information for XBMCAddon::xbmcaddon::Addon
|
||||
TypeInfo TyXBMCAddon_xbmcaddon_Addon_Type(typeid(XBMCAddon::xbmcaddon::Addon));
|
||||
//=========================================================================
|
||||
|
||||
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_New (PyTypeObject* pytype , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
char * id = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"|s",
|
||||
const_cast<char**>(keywords),
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XBMCAddon::xbmcaddon::Addon * apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::PythonLanguageHook::GetIfExists(PyThreadState_Get()->interp).get());
|
||||
apiResult = new XBMCAddon::xbmcaddon::Addon( id );
|
||||
prepareForReturn(apiResult);
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"new XBMCAddon::xbmcaddon::Addon\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"new XBMCAddon::xbmcaddon::Addon\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = makePythonInstance(apiResult,pytype,false);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_getLocalizedString (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
int id ;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"i",
|
||||
const_cast<char**>(keywords),
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XBMCAddon::String apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"getLocalizedString","XBMCAddon::xbmcaddon::Addon"))-> getLocalizedString( id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"getLocalizedString\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"getLocalizedString\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = PyUnicode_DecodeUTF8(apiResult.c_str(),apiResult.size(),"replace");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSetting (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"s",
|
||||
const_cast<char**>(keywords),
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XBMCAddon::String apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"getSetting","XBMCAddon::xbmcaddon::Addon"))-> getSetting( id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"getSetting\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"getSetting\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = PyString_FromStringAndSize(apiResult.c_str(), apiResult.length());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSettingBool (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"s",
|
||||
const_cast<char**>(keywords),
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"getSettingBool","XBMCAddon::xbmcaddon::Addon"))-> getSettingBool( id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"getSettingBool\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"getSettingBool\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = Py_BuildValue("b", apiResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSettingInt (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"s",
|
||||
const_cast<char**>(keywords),
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"getSettingInt","XBMCAddon::xbmcaddon::Addon"))-> getSettingInt( id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"getSettingInt\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"getSettingInt\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = Py_BuildValue("i", apiResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSettingNumber (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"s",
|
||||
const_cast<char**>(keywords),
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
double apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"getSettingNumber","XBMCAddon::xbmcaddon::Addon"))-> getSettingNumber( id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"getSettingNumber\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"getSettingNumber\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = PyFloat_FromDouble(apiResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSettingString (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"s",
|
||||
const_cast<char**>(keywords),
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XBMCAddon::String apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"getSettingString","XBMCAddon::xbmcaddon::Addon"))-> getSettingString( id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"getSettingString\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"getSettingString\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = PyString_FromStringAndSize(apiResult.c_str(), apiResult.length());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSetting (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
"value",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
std::string value ;
|
||||
PyObject* pyvalue = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"sO",
|
||||
const_cast<char**>(keywords),
|
||||
&id,
|
||||
&pyvalue
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
if (pyvalue) PyXBMCGetUnicodeString(value,pyvalue,false,"value","setSetting");
|
||||
|
||||
((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"setSetting","XBMCAddon::xbmcaddon::Addon"))-> setSetting( id, value );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"setSetting\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"setSetting\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
Py_INCREF(Py_None);
|
||||
result = Py_None;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSettingBool (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
"value",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
bool value ;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"sb",
|
||||
const_cast<char**>(keywords),
|
||||
&id,
|
||||
&value
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"setSettingBool","XBMCAddon::xbmcaddon::Addon"))-> setSettingBool( id, value );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"setSettingBool\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"setSettingBool\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = Py_BuildValue("b", apiResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSettingInt (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
"value",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
int value ;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"si",
|
||||
const_cast<char**>(keywords),
|
||||
&id,
|
||||
&value
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"setSettingInt","XBMCAddon::xbmcaddon::Addon"))-> setSettingInt( id, value );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"setSettingInt\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"setSettingInt\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = Py_BuildValue("b", apiResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSettingNumber (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
"value",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
double value ;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"sd",
|
||||
const_cast<char**>(keywords),
|
||||
&id,
|
||||
&value
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"setSettingNumber","XBMCAddon::xbmcaddon::Addon"))-> setSettingNumber( id, value );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"setSettingNumber\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"setSettingNumber\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = Py_BuildValue("b", apiResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSettingString (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
"value",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
std::string value ;
|
||||
PyObject* pyvalue = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"sO",
|
||||
const_cast<char**>(keywords),
|
||||
&id,
|
||||
&pyvalue
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool apiResult;
|
||||
try
|
||||
{
|
||||
if (pyvalue) PyXBMCGetUnicodeString(value,pyvalue,false,"value","setSettingString");
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"setSettingString","XBMCAddon::xbmcaddon::Addon"))-> setSettingString( id, value );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"setSettingString\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"setSettingString\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = Py_BuildValue("b", apiResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_openSettings (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"openSettings","XBMCAddon::xbmcaddon::Addon"))-> openSettings( );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"openSettings\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"openSettings\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
Py_INCREF(Py_None);
|
||||
result = Py_None;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject* xbmcaddon_XBMCAddon_xbmcaddon_Addon_getAddonInfo (PyHolder* self , PyObject *args, PyObject *kwds )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
static const char *keywords[] = {
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
char * id = nullptr;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
"s",
|
||||
const_cast<char**>(keywords),
|
||||
&id
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XBMCAddon::String apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = ((XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"getAddonInfo","XBMCAddon::xbmcaddon::Addon"))-> getAddonInfo( id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"getAddonInfo\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"getAddonInfo\"");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = PyString_FromStringAndSize(apiResult.c_str(), apiResult.length());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void xbmcaddon_XBMCAddon_xbmcaddon_Addon_Dealloc (PyHolder* self )
|
||||
{
|
||||
XBMC_TRACE;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
XBMCAddon::xbmcaddon::Addon* theObj = (XBMCAddon::xbmcaddon::Addon*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcaddon_Addon_Type,"~XBMCAddon::xbmcaddon::Addon","XBMCAddon::xbmcaddon::Addon");
|
||||
cleanForDealloc(theObj);
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: Unknown exception thrown from the call \"XBMCAddon::xbmcaddon::Addon\"");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"XBMCAddon::xbmcaddon::Addon\"");
|
||||
}
|
||||
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
|
||||
}
|
||||
//=========================================================================
|
||||
// This section contains the initialization for the
|
||||
// Python extension for the Api class XBMCAddon::xbmcaddon::Addon
|
||||
//=========================================================================
|
||||
// All of the methods on this class
|
||||
static PyMethodDef XBMCAddon_xbmcaddon_Addon_methods[] = {
|
||||
{"getLocalizedString", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_getLocalizedString, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"getSetting", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSetting, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"getSettingBool", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSettingBool, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"getSettingInt", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSettingInt, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"getSettingNumber", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSettingNumber, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"getSettingString", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_getSettingString, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setSetting", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSetting, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setSettingBool", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSettingBool, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setSettingInt", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSettingInt, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setSettingNumber", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSettingNumber, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setSettingString", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_setSettingString, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"openSettings", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_openSettings, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"getAddonInfo", (PyCFunction)xbmcaddon_XBMCAddon_xbmcaddon_Addon_getAddonInfo, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// This method initializes the above mentioned Python Type structure
|
||||
static void initPyXBMCAddon_xbmcaddon_Addon_Type()
|
||||
{
|
||||
|
||||
|
||||
PyTypeObject& pythonType = TyXBMCAddon_xbmcaddon_Addon_Type.pythonType;
|
||||
pythonType.tp_name = "xbmcaddon.Addon";
|
||||
pythonType.tp_basicsize = sizeof(PyHolder);
|
||||
pythonType.tp_dealloc = (destructor)xbmcaddon_XBMCAddon_xbmcaddon_Addon_Dealloc;
|
||||
|
||||
|
||||
pythonType.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE;
|
||||
|
||||
pythonType.tp_doc = NULL;
|
||||
pythonType.tp_methods = XBMCAddon_xbmcaddon_Addon_methods;
|
||||
|
||||
pythonType.tp_base = NULL;
|
||||
pythonType.tp_new = xbmcaddon_XBMCAddon_xbmcaddon_Addon_New;
|
||||
|
||||
TyXBMCAddon_xbmcaddon_Addon_Type.swigType="p.XBMCAddon::xbmcaddon::Addon";
|
||||
registerAddonClassTypeInformation(&TyXBMCAddon_xbmcaddon_Addon_Type);
|
||||
|
||||
}
|
||||
//=========================================================================
|
||||
|
||||
|
||||
static PyMethodDef xbmcaddon_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
// This is the call that will call all of the other initializes
|
||||
// for all of the classes in this module
|
||||
static void initTypes()
|
||||
{
|
||||
static bool typesAlreadyInitialized = false;
|
||||
if (!typesAlreadyInitialized)
|
||||
{
|
||||
typesAlreadyInitialized = true;
|
||||
|
||||
initPyXBMCAddon_xbmcaddon_Addon_Type();
|
||||
if (PyType_Ready(&(TyXBMCAddon_xbmcaddon_Addon_Type.pythonType)) < 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void initModule_xbmcaddon()
|
||||
{
|
||||
initTypes();
|
||||
|
||||
// init general xbmcaddon modules
|
||||
PyObject* module;
|
||||
|
||||
|
||||
Py_INCREF(&(TyXBMCAddon_xbmcaddon_Addon_Type.pythonType));
|
||||
|
||||
module = Py_InitModule("xbmcaddon", xbmcaddon_methods);
|
||||
if (module == NULL) return;
|
||||
|
||||
|
||||
PyModule_AddObject(module, "Addon", (PyObject*)(&(TyXBMCAddon_xbmcaddon_Addon_Type.pythonType)));
|
||||
|
||||
// constants
|
||||
PyModule_AddStringConstant(module, "__author__", "Team Kodi <http://kodi.tv>");
|
||||
PyModule_AddStringConstant(module, "__date__", "Wed Jan 30 17:54:18 GMT 2019");
|
||||
PyModule_AddStringConstant(module, "__version__", "2.26.0");
|
||||
PyModule_AddStringConstant(module, "__credits__", "Team Kodi");
|
||||
PyModule_AddStringConstant(module, "__platform__", "ALL");
|
||||
|
||||
// need to handle constants
|
||||
|
||||
}
|
||||
|
||||
} // end PythonBindings namespace for python type definitions
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,24 +1,11 @@
|
|||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2005-2013 Team XBMC
|
||||
* http://xbmc.org
|
||||
*
|
||||
* This Program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This Program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with XBMC; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
* Copyright (C) 2005-2018 Team Kodi
|
||||
* This file is part of Kodi - https://kodi.tv
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
* See LICENSES/README.md for more information.
|
||||
*/
|
||||
|
||||
// ************************************************************************
|
||||
|
@ -36,12 +23,16 @@
|
|||
#include "interfaces/python/PyContext.h"
|
||||
|
||||
|
||||
#if defined(TARGET_WINDOWS)
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "interfaces/legacy/ModuleXbmcplugin.h"
|
||||
|
||||
using namespace XBMCAddon;
|
||||
using namespace xbmcplugin;
|
||||
|
||||
#if defined(__GNUG__) && (__GNUC__>4) || (__GNUC__==4 && __GNUC_MINOR__>=2)
|
||||
#if defined(__GNUG__)
|
||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#endif
|
||||
|
||||
|
@ -51,7 +42,7 @@ namespace PythonBindings
|
|||
{
|
||||
|
||||
//=========================================================================
|
||||
// These variables define the type XBMCAddon::xbmcgui::ListItem from another module
|
||||
// These variables define the type XBMCAddon::xbmcgui::ListItem from another module
|
||||
extern TypeInfo TyXBMCAddon_xbmcgui_ListItem_Type;
|
||||
//=========================================================================
|
||||
|
||||
|
@ -68,19 +59,19 @@ namespace PythonBindings
|
|||
"isFolder",
|
||||
"totalItems",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
|
||||
int handle ;
|
||||
std::string url ;
|
||||
PyObject* pyurl = NULL;
|
||||
XBMCAddon::xbmcgui::ListItem * listitem ;
|
||||
PyObject* pylistitem = NULL;
|
||||
bool isFolder = false;
|
||||
PyObject* pyurl = NULL;
|
||||
XBMCAddon::xbmcgui::ListItem * listitem = nullptr;
|
||||
PyObject* pylistitem = NULL;
|
||||
bool isFolder = false;
|
||||
int totalItems = 0;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"iOO|bi",
|
||||
(char**)keywords,
|
||||
"iOO|bi",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&pyurl,
|
||||
&pylistitem,
|
||||
|
@ -98,17 +89,17 @@ namespace PythonBindings
|
|||
listitem = (XBMCAddon::xbmcgui::ListItem *)retrieveApiInstance(pylistitem,"p.XBMCAddon::xbmcgui::ListItem","XBMCAddon::xbmcplugin::","XBMCAddon::xbmcplugin::addDirectoryItem");
|
||||
|
||||
XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::PythonLanguageHook::GetIfExists(PyThreadState_Get()->interp).get());
|
||||
apiResult = (bool )XBMCAddon::xbmcplugin::addDirectoryItem( handle, url, listitem, isFolder, totalItems );
|
||||
apiResult = XBMCAddon::xbmcplugin::addDirectoryItem( handle, url, listitem, isFolder, totalItems );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -123,7 +114,7 @@ namespace PythonBindings
|
|||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = Py_BuildValue((char*)"b", apiResult);
|
||||
result = Py_BuildValue("b", apiResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -137,16 +128,16 @@ namespace PythonBindings
|
|||
"items",
|
||||
"totalItems",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
|
||||
int handle ;
|
||||
std::vector< Tuple< XBMCAddon::String ,XBMCAddon::xbmcgui::ListItem const *,bool > > items ;
|
||||
PyObject* pyitems = NULL;
|
||||
PyObject* pyitems = NULL;
|
||||
int totalItems = 0;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"iO|i",
|
||||
(char**)keywords,
|
||||
"iO|i",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&pyitems,
|
||||
&totalItems
|
||||
|
@ -167,8 +158,8 @@ namespace PythonBindings
|
|||
|
||||
|
||||
PyObject *pyentry1 = NULL;
|
||||
int vecSize = (isTuple ? PyTuple_Size(pyitems) : PyList_Size(pyitems));
|
||||
for(int i = 0; i < vecSize; i++)
|
||||
auto vecSize = (isTuple ? PyTuple_Size(pyitems) : PyList_Size(pyitems));
|
||||
for(Py_ssize_t i = 0; i < vecSize; i++)
|
||||
{
|
||||
pyentry1 = (isTuple ? PyTuple_GetItem(pyitems, i) : PyList_GetItem(pyitems, i));
|
||||
Tuple< XBMCAddon::String ,XBMCAddon::xbmcgui::ListItem const *,bool > entry1;
|
||||
|
@ -178,7 +169,7 @@ namespace PythonBindings
|
|||
bool isTuple = PyObject_TypeCheck(pyentry1,&PyTuple_Type);
|
||||
if (!isTuple && !PyObject_TypeCheck(pyentry1,&PyList_Type))
|
||||
throw WrongTypeException("The parameter \"entry1\" must be either a Tuple or a List.");
|
||||
int vecSize = (isTuple ? PyTuple_Size(pyentry1) : PyList_Size(pyentry1));
|
||||
auto vecSize = (isTuple ? PyTuple_Size(pyentry1) : PyList_Size(pyentry1));
|
||||
|
||||
if (vecSize > 0)
|
||||
{
|
||||
|
@ -215,17 +206,17 @@ namespace PythonBindings
|
|||
|
||||
|
||||
XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::PythonLanguageHook::GetIfExists(PyThreadState_Get()->interp).get());
|
||||
apiResult = (bool )XBMCAddon::xbmcplugin::addDirectoryItems( handle, items, totalItems );
|
||||
apiResult = XBMCAddon::xbmcplugin::addDirectoryItems( handle, items, totalItems );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -240,7 +231,7 @@ namespace PythonBindings
|
|||
PyObject* result = Py_None;
|
||||
|
||||
// transform the result
|
||||
result = Py_BuildValue((char*)"b", apiResult);
|
||||
result = Py_BuildValue("b", apiResult);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -255,16 +246,16 @@ namespace PythonBindings
|
|||
"updateListing",
|
||||
"cacheToDisc",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
bool succeeded = true;
|
||||
bool updateListing = false;
|
||||
|
||||
int handle ;
|
||||
bool succeeded = true;
|
||||
bool updateListing = false;
|
||||
bool cacheToDisc = true;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"i|bbb",
|
||||
(char**)keywords,
|
||||
"i|bbb",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&succeeded,
|
||||
&updateListing,
|
||||
|
@ -283,13 +274,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -319,16 +310,16 @@ namespace PythonBindings
|
|||
"succeeded",
|
||||
"listitem",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
bool succeeded ;
|
||||
XBMCAddon::xbmcgui::ListItem * listitem ;
|
||||
|
||||
int handle ;
|
||||
bool succeeded ;
|
||||
XBMCAddon::xbmcgui::ListItem * listitem = nullptr;
|
||||
PyObject* pylistitem = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"ibO",
|
||||
(char**)keywords,
|
||||
"ibO",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&succeeded,
|
||||
&pylistitem
|
||||
|
@ -347,13 +338,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -383,16 +374,16 @@ namespace PythonBindings
|
|||
"sortMethod",
|
||||
"label2Mask",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
int sortMethod ;
|
||||
|
||||
int handle ;
|
||||
int sortMethod ;
|
||||
std::string label2Mask = XBMCAddon::emptyString;
|
||||
PyObject* pylabel2Mask = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"ii|O",
|
||||
(char**)keywords,
|
||||
"ii|O",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&sortMethod,
|
||||
&pylabel2Mask
|
||||
|
@ -411,13 +402,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -446,14 +437,14 @@ namespace PythonBindings
|
|||
"handle",
|
||||
"id",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
char * id ;
|
||||
|
||||
int handle ;
|
||||
char * id = nullptr;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"is",
|
||||
(char**)keywords,
|
||||
"is",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&id
|
||||
))
|
||||
|
@ -461,22 +452,22 @@ namespace PythonBindings
|
|||
return NULL;
|
||||
}
|
||||
|
||||
std::string apiResult;
|
||||
XBMCAddon::String apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::PythonLanguageHook::GetIfExists(PyThreadState_Get()->interp).get());
|
||||
apiResult = (std::string )XBMCAddon::xbmcplugin::getSetting( handle, id );
|
||||
apiResult = XBMCAddon::xbmcplugin::getSetting( handle, id );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -505,17 +496,17 @@ namespace PythonBindings
|
|||
"id",
|
||||
"value",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
|
||||
int handle ;
|
||||
std::string id ;
|
||||
PyObject* pyid = NULL;
|
||||
PyObject* pyid = NULL;
|
||||
std::string value ;
|
||||
PyObject* pyvalue = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"iOO",
|
||||
(char**)keywords,
|
||||
"iOO",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&pyid,
|
||||
&pyvalue
|
||||
|
@ -535,13 +526,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -570,14 +561,14 @@ namespace PythonBindings
|
|||
"handle",
|
||||
"content",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
char * content ;
|
||||
|
||||
int handle ;
|
||||
char * content = nullptr;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"is",
|
||||
(char**)keywords,
|
||||
"is",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&content
|
||||
))
|
||||
|
@ -594,13 +585,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -629,15 +620,15 @@ namespace PythonBindings
|
|||
"handle",
|
||||
"category",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
|
||||
int handle ;
|
||||
std::string category ;
|
||||
PyObject* pycategory = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"iO",
|
||||
(char**)keywords,
|
||||
"iO",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&pycategory
|
||||
))
|
||||
|
@ -655,13 +646,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -693,17 +684,17 @@ namespace PythonBindings
|
|||
"color2",
|
||||
"color3",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
char * image = NULL;
|
||||
char * color1 = NULL;
|
||||
char * color2 = NULL;
|
||||
|
||||
int handle ;
|
||||
char * image = NULL;
|
||||
char * color1 = NULL;
|
||||
char * color2 = NULL;
|
||||
char * color3 = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"i|ssss",
|
||||
(char**)keywords,
|
||||
"i|ssss",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&image,
|
||||
&color1,
|
||||
|
@ -723,13 +714,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -759,16 +750,16 @@ namespace PythonBindings
|
|||
"key",
|
||||
"value",
|
||||
NULL};
|
||||
|
||||
int handle ;
|
||||
char * key ;
|
||||
|
||||
int handle ;
|
||||
char * key = nullptr;
|
||||
std::string value ;
|
||||
PyObject* pyvalue = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"isO",
|
||||
(char**)keywords,
|
||||
"isO",
|
||||
const_cast<char**>(keywords),
|
||||
&handle,
|
||||
&key,
|
||||
&pyvalue
|
||||
|
@ -787,13 +778,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -816,21 +807,21 @@ namespace PythonBindings
|
|||
|
||||
|
||||
static PyMethodDef xbmcplugin_methods[] = {
|
||||
{(char*)"addDirectoryItem", (PyCFunction)xbmcplugin_addDirectoryItem, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"addDirectoryItems", (PyCFunction)xbmcplugin_addDirectoryItems, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"endOfDirectory", (PyCFunction)xbmcplugin_endOfDirectory, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"setResolvedUrl", (PyCFunction)xbmcplugin_setResolvedUrl, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"addSortMethod", (PyCFunction)xbmcplugin_addSortMethod, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"getSetting", (PyCFunction)xbmcplugin_getSetting, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"setSetting", (PyCFunction)xbmcplugin_setSetting, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"setContent", (PyCFunction)xbmcplugin_setContent, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"setPluginCategory", (PyCFunction)xbmcplugin_setPluginCategory, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"setPluginFanart", (PyCFunction)xbmcplugin_setPluginFanart, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"setProperty", (PyCFunction)xbmcplugin_setProperty, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"addDirectoryItem", (PyCFunction)xbmcplugin_addDirectoryItem, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"addDirectoryItems", (PyCFunction)xbmcplugin_addDirectoryItems, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"endOfDirectory", (PyCFunction)xbmcplugin_endOfDirectory, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setResolvedUrl", (PyCFunction)xbmcplugin_setResolvedUrl, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"addSortMethod", (PyCFunction)xbmcplugin_addSortMethod, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"getSetting", (PyCFunction)xbmcplugin_getSetting, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setSetting", (PyCFunction)xbmcplugin_setSetting, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setContent", (PyCFunction)xbmcplugin_setContent, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setPluginCategory", (PyCFunction)xbmcplugin_setPluginCategory, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setPluginFanart", (PyCFunction)xbmcplugin_setPluginFanart, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"setProperty", (PyCFunction)xbmcplugin_setProperty, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
// This is the call that will call all of the other initializes
|
||||
// This is the call that will call all of the other initializes
|
||||
// for all of the classes in this module
|
||||
static void initTypes()
|
||||
{
|
||||
|
@ -851,17 +842,17 @@ namespace PythonBindings
|
|||
|
||||
|
||||
|
||||
module = Py_InitModule((char*)"xbmcplugin", xbmcplugin_methods);
|
||||
module = Py_InitModule("xbmcplugin", xbmcplugin_methods);
|
||||
if (module == NULL) return;
|
||||
|
||||
|
||||
|
||||
// constants
|
||||
PyModule_AddStringConstant(module, (char*)"__author__", (char*)"Team Kodi <http://kodi.tv>");
|
||||
PyModule_AddStringConstant(module, (char*)"__date__", (char*)"Wed Nov 15 19:05:17 GMT 2017");
|
||||
PyModule_AddStringConstant(module, (char*)"__version__", (char*)"2.25.0");
|
||||
PyModule_AddStringConstant(module, (char*)"__credits__", (char*)"Team Kodi");
|
||||
PyModule_AddStringConstant(module, (char*)"__platform__", (char*)"ALL");
|
||||
PyModule_AddStringConstant(module, "__author__", "Team Kodi <http://kodi.tv>");
|
||||
PyModule_AddStringConstant(module, "__date__", "Wed Jan 30 17:54:26 GMT 2019");
|
||||
PyModule_AddStringConstant(module, "__version__", "2.26.0");
|
||||
PyModule_AddStringConstant(module, "__credits__", "Team Kodi");
|
||||
PyModule_AddStringConstant(module, "__platform__", "ALL");
|
||||
|
||||
// need to handle constants
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,24 +1,11 @@
|
|||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2005-2013 Team XBMC
|
||||
* http://xbmc.org
|
||||
*
|
||||
* This Program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This Program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with XBMC; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
* Copyright (C) 2005-2018 Team Kodi
|
||||
* This file is part of Kodi - https://kodi.tv
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
* See LICENSES/README.md for more information.
|
||||
*/
|
||||
|
||||
// ************************************************************************
|
||||
|
@ -28,7 +15,9 @@
|
|||
// ************************************************************************
|
||||
|
||||
|
||||
#include "system.h"
|
||||
#if defined(TARGET_WINDOWS)
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAS_WEB_SERVER
|
||||
|
||||
|
@ -48,7 +37,7 @@
|
|||
using namespace XBMCAddon;
|
||||
using namespace xbmcwsgi;
|
||||
|
||||
#if defined(__GNUG__) && (__GNUC__>4) || (__GNUC__==4 && __GNUC_MINOR__>=2)
|
||||
#if defined(__GNUG__)
|
||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#endif
|
||||
|
||||
|
@ -92,17 +81,17 @@ namespace PythonBindings
|
|||
{
|
||||
|
||||
XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::PythonLanguageHook::GetIfExists(PyThreadState_Get()->interp).get());
|
||||
apiResult = (XBMCAddon::xbmcwsgi::WsgiErrorStream *)new XBMCAddon::xbmcwsgi::WsgiErrorStream( );
|
||||
apiResult = new XBMCAddon::xbmcwsgi::WsgiErrorStream( );
|
||||
prepareForReturn(apiResult);
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -133,13 +122,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -167,14 +156,14 @@ namespace PythonBindings
|
|||
static const char *keywords[] = {
|
||||
"str",
|
||||
NULL};
|
||||
|
||||
|
||||
std::string str ;
|
||||
PyObject* pystr = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"O",
|
||||
(char**)keywords,
|
||||
"O",
|
||||
const_cast<char**>(keywords),
|
||||
&pystr
|
||||
))
|
||||
{
|
||||
|
@ -190,13 +179,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -224,14 +213,14 @@ namespace PythonBindings
|
|||
static const char *keywords[] = {
|
||||
"seq",
|
||||
NULL};
|
||||
|
||||
|
||||
std::vector< XBMCAddon::String > seq ;
|
||||
PyObject* pyseq = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"O",
|
||||
(char**)keywords,
|
||||
"O",
|
||||
const_cast<char**>(keywords),
|
||||
&pyseq
|
||||
))
|
||||
{
|
||||
|
@ -250,8 +239,8 @@ namespace PythonBindings
|
|||
|
||||
|
||||
PyObject *pyentry1 = NULL;
|
||||
int vecSize = (isTuple ? PyTuple_Size(pyseq) : PyList_Size(pyseq));
|
||||
for(int i = 0; i < vecSize; i++)
|
||||
auto vecSize = (isTuple ? PyTuple_Size(pyseq) : PyList_Size(pyseq));
|
||||
for(Py_ssize_t i = 0; i < vecSize; i++)
|
||||
{
|
||||
pyentry1 = (isTuple ? PyTuple_GetItem(pyseq, i) : PyList_GetItem(pyseq, i));
|
||||
std::string entry1;
|
||||
|
@ -265,13 +254,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -300,17 +289,17 @@ namespace PythonBindings
|
|||
{
|
||||
|
||||
XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::PythonLanguageHook::GetIfExists(PyThreadState_Get()->interp).get());
|
||||
apiResult = (XBMCAddon::xbmcwsgi::WsgiInputStreamIterator *)new XBMCAddon::xbmcwsgi::WsgiInputStreamIterator( );
|
||||
apiResult = new XBMCAddon::xbmcwsgi::WsgiInputStreamIterator( );
|
||||
prepareForReturn(apiResult);
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -337,34 +326,34 @@ namespace PythonBindings
|
|||
static const char *keywords[] = {
|
||||
"size",
|
||||
NULL};
|
||||
|
||||
|
||||
unsigned long size = 0;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"|k",
|
||||
(char**)keywords,
|
||||
"|k",
|
||||
const_cast<char**>(keywords),
|
||||
&size
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::string apiResult;
|
||||
XBMCAddon::String apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = (std::string )((XBMCAddon::xbmcwsgi::WsgiInputStreamIterator*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Type,"read","XBMCAddon::xbmcwsgi::WsgiInputStreamIterator"))-> read( size );
|
||||
apiResult = ((XBMCAddon::xbmcwsgi::WsgiInputStreamIterator*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Type,"read","XBMCAddon::xbmcwsgi::WsgiInputStreamIterator"))-> read( size );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -391,34 +380,34 @@ namespace PythonBindings
|
|||
static const char *keywords[] = {
|
||||
"size",
|
||||
NULL};
|
||||
|
||||
|
||||
unsigned long size = 0;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"|k",
|
||||
(char**)keywords,
|
||||
"|k",
|
||||
const_cast<char**>(keywords),
|
||||
&size
|
||||
))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::string apiResult;
|
||||
XBMCAddon::String apiResult;
|
||||
try
|
||||
{
|
||||
|
||||
apiResult = (std::string )((XBMCAddon::xbmcwsgi::WsgiInputStreamIterator*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Type,"readline","XBMCAddon::xbmcwsgi::WsgiInputStreamIterator"))-> readline( size );
|
||||
apiResult = ((XBMCAddon::xbmcwsgi::WsgiInputStreamIterator*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Type,"readline","XBMCAddon::xbmcwsgi::WsgiInputStreamIterator"))-> readline( size );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -445,13 +434,13 @@ namespace PythonBindings
|
|||
static const char *keywords[] = {
|
||||
"sizehint",
|
||||
NULL};
|
||||
|
||||
|
||||
unsigned long sizehint = 0;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"|k",
|
||||
(char**)keywords,
|
||||
"|k",
|
||||
const_cast<char**>(keywords),
|
||||
&sizehint
|
||||
))
|
||||
{
|
||||
|
@ -462,17 +451,17 @@ namespace PythonBindings
|
|||
try
|
||||
{
|
||||
|
||||
apiResult = (std::vector< XBMCAddon::String > )((XBMCAddon::xbmcwsgi::WsgiInputStreamIterator*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Type,"readlines","XBMCAddon::xbmcwsgi::WsgiInputStreamIterator"))-> readlines( sizehint );
|
||||
apiResult = ((XBMCAddon::xbmcwsgi::WsgiInputStreamIterator*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Type,"readlines","XBMCAddon::xbmcwsgi::WsgiInputStreamIterator"))-> readlines( sizehint );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -512,17 +501,17 @@ namespace PythonBindings
|
|||
{
|
||||
|
||||
XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::PythonLanguageHook::GetIfExists(PyThreadState_Get()->interp).get());
|
||||
apiResult = (XBMCAddon::xbmcwsgi::WsgiInputStream *)new XBMCAddon::xbmcwsgi::WsgiInputStream( );
|
||||
apiResult = new XBMCAddon::xbmcwsgi::WsgiInputStream( );
|
||||
prepareForReturn(apiResult);
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -550,17 +539,17 @@ namespace PythonBindings
|
|||
{
|
||||
|
||||
XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::PythonLanguageHook::GetIfExists(PyThreadState_Get()->interp).get());
|
||||
apiResult = (XBMCAddon::xbmcwsgi::WsgiResponse *)new XBMCAddon::xbmcwsgi::WsgiResponse( );
|
||||
apiResult = new XBMCAddon::xbmcwsgi::WsgiResponse( );
|
||||
prepareForReturn(apiResult);
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -589,18 +578,18 @@ namespace PythonBindings
|
|||
"response_headers",
|
||||
"exc_info",
|
||||
NULL};
|
||||
|
||||
|
||||
std::string status ;
|
||||
PyObject* pystatus = NULL;
|
||||
PyObject* pystatus = NULL;
|
||||
std::vector< XBMCAddon::xbmcwsgi::WsgiHttpHeader > response_headers ;
|
||||
PyObject* pyresponse_headers = NULL;
|
||||
PyObject* pyresponse_headers = NULL;
|
||||
void * exc_info = NULL;
|
||||
PyObject* pyexc_info = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"OO|O",
|
||||
(char**)keywords,
|
||||
"OO|O",
|
||||
const_cast<char**>(keywords),
|
||||
&pystatus,
|
||||
&pyresponse_headers,
|
||||
&pyexc_info
|
||||
|
@ -622,8 +611,8 @@ namespace PythonBindings
|
|||
|
||||
|
||||
PyObject *pyentry1 = NULL;
|
||||
int vecSize = (isTuple ? PyTuple_Size(pyresponse_headers) : PyList_Size(pyresponse_headers));
|
||||
for(int i = 0; i < vecSize; i++)
|
||||
auto vecSize = (isTuple ? PyTuple_Size(pyresponse_headers) : PyList_Size(pyresponse_headers));
|
||||
for(Py_ssize_t i = 0; i < vecSize; i++)
|
||||
{
|
||||
pyentry1 = (isTuple ? PyTuple_GetItem(pyresponse_headers, i) : PyList_GetItem(pyresponse_headers, i));
|
||||
Tuple< XBMCAddon::String ,XBMCAddon::String > entry1;
|
||||
|
@ -633,7 +622,7 @@ namespace PythonBindings
|
|||
bool isTuple = PyObject_TypeCheck(pyentry1,&PyTuple_Type);
|
||||
if (!isTuple && !PyObject_TypeCheck(pyentry1,&PyList_Type))
|
||||
throw WrongTypeException("The parameter \"entry1\" must be either a Tuple or a List.");
|
||||
int vecSize = (isTuple ? PyTuple_Size(pyentry1) : PyList_Size(pyentry1));
|
||||
auto vecSize = (isTuple ? PyTuple_Size(pyentry1) : PyList_Size(pyentry1));
|
||||
|
||||
if (vecSize > 0)
|
||||
{
|
||||
|
@ -661,17 +650,17 @@ namespace PythonBindings
|
|||
|
||||
exc_info = (void*)pyexc_info;
|
||||
|
||||
apiResult = (WsgiResponseBody *)((XBMCAddon::xbmcwsgi::WsgiResponse*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcwsgi_WsgiResponse_Type,"operator ()","XBMCAddon::xbmcwsgi::WsgiResponse"))-> operator ()( status, response_headers, exc_info );
|
||||
apiResult = ((XBMCAddon::xbmcwsgi::WsgiResponse*)retrieveApiInstance((PyObject*)self,&TyXBMCAddon_xbmcwsgi_WsgiResponse_Type,"operator ()","XBMCAddon::xbmcwsgi::WsgiResponse"))-> operator ()( status, response_headers, exc_info );
|
||||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -699,17 +688,17 @@ namespace PythonBindings
|
|||
{
|
||||
|
||||
XBMCAddon::SetLanguageHookGuard slhg(XBMCAddon::Python::PythonLanguageHook::GetIfExists(PyThreadState_Get()->interp).get());
|
||||
apiResult = (XBMCAddon::xbmcwsgi::WsgiResponseBody *)new XBMCAddon::xbmcwsgi::WsgiResponseBody( );
|
||||
apiResult = new XBMCAddon::xbmcwsgi::WsgiResponseBody( );
|
||||
prepareForReturn(apiResult);
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -736,14 +725,14 @@ namespace PythonBindings
|
|||
static const char *keywords[] = {
|
||||
"data",
|
||||
NULL};
|
||||
|
||||
|
||||
std::string data ;
|
||||
PyObject* pydata = NULL;
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args,
|
||||
kwds,
|
||||
(char*)"O",
|
||||
(char**)keywords,
|
||||
"O",
|
||||
const_cast<char**>(keywords),
|
||||
&pydata
|
||||
))
|
||||
{
|
||||
|
@ -759,13 +748,13 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -799,12 +788,12 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
}
|
||||
|
@ -814,7 +803,7 @@ namespace PythonBindings
|
|||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"XBMCAddon::xbmcwsgi::WsgiErrorStream\"");
|
||||
}
|
||||
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
|
||||
}
|
||||
static void xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Dealloc (PyHolder* self )
|
||||
|
@ -830,12 +819,12 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
}
|
||||
|
@ -845,7 +834,7 @@ namespace PythonBindings
|
|||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"XBMCAddon::xbmcwsgi::WsgiInputStreamIterator\"");
|
||||
}
|
||||
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
|
||||
}
|
||||
static void xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStream_Dealloc (PyHolder* self )
|
||||
|
@ -861,12 +850,12 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
}
|
||||
|
@ -876,7 +865,7 @@ namespace PythonBindings
|
|||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"XBMCAddon::xbmcwsgi::WsgiInputStream\"");
|
||||
}
|
||||
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
|
||||
}
|
||||
static void xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiResponse_Dealloc (PyHolder* self )
|
||||
|
@ -892,12 +881,12 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
}
|
||||
|
@ -907,7 +896,7 @@ namespace PythonBindings
|
|||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"XBMCAddon::xbmcwsgi::WsgiResponse\"");
|
||||
}
|
||||
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
|
||||
}
|
||||
static void xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiResponseBody_Dealloc (PyHolder* self )
|
||||
|
@ -923,12 +912,12 @@ namespace PythonBindings
|
|||
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
}
|
||||
|
@ -938,18 +927,18 @@ namespace PythonBindings
|
|||
PyErr_SetString(PyExc_RuntimeError, "Unknown exception thrown from the call \"XBMCAddon::xbmcwsgi::WsgiResponseBody\"");
|
||||
}
|
||||
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
|
||||
}
|
||||
//=========================================================================
|
||||
// This section contains the initialization for the
|
||||
// Python extention for the Api class XBMCAddon::xbmcwsgi::WsgiErrorStream
|
||||
// Python extension for the Api class XBMCAddon::xbmcwsgi::WsgiErrorStream
|
||||
//=========================================================================
|
||||
// All of the methods on this class
|
||||
static PyMethodDef XBMCAddon_xbmcwsgi_WsgiErrorStream_methods[] = {
|
||||
{(char*)"flush", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiErrorStream_flush, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"write", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiErrorStream_write, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"writelines", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiErrorStream_writelines, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"flush", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiErrorStream_flush, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"write", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiErrorStream_write, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"writelines", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiErrorStream_writelines, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
|
@ -961,7 +950,7 @@ namespace PythonBindings
|
|||
|
||||
|
||||
PyTypeObject& pythonType = TyXBMCAddon_xbmcwsgi_WsgiErrorStream_Type.pythonType;
|
||||
pythonType.tp_name = (char*)"xbmcwsgi.WsgiErrorStream";
|
||||
pythonType.tp_name = "xbmcwsgi.WsgiErrorStream";
|
||||
pythonType.tp_basicsize = sizeof(PyHolder);
|
||||
pythonType.tp_dealloc = (destructor)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiErrorStream_Dealloc;
|
||||
|
||||
|
@ -982,13 +971,13 @@ namespace PythonBindings
|
|||
|
||||
//=========================================================================
|
||||
// This section contains the initialization for the
|
||||
// Python extention for the Api class XBMCAddon::xbmcwsgi::WsgiInputStreamIterator
|
||||
// Python extension for the Api class XBMCAddon::xbmcwsgi::WsgiInputStreamIterator
|
||||
//=========================================================================
|
||||
// All of the methods on this class
|
||||
static PyMethodDef XBMCAddon_xbmcwsgi_WsgiInputStreamIterator_methods[] = {
|
||||
{(char*)"read", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStreamIterator_read, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"readline", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStreamIterator_readline, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{(char*)"readlines", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStreamIterator_readlines, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"read", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStreamIterator_read, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"readline", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStreamIterator_readline, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{"readlines", (PyCFunction)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStreamIterator_readlines, METH_VARARGS|METH_KEYWORDS, NULL },
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
|
@ -1015,13 +1004,13 @@ namespace PythonBindings
|
|||
}
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -1043,7 +1032,7 @@ namespace PythonBindings
|
|||
|
||||
|
||||
PyTypeObject& pythonType = TyXBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Type.pythonType;
|
||||
pythonType.tp_name = (char*)"xbmcwsgi.WsgiInputStreamIterator";
|
||||
pythonType.tp_name = "xbmcwsgi.WsgiInputStreamIterator";
|
||||
pythonType.tp_basicsize = sizeof(PyHolder);
|
||||
pythonType.tp_dealloc = (destructor)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Dealloc;
|
||||
|
||||
|
@ -1067,7 +1056,7 @@ namespace PythonBindings
|
|||
|
||||
//=========================================================================
|
||||
// This section contains the initialization for the
|
||||
// Python extention for the Api class XBMCAddon::xbmcwsgi::WsgiInputStream
|
||||
// Python extension for the Api class XBMCAddon::xbmcwsgi::WsgiInputStream
|
||||
//=========================================================================
|
||||
// All of the methods on this class
|
||||
static PyMethodDef XBMCAddon_xbmcwsgi_WsgiInputStream_methods[] = {
|
||||
|
@ -1081,17 +1070,17 @@ namespace PythonBindings
|
|||
try
|
||||
{
|
||||
XBMCAddon::xbmcwsgi::WsgiInputStreamIterator* apiResult = ((XBMCAddon::xbmcwsgi::WsgiInputStream*)retrieveApiInstance(self,&TyXBMCAddon_xbmcwsgi_WsgiInputStream_Type,"xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStream_iternext","XBMCAddon::xbmcwsgi::WsgiInputStream"))->begin();
|
||||
|
||||
|
||||
result = makePythonInstance(apiResult,true);
|
||||
}
|
||||
catch (const XBMCAddon::WrongTypeException& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_TypeError, e.GetMessage());
|
||||
return NULL;
|
||||
}
|
||||
catch (const XbmcCommons::Exception& e)
|
||||
{
|
||||
{
|
||||
CLog::Log(LOGERROR,"EXCEPTION: %s",e.GetMessage());
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessage());
|
||||
return NULL;
|
||||
|
@ -1113,7 +1102,7 @@ namespace PythonBindings
|
|||
|
||||
|
||||
PyTypeObject& pythonType = TyXBMCAddon_xbmcwsgi_WsgiInputStream_Type.pythonType;
|
||||
pythonType.tp_name = (char*)"xbmcwsgi.WsgiInputStream";
|
||||
pythonType.tp_name = "xbmcwsgi.WsgiInputStream";
|
||||
pythonType.tp_basicsize = sizeof(PyHolder);
|
||||
pythonType.tp_dealloc = (destructor)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiInputStream_Dealloc;
|
||||
|
||||
|
@ -1138,7 +1127,7 @@ namespace PythonBindings
|
|||
|
||||
//=========================================================================
|
||||
// This section contains the initialization for the
|
||||
// Python extention for the Api class XBMCAddon::xbmcwsgi::WsgiResponse
|
||||
// Python extension for the Api class XBMCAddon::xbmcwsgi::WsgiResponse
|
||||
//=========================================================================
|
||||
// All of the methods on this class
|
||||
static PyMethodDef XBMCAddon_xbmcwsgi_WsgiResponse_methods[] = {
|
||||
|
@ -1153,7 +1142,7 @@ namespace PythonBindings
|
|||
|
||||
|
||||
PyTypeObject& pythonType = TyXBMCAddon_xbmcwsgi_WsgiResponse_Type.pythonType;
|
||||
pythonType.tp_name = (char*)"xbmcwsgi.WsgiResponse";
|
||||
pythonType.tp_name = "xbmcwsgi.WsgiResponse";
|
||||
pythonType.tp_basicsize = sizeof(PyHolder);
|
||||
pythonType.tp_dealloc = (destructor)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiResponse_Dealloc;
|
||||
|
||||
|
@ -1176,7 +1165,7 @@ namespace PythonBindings
|
|||
|
||||
//=========================================================================
|
||||
// This section contains the initialization for the
|
||||
// Python extention for the Api class XBMCAddon::xbmcwsgi::WsgiResponseBody
|
||||
// Python extension for the Api class XBMCAddon::xbmcwsgi::WsgiResponseBody
|
||||
//=========================================================================
|
||||
// All of the methods on this class
|
||||
static PyMethodDef XBMCAddon_xbmcwsgi_WsgiResponseBody_methods[] = {
|
||||
|
@ -1191,7 +1180,7 @@ namespace PythonBindings
|
|||
|
||||
|
||||
PyTypeObject& pythonType = TyXBMCAddon_xbmcwsgi_WsgiResponseBody_Type.pythonType;
|
||||
pythonType.tp_name = (char*)"xbmcwsgi.WsgiResponseBody";
|
||||
pythonType.tp_name = "xbmcwsgi.WsgiResponseBody";
|
||||
pythonType.tp_basicsize = sizeof(PyHolder);
|
||||
pythonType.tp_dealloc = (destructor)xbmcwsgi_XBMCAddon_xbmcwsgi_WsgiResponseBody_Dealloc;
|
||||
|
||||
|
@ -1217,7 +1206,7 @@ namespace PythonBindings
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
// This is the call that will call all of the other initializes
|
||||
// This is the call that will call all of the other initializes
|
||||
// for all of the classes in this module
|
||||
static void initTypes()
|
||||
{
|
||||
|
@ -1258,22 +1247,22 @@ namespace PythonBindings
|
|||
Py_INCREF(&(TyXBMCAddon_xbmcwsgi_WsgiResponse_Type.pythonType));
|
||||
Py_INCREF(&(TyXBMCAddon_xbmcwsgi_WsgiResponseBody_Type.pythonType));
|
||||
|
||||
module = Py_InitModule((char*)"xbmcwsgi", xbmcwsgi_methods);
|
||||
module = Py_InitModule("xbmcwsgi", xbmcwsgi_methods);
|
||||
if (module == NULL) return;
|
||||
|
||||
|
||||
PyModule_AddObject(module, (char*)"WsgiErrorStream", (PyObject*)(&(TyXBMCAddon_xbmcwsgi_WsgiErrorStream_Type.pythonType)));
|
||||
PyModule_AddObject(module, (char*)"WsgiInputStreamIterator", (PyObject*)(&(TyXBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Type.pythonType)));
|
||||
PyModule_AddObject(module, (char*)"WsgiInputStream", (PyObject*)(&(TyXBMCAddon_xbmcwsgi_WsgiInputStream_Type.pythonType)));
|
||||
PyModule_AddObject(module, (char*)"WsgiResponse", (PyObject*)(&(TyXBMCAddon_xbmcwsgi_WsgiResponse_Type.pythonType)));
|
||||
PyModule_AddObject(module, (char*)"WsgiResponseBody", (PyObject*)(&(TyXBMCAddon_xbmcwsgi_WsgiResponseBody_Type.pythonType)));
|
||||
PyModule_AddObject(module, "WsgiErrorStream", (PyObject*)(&(TyXBMCAddon_xbmcwsgi_WsgiErrorStream_Type.pythonType)));
|
||||
PyModule_AddObject(module, "WsgiInputStreamIterator", (PyObject*)(&(TyXBMCAddon_xbmcwsgi_WsgiInputStreamIterator_Type.pythonType)));
|
||||
PyModule_AddObject(module, "WsgiInputStream", (PyObject*)(&(TyXBMCAddon_xbmcwsgi_WsgiInputStream_Type.pythonType)));
|
||||
PyModule_AddObject(module, "WsgiResponse", (PyObject*)(&(TyXBMCAddon_xbmcwsgi_WsgiResponse_Type.pythonType)));
|
||||
PyModule_AddObject(module, "WsgiResponseBody", (PyObject*)(&(TyXBMCAddon_xbmcwsgi_WsgiResponseBody_Type.pythonType)));
|
||||
|
||||
// constants
|
||||
PyModule_AddStringConstant(module, (char*)"__author__", (char*)"Team Kodi <http://kodi.tv>");
|
||||
PyModule_AddStringConstant(module, (char*)"__date__", (char*)"Wed Nov 15 19:05:04 GMT 2017");
|
||||
PyModule_AddStringConstant(module, (char*)"__version__", (char*)"2.25.0");
|
||||
PyModule_AddStringConstant(module, (char*)"__credits__", (char*)"Team Kodi");
|
||||
PyModule_AddStringConstant(module, (char*)"__platform__", (char*)"ALL");
|
||||
PyModule_AddStringConstant(module, "__author__", "Team Kodi <http://kodi.tv>");
|
||||
PyModule_AddStringConstant(module, "__date__", "Wed Jan 30 17:54:19 GMT 2019");
|
||||
PyModule_AddStringConstant(module, "__version__", "2.26.0");
|
||||
PyModule_AddStringConstant(module, "__credits__", "Team Kodi");
|
||||
PyModule_AddStringConstant(module, "__platform__", "ALL");
|
||||
|
||||
// need to handle constants
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,39 +0,0 @@
|
|||
From bbc7a53911f1ef8a4a24b76d88c5b0e5899e082f Mon Sep 17 00:00:00 2001
|
||||
From: Michael Cronenworth <mike@cchtml.com>
|
||||
Date: Fri, 16 Mar 2018 13:48:34 -0500
|
||||
Subject: [PATCH] DllLoader: Update variable to use standard va_list type
|
||||
|
||||
The _G_ types were ancient, internal-only types defined in _G_config.h
|
||||
and are now deprecated.
|
||||
|
||||
https://sourceware.org/ml/libc-announce/2018/msg00000.html
|
||||
https://sourceware.org/git/?p=glibc.git;a=commit;h=48a8f8328122ab8d06b7333cb87be46feeaf7cca
|
||||
|
||||
Signed-off-by: Michael Cronenworth <mike@cchtml.com>
|
||||
---
|
||||
xbmc/cores/DllLoader/exports/wrapper.c | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/DllLoader/exports/wrapper.c b/xbmc/cores/DllLoader/exports/wrapper.c
|
||||
index 1980bfe65cac..7c7d4ac6131d 100644
|
||||
--- a/xbmc/cores/DllLoader/exports/wrapper.c
|
||||
+++ b/xbmc/cores/DllLoader/exports/wrapper.c
|
||||
@@ -45,9 +45,6 @@ typedef int64_t off64_t;
|
||||
typedef off64_t __off64_t;
|
||||
typedef fpos_t fpos64_t;
|
||||
#define stat64 stat
|
||||
-#if defined(TARGET_DARWIN) || defined(TARGET_ANDROID)
|
||||
-#define _G_va_list va_list
|
||||
-#endif
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_POSIX
|
||||
@@ -485,7 +482,7 @@ int __wrap___printf_chk(int flag, const char *format, ...)
|
||||
return res;
|
||||
}
|
||||
|
||||
-int __wrap___vfprintf_chk(FILE* stream, int flag, const char *format, _G_va_list ap)
|
||||
+int __wrap___vfprintf_chk(FILE* stream, int flag, const char *format, va_list ap)
|
||||
{
|
||||
return dll_vfprintf(stream, format, ap);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
--- a/project/cmake/modules/FindCrossGUID.cmake.orig 2017-09-04 14:23:17.801957041 +0200
|
||||
+++ b/project/cmake/modules/FindCrossGUID.cmake 2017-09-04 14:23:55.258390977 +0200
|
||||
@@ -44,10 +44,10 @@
|
||||
--- a/cmake/modules/FindCrossGUID.cmake 2019-01-30 18:31:51.519546398 +0100
|
||||
+++ b/cmake/modules/FindCrossGUID.cmake 2019-01-30 18:32:51.197608565 +0100
|
||||
@@ -49,10 +49,10 @@
|
||||
set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY})
|
||||
set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR})
|
||||
else()
|
||||
|
@ -14,18 +14,18 @@
|
|||
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(CROSSGUID)
|
||||
--- a/xbmc/utils/StringUtils.cpp.orig 2017-09-04 14:39:15.802986978 +0200
|
||||
+++ b/xbmc/utils/StringUtils.cpp 2017-09-04 14:41:00.026267037 +0200
|
||||
@@ -28,7 +28,7 @@
|
||||
--- a/xbmc/utils/StringUtils.cpp 2019-01-30 18:35:42.588517593 +0100
|
||||
+++ b/xbmc/utils/StringUtils.cpp 2019-01-30 18:37:38.058555463 +0100
|
||||
@@ -16,7 +16,7 @@
|
||||
//
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
-#include <guid.h>
|
||||
+#include <Guid.hpp>
|
||||
|
||||
#include "StringUtils.h"
|
||||
#include "CharsetConverter.h"
|
||||
@@ -1191,8 +1191,7 @@
|
||||
#if defined(TARGET_ANDROID)
|
||||
#include <androidjni/JNIThreading.h>
|
||||
@@ -1126,8 +1126,7 @@
|
||||
|
||||
std::string StringUtils::CreateUUID()
|
||||
{
|
||||
|
|
|
@ -1,345 +0,0 @@
|
|||
--- xbmc-17.6-Krypton/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.h 2017-11-14 17:55:01.000000000 +0100
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.h 2018-07-02 20:54:54.388785087 +0200
|
||||
@@ -56,7 +56,7 @@
|
||||
SwrContext *m_SwrCtx;
|
||||
CAEChannelInfo m_Layout;
|
||||
AVPacket m_Pkt;
|
||||
- uint8_t m_Buffer[8 + FF_MIN_BUFFER_SIZE];
|
||||
+ uint8_t m_Buffer[8 + AV_INPUT_BUFFER_MIN_SIZE];
|
||||
int m_BufferSize;
|
||||
int m_OutputSize;
|
||||
double m_OutputRatio;
|
||||
--- xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp 2017-11-14 17:55:01.000000000 +0100
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp 2018-07-02 21:13:08.856841550 +0200
|
||||
@@ -82,8 +82,8 @@
|
||||
m_pCodecContext->debug = 0;
|
||||
m_pCodecContext->workaround_bugs = 1;
|
||||
|
||||
- if (pCodec->capabilities & CODEC_CAP_TRUNCATED)
|
||||
- m_pCodecContext->flags |= CODEC_FLAG_TRUNCATED;
|
||||
+ if (pCodec->capabilities & AV_CODEC_CAP_TRUNCATED)
|
||||
+ m_pCodecContext->flags |= AV_CODEC_FLAG_TRUNCATED;
|
||||
|
||||
m_matrixEncoding = AV_MATRIX_ENCODING_NONE;
|
||||
m_channels = 0;
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
if( hints.extradata && hints.extrasize > 0 )
|
||||
{
|
||||
- m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if(m_pCodecContext->extradata)
|
||||
{
|
||||
m_pCodecContext->extradata_size = hints.extrasize;
|
||||
--- xbmc-17.6-Krypton/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEFilter.cpp 2017-11-14 17:55:01.000000000 +0100
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEFilter.cpp 2018-07-02 21:06:40.206821500 +0200
|
||||
@@ -91,7 +91,13 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(7,0,0)
|
||||
+ const
|
||||
+#endif
|
||||
AVFilter* srcFilter = avfilter_get_by_name("abuffer");
|
||||
+#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(7,0,0)
|
||||
+ const
|
||||
+#endif
|
||||
AVFilter* outFilter = avfilter_get_by_name("abuffersink");
|
||||
|
||||
std::string args = StringUtils::Format("time_base=1/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%" PRIx64,
|
||||
@@ -121,6 +127,9 @@
|
||||
|
||||
bool CActiveAEFilter::CreateAtempoFilter()
|
||||
{
|
||||
+#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(7,0,0)
|
||||
+ const
|
||||
+#endif
|
||||
AVFilter *atempo;
|
||||
|
||||
atempo = avfilter_get_by_name("atempo");
|
||||
--- xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp 2017-11-14 17:55:01.000000000 +0100
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp 2018-07-02 21:22:36.309870824 +0200
|
||||
@@ -73,7 +73,7 @@
|
||||
if( hints.extradata && hints.extrasize > 0 )
|
||||
{
|
||||
m_pCodecContext->extradata_size = hints.extrasize;
|
||||
- m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
memcpy(m_pCodecContext->extradata, hints.extradata, hints.extrasize);
|
||||
|
||||
// start parsing of extra data - create a copy to be safe and make it zero-terminating to avoid access violations!
|
||||
--- xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxUtils.cpp 2017-11-14 17:55:01.000000000 +0100
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxUtils.cpp 2018-07-02 21:23:35.419873874 +0200
|
||||
@@ -68,7 +68,7 @@
|
||||
* Note, if the first 23 bits of the additional bytes are not 0 then damaged
|
||||
* MPEG bitstreams could cause overread and segfault
|
||||
*/
|
||||
- pPacket->pData =(uint8_t*)_aligned_malloc(iDataSize + FF_INPUT_BUFFER_PADDING_SIZE, 16);
|
||||
+ pPacket->pData =(uint8_t*)_aligned_malloc(iDataSize + AV_INPUT_BUFFER_PADDING_SIZE, 16);
|
||||
if (!pPacket->pData)
|
||||
{
|
||||
FreeDemuxPacket(pPacket);
|
||||
@@ -76,7 +76,7 @@
|
||||
}
|
||||
|
||||
// reset the last 8 bytes to 0;
|
||||
- memset(pPacket->pData + iDataSize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ memset(pPacket->pData + iDataSize, 0, AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
}
|
||||
|
||||
// setup defaults
|
||||
--- xbmc-17.6-Krypton/xbmc/utils/BitstreamConverter.cpp 2017-11-14 17:55:01.000000000 +0100
|
||||
+++ xbmc-17.6-Krypton/xbmc/utils/BitstreamConverter.cpp 2018-07-02 21:26:49.852883905 +0200
|
||||
@@ -686,13 +686,13 @@
|
||||
unit_size = extradata[0] << 8 | extradata[1];
|
||||
total_size += unit_size + 4;
|
||||
|
||||
- if (total_size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE ||
|
||||
+ if (total_size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE ||
|
||||
(extradata + 2 + unit_size) > ((uint8_t*)in_extradata + in_extrasize))
|
||||
{
|
||||
av_free(out);
|
||||
return false;
|
||||
}
|
||||
- tmp = av_realloc(out, total_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ tmp = av_realloc(out, total_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!tmp)
|
||||
{
|
||||
av_free(out);
|
||||
@@ -713,7 +713,7 @@
|
||||
}
|
||||
|
||||
if (out)
|
||||
- memset(out + total_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ memset(out + total_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
if (!sps_seen)
|
||||
CLog::Log(LOGDEBUG, "SPS NALU missing or invalid. The resulting stream may not play");
|
||||
@@ -776,13 +776,13 @@
|
||||
}
|
||||
total_size += unit_size + 4;
|
||||
|
||||
- if (total_size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE ||
|
||||
+ if (total_size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE ||
|
||||
(extradata + unit_size) > ((uint8_t*)in_extradata + in_extrasize))
|
||||
{
|
||||
av_free(out);
|
||||
return false;
|
||||
}
|
||||
- tmp = av_realloc(out, total_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ tmp = av_realloc(out, total_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!tmp)
|
||||
{
|
||||
av_free(out);
|
||||
@@ -796,7 +796,7 @@
|
||||
}
|
||||
|
||||
if (out)
|
||||
- memset(out + total_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ memset(out + total_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
if (!sps_seen)
|
||||
CLog::Log(LOGDEBUG, "SPS NALU missing or invalid. The resulting stream may not play");
|
||||
--- xbmc-17.6-Krypton/xbmc/guilib/FFmpegImage.cpp 2017-11-14 17:55:01.000000000 +0100
|
||||
+++ xbmc-17.6-Krypton/xbmc/guilib/FFmpegImage.cpp 2018-07-02 21:29:40.403892703 +0200
|
||||
@@ -551,7 +551,7 @@
|
||||
tdm.avOutctx->time_base.num = 1;
|
||||
tdm.avOutctx->time_base.den = 1;
|
||||
tdm.avOutctx->pix_fmt = jpg_output ? AV_PIX_FMT_YUVJ420P : AV_PIX_FMT_RGBA;
|
||||
- tdm.avOutctx->flags = CODEC_FLAG_QSCALE;
|
||||
+ tdm.avOutctx->flags = AV_CODEC_FLAG_QSCALE;
|
||||
tdm.avOutctx->mb_lmin = tdm.avOutctx->qmin * FF_QP2LAMBDA;
|
||||
tdm.avOutctx->mb_lmax = tdm.avOutctx->qmax * FF_QP2LAMBDA;
|
||||
tdm.avOutctx->global_quality = tdm.avOutctx->qmin * FF_QP2LAMBDA;
|
||||
--- xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp 2017-11-14 17:55:01.000000000 +0100
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp 2018-07-02 21:32:30.151901460 +0200
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "settings/Settings.h"
|
||||
#include "../DVDClock.h"
|
||||
|
||||
-#define FF_MAX_EXTRADATA_SIZE ((1 << 28) - FF_INPUT_BUFFER_PADDING_SIZE)
|
||||
+#define AV_MAX_EXTRADATA_SIZE ((1 << 28) - AV_INPUT_BUFFER_PADDING_SIZE)
|
||||
|
||||
|
||||
class CDemuxStreamClientInternal
|
||||
@@ -172,16 +172,16 @@
|
||||
if (stream->m_parser_split && stream->m_parser->parser->split)
|
||||
{
|
||||
int len = stream->m_parser->parser->split(stream->m_context, pkt->pData, pkt->iSize);
|
||||
- if (len > 0 && len < FF_MAX_EXTRADATA_SIZE)
|
||||
+ if (len > 0 && len < AV_MAX_EXTRADATA_SIZE)
|
||||
{
|
||||
if (st->ExtraData)
|
||||
delete[] (uint8_t*)st->ExtraData;
|
||||
st->changes++;
|
||||
st->disabled = false;
|
||||
st->ExtraSize = len;
|
||||
- st->ExtraData = new uint8_t[len+FF_INPUT_BUFFER_PADDING_SIZE];
|
||||
+ st->ExtraData = new uint8_t[len+AV_INPUT_BUFFER_PADDING_SIZE];
|
||||
memcpy(st->ExtraData, pkt->pData, len);
|
||||
- memset((uint8_t*)st->ExtraData + len, 0 , FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ memset((uint8_t*)st->ExtraData + len, 0 , AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
stream->m_parser_split = false;
|
||||
}
|
||||
}
|
||||
--- xbmc-17.6-Krypton/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp 2017-11-14 17:55:01.000000000 +0100
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp 2018-07-02 21:39:23.350922777 +0200
|
||||
@@ -86,8 +86,8 @@
|
||||
m_pCodecContext->debug = 0;
|
||||
m_pCodecContext->workaround_bugs = 1;
|
||||
|
||||
- if (pCodec->capabilities & CODEC_CAP_TRUNCATED)
|
||||
- m_pCodecContext->flags |= CODEC_FLAG_TRUNCATED;
|
||||
+ if (pCodec->capabilities & AV_CODEC_CAP_TRUNCATED)
|
||||
+ m_pCodecContext->flags |= AV_CODEC_FLAG_TRUNCATED;
|
||||
|
||||
m_channels = 0;
|
||||
m_pCodecContext->channels = hints.channels;
|
||||
@@ -110,7 +110,7 @@
|
||||
|
||||
if( hints.extradata && hints.extrasize > 0 )
|
||||
{
|
||||
- m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if(m_pCodecContext->extradata)
|
||||
{
|
||||
m_pCodecContext->extradata_size = hints.extrasize;
|
||||
@@ -222,7 +222,7 @@
|
||||
|
||||
if (m_iBufferOutputAlloced < m_iBufferOutputUsed + outputSize)
|
||||
{
|
||||
- m_pBufferOutput = (BYTE*)av_realloc(m_pBufferOutput, m_iBufferOutputUsed + outputSize + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ m_pBufferOutput = (BYTE*)av_realloc(m_pBufferOutput, m_iBufferOutputUsed + outputSize + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
m_iBufferOutputAlloced = m_iBufferOutputUsed + outputSize;
|
||||
}
|
||||
|
||||
|
||||
--- xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp.orig 2018-07-03 03:58:00.987120857 +0200
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp 2018-07-03 04:00:22.013863754 +0200
|
||||
@@ -382,16 +382,6 @@
|
||||
else
|
||||
m_decoderState = STATE_SW_SINGLE;
|
||||
|
||||
-#if defined(TARGET_DARWIN_IOS)
|
||||
- // ffmpeg with enabled neon will crash and burn if this is enabled
|
||||
- m_pCodecContext->flags &= CODEC_FLAG_EMU_EDGE;
|
||||
-#else
|
||||
- if (pCodec->id != AV_CODEC_ID_H264 && pCodec->capabilities & CODEC_CAP_DR1
|
||||
- && pCodec->id != AV_CODEC_ID_VP8
|
||||
- )
|
||||
- m_pCodecContext->flags |= CODEC_FLAG_EMU_EDGE;
|
||||
-#endif
|
||||
-
|
||||
// if we don't do this, then some codecs seem to fail.
|
||||
m_pCodecContext->coded_height = hints.height;
|
||||
m_pCodecContext->coded_width = hints.width;
|
||||
@@ -882,23 +872,7 @@
|
||||
else
|
||||
pDvdVideoPicture->color_range = 0;
|
||||
|
||||
- int qscale_type;
|
||||
- pDvdVideoPicture->qp_table = av_frame_get_qp_table(m_pFrame, &pDvdVideoPicture->qstride, &qscale_type);
|
||||
-
|
||||
- switch (qscale_type)
|
||||
- {
|
||||
- case FF_QSCALE_TYPE_MPEG1:
|
||||
- pDvdVideoPicture->qscale_type = DVP_QSCALE_MPEG1;
|
||||
- break;
|
||||
- case FF_QSCALE_TYPE_MPEG2:
|
||||
- pDvdVideoPicture->qscale_type = DVP_QSCALE_MPEG2;
|
||||
- break;
|
||||
- case FF_QSCALE_TYPE_H264:
|
||||
- pDvdVideoPicture->qscale_type = DVP_QSCALE_H264;
|
||||
- break;
|
||||
- default:
|
||||
- pDvdVideoPicture->qscale_type = DVP_QSCALE_UNKNOWN;
|
||||
- }
|
||||
+ pDvdVideoPicture->qp_table = av_frame_get_qp_table(m_pFrame, &pDvdVideoPicture->qstride, &pDvdVideoPicture->qscale_type);
|
||||
|
||||
if (pDvdVideoPicture->iRepeatPicture)
|
||||
pDvdVideoPicture->dts = DVD_NOPTS_VALUE;
|
||||
@@ -989,7 +963,13 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
+#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(7,0,0)
|
||||
+ const
|
||||
+#endif
|
||||
AVFilter* srcFilter = avfilter_get_by_name("buffer");
|
||||
+#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(7,0,0)
|
||||
+ const
|
||||
+#endif
|
||||
AVFilter* outFilter = avfilter_get_by_name("buffersink"); // should be last filter in the graph for now
|
||||
|
||||
std::string args = StringUtils::Format("%d:%d:%d:%d:%d:%d:%d",
|
||||
|
||||
--- xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp.orig 2018-07-03 04:09:57.457702946 +0200
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp 2018-07-03 04:10:31.769395588 +0200
|
||||
@@ -390,7 +390,7 @@
|
||||
if( hints.extradata && hints.extrasize > 0 )
|
||||
{
|
||||
m_pCodecContext->extradata_size = hints.extrasize;
|
||||
- m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ m_pCodecContext->extradata = (uint8_t*)av_mallocz(hints.extrasize + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
memcpy(m_pCodecContext->extradata, hints.extradata, hints.extrasize);
|
||||
}
|
||||
|
||||
--- xbmc-17.6-Krypton/xbmc/cdrip/EncoderFFmpeg.cpp.orig 2018-07-03 04:15:20.761822331 +0200
|
||||
+++ xbmc-17.6-Krypton/xbmc/cdrip/EncoderFFmpeg.cpp 2018-07-03 04:16:14.960339734 +0200
|
||||
@@ -119,8 +119,8 @@
|
||||
|
||||
if(m_Format->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
{
|
||||
- m_CodecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
- m_Format->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
+ m_CodecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
||||
+ m_Format->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
||||
}
|
||||
|
||||
switch(m_iInBitsPerSample)
|
||||
|
||||
--- xbmc-17.6-Krypton/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp.orig 2018-07-03 04:22:26.222041472 +0200
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp 2018-07-03 04:22:44.318880987 +0200
|
||||
@@ -2955,7 +2955,7 @@
|
||||
int fileSize = sound->GetFileSize();
|
||||
|
||||
fmt_ctx = avformat_alloc_context();
|
||||
- unsigned char* buffer = (unsigned char*)av_malloc(SOUNDBUFFER_SIZE+FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ unsigned char* buffer = (unsigned char*)av_malloc(SOUNDBUFFER_SIZE+AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
io_ctx = avio_alloc_context(buffer, SOUNDBUFFER_SIZE, 0,
|
||||
sound, CActiveAESound::Read, NULL, CActiveAESound::Seek);
|
||||
io_ctx->max_packet_size = sound->GetChunkSize();
|
||||
|
||||
--- xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp.orig 2018-07-03 04:29:28.402298801 +0200
|
||||
+++ xbmc-17.6-Krypton/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp 2018-07-03 04:30:42.334643983 +0200
|
||||
@@ -78,7 +78,7 @@
|
||||
{}
|
||||
};
|
||||
|
||||
-#define FF_MAX_EXTRADATA_SIZE ((1 << 28) - FF_INPUT_BUFFER_PADDING_SIZE)
|
||||
+#define AV_MAX_EXTRADATA_SIZE ((1 << 28) - AV_INPUT_BUFFER_PADDING_SIZE)
|
||||
|
||||
std::string CDemuxStreamAudioFFmpeg::GetStreamName()
|
||||
{
|
||||
@@ -1876,17 +1876,17 @@
|
||||
if(st->parser && st->parser->parser->split && !st->codec->extradata)
|
||||
{
|
||||
int i = st->parser->parser->split(st->codec, pkt->data, pkt->size);
|
||||
- if (i > 0 && i < FF_MAX_EXTRADATA_SIZE)
|
||||
+ if (i > 0 && i < AV_MAX_EXTRADATA_SIZE)
|
||||
{
|
||||
// Found extradata, fill it in. This will cause
|
||||
// a new stream to be created and used.
|
||||
st->codec->extradata_size = i;
|
||||
- st->codec->extradata = (uint8_t*)av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ st->codec->extradata = (uint8_t*)av_malloc(st->codec->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (st->codec->extradata)
|
||||
{
|
||||
CLog::Log(LOGDEBUG, "CDVDDemuxFFmpeg::Read() fetching extradata, extradata_size(%d)", st->codec->extradata_size);
|
||||
memcpy(st->codec->extradata, pkt->data, st->codec->extradata_size);
|
||||
- memset(st->codec->extradata + i, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ memset(st->codec->extradata + i, 0, AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1,106 +1,6 @@
|
|||
diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
|
||||
index ab14942..cf9d73d 100644
|
||||
--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
|
||||
+++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
|
||||
@@ -51,6 +51,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
+#include <paths.h>
|
||||
#ifdef TARGET_POSIX
|
||||
#include "PlatformDefs.h" // for __stat64
|
||||
#include "XFileUtils.h"
|
||||
@@ -476,13 +477,10 @@ extern "C"
|
||||
EmuFileObject* o = g_emuFileWrapper.GetFileObjectByDescriptor(fd);
|
||||
if (o)
|
||||
{
|
||||
- if(!o->used)
|
||||
- return NULL;
|
||||
-
|
||||
int nmode = convert_fmode(mode);
|
||||
if( (o->mode & nmode) != nmode)
|
||||
CLog::Log(LOGWARNING, "dll_fdopen - mode 0x%x differs from fd mode 0x%x", nmode, o->mode);
|
||||
- return &o->file_emu;
|
||||
+ return g_emuFileWrapper.GetStreamByFileObject(o);
|
||||
}
|
||||
else if (!IS_STD_DESCRIPTOR(fd))
|
||||
{
|
||||
@@ -545,7 +543,7 @@ extern "C"
|
||||
return -1;
|
||||
}
|
||||
object->mode = iMode;
|
||||
- return g_emuFileWrapper.GetDescriptorByStream(&object->file_emu);
|
||||
+ return g_emuFileWrapper.GetDescriptorByFileObject(object);
|
||||
}
|
||||
delete pFile;
|
||||
return -1;
|
||||
@@ -1214,8 +1212,8 @@ extern "C"
|
||||
{
|
||||
FILE* file = NULL;
|
||||
#if defined(TARGET_LINUX) && !defined(TARGET_ANDROID)
|
||||
- if (strcmp(filename, MOUNTED) == 0
|
||||
- || strcmp(filename, MNTTAB) == 0)
|
||||
+ if (strcmp(filename, _PATH_MOUNTED) == 0
|
||||
+ || strcmp(filename, _PATH_MNTTAB) == 0)
|
||||
{
|
||||
CLog::Log(LOGINFO, "%s - something opened the mount file, let's hope it knows what it's doing", __FUNCTION__);
|
||||
return fopen(filename, mode);
|
||||
@@ -1622,7 +1620,7 @@ extern "C"
|
||||
int ret;
|
||||
|
||||
ret = dll_fgetpos64(stream, &tmpPos);
|
||||
-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
+#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
*pos = (fpos_t)tmpPos;
|
||||
#else
|
||||
pos->__pos = (off_t)tmpPos.__pos;
|
||||
@@ -1635,8 +1633,9 @@ extern "C"
|
||||
CFile* pFile = g_emuFileWrapper.GetFileXbmcByStream(stream);
|
||||
if (pFile != NULL)
|
||||
{
|
||||
-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
- *pos = pFile->GetPosition();
|
||||
+#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
+ uint64_t *ppos = (uint64_t *) pos;
|
||||
+ *ppos = pFile->GetPosition();
|
||||
#else
|
||||
pos->__pos = pFile->GetPosition();
|
||||
#endif
|
||||
@@ -1657,8 +1656,9 @@ extern "C"
|
||||
int fd = g_emuFileWrapper.GetDescriptorByStream(stream);
|
||||
if (fd >= 0)
|
||||
{
|
||||
-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
- if (dll_lseeki64(fd, *pos, SEEK_SET) >= 0)
|
||||
+#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
+ const uint64_t *ppos = (const uint64_t *) pos;
|
||||
+ if (dll_lseeki64(fd, *ppos, SEEK_SET) >= 0)
|
||||
#else
|
||||
if (dll_lseeki64(fd, (__off64_t)pos->__pos, SEEK_SET) >= 0)
|
||||
#endif
|
||||
@@ -1674,7 +1674,7 @@ extern "C"
|
||||
{
|
||||
// it might be something else than a file, or the file is not emulated
|
||||
// let the operating system handle it
|
||||
-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
+#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
return fsetpos(stream, pos);
|
||||
#else
|
||||
return fsetpos64(stream, pos);
|
||||
@@ -1690,7 +1690,7 @@ extern "C"
|
||||
if (fd >= 0)
|
||||
{
|
||||
fpos64_t tmpPos;
|
||||
-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
+#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
tmpPos= *pos;
|
||||
#else
|
||||
tmpPos.__pos = (off64_t)(pos->__pos);
|
||||
diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.h b/xbmc/cores/DllLoader/exports/emu_msvcrt.h
|
||||
index 3294d9a..3ce8b24 100644
|
||||
--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.h
|
||||
+++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.h
|
||||
@@ -24,7 +24,7 @@
|
||||
--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.h 2019-01-30 19:20:09.336910851 +0100
|
||||
+++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.h 2019-01-30 19:20:25.423668836 +0100
|
||||
@@ -12,7 +12,7 @@
|
||||
#define _onexit_t void*
|
||||
#endif
|
||||
|
||||
|
@ -109,354 +9,9 @@ index 3294d9a..3ce8b24 100644
|
|||
typedef off_t __off_t;
|
||||
typedef int64_t off64_t;
|
||||
typedef off64_t __off64_t;
|
||||
diff --git a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp
|
||||
index 8927d41..0e78707 100644
|
||||
--- a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp
|
||||
+++ b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp
|
||||
@@ -53,15 +53,7 @@ constexpr bool isValidFilePtr(FILE* f)
|
||||
CEmuFileWrapper::CEmuFileWrapper()
|
||||
{
|
||||
// since we always use dlls we might just initialize it directly
|
||||
- for (int i = 0; i < MAX_EMULATED_FILES; i++)
|
||||
- {
|
||||
- memset(&m_files[i], 0, sizeof(EmuFileObject));
|
||||
- m_files[i].used = false;
|
||||
-#if defined(TARGET_WINDOWS) && (_MSC_VER >= 1900)
|
||||
- m_files[i].file_emu._Placeholder = new kodi_iobuf();
|
||||
-#endif
|
||||
- FileDescriptor(m_files[i].file_emu)->_file = -1;
|
||||
- }
|
||||
+ memset(m_files, 0, sizeof(m_files));
|
||||
}
|
||||
|
||||
CEmuFileWrapper::~CEmuFileWrapper()
|
||||
@@ -73,29 +65,7 @@ void CEmuFileWrapper::CleanUp()
|
||||
{
|
||||
CSingleLock lock(m_criticalSection);
|
||||
for (int i = 0; i < MAX_EMULATED_FILES; i++)
|
||||
- {
|
||||
- if (m_files[i].used)
|
||||
- {
|
||||
- m_files[i].file_xbmc->Close();
|
||||
- delete m_files[i].file_xbmc;
|
||||
-
|
||||
- if (m_files[i].file_lock)
|
||||
- {
|
||||
- delete m_files[i].file_lock;
|
||||
- m_files[i].file_lock = nullptr;
|
||||
- }
|
||||
-#if !defined(TARGET_WINDOWS)
|
||||
- //Don't memset on Windows as it overwrites our pointer
|
||||
- memset(&m_files[i], 0, sizeof(EmuFileObject));
|
||||
-#endif
|
||||
- m_files[i].used = false;
|
||||
- FileDescriptor(m_files[i].file_emu)->_file = -1;
|
||||
- }
|
||||
-#if defined(TARGET_WINDOWS) && (_MSC_VER >= 1900)
|
||||
- delete static_cast<kodi_iobuf*>(m_files[i].file_emu._Placeholder);
|
||||
- m_files[i].file_emu._Placeholder = nullptr;
|
||||
-#endif
|
||||
- }
|
||||
+ UnRegisterFileObject(&m_files[i], true);
|
||||
}
|
||||
|
||||
EmuFileObject* CEmuFileWrapper::RegisterFileObject(XFILE::CFile* pFile)
|
||||
@@ -106,13 +76,11 @@ EmuFileObject* CEmuFileWrapper::RegisterFileObject(XFILE::CFile* pFile)
|
||||
|
||||
for (int i = 0; i < MAX_EMULATED_FILES; i++)
|
||||
{
|
||||
- if (!m_files[i].used)
|
||||
+ if (!m_files[i].file_xbmc)
|
||||
{
|
||||
// found a free location
|
||||
object = &m_files[i];
|
||||
- object->used = true;
|
||||
object->file_xbmc = pFile;
|
||||
- FileDescriptor(object->file_emu)->_file = (i + FILE_WRAPPER_OFFSET);
|
||||
object->file_lock = new CCriticalSection();
|
||||
break;
|
||||
}
|
||||
@@ -121,82 +89,70 @@ EmuFileObject* CEmuFileWrapper::RegisterFileObject(XFILE::CFile* pFile)
|
||||
return object;
|
||||
}
|
||||
|
||||
-void CEmuFileWrapper::UnRegisterFileObjectByDescriptor(int fd)
|
||||
+void CEmuFileWrapper::UnRegisterFileObject(EmuFileObject *object, bool free_file)
|
||||
{
|
||||
- int i = fd - FILE_WRAPPER_OFFSET;
|
||||
- if (! (i >= 0 && i < MAX_EMULATED_FILES))
|
||||
+ if (! (object && object->file_xbmc))
|
||||
return;
|
||||
|
||||
- if (!m_files[i].used)
|
||||
- return;
|
||||
-
|
||||
- CSingleLock lock(m_criticalSection);
|
||||
-
|
||||
- // we assume the emulated function alreay deleted the CFile object
|
||||
- if (m_files[i].file_lock)
|
||||
+ if (object->file_xbmc && free_file)
|
||||
{
|
||||
- delete m_files[i].file_lock;
|
||||
- m_files[i].file_lock = nullptr;
|
||||
+ CSingleLock lock(m_criticalSection);
|
||||
+
|
||||
+ object->file_xbmc->Close();
|
||||
+ delete object->file_xbmc;
|
||||
}
|
||||
-#if !defined(TARGET_WINDOWS)
|
||||
- //Don't memset on Windows as it overwrites our pointer
|
||||
- memset(&m_files[i], 0, sizeof(EmuFileObject));
|
||||
-#endif
|
||||
- m_files[i].used = false;
|
||||
- FileDescriptor(m_files[i].file_emu)->_file = -1;
|
||||
+ if (object->file_lock)
|
||||
+ delete object->file_lock;
|
||||
+
|
||||
+ memset(object, 0, sizeof(*object));
|
||||
+}
|
||||
+
|
||||
+void CEmuFileWrapper::UnRegisterFileObjectByDescriptor(int fd)
|
||||
+{
|
||||
+ CSingleLock lock(m_criticalSection);
|
||||
+ UnRegisterFileObject(GetFileObjectByDescriptor(fd), false);
|
||||
}
|
||||
|
||||
void CEmuFileWrapper::UnRegisterFileObjectByStream(FILE* stream)
|
||||
{
|
||||
- if (isValidFilePtr(stream))
|
||||
- {
|
||||
- return UnRegisterFileObjectByDescriptor(FileDescriptor(*stream)->_file);
|
||||
- }
|
||||
+ CSingleLock lock(m_criticalSection);
|
||||
+ UnRegisterFileObject(GetFileObjectByStream(stream), false);
|
||||
}
|
||||
|
||||
void CEmuFileWrapper::LockFileObjectByDescriptor(int fd)
|
||||
{
|
||||
- int i = fd - FILE_WRAPPER_OFFSET;
|
||||
- if (i >= 0 && i < MAX_EMULATED_FILES)
|
||||
+ EmuFileObject* object = GetFileObjectByDescriptor(fd);
|
||||
+ if (object && object->file_xbmc)
|
||||
{
|
||||
- if (m_files[i].used)
|
||||
- {
|
||||
- m_files[i].file_lock->lock();
|
||||
- }
|
||||
+ object->file_lock->lock();
|
||||
}
|
||||
}
|
||||
|
||||
bool CEmuFileWrapper::TryLockFileObjectByDescriptor(int fd)
|
||||
{
|
||||
- int i = fd - FILE_WRAPPER_OFFSET;
|
||||
- if (i >= 0 && i < MAX_EMULATED_FILES)
|
||||
+ EmuFileObject* object = GetFileObjectByDescriptor(fd);
|
||||
+ if (object && object->file_xbmc)
|
||||
{
|
||||
- if (m_files[i].used)
|
||||
- {
|
||||
- return m_files[i].file_lock->try_lock();
|
||||
- }
|
||||
+ return object->file_lock->try_lock();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CEmuFileWrapper::UnlockFileObjectByDescriptor(int fd)
|
||||
{
|
||||
- int i = fd - FILE_WRAPPER_OFFSET;
|
||||
- if (i >= 0 && i < MAX_EMULATED_FILES)
|
||||
+ EmuFileObject* object = GetFileObjectByDescriptor(fd);
|
||||
+ if (object && object->file_xbmc)
|
||||
{
|
||||
- if (m_files[i].used)
|
||||
- {
|
||||
- m_files[i].file_lock->unlock();
|
||||
- }
|
||||
+ object->file_lock->unlock();
|
||||
}
|
||||
}
|
||||
|
||||
EmuFileObject* CEmuFileWrapper::GetFileObjectByDescriptor(int fd)
|
||||
{
|
||||
- int i = fd - FILE_WRAPPER_OFFSET;
|
||||
+ int i = fd - 0x7000000;
|
||||
if (i >= 0 && i < MAX_EMULATED_FILES)
|
||||
{
|
||||
- if (m_files[i].used)
|
||||
+ if (m_files[i].file_xbmc)
|
||||
{
|
||||
return &m_files[i];
|
||||
}
|
||||
@@ -204,20 +160,38 @@ EmuFileObject* CEmuFileWrapper::GetFileObjectByDescriptor(int fd)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
-EmuFileObject* CEmuFileWrapper::GetFileObjectByStream(FILE* stream)
|
||||
+int CEmuFileWrapper::GetDescriptorByFileObject(EmuFileObject *object)
|
||||
{
|
||||
- if (isValidFilePtr(stream))
|
||||
+ int i = object - m_files;
|
||||
+ if (i >= 0 && i < MAX_EMULATED_FILES)
|
||||
{
|
||||
- return GetFileObjectByDescriptor(FileDescriptor(*stream)->_file);
|
||||
+ return 0x7000000 + i;
|
||||
}
|
||||
+ return -1;
|
||||
+}
|
||||
|
||||
+EmuFileObject* CEmuFileWrapper::GetFileObjectByStream(FILE* stream)
|
||||
+{
|
||||
+ EmuFileObject *object = (EmuFileObject*) stream;
|
||||
+ if (object >= &m_files[0] || object < &m_files[MAX_EMULATED_FILES])
|
||||
+ {
|
||||
+ if (object->file_xbmc)
|
||||
+ {
|
||||
+ return object;
|
||||
+ }
|
||||
+ }
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
+FILE* CEmuFileWrapper::GetStreamByFileObject(EmuFileObject *object)
|
||||
+{
|
||||
+ return (FILE*) object;
|
||||
+}
|
||||
+
|
||||
XFILE::CFile* CEmuFileWrapper::GetFileXbmcByDescriptor(int fd)
|
||||
{
|
||||
auto object = GetFileObjectByDescriptor(fd);
|
||||
- if (object != nullptr && object->used)
|
||||
+ if (object != nullptr)
|
||||
{
|
||||
return object->file_xbmc;
|
||||
}
|
||||
@@ -228,8 +202,8 @@ XFILE::CFile* CEmuFileWrapper::GetFileXbmcByStream(FILE* stream)
|
||||
{
|
||||
if (isValidFilePtr(stream))
|
||||
{
|
||||
- auto object = GetFileObjectByDescriptor(FileDescriptor(*stream)->_file);
|
||||
- if (object != nullptr && object->used)
|
||||
+ auto object = GetFileObjectByStream(stream);
|
||||
+ if (object != nullptr)
|
||||
{
|
||||
return object->file_xbmc;
|
||||
}
|
||||
@@ -239,32 +213,25 @@ XFILE::CFile* CEmuFileWrapper::GetFileXbmcByStream(FILE* stream)
|
||||
|
||||
int CEmuFileWrapper::GetDescriptorByStream(FILE* stream)
|
||||
{
|
||||
- if (isValidFilePtr(stream))
|
||||
- {
|
||||
- int i = FileDescriptor(*stream)->_file - FILE_WRAPPER_OFFSET;
|
||||
- if (i >= 0 && i < MAX_EMULATED_FILES)
|
||||
- {
|
||||
- return i + FILE_WRAPPER_OFFSET;
|
||||
- }
|
||||
- }
|
||||
- return -1;
|
||||
+ return GetDescriptorByFileObject(GetFileObjectByStream(stream));
|
||||
}
|
||||
|
||||
FILE* CEmuFileWrapper::GetStreamByDescriptor(int fd)
|
||||
{
|
||||
- auto object = GetFileObjectByDescriptor(fd);
|
||||
- if (object != nullptr && object->used)
|
||||
- {
|
||||
- return &object->file_emu;
|
||||
- }
|
||||
- return nullptr;
|
||||
+ return GetStreamByFileObject(GetFileObjectByDescriptor(fd));
|
||||
}
|
||||
|
||||
bool CEmuFileWrapper::StreamIsEmulatedFile(FILE* stream)
|
||||
{
|
||||
if (isValidFilePtr(stream))
|
||||
{
|
||||
- return DescriptorIsEmulatedFile(FileDescriptor(*stream)->_file);
|
||||
+ return DescriptorIsEmulatedFile(GetDescriptorByStream(stream));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+bool CEmuFileWrapper::DescriptorIsEmulatedFile(int fd)
|
||||
+{
|
||||
+ return GetFileObjectByDescriptor(fd) != NULL;
|
||||
+}
|
||||
+
|
||||
diff --git a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
|
||||
index 786fa85..311a5cf 100644
|
||||
--- a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
|
||||
+++ b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
|
||||
@@ -25,14 +25,14 @@
|
||||
#include "system.h"
|
||||
#include "threads/CriticalSection.h"
|
||||
|
||||
-#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN) && !defined(TARGET_FREEBSD) && !defined(TARGET_ANDROID) && !defined(__UCLIBC__)
|
||||
-#define _file _fileno
|
||||
-#elif defined(__UCLIBC__)
|
||||
-#define _file __filedes
|
||||
-#endif
|
||||
+//#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN) && !defined(TARGET_FREEBSD) && !defined(TARGET_ANDROID) && !defined(__UCLIBC__)
|
||||
+//#define _file _fileno
|
||||
+//#elif defined(__UCLIBC__)
|
||||
+//#define _file __filedes
|
||||
+//#endif
|
||||
|
||||
#define MAX_EMULATED_FILES 50
|
||||
-#define FILE_WRAPPER_OFFSET 0x00000200
|
||||
+//#define FILE_WRAPPER_OFFSET 0x00000200
|
||||
|
||||
namespace XFILE
|
||||
{
|
||||
@@ -47,12 +47,9 @@ struct kodi_iobuf {
|
||||
|
||||
typedef struct stEmuFileObject
|
||||
{
|
||||
- FILE file_emu;
|
||||
XFILE::CFile* file_xbmc;
|
||||
CCriticalSection *file_lock;
|
||||
int mode;
|
||||
- //Stick this last to avoid 3-7 bytes of padding
|
||||
- bool used;
|
||||
} EmuFileObject;
|
||||
|
||||
class CEmuFileWrapper
|
||||
@@ -67,22 +64,22 @@ public:
|
||||
void CleanUp();
|
||||
|
||||
EmuFileObject* RegisterFileObject(XFILE::CFile* pFile);
|
||||
+ void UnRegisterFileObject(EmuFileObject*, bool free_file);
|
||||
void UnRegisterFileObjectByDescriptor(int fd);
|
||||
void UnRegisterFileObjectByStream(FILE* stream);
|
||||
void LockFileObjectByDescriptor(int fd);
|
||||
bool TryLockFileObjectByDescriptor(int fd);
|
||||
void UnlockFileObjectByDescriptor(int fd);
|
||||
EmuFileObject* GetFileObjectByDescriptor(int fd);
|
||||
+ int GetDescriptorByFileObject(EmuFileObject*);
|
||||
EmuFileObject* GetFileObjectByStream(FILE* stream);
|
||||
+ FILE* GetStreamByFileObject(EmuFileObject*);
|
||||
XFILE::CFile* GetFileXbmcByDescriptor(int fd);
|
||||
XFILE::CFile* GetFileXbmcByStream(FILE* stream);
|
||||
- static int GetDescriptorByStream(FILE* stream);
|
||||
+ int GetDescriptorByStream(FILE* stream);
|
||||
FILE* GetStreamByDescriptor(int fd);
|
||||
- static constexpr bool DescriptorIsEmulatedFile(int fd)
|
||||
- {
|
||||
- return fd >= FILE_WRAPPER_OFFSET && fd < FILE_WRAPPER_OFFSET + MAX_EMULATED_FILES;
|
||||
- }
|
||||
- static bool StreamIsEmulatedFile(FILE* stream);
|
||||
+ bool DescriptorIsEmulatedFile(int fd);
|
||||
+ bool StreamIsEmulatedFile(FILE* stream);
|
||||
private:
|
||||
EmuFileObject m_files[MAX_EMULATED_FILES];
|
||||
CCriticalSection m_criticalSection;
|
||||
diff --git a/xbmc/cores/DllLoader/exports/wrapper.c b/xbmc/cores/DllLoader/exports/wrapper.c
|
||||
index e363662..4498c27 100644
|
||||
--- a/xbmc/cores/DllLoader/exports/wrapper.c
|
||||
+++ b/xbmc/cores/DllLoader/exports/wrapper.c
|
||||
@@ -39,7 +39,7 @@
|
||||
--- a/xbmc/cores/DllLoader/exports/wrapper.c 2019-01-30 19:24:16.396348561 +0100
|
||||
+++ b/xbmc/cores/DllLoader/exports/wrapper.c 2019-01-30 19:25:38.562176774 +0100
|
||||
@@ -27,7 +27,7 @@
|
||||
#endif
|
||||
#include <dlfcn.h>
|
||||
|
||||
|
@ -465,3 +20,55 @@ index e363662..4498c27 100644
|
|||
typedef off_t __off_t;
|
||||
typedef int64_t off64_t;
|
||||
typedef off64_t __off64_t;
|
||||
--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp 2019-01-30 19:29:02.249253971 +0100
|
||||
+++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp 2019-01-30 19:39:34.911053272 +0100
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
+#include <paths.h>
|
||||
#ifdef TARGET_POSIX
|
||||
#include "PlatformDefs.h" // for __stat64
|
||||
#include "XFileUtils.h"
|
||||
@@ -1480,7 +1481,7 @@
|
||||
int ret;
|
||||
|
||||
ret = dll_fgetpos64(stream, &tmpPos);
|
||||
-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
+#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
|
||||
*pos = (fpos_t)tmpPos;
|
||||
#else
|
||||
pos->__pos = (off_t)tmpPos.__pos;
|
||||
@@ -1493,8 +1494,9 @@
|
||||
CFile* pFile = g_emuFileWrapper.GetFileXbmcByStream(stream);
|
||||
if (pFile != NULL)
|
||||
{
|
||||
-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
- *pos = pFile->GetPosition();
|
||||
+#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
|
||||
+ uint64_t *ppos = (uint64_t *) pos;
|
||||
+ *ppos = pFile->GetPosition();
|
||||
#else
|
||||
pos->__pos = pFile->GetPosition();
|
||||
#endif
|
||||
@@ -1509,8 +1511,9 @@
|
||||
int fd = g_emuFileWrapper.GetDescriptorByStream(stream);
|
||||
if (fd >= 0)
|
||||
{
|
||||
-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
- if (dll_lseeki64(fd, *pos, SEEK_SET) >= 0)
|
||||
+#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
|
||||
+ const uint64_t *ppos = (const uint64_t *) pos;
|
||||
+ if (dll_lseeki64(fd, *ppos, SEEK_SET) >= 0)
|
||||
#else
|
||||
if (dll_lseeki64(fd, (__off64_t)pos->__pos, SEEK_SET) >= 0)
|
||||
#endif
|
||||
@@ -1532,7 +1535,7 @@
|
||||
if (fd >= 0)
|
||||
{
|
||||
fpos64_t tmpPos;
|
||||
-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
|
||||
+#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
|
||||
tmpPos= *pos;
|
||||
#else
|
||||
tmpPos.__pos = (off64_t)(pos->__pos);
|
||||
|
|
|
@ -1,122 +1,9 @@
|
|||
diff --git a/configure.ac b/configure.ac
|
||||
index 9bd8d6e..205acfc 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -526,7 +526,7 @@ case $host in
|
||||
use_x11=no
|
||||
build_shared_lib=yes
|
||||
;;
|
||||
- i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
|
||||
+ i*86*-linux-*)
|
||||
target_platform=target_linux
|
||||
CORE_SYSTEM_NAME=linux
|
||||
ARCH="i486-linux"
|
||||
@@ -549,7 +549,7 @@ case $host in
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
- x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
|
||||
+ x86_64-*-linux-*)
|
||||
target_platform=target_linux
|
||||
CORE_SYSTEM_NAME=linux
|
||||
ARCH="x86_64-linux"
|
||||
diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4
|
||||
index d28f263..6fb6210 100644
|
||||
--- a/m4/xbmc_arch.m4
|
||||
+++ b/m4/xbmc_arch.m4
|
||||
@@ -2,10 +2,10 @@ AC_DEFUN([XBMC_SETUP_ARCH_DEFINES],[
|
||||
|
||||
# build detection and setup - this is the native arch
|
||||
case $build in
|
||||
- i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
|
||||
+ i*86*-linux-*)
|
||||
AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
|
||||
;;
|
||||
- x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
|
||||
+ x86_64-*-linux-*)
|
||||
AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
|
||||
;;
|
||||
i386-*-freebsd*)
|
||||
@@ -17,13 +17,13 @@ case $build in
|
||||
*86*-apple-darwin*)
|
||||
AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
|
||||
;;
|
||||
- powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*)
|
||||
+ powerpc-*-linux-*)
|
||||
AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC")
|
||||
;;
|
||||
- powerpc64-*-linux-gnu*|powerpc64-*-linux-uclibc*)
|
||||
+ powerpc64-*-linux-*)
|
||||
AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64")
|
||||
;;
|
||||
- arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
|
||||
+ arm*-*-linux-*)
|
||||
AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
|
||||
;;
|
||||
*)
|
||||
@@ -33,10 +33,10 @@ esac
|
||||
|
||||
# host detection and setup - this is the target arch
|
||||
case $host in
|
||||
- i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
|
||||
+ i*86*-linux-*)
|
||||
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
|
||||
;;
|
||||
- x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
|
||||
+ x86_64-*-linux-*)
|
||||
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
|
||||
;;
|
||||
i386-*-freebsd*)
|
||||
@@ -54,16 +54,16 @@ case $host in
|
||||
powerpc-apple-darwin*)
|
||||
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
|
||||
;;
|
||||
- powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*)
|
||||
+ powerpc-*-linux-*)
|
||||
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC")
|
||||
;;
|
||||
- powerpc64*-*-linux-gnu*|powerpc64*-*-linux-uclibc*)
|
||||
+ powerpc64*-*-linux-*)
|
||||
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64")
|
||||
;;
|
||||
- arm*-*-linux-gnu*|arm*-*-linux-uclibc*|aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*)
|
||||
+ arm*-*-linux-*)
|
||||
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
|
||||
;;
|
||||
- mips*-*-linux-gnu*|mips*-*-linux-uclibc*)
|
||||
+ mips*-*-linux-*)
|
||||
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
|
||||
;;
|
||||
*-*linux-android*)
|
||||
diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac
|
||||
index 3626ea5..f178f7a 100644
|
||||
--- a/tools/depends/configure.ac
|
||||
+++ b/tools/depends/configure.ac
|
||||
@@ -120,13 +120,13 @@ platform_cc=gcc
|
||||
platform_cxx=g++
|
||||
|
||||
case $build in
|
||||
- arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
|
||||
+ arm*-*-linux-*)
|
||||
build_os="linux"
|
||||
;;
|
||||
- *i686*-linux-gnu*|i*86*-*-linux-uclibc*)
|
||||
+ i*86*-*-linux-*)
|
||||
build_os="linux"
|
||||
;;
|
||||
- x86_64*-linux-gnu*|x86_64-*-linux-uclibc*)
|
||||
+ x86_64*-linux-*)
|
||||
build_os="linux"
|
||||
;;
|
||||
*darwin*)
|
||||
diff --git a/xbmc/cores/DllLoader/ldt_keeper.c b/xbmc/cores/DllLoader/ldt_keeper.c
|
||||
index 3fe6854..ca78612 100644
|
||||
--- a/xbmc/cores/DllLoader/ldt_keeper.c
|
||||
+++ b/xbmc/cores/DllLoader/ldt_keeper.c
|
||||
@@ -48,7 +48,7 @@ extern "C" {
|
||||
#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0))
|
||||
_syscall3( int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount );
|
||||
#else
|
||||
--- a/xbmc/cores/DllLoader/ldt_keeper.c 2019-01-30 20:08:15.532823846 +0100
|
||||
+++ b/xbmc/cores/DllLoader/ldt_keeper.c 2019-01-30 20:08:34.139580225 +0100
|
||||
@@ -49,7 +49,7 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
-#if defined(TARGET_ANDROID) && defined(__i386__) && !defined(modify_ldt)
|
||||
+#if defined(__linux__) && !defined(__GLIBC__) && !defined(modify_ldt)
|
||||
#define modify_ldt(a,b,c) syscall( __NR_modify_ldt, a, b, c);
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
--- a/cmake/scripts/linux/ArchSetup.cmake 2019-01-30 21:03:03.146025973 +0100
|
||||
+++ b/cmake/scripts/linux/ArchSetup.cmake 2019-01-30 21:03:47.810441038 +0100
|
||||
@@ -32,6 +32,12 @@
|
||||
elseif(CPU MATCHES aarch64 OR CPU MATCHES arm64)
|
||||
set(ARCH aarch64)
|
||||
set(NEON True)
|
||||
+ elseif(CPU MATCHES ppc64le)
|
||||
+ set(ARCH ppc64le-linux)
|
||||
+ set(NEON False)
|
||||
+ elseif(CPU MATCHES ppc64)
|
||||
+ set(ARCH ppc64-linux)
|
||||
+ set(NEON False)
|
||||
else()
|
||||
message(SEND_ERROR "Unknown CPU: ${CPU}")
|
||||
endif()
|
|
@ -1,7 +1,7 @@
|
|||
--- a/xbmc/utils/posix/PosixInterfaceForCLog.cpp.orig
|
||||
+++ b/xbmc/utils/posix/PosixInterfaceForCLog.cpp
|
||||
@@ -28,10 +28,6 @@
|
||||
#include "android/activity/XBMCApp.h"
|
||||
--- a/xbmc/platform/posix/utils/PosixInterfaceForCLog.cpp 2019-01-30 19:51:15.744119125 +0100
|
||||
+++ b/xbmc/platform/posix/utils/PosixInterfaceForCLog.cpp 2019-01-30 19:54:51.940377340 +0100
|
||||
@@ -17,10 +17,6 @@
|
||||
#include "platform/android/activity/XBMCApp.h"
|
||||
#endif // TARGET_ANDROID
|
||||
|
||||
-struct FILEWRAP : public FILE
|
||||
|
@ -11,7 +11,7 @@
|
|||
CPosixInterfaceForCLog::CPosixInterfaceForCLog() :
|
||||
m_file(NULL)
|
||||
{ }
|
||||
@@ -50,7 +46,7 @@
|
||||
@@ -40,7 +36,7 @@
|
||||
(void)remove(backupOldLogToFilename.c_str()); // if it's failed, try to continue
|
||||
(void)rename(logFilename.c_str(), backupOldLogToFilename.c_str()); // if it's failed, try to continue
|
||||
|
||||
|
@ -20,9 +20,9 @@
|
|||
if (!m_file)
|
||||
return false; // error, can't open log file
|
||||
|
||||
--- a/xbmc/utils/posix/PosixInterfaceForCLog.h.orig
|
||||
+++ b/xbmc/utils/posix/PosixInterfaceForCLog.h
|
||||
@@ -21,8 +21,6 @@
|
||||
--- a/xbmc/platform/posix/utils/PosixInterfaceForCLog.h 2019-01-30 19:55:21.460002043 +0100
|
||||
+++ b/xbmc/platform/posix/utils/PosixInterfaceForCLog.h 2019-01-30 19:55:36.156814572 +0100
|
||||
@@ -10,8 +10,6 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -31,10 +31,10 @@
|
|||
class CPosixInterfaceForCLog
|
||||
{
|
||||
public:
|
||||
@@ -34,5 +32,5 @@
|
||||
@@ -23,5 +21,5 @@
|
||||
void PrintDebugString(const std::string& debugString);
|
||||
static void GetCurrentLocalTime(int& hour, int& minute, int& second);
|
||||
static void GetCurrentLocalTime(int& hour, int& minute, int& second, double& millisecond);
|
||||
private:
|
||||
- FILEWRAP* m_file;
|
||||
+ FILE * m_file;
|
||||
+ FILE* m_file;
|
||||
};
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
--- a/system/addon-manifest.xml.orig
|
||||
+++ b/system/addon-manifest.xml
|
||||
@@ -28,7 +28,6 @@
|
||||
<addon>screensaver.xbmc.builtin.black</addon>
|
||||
<addon>screensaver.xbmc.builtin.dim</addon>
|
||||
<addon>script.module.pil</addon>
|
||||
- <addon>service.xbmc.versioncheck</addon>
|
||||
<addon>skin.estuary</addon>
|
||||
<addon>skin.estouchy</addon>
|
||||
<addon>webinterface.default</addon>
|
|
@ -1,27 +1,27 @@
|
|||
# Template file for 'kodi'
|
||||
pkgname=kodi
|
||||
version=17.6
|
||||
revision=5
|
||||
_codename="Krypton"
|
||||
version=18.0
|
||||
revision=1
|
||||
_codename="Leia"
|
||||
wrksrc="xbmc-${version}-${_codename}"
|
||||
build_wrksrc=project/cmake
|
||||
build_style=cmake
|
||||
configure_args="-DENABLE_INTERNAL_CROSSGUID=OFF"
|
||||
short_desc="A software media player and entertainment hub for digital media"
|
||||
maintainer="Juan RP <xtraeme@voidlinux.org>"
|
||||
license="GPL-2"
|
||||
homepage="http://www.kodi.tv/"
|
||||
configure_args="-DENABLE_INTERNAL_CROSSGUID=OFF -DWITH_FFMPEG=/usr"
|
||||
short_desc="Software media player and entertainment hub for digital media"
|
||||
maintainer="Helmut Pozimski <helmut@pozimski.eu>"
|
||||
license="GPL-2.0-or-later"
|
||||
homepage="http://www.kodi.tv"
|
||||
distfiles="https://github.com/xbmc/xbmc/archive/${version}-${_codename}.tar.gz"
|
||||
checksum=c8312fe92e5bab1cdac1da93d60baed88fa1574146c50c44e3c86d01671c2b1d
|
||||
checksum=ac5d64d59c6f4811b41a869538506e56c342b530fac97ad9dc9715f3d480e633
|
||||
patch_args="-Np1"
|
||||
LDFLAGS+=" -Wl,-z,stack-size=1048576"
|
||||
|
||||
lib32disabled=yes
|
||||
only_for_archs="i686 i686-musl x86_64 x86_64-musl aarch64 aarch64-musl"
|
||||
only_for_archs="i686 i686-musl x86_64 x86_64-musl aarch64 aarch64-musl
|
||||
ppc64le ppc64le-musl ppc64-musl"
|
||||
|
||||
hostmakedepends="
|
||||
automake libtool pkg-config gperf cmake zip unzip nasm yasm python-devel
|
||||
gettext-devel libltdl-devel curl"
|
||||
gettext-devel libltdl-devel curl flatbuffers"
|
||||
makedepends="
|
||||
eudev-libudev-devel pcre-devel expat-devel libpng-devel libjpeg-turbo-devel
|
||||
libXrandr-devel avahi-libs-devel pulseaudio-devel samba-devel tiff-devel
|
||||
|
@ -33,7 +33,8 @@ makedepends="
|
|||
libbluetooth-devel yajl-devel libplist-devel librtmp-devel tinyxml-devel
|
||||
taglib-devel libcap-devel lame-devel libbluray-devel libnfs-devel ffmpeg-devel
|
||||
giflib-devel libxslt-devel gnutls-devel libssh-devel libmicrohttpd-devel
|
||||
libcec-devel dcadec-devel crossguid"
|
||||
libcec-devel dcadec-devel crossguid flatbuffers-devel fmt-devel lcms2-devel
|
||||
libfstrcmp-devel rapidjson ffmpeg-devel"
|
||||
|
||||
# The following dependencies are dlopen(3)ed.
|
||||
depends="libbluray libmad libvorbis libcurl libflac libmodplug libass libmpeg2
|
||||
|
@ -44,7 +45,7 @@ case "$XBPS_TARGET_MACHINE" in
|
|||
aarch64*)
|
||||
hostmakedepends+=" libmysqlclient-devel SDL2_image-devel lzo-devel";
|
||||
makedepends+=" python-devel ffmpeg-devel";
|
||||
configure_args+=" -DENABLE_LDGOLD=Off -DWITH_FFMPEG=/usr -DENABLE_VAAPI=OFF";
|
||||
configure_args+=" -DENABLE_LDGOLD=Off -DENABLE_VAAPI=OFF";
|
||||
_kodi_nojava=yes
|
||||
;;
|
||||
esac
|
||||
|
@ -58,7 +59,7 @@ esac
|
|||
|
||||
pre_configure() {
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
find ../.. -type f | \
|
||||
find -type f | \
|
||||
grep "configure\.ac\|Makefile\|cmake\|config\.site" | \
|
||||
xargs sed -i -e "s;-isystem;-I;g"
|
||||
fi
|
||||
|
@ -71,14 +72,14 @@ pre_configure() {
|
|||
cp -r $FILESDIR/swig.nojava-$version/* -t build/build/swig
|
||||
cp $FILESDIR/CMakeCache.txt.nojava build/CMakeCache.txt
|
||||
|
||||
echo "set(FOUND_SWIG Yes)" > modules/FindSWIG.cmake
|
||||
echo "set(FOUND_SWIG Yes)" > cmake/modules/FindSWIG.cmake
|
||||
else
|
||||
. /etc/profile.d/10_openjdk.sh
|
||||
fi
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
for i in JsonSchemaBuilder TexturePacker; do
|
||||
cat > modules/Find$i.cmake <<EOF
|
||||
cat > cmake/modules/Find$i.cmake <<EOF
|
||||
add_executable($i::$i IMPORTED GLOBAL)
|
||||
set_target_properties($i::$i PROPERTIES
|
||||
IMPORTED_LOCATION "\${CORE_SOURCE_DIR}/tools/depends/native/$i/bin/$i")
|
||||
|
@ -92,7 +93,7 @@ pre_build() {
|
|||
if [ "$CROSS_BUILD" ]; then
|
||||
for i in JsonSchemaBuilder TexturePacker; do
|
||||
CC= LD= CXX= LDFLAGS= CFLAGS= CXXFLAGS= \
|
||||
make -C ../../tools/depends/native/$i
|
||||
make -C tools/depends/native/$i
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
@ -101,7 +102,7 @@ post_build() {
|
|||
# Rebuild for target
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
for i in JsonSchemaBuilder TexturePacker; do
|
||||
make -C ../../tools/depends/native/$i clean all \
|
||||
make -C tools/depends/native/$i clean all \
|
||||
CC="$CC" CXX="$CXX" LD="$LD" AR="$AR" RANLIB="$RANLIB" \
|
||||
CPP="$CPP" AS="$AS" OBJDUMP="$OBJDUMP" \
|
||||
CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
|
||||
|
|
Loading…
Reference in New Issue