|
a/libupnpp/control/mediarenderer.cxx |
|
b/libupnpp/control/mediarenderer.cxx |
|
... |
|
... |
62 |
unordered_map<string, UPnPDeviceDesc> mydevs;
|
62 |
unordered_map<string, UPnPDeviceDesc> mydevs;
|
63 |
|
63 |
|
64 |
UPnPDeviceDirectory::Visitor visitor = bind(MDAccum, &mydevs, friendlyName,
|
64 |
UPnPDeviceDirectory::Visitor visitor = bind(MDAccum, &mydevs, friendlyName,
|
65 |
_1, _2);
|
65 |
_1, _2);
|
66 |
UPnPDeviceDirectory::getTheDir()->traverse(visitor);
|
66 |
UPnPDeviceDirectory::getTheDir()->traverse(visitor);
|
67 |
for (auto& entry : mydevs)
|
67 |
for (auto it = mydevs.begin(); it != mydevs.end(); it++)
|
68 |
devices.push_back(entry.second);
|
68 |
devices.push_back(it->second);
|
69 |
return !devices.empty();
|
69 |
return !devices.empty();
|
70 |
}
|
70 |
}
|
71 |
|
71 |
|
72 |
MediaRenderer::MediaRenderer(const UPnPDeviceDesc& desc)
|
72 |
MediaRenderer::MediaRenderer(const UPnPDeviceDesc& desc)
|
73 |
: Device(desc)
|
73 |
: Device(desc)
|
|
... |
|
... |
80 |
}
|
80 |
}
|
81 |
|
81 |
|
82 |
|
82 |
|
83 |
RDCH MediaRenderer::rdc()
|
83 |
RDCH MediaRenderer::rdc()
|
84 |
{
|
84 |
{
|
85 |
for (auto& entry : m_desc.services) {
|
85 |
for (auto it = m_desc.services.begin(); it != m_desc.services.end(); it++) {
|
86 |
if (RenderingControl::isRDCService(entry.serviceType)) {
|
86 |
if (RenderingControl::isRDCService(it->serviceType)) {
|
87 |
m_rdc = RDCH(new RenderingControl(m_desc, entry));
|
87 |
m_rdc = RDCH(new RenderingControl(m_desc, *it));
|
88 |
return m_rdc;
|
88 |
return m_rdc;
|
89 |
}
|
89 |
}
|
90 |
}
|
90 |
}
|
91 |
LOGERR("MediaRenderer::rdc: RenderingControl service not found" << endl);
|
91 |
LOGERR("MediaRenderer::rdc: RenderingControl service not found" << endl);
|
92 |
return m_rdc;
|
92 |
return m_rdc;
|
93 |
}
|
93 |
}
|
94 |
|
94 |
|
95 |
AVTH MediaRenderer::avt()
|
95 |
AVTH MediaRenderer::avt()
|
96 |
{
|
96 |
{
|
97 |
for (auto& entry : m_desc.services) {
|
97 |
for (auto it = m_desc.services.begin(); it != m_desc.services.end(); it++) {
|
98 |
if (AVTransport::isAVTService(entry.serviceType)) {
|
98 |
if (AVTransport::isAVTService(it->serviceType)) {
|
99 |
return m_avt = AVTH(new AVTransport(m_desc, entry));
|
99 |
return m_avt = AVTH(new AVTransport(m_desc, *it));
|
100 |
}
|
100 |
}
|
101 |
}
|
101 |
}
|
102 |
LOGERR("MediaRenderer::avt: AVTransport service not found" << endl);
|
102 |
LOGERR("MediaRenderer::avt: AVTransport service not found" << endl);
|
103 |
return m_avt;
|
103 |
return m_avt;
|
104 |
}
|
104 |
}
|
105 |
|
105 |
|
106 |
OHPRH MediaRenderer::ohpr()
|
106 |
OHPRH MediaRenderer::ohpr()
|
107 |
{
|
107 |
{
|
108 |
for (auto& entry : m_desc.services) {
|
108 |
for (auto it = m_desc.services.begin(); it != m_desc.services.end(); it++) {
|
109 |
if (OHProduct::isOHPrService(entry.serviceType)) {
|
109 |
if (OHProduct::isOHPrService(it->serviceType)) {
|
110 |
return m_ohpr = OHPRH(new OHProduct(m_desc, entry));
|
110 |
return m_ohpr = OHPRH(new OHProduct(m_desc, *it));
|
111 |
}
|
111 |
}
|
112 |
}
|
112 |
}
|
113 |
LOGINF("MediaRenderer::ohpr: OHProduct service not found" << endl);
|
113 |
LOGINF("MediaRenderer::ohpr: OHProduct service not found" << endl);
|
114 |
return m_ohpr;
|
114 |
return m_ohpr;
|
115 |
}
|
115 |
}
|
116 |
|
116 |
|
117 |
OHPLH MediaRenderer::ohpl()
|
117 |
OHPLH MediaRenderer::ohpl()
|
118 |
{
|
118 |
{
|
119 |
for (auto& entry : m_desc.services) {
|
119 |
for (auto it = m_desc.services.begin(); it != m_desc.services.end(); it++) {
|
120 |
if (OHPlaylist::isOHPlService(entry.serviceType)) {
|
120 |
if (OHPlaylist::isOHPlService(it->serviceType)) {
|
121 |
return m_ohpl = OHPLH(new OHPlaylist(m_desc, entry));
|
121 |
return m_ohpl = OHPLH(new OHPlaylist(m_desc, *it));
|
122 |
}
|
122 |
}
|
123 |
}
|
123 |
}
|
124 |
LOGINF("MediaRenderer::ohpl: OHPlaylist service not found" << endl);
|
124 |
LOGINF("MediaRenderer::ohpl: OHPlaylist service not found" << endl);
|
125 |
return m_ohpl;
|
125 |
return m_ohpl;
|
126 |
}
|
126 |
}
|