summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormethodus <methodus@web.de>2012-10-12 13:38:12 +0200
committermethodus <methodus@web.de>2012-10-12 13:38:12 +0200
commit9b199c2d95141de43fac33412ec3e9fc1f543e71 (patch)
treecd62f387aad28bc8216774e52eda0582ebbcc526 /plugins
parente3ce4d1e7e47af0efe5bc1015ba38598e68a149d (diff)
downloadvdr-plugin-upnp-9b199c2d95141de43fac33412ec3e9fc1f543e71.tar.gz
vdr-plugin-upnp-9b199c2d95141de43fac33412ec3e9fc1f543e71.tar.bz2
Continued DVBProfiler for recordings and Live-TV channels
Diffstat (limited to 'plugins')
-rw-r--r--plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp62
1 files changed, 59 insertions, 3 deletions
diff --git a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp
index eb578a0..4bb14c6 100644
--- a/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp
+++ b/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp
@@ -12,6 +12,7 @@
#include <tools.h>
#include <string>
#include <sstream>
+#include <media/profile.h>
using namespace std;
@@ -40,13 +41,68 @@ public:
private:
virtual bool GetRecordingMetadata(const string& uri, cMetadata& metadata){
- dsyslog("DvbProfiler\tGetting recording metadata for '%s'", uri.c_str());
+ //TODO
return false;
}
virtual bool GetChannelMetadata(const string& uri, cMetadata& metadata){
- dsyslog("DvbProfiler\tGetting channel metadata for '%s'", uri.c_str());
- return false;
+
+ tChannelID channelID = tChannelID::FromString(uri.substr(6).c_str());
+ if(!channelID.Valid()) return false;
+
+ cChannel* channel = Channels.GetByChannelID(channelID);
+ if(channel == NULL) return false;
+
+ // First of all we can set the default information.
+
+ string parentUri = uri.substr(0, uri.find_last_of('/')+1);
+
+ metadata.SetObjectIDByUri(uri);
+ metadata.SetParentIDByUri(parentUri);
+ metadata.SetProperty(cMetadata::Property(property::object::KEY_CLASS, string("object.item.videoItem.videoBroadcast")));
+ metadata.SetProperty(cMetadata::Property(property::object::KEY_RESTRICTED, true));
+ metadata.SetProperty(cMetadata::Property(property::object::KEY_CHANNEL_NAME, string(channel->Name())));
+ metadata.SetProperty(cMetadata::Property(property::object::KEY_CHANNEL_NR, (long int)channel->Number()));
+
+ // Now, we try to get the present event of the schedule
+ metadata.SetProperty(cMetadata::Property(property::object::KEY_TITLE, string(channel->Name())));
+
+ cMetadata::Resource resource;
+
+ stringstream protocolInfo;
+
+ protocolInfo << "http-get:*:video/mpeg:";
+
+ DLNA4thField fourthfield;
+
+ switch (channel->Vtype()) {
+ case 0x02:
+ fourthfield = DLNA4thField("MPEG_TS_SD_EU_ISO", DLNA_OPERATION_NONE,
+ DLNA_PLAYSPEEDS_NONE, DLNA_CONVERSION_NONE,
+ DLNA_FLAG_STREAMING_TRANSFER |
+ DLNA_FLAG_SN_INCREASE |
+ DLNA_FLAG_VERSION_1_5 );
+ break;
+ case 0x1B:
+ fourthfield = DLNA4thField("AVC_TS_HD_EU_ISO", DLNA_OPERATION_NONE,
+ DLNA_PLAYSPEEDS_NONE, DLNA_CONVERSION_NONE,
+ DLNA_FLAG_STREAMING_TRANSFER |
+ DLNA_FLAG_SN_INCREASE |
+ DLNA_FLAG_VERSION_1_5 );
+ break;
+ default:
+ return false;
+ break;
+ }
+
+ protocolInfo << fourthfield.ToString();
+
+ resource.SetResourceUri(uri);
+ resource.SetProtocolInfo(protocolInfo.str());
+
+ metadata.AddResource(resource);
+
+ return true;
}
};