From cbef7cfb972c27251ea8d58dde054b7c57e1715f Mon Sep 17 00:00:00 2001 From: methodus Date: Tue, 2 Oct 2012 02:52:14 +0200 Subject: VDRProvider plugin for serving live tv started. --- Makefile | 2 +- include/media/mediaManager.h | 6 +++--- media/mediaManager.cpp | 3 ++- media/pluginManager.cpp | 14 ++++++++++---- plugins/provider/vdrProvider/Makefile | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index aff0a2f..d77e982 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ LIBDIR ?= ../../lib TMPDIR ?= /tmp PLUGINDIR= ./PLUGINS -PLUGINLIBDIR= $(PLUGINDIR)/lib/upnp +PLUGINLIBDIR= /usr/lib/vdr/plugins/upnp ### Make sure that necessary options are included: diff --git a/include/media/mediaManager.h b/include/media/mediaManager.h index 71f6d38..16dbb4d 100644 --- a/include/media/mediaManager.h +++ b/include/media/mediaManager.h @@ -8,15 +8,15 @@ #ifndef MEDIAMANAGER_H_ #define MEDIAMANAGER_H_ +#include "../../include/pluginManager.h" +#include "../../include/plugin.h" +#include "../../include/tools.h" #include #include #include #include #include #include -#include "../../include/plugin.h" -#include "../../include/tools.h" -#include "../../include/pluginManager.h" namespace upnp { diff --git a/media/mediaManager.cpp b/media/mediaManager.cpp index e8ee505..a94b563 100644 --- a/media/mediaManager.cpp +++ b/media/mediaManager.cpp @@ -5,13 +5,14 @@ * Author: savop */ -#include "../include/plugin.h" #include "../include/media/mediaManager.h" +#include "../include/plugin.h" #include "../include/server.h" #include "../include/parser.h" #include "../include/tools.h" #include #include +#include #include #include #include diff --git a/media/pluginManager.cpp b/media/pluginManager.cpp index b35cd49..40a0b9f 100644 --- a/media/pluginManager.cpp +++ b/media/pluginManager.cpp @@ -259,7 +259,7 @@ upnp::cPluginManager::cPluginManager(cMediaManager* manager) : manager(manager) {} -upnp::cPluginManager::~cPluginManager(){} +cPluginManager::~cPluginManager(){} #define UPNPPLUGIN_PREFIX "libupnp-" #define SO_INDICATOR ".so." @@ -282,7 +282,7 @@ bool upnp::cPluginManager::LoadPlugins(const string& directory){ filename.find(UPNPPLUGIN_VERSION) != string::npos && filename.find(SO_INDICATOR) != string::npos) { - boost::shared_ptr dll(new DLL(filename)); + boost::shared_ptr dll(new DLL(directory + "/" + filename)); if(dll->Load()) dlls.push_back(dll); } @@ -313,15 +313,23 @@ bool upnp::cPluginManager::DLL::Load(){ if (!(error = dlerror())){ isyslog("UPnP\tFound provider in %s", file.c_str()); return true; + } else { + dsyslog("UPnP\tError: %s", error); } profiler = (FunctionPtr)dlsym(handle, "UPnPCreateMediaProfiler"); if (!(error = dlerror())){ isyslog("UPnP\tFound profiler in %s", file.c_str()); return true; + } else { + dsyslog("UPnP\tError: %s", error); } + } else { + dsyslog("UPnP\tError: %s", error); } + isyslog("UPnP\tInvalid library '%s', no valid symbols found.", file.c_str()); + return false; } @@ -332,5 +340,3 @@ upnp::cPluginManager::DLL::~DLL() } } // namespace upnp - - diff --git a/plugins/provider/vdrProvider/Makefile b/plugins/provider/vdrProvider/Makefile index 8bc602e..dfbf54f 100644 --- a/plugins/provider/vdrProvider/Makefile +++ b/plugins/provider/vdrProvider/Makefile @@ -25,7 +25,7 @@ INCLUDES += -I$(UPNPDIR)/include DEFINES += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -OBJS = $(SCHEMA)Provider.cpp +OBJS = $(SCHEMA)Provider.o all: libupnp-$(SCHEMA)-provider.so -- cgit v1.2.3