summaryrefslogtreecommitdiff
path: root/plugins/provider/vdrProvider
diff options
context:
space:
mode:
authormethodus <methodus@web.de>2012-10-03 22:34:14 +0200
committermethodus <methodus@web.de>2012-10-03 22:34:14 +0200
commitd3be5479f0a3eee76ab8b98b1c6488b3cf5e50a5 (patch)
treed9b424029362ced5c48bf39e4670688f68c3c89b /plugins/provider/vdrProvider
parent8bfbe9ae40adccea37598b067340330521a9a5f8 (diff)
downloadvdr-plugin-upnp-d3be5479f0a3eee76ab8b98b1c6488b3cf5e50a5.tar.gz
vdr-plugin-upnp-d3be5479f0a3eee76ab8b98b1c6488b3cf5e50a5.tar.bz2
Splitted tools.h into several tool headers to avoid clashed for example when only requiring string tools but not ixml tools.
Diffstat (limited to 'plugins/provider/vdrProvider')
-rw-r--r--plugins/provider/vdrProvider/Makefile6
-rw-r--r--plugins/provider/vdrProvider/vdrProvider.cpp35
2 files changed, 30 insertions, 11 deletions
diff --git a/plugins/provider/vdrProvider/Makefile b/plugins/provider/vdrProvider/Makefile
index dfbf54f..1220a55 100644
--- a/plugins/provider/vdrProvider/Makefile
+++ b/plugins/provider/vdrProvider/Makefile
@@ -21,6 +21,8 @@ CXXFLAGS ?= -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses -fPIC
UPNPDIR ?= ../../..
+APIVERSION = $(shell sed -ne '/define UPNPPLUGIN_VERSION/s/^.*"\(.*\)".*$$/\1/p' $(UPNPDIR)/include/plugin.h)
+
INCLUDES += -I$(UPNPDIR)/include
DEFINES += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
@@ -45,3 +47,7 @@ $(DEPFILE): Makefile
libupnp-$(SCHEMA)-provider.so: $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
+ @cp --remove-destination $@ $@.$(APIVERSION)
+
+clean:
+ @-rm -f $(OBJS) $(DEPFILE) *.so *.so.$(APIVERSION) core* *~
diff --git a/plugins/provider/vdrProvider/vdrProvider.cpp b/plugins/provider/vdrProvider/vdrProvider.cpp
index f593cba..7d1ef22 100644
--- a/plugins/provider/vdrProvider/vdrProvider.cpp
+++ b/plugins/provider/vdrProvider/vdrProvider.cpp
@@ -8,13 +8,15 @@
#include <plugin.h>
#include <vdr/channels.h>
#include <vdr/tools.h>
+#include <vdr/config.h>
#include <string>
+#include <tools.h>
-namespace upnp {
+using namespace std;
-#define GROUP_CHANNELS
+namespace upnp {
-class VdrProvider : cUPnPResourceProvider {
+class VdrProvider : public cUPnPResourceProvider {
virtual string ProvidesSchema(){ return "vdr"; }
@@ -22,10 +24,10 @@ class VdrProvider : cUPnPResourceProvider {
return ProvidesSchema() + "://";
}
- virtual EntryList GetContainerEntries(string uri){
+ virtual cUPnPResourceProvider::EntryList GetContainerEntries(const string& uri){
if(uri.find(GetRootContainer(), 0) != 0){
isyslog("VdrProvider\tUri does not contain the root.");
- return EntryList;
+ return cUPnPResourceProvider::EntryList();
}
EntryList list;
@@ -43,24 +45,35 @@ class VdrProvider : cUPnPResourceProvider {
return list;
}
- virtual bool IsContainer(string uri){
+ virtual bool IsContainer(const string& uri){
return uri.compare(GetRootContainer()) == 0;
}
- virtual bool IsLink(string uri, string& target){
+ virtual bool IsLink(const string& uri, string& target){
// TODO: what are Channel::RefChannel or LinkChannels ?
return false;
}
- virtual long GetContainerUpdateId(string uri){
+ virtual long GetContainerUpdateId(const string& uri){
// TODO: provide a container update id
return 0;
}
- virtual cMetadata GetMetadata(string uri);
+ virtual bool GetMetadata(const string& uri, cMetadata& metadata){
+ if(uri.find(GetRootContainer(), 0) != 0){
+ isyslog("VdrProvider\tUri does not contain the root.");
+ return false;
+ }
+
+ return false;
+ }
+
+ virtual string GetHTTPUri(const string& uri, const string& currentIP){
+ if(uri.find(GetRootContainer(), 0) != 0){
+ isyslog("VdrProvider\tUri does not contain the root.");
+ return string();
+ }
- virtual string GetHTTPUri(string uri){
- // TODO: get streamdev settings from configuration
return string();
}