diff options
author | methodus <methodus@web.de> | 2012-10-12 20:46:25 +0200 |
---|---|---|
committer | methodus <methodus@web.de> | 2012-10-12 20:46:25 +0200 |
commit | b450015b9a6c0d35c264e93fbc9bcdf92538f47a (patch) | |
tree | 8959f8d24f8a14285e8623af078beacd860d4c58 /media/profile.cpp | |
parent | 9b199c2d95141de43fac33412ec3e9fc1f543e71 (diff) | |
download | vdr-plugin-upnp-b450015b9a6c0d35c264e93fbc9bcdf92538f47a.tar.gz vdr-plugin-upnp-b450015b9a6c0d35c264e93fbc9bcdf92538f47a.tar.bz2 |
Fixed some minor issues. Added current event from schedule to channel details.
Diffstat (limited to 'media/profile.cpp')
-rw-r--r-- | media/profile.cpp | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/media/profile.cpp b/media/profile.cpp index 0cff566..8c9df6f 100644 --- a/media/profile.cpp +++ b/media/profile.cpp @@ -11,6 +11,42 @@ using namespace upnp; +ProtocolInfo::ProtocolInfo() +: streamType(DLNA_STREAM_HTTP) +, contentType(string()) +, fourthField(DLNA4thField()) +{ +} + +ProtocolInfo::ProtocolInfo(string ct, DLNA4thField ffld, StreamType t) +: streamType(t) +, contentType(ct) +, fourthField(ffld) +{ +} + +string ProtocolInfo::ToString(){ + if(contentType.empty()) return string(); + + stringstream ss; + switch(streamType){ + case DLNA_STREAM_HTTP: + ss << "http-get:"; + break; + case DLNA_STREAM_RTP: + ss << "rtsp-rtp-udp:"; + break; + } + + ss << "*:"; + + ss << contentType << ":"; + + ss << fourthField.ToString(); + + return ss.str(); +} + DLNA4thField::DLNA4thField() : profile(string()) , operations(DLNA_OPERATION_NONE) @@ -30,17 +66,20 @@ DLNA4thField::DLNA4thField(string pn, uint8_t op, string ps, bool ci, uint32_t f } string DLNA4thField::ToString(){ - stringstream ss; - if(profile.empty()) return "*"; - ss << "DLNA.ORG_PN=" << profile << ";"; + stringstream ss; + ss << "DLNA.ORG_PN=" << profile; + + if(primaryFlags){ + ss << ";"; - ss << "DLNA.ORG_OP=" << bitset<2>(operations) << ";"; + ss << "DLNA.ORG_OP=" << bitset<2>(operations) << ";"; - ss << "DLNA.ORG_CI=" << bitset<1>(conversionIndicator) << ";"; + ss << "DLNA.ORG_CI=" << bitset<1>(conversionIndicator) << ";"; - ss << "DLNA.ORG_FLAGS=" << hex << primaryFlags << "000000000000000000000000" << ";"; + ss << "DLNA.ORG_FLAGS=" << hex << primaryFlags << "000000000000000000000000"; + } return ss.str(); } |