diff options
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | Makefile.include.in | 1 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | lib/addons/library.xbmc.codec/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/addons/library.xbmc.codec/Makefile.in | 29 | ||||
-rw-r--r-- | lib/addons/library.xbmc.codec/libXBMC_codec.cpp | 73 | ||||
-rw-r--r-- | lib/addons/library.xbmc.codec/project/VS2010Express/libXBMC_codec.vcxproj | 84 | ||||
-rw-r--r-- | lib/addons/library.xbmc.codec/project/VS2010Express/libXBMC_codec.vcxproj.filters | 18 | ||||
-rw-r--r-- | project/cmake/installdata/common/addons.txt | 1 | ||||
-rw-r--r-- | project/cmake/treedata/common/addons.txt | 1 | ||||
-rw-r--r-- | xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h | 7 | ||||
-rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h | 78 |
13 files changed, 31 insertions, 271 deletions
diff --git a/.gitignore b/.gitignore index 06e09a5abb..8287cd53cc 100644 --- a/.gitignore +++ b/.gitignore @@ -148,12 +148,9 @@ cmake_install.cmake /lib/addons/library.kodi.guilib/project/VS2010Express/Release /lib/addons/library.kodi.guilib/project/VS2010Express/Debug /lib/addons/library.xbmc.addon/Makefile -/lib/addons/library.xbmc.codec/Makefile /lib/addons/library.kodi.game/Makefile /lib/addons/library.xbmc.addon/project/VS2010Express/Release /lib/addons/library.xbmc.addon/project/VS2010Express/Debug -/lib/addons/library.xbmc.codec/project/VS2010Express/Release -/lib/addons/library.xbmc.codec/project/VS2010Express/Debug /lib/addons/library.kodi.audioengine/Makefile /lib/addons/library.kodi.audioengine/project/VS2010Express/Release/ /lib/addons/library.kodi.audioengine/project/VS2010Express/Debug/ @@ -534,8 +531,6 @@ lib/cpluff/stamp-h1 /addons/library.xbmc.addon/libXBMC_addon.dll /addons/library.xbmc.addon/libXBMC_addon.lib -/addons/library.xbmc.codec/libXBMC_codec.dll -/addons/library.xbmc.codec/libXBMC_codec.lib /addons/library.kodi.guilib/libKODI_guilib.dll /addons/library.kodi.guilib/libKODI_guilib.lib /addons/library.kodi.audioengine/libKODI_audioengine.dll diff --git a/Makefile.in b/Makefile.in index e8343010c4..f233c539c6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -238,7 +238,6 @@ LIB_DIRS=\ LIBADDON_DIRS=\ lib/addons/library.xbmc.addon \ lib/addons/library.kodi.audioengine \ - lib/addons/library.xbmc.codec \ lib/addons/library.kodi.guilib \ lib/addons/library.kodi.game \ @@ -359,7 +358,6 @@ dllloader: exports xbmc/cores/DllLoader/dllloader.a libaddon: exports $(MAKE) -C lib/addons/library.xbmc.addon $(MAKE) -C lib/addons/library.kodi.audioengine - $(MAKE) -C lib/addons/library.xbmc.codec $(MAKE) -C lib/addons/library.kodi.game $(MAKE) -C lib/addons/library.kodi.guilib dvdpcodecs: dllloader diff --git a/Makefile.include.in b/Makefile.include.in index 6c6a184929..01cd3fbe6b 100644 --- a/Makefile.include.in +++ b/Makefile.include.in @@ -44,7 +44,6 @@ INCLUDES+=-I@abs_top_srcdir@/xbmc/addons/kodi-addon-dev-kit/include INCLUDES+=-I@abs_top_srcdir@/addons/library.kodi.guilib INCLUDES+=-I@abs_top_srcdir@/addons/library.xbmc.addon INCLUDES+=-I@abs_top_srcdir@/addons/library.kodi.audioengine -INCLUDES+=-I@abs_top_srcdir@/addons/library.xbmc.codec INCLUDES+=$(sort @INCLUDES@) INCLUDES+=-I@abs_top_srcdir@/xbmc/linux INCLUDES+=-I@abs_top_srcdir@/xbmc/cores/VideoPlayer diff --git a/configure.ac b/configure.ac index 248a686b01..cb16c21638 100644 --- a/configure.ac +++ b/configure.ac @@ -2193,7 +2193,6 @@ OUTPUT_FILES="Makefile \ xbmc/windowing/egl/Makefile \ lib/addons/library.xbmc.addon/Makefile \ lib/addons/library.kodi.audioengine/Makefile \ - lib/addons/library.xbmc.codec/Makefile \ lib/addons/library.kodi.game/Makefile \ lib/addons/library.kodi.guilib/Makefile \ tools/Linux/kodi.sh \ diff --git a/lib/addons/library.xbmc.codec/CMakeLists.txt b/lib/addons/library.xbmc.codec/CMakeLists.txt deleted file mode 100644 index 0202216b60..0000000000 --- a/lib/addons/library.xbmc.codec/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -project(XBMC_codec) -core_add_addon_library(${PROJECT_NAME}) diff --git a/lib/addons/library.xbmc.codec/Makefile.in b/lib/addons/library.xbmc.codec/Makefile.in deleted file mode 100644 index b7d39d8b2c..0000000000 --- a/lib/addons/library.xbmc.codec/Makefile.in +++ /dev/null @@ -1,29 +0,0 @@ -ARCH=@ARCH@ -INCLUDES=-I. -I../../../xbmc/addons/kodi-addon-dev-kit/include/kodi -I../../../xbmc/addons/kodi-addon-dev-kit/include -DEFINES+= -CXXFLAGS=-fPIC -LIBNAME=libXBMC_codec -OBJS=$(LIBNAME).o - -ifeq ($(findstring osx,$(ARCH)), osx) -LIB_SHARED=../../../addons/library.xbmc.codec/$(LIBNAME)-$(ARCH).dylib -else -LIB_SHARED=../../../addons/library.xbmc.codec/$(LIBNAME)-$(ARCH).so -endif - -all: $(LIB_SHARED) - -$(LIB_SHARED): $(OBJS) -ifeq ($(findstring osx,$(ARCH)), osx) - $(CXX) $(CXXFLAGS) $(LDFLAGS) -dynamiclib -o $@ $(OBJS) -else - $(CXX) $(CFLAGS) $(LDFLAGS) -shared -g -o $(LIB_SHARED) $(OBJS) -endif - -CLEAN_FILES = \ - $(LIB_SHARED) \ - -DISTCLEAN_FILES= \ - Makefile \ - -include ../../../Makefile.include diff --git a/lib/addons/library.xbmc.codec/libXBMC_codec.cpp b/lib/addons/library.xbmc.codec/libXBMC_codec.cpp deleted file mode 100644 index 7c042153e2..0000000000 --- a/lib/addons/library.xbmc.codec/libXBMC_codec.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2012-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, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <string> -#include "addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h" -#include "addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h" - -#ifdef _WIN32 -#include <windows.h> -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT -#endif - -using namespace std; -using namespace KodiAPI::V1::Codec; - -extern "C" -{ - -DLLEXPORT void* CODEC_register_me(void *hdl) -{ - CB_CodecLib *cb = NULL; - if (!hdl) - fprintf(stderr, "libXBMC_codec-ERROR: %s is called with NULL handle\n", __FUNCTION__); - else - { - cb = (CB_CodecLib*)((AddonCB*)hdl)->CodecLib_RegisterMe(((AddonCB*)hdl)->addonData); - if (!cb) - fprintf(stderr, "libXBMC_codec-ERROR: %s can't get callback table from XBMC\n", __FUNCTION__); - } - return cb; -} - -DLLEXPORT void CODEC_unregister_me(void *hdl, void* cb) -{ - if (hdl && cb) - ((AddonCB*)hdl)->CodecLib_UnRegisterMe(((AddonCB*)hdl)->addonData, (CB_CodecLib*)cb); -} - -DLLEXPORT xbmc_codec_t CODEC_get_codec_by_name(void *hdl, void* cb, const char* strCodecName) -{ - xbmc_codec_t retVal; - retVal.codec_id = XBMC_INVALID_CODEC_ID; - retVal.codec_type = XBMC_CODEC_TYPE_UNKNOWN; - - if (cb != NULL) - retVal = ((CB_CodecLib*)cb)->GetCodecByName(((AddonCB*)hdl)->addonData, strCodecName); - - return retVal; -} - -}; diff --git a/lib/addons/library.xbmc.codec/project/VS2010Express/libXBMC_codec.vcxproj b/lib/addons/library.xbmc.codec/project/VS2010Express/libXBMC_codec.vcxproj deleted file mode 100644 index 3ecdb30027..0000000000 --- a/lib/addons/library.xbmc.codec/project/VS2010Express/libXBMC_codec.vcxproj +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{F8F1290B-1188-4810-86C9-88178A31D2AF}</ProjectGuid> - <RootNamespace>XBMC_VDR</RootNamespace> - <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion> - </PropertyGroup> - <Import Project="$(SolutionDir)\XBMC.core-defaults.props" /> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>v140</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets"> - <Import Project="$(SolutionDir)\XBMC.defaults.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\..\addons\library.xbmc.codec\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\..\addons\library.xbmc.codec\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\..\addons\library.xbmc.addon\;$(IncludePath)</IncludePath> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\..\addons\library.xbmc.addon\;$(IncludePath)</IncludePath> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <AdditionalIncludeDirectories>..\..\..\..\..\xbmc;..\..\..\..\..\xbmc\addons\kodi-addon-dev-kit\include\kodi;..\..\..\..\..\xbmc\cores\VideoPlayer\DVDDemuxers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>VDR_EXPORTS;_WIN32PC;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ExceptionHandling>Sync</ExceptionHandling> - <PrecompiledHeader> - </PrecompiledHeader> - </ClCompile> - <Link> - <OutputFile>..\..\..\..\..\addons\library.xbmc.codec\$(ProjectName).dll</OutputFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <AdditionalIncludeDirectories>..\..\..\..\..\xbmc;..\..\..\..\..\xbmc\addons\kodi-addon-dev-kit\include\kodi;..\..\..\..\..\xbmc\cores\VideoPlayer\DVDDemuxers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>HAS_SDL;_USRDLL;XBMC_VDR_EXPORTS;_WIN32PC;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ExceptionHandling>Sync</ExceptionHandling> - <PrecompiledHeader> - </PrecompiledHeader> - </ClCompile> - <Link> - <OutputFile>../../../../../addons/library.xbmc.codec/$(ProjectName).dll</OutputFile> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\..\libXBMC_codec.cpp" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project>
\ No newline at end of file diff --git a/lib/addons/library.xbmc.codec/project/VS2010Express/libXBMC_codec.vcxproj.filters b/lib/addons/library.xbmc.codec/project/VS2010Express/libXBMC_codec.vcxproj.filters deleted file mode 100644 index 3953f0c02d..0000000000 --- a/lib/addons/library.xbmc.codec/project/VS2010Express/libXBMC_codec.vcxproj.filters +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <UniqueIdentifier>{F8F1290B-1188-4810-86C9-88178A31D2AF}</UniqueIdentifier> - <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> - </Filter> - <Filter Include="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="..\..\libXBMC_codec.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/project/cmake/installdata/common/addons.txt b/project/cmake/installdata/common/addons.txt index d643765854..02f977d2ab 100644 --- a/project/cmake/installdata/common/addons.txt +++ b/project/cmake/installdata/common/addons.txt @@ -22,7 +22,6 @@ addons/library.kodi.audioengine/* addons/library.kodi.game/* addons/library.kodi.guilib/* addons/library.xbmc.addon/* -addons/library.xbmc.codec/* addons/repository.xbmc.org/* addons/webinterface.default/* addons/screensaver.xbmc.builtin.dim/* diff --git a/project/cmake/treedata/common/addons.txt b/project/cmake/treedata/common/addons.txt index e37a50fe6c..5e5fcfb493 100644 --- a/project/cmake/treedata/common/addons.txt +++ b/project/cmake/treedata/common/addons.txt @@ -2,4 +2,3 @@ lib/addons/library.kodi.audioengine KODI_audioengine lib/addons/library.kodi.game KODI_game lib/addons/library.kodi.guilib KODI_guilib lib/addons/library.xbmc.addon XBMC_addon -lib/addons/library.xbmc.codec XBMC_codec diff --git a/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h b/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h index 77302c140e..8424eb8ca8 100644 --- a/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h +++ b/xbmc/addons/binary/interfaces/api1/Codec/AddonCallbacksCodec.h @@ -30,13 +30,6 @@ namespace V1 namespace Codec { -typedef xbmc_codec_t (*CODECGetCodecByName)(const void* addonData, const char* strCodecName); - -typedef struct CB_CODEC -{ - CODECGetCodecByName GetCodecByName; -} CB_CodecLib; - class CAddonCallbacksCodec : public ADDON::IAddonInterface { public: diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h index 0e64b11865..41e8cfe6cc 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h @@ -27,24 +27,39 @@ #include "xbmc_codec_types.h" #include "libXBMC_addon.h" -#define CODEC_HELPER_DLL_NAME XBMC_DLL_NAME("codec") -#define CODEC_HELPER_DLL XBMC_DLL("codec") +extern "C" +{ +namespace KodiAPI +{ +namespace V1 +{ +namespace Codec +{ + +typedef struct CB_CODEC +{ + xbmc_codec_t (*GetCodecByName)(const void* addonData, const char* strCodecName); +} CB_CodecLib; + +} /* namespace Codec */ +} /* namespace V1 */ +} /* namespace KodiAPI */ +} /* extern "C" */ class CHelper_libXBMC_codec { public: CHelper_libXBMC_codec(void) { - m_libXBMC_codec = NULL; - m_Handle = NULL; + m_Handle = nullptr; + m_Callbacks = nullptr; } ~CHelper_libXBMC_codec(void) { - if (m_libXBMC_codec) + if (m_Handle && m_Callbacks) { - CODEC_unregister_me(m_Handle, m_Callbacks); - dlclose(m_libXBMC_codec); + m_Handle->CodecLib_UnRegisterMe(m_Handle->addonData, m_Callbacks); } } @@ -55,33 +70,13 @@ public: */ bool RegisterMe(void* handle) { - m_Handle = handle; + m_Handle = static_cast<AddonCB*>(handle); + if (m_Handle) + m_Callbacks = (KodiAPI::V1::Codec::CB_CODEC*)m_Handle->CodecLib_RegisterMe(m_Handle->addonData); + if (!m_Callbacks) + fprintf(stderr, "libXBMC_codec-ERROR: CodecLib_RegisterMe can't get callback table from Kodi !!!\n"); - std::string libBasePath; - libBasePath = ((cb_array*)m_Handle)->libPath; - libBasePath += CODEC_HELPER_DLL; - - m_libXBMC_codec = dlopen(libBasePath.c_str(), RTLD_LAZY); - if (m_libXBMC_codec == NULL) - { - fprintf(stderr, "Unable to load %s\n", dlerror()); - return false; - } - - CODEC_register_me = (void* (*)(void *HANDLE)) - dlsym(m_libXBMC_codec, "CODEC_register_me"); - if (CODEC_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } - - CODEC_unregister_me = (void (*)(void* HANDLE, void* CB)) - dlsym(m_libXBMC_codec, "CODEC_unregister_me"); - if (CODEC_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } - - CODEC_get_codec_by_name = (xbmc_codec_t (*)(void* HANDLE, void* CB, const char* strCodecName)) - dlsym(m_libXBMC_codec, "CODEC_get_codec_by_name"); - if (CODEC_get_codec_by_name == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } - - m_Callbacks = CODEC_register_me(m_Handle); - return m_Callbacks != NULL; + return m_Callbacks != nullptr; } /*! @@ -91,21 +86,10 @@ public: */ xbmc_codec_t GetCodecByName(const char* strCodecName) { - return CODEC_get_codec_by_name(m_Handle, m_Callbacks, strCodecName); + return m_Callbacks->GetCodecByName(m_Handle->addonData, strCodecName); } -protected: - void* (*CODEC_register_me)(void*); - void (*CODEC_unregister_me)(void*, void*); - xbmc_codec_t (*CODEC_get_codec_by_name)(void *HANDLE, void* CB, const char* strCodecName); - private: - void* m_libXBMC_codec; - void* m_Handle; - void* m_Callbacks; - struct cb_array - { - const char* libPath; - }; + AddonCB* m_Handle; + KodiAPI::V1::Codec::CB_CODEC *m_Callbacks; }; - |