From 56296525a687aec715bb52def9a68d3812771082 Mon Sep 17 00:00:00 2001 From: methodus Date: Tue, 2 Oct 2012 02:53:05 +0200 Subject: VDRProvider plugin for serving live tv started. --- plugins/provider/vdrProvider/.dependencies | 1 + plugins/provider/vdrProvider/vdrProvider.cpp | 72 ++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 plugins/provider/vdrProvider/.dependencies create mode 100644 plugins/provider/vdrProvider/vdrProvider.cpp (limited to 'plugins') diff --git a/plugins/provider/vdrProvider/.dependencies b/plugins/provider/vdrProvider/.dependencies new file mode 100644 index 0000000..90d877c --- /dev/null +++ b/plugins/provider/vdrProvider/.dependencies @@ -0,0 +1 @@ +vdrProvider.o: vdrProvider.cpp ../../../include/plugin.h diff --git a/plugins/provider/vdrProvider/vdrProvider.cpp b/plugins/provider/vdrProvider/vdrProvider.cpp new file mode 100644 index 0000000..f593cba --- /dev/null +++ b/plugins/provider/vdrProvider/vdrProvider.cpp @@ -0,0 +1,72 @@ +/* + * vdrProvider.cpp + * + * Created on: 01.10.2012 + * Author: savop + */ + +#include +#include +#include +#include + +namespace upnp { + +#define GROUP_CHANNELS + +class VdrProvider : cUPnPResourceProvider { + + virtual string ProvidesSchema(){ return "vdr"; } + + virtual string GetRootContainer(){ + return ProvidesSchema() + "://"; + } + + virtual EntryList GetContainerEntries(string uri){ + if(uri.find(GetRootContainer(), 0) != 0){ + isyslog("VdrProvider\tUri does not contain the root."); + return EntryList; + } + + EntryList list; + + // Check if this is the root: + if(uri.compare(GetRootContainer()) == 0){ + cChannel* channel = NULL; + for(int index = 0; (channel = Channels.Get(index)); index = Channels.GetNextNormal(index)){ + if(!channel->GroupSep()){ + list.push_back(*channel->GetChannelID().ToString()); + } + } + } + + return list; + } + + virtual bool IsContainer(string uri){ + return uri.compare(GetRootContainer()) == 0; + } + + virtual bool IsLink(string uri, string& target){ + // TODO: what are Channel::RefChannel or LinkChannels ? + return false; + } + + virtual long GetContainerUpdateId(string uri){ + // TODO: provide a container update id + return 0; + } + + virtual cMetadata GetMetadata(string uri); + + virtual string GetHTTPUri(string uri){ + // TODO: get streamdev settings from configuration + return string(); + } + +}; + +UPNP_REGISTER_RESOURCE_PROVIDER(VdrProvider); + +} // namespace upnp + -- cgit v1.2.3