blob: 8147e5c91b7914ce78c74690a3f4e8c0177206ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#include "Media.h"
namespace plexclient
{
Media::Media(Poco::XML::Node* pNode)
{
NodeIterator it(pNode, Poco::XML::NodeFilter::SHOW_ALL);
Poco::XML::Node* pChildNode = it.nextNode();
while(pChildNode) {
if(Poco::icompare(pChildNode->nodeName(), "Media") == 0) {
Poco::XML::AutoPtr<Poco::XML::NamedNodeMap> pAttribs = pChildNode->attributes();
m_sVideoResolution = GetNodeValue(pAttribs->getNamedItem("videoResolution"));
m_iId = GetNodeValueAsInt(pAttribs->getNamedItem("id"));
m_lDuration = GetNodeValueAsLong(pAttribs->getNamedItem("duration"));
m_iBitrate = GetNodeValueAsInt(pAttribs->getNamedItem("bitrate"));
m_iWidth = GetNodeValueAsInt(pAttribs->getNamedItem("width"));
m_iHeight = GetNodeValueAsInt(pAttribs->getNamedItem("height"));
m_sAspectRatio = GetNodeValue(pAttribs->getNamedItem("aspectRatio"));
m_iAudioChannels = GetNodeValueAsInt(pAttribs->getNamedItem("audioChannels"));
m_sAudioCodec = GetNodeValue(pAttribs->getNamedItem("audioCodec"));
m_sVideoCodec = GetNodeValue(pAttribs->getNamedItem("videoCodec"));
m_sContainer = GetNodeValue(pAttribs->getNamedItem("container"));
m_VideoFrameRate = GetNodeValueAsDouble(pAttribs->getNamedItem("videoFrameRate"));
pAttribs->release();
}
if(Poco::icompare(pChildNode->nodeName(), "Part") == 0) {
Poco::XML::AutoPtr<Poco::XML::NamedNodeMap> pAttribs = pChildNode->attributes();
m_sPartKey = GetNodeValue(pAttribs->getNamedItem("key"));
m_iPartId = GetNodeValueAsInt(pAttribs->getNamedItem("id"));
m_lPartDuration = GetNodeValueAsLong(pAttribs->getNamedItem("duration"));
m_sPartFile = GetNodeValue(pAttribs->getNamedItem("file"));
m_lPartSize = GetNodeValueAsLong(pAttribs->getNamedItem("size"));
m_sPartContainer = GetNodeValue(pAttribs->getNamedItem("container"));
pAttribs->release();
}
if(Poco::icompare(pChildNode->nodeName(), "Stream") == 0) {
m_vStreams.push_back(Stream(pChildNode));
}
pChildNode = it.nextNode();
}
}
}
|