summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/provider/vdrProvider/.dependencies1
-rw-r--r--plugins/provider/vdrProvider/vdrProvider.cpp72
2 files changed, 73 insertions, 0 deletions
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 <plugin.h>
+#include <vdr/channels.h>
+#include <vdr/tools.h>
+#include <string>
+
+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
+