|
a/src/avtransport.cxx |
|
b/src/avtransport.cxx |
|
... |
|
... |
95 |
// If no setnext, fake stopping at each track
|
95 |
// If no setnext, fake stopping at each track
|
96 |
m_dev->m_mpdcli->single(true);
|
96 |
m_dev->m_mpdcli->single(true);
|
97 |
#endif
|
97 |
#endif
|
98 |
}
|
98 |
}
|
99 |
|
99 |
|
|
|
100 |
// AVTransport Errors
|
|
|
101 |
enum AVTErrorCode {
|
|
|
102 |
UPNP_AV_AVT_INVALID_TRANSITION = 701,
|
|
|
103 |
UPNP_AV_AVT_NO_CONTENTS = 702,
|
|
|
104 |
UPNP_AV_AVT_READ_ERROR = 703,
|
|
|
105 |
UPNP_AV_AVT_UNSUPPORTED_PLAY_FORMAT = 704,
|
|
|
106 |
UPNP_AV_AVT_TRANSPORT_LOCKED = 705,
|
|
|
107 |
UPNP_AV_AVT_WRITE_ERROR = 706,
|
|
|
108 |
UPNP_AV_AVT_PROTECTED_MEDIA = 707,
|
|
|
109 |
UPNP_AV_AVT_UNSUPPORTED_REC_FORMAT = 708,
|
|
|
110 |
UPNP_AV_AVT_FULL_MEDIA = 709,
|
|
|
111 |
UPNP_AV_AVT_UNSUPPORTED_SEEK_MODE = 710,
|
|
|
112 |
UPNP_AV_AVT_ILLEGAL_SEEK_TARGET = 711,
|
|
|
113 |
UPNP_AV_AVT_UNSUPPORTED_PLAY_MODE = 712,
|
|
|
114 |
UPNP_AV_AVT_UNSUPPORTED_REC_QUALITY = 713,
|
|
|
115 |
UPNP_AV_AVT_ILLEGAL_MIME = 714,
|
|
|
116 |
UPNP_AV_AVT_CONTENT_BUSY = 715,
|
|
|
117 |
UPNP_AV_AVT_RESOURCE_NOT_FOUND = 716,
|
|
|
118 |
UPNP_AV_AVT_UNSUPPORTED_PLAY_SPEED = 717,
|
|
|
119 |
UPNP_AV_AVT_INVALID_INSTANCE_ID = 718,
|
|
|
120 |
};
|
|
|
121 |
|
|
|
122 |
const std::string UpMpdAVTransport::serviceErrString(int error) const
|
|
|
123 |
{
|
|
|
124 |
switch(error) {
|
|
|
125 |
case UPNP_AV_AVT_INVALID_TRANSITION:
|
|
|
126 |
return "AVTransport Invalid Transition";
|
|
|
127 |
case UPNP_AV_AVT_NO_CONTENTS: return "AVTransport No Contents";
|
|
|
128 |
case UPNP_AV_AVT_READ_ERROR: return "AVTransport Read Error";
|
|
|
129 |
case UPNP_AV_AVT_UNSUPPORTED_PLAY_FORMAT:
|
|
|
130 |
return "AVTransport Unsupported Play Format";
|
|
|
131 |
case UPNP_AV_AVT_TRANSPORT_LOCKED: return "AVTransport Transport Locked";
|
|
|
132 |
case UPNP_AV_AVT_WRITE_ERROR: return "AVTransport Write Error";
|
|
|
133 |
case UPNP_AV_AVT_PROTECTED_MEDIA: return "AVTransport Protected Media";
|
|
|
134 |
case UPNP_AV_AVT_UNSUPPORTED_REC_FORMAT:
|
|
|
135 |
return "AVTransport Unsupported Rec Format";
|
|
|
136 |
case UPNP_AV_AVT_FULL_MEDIA: return "AVTransport Full Media";
|
|
|
137 |
case UPNP_AV_AVT_UNSUPPORTED_SEEK_MODE:
|
|
|
138 |
return "AVTransport Unsupported Seek Mode";
|
|
|
139 |
case UPNP_AV_AVT_ILLEGAL_SEEK_TARGET:
|
|
|
140 |
return "AVTransport Illegal Seek Target";
|
|
|
141 |
case UPNP_AV_AVT_UNSUPPORTED_PLAY_MODE:
|
|
|
142 |
return "AVTransport Unsupported Play Mode";
|
|
|
143 |
case UPNP_AV_AVT_UNSUPPORTED_REC_QUALITY:
|
|
|
144 |
return "AVTransport Unsupported Rec Quality";
|
|
|
145 |
case UPNP_AV_AVT_ILLEGAL_MIME: return "AVTransport Illegal Mime";
|
|
|
146 |
case UPNP_AV_AVT_CONTENT_BUSY: return "AVTransport Content Busy";
|
|
|
147 |
case UPNP_AV_AVT_RESOURCE_NOT_FOUND:
|
|
|
148 |
return "AVTransport Resource Not Found";
|
|
|
149 |
case UPNP_AV_AVT_UNSUPPORTED_PLAY_SPEED:
|
|
|
150 |
return "AVTransport Unsupported Play Speed";
|
|
|
151 |
case UPNP_AV_AVT_INVALID_INSTANCE_ID:
|
|
|
152 |
return "AVTransport Invalid Instance Id";
|
|
|
153 |
default:
|
|
|
154 |
return "AVTRansport Unknown Error";
|
|
|
155 |
}
|
|
|
156 |
}
|
|
|
157 |
|
100 |
// Translate MPD mode flags to UPnP Play mode
|
158 |
// Translate MPD mode flags to UPnP Play mode
|
101 |
static string mpdsToPlaymode(const MpdStatus& mpds)
|
159 |
static string mpdsToPlaymode(const MpdStatus& mpds)
|
102 |
{
|
160 |
{
|
103 |
string playmode = "NORMAL";
|
161 |
string playmode = "NORMAL";
|
104 |
if (!mpds.rept && mpds.random && !mpds.single)
|
162 |
if (!mpds.rept && mpds.random && !mpds.single)
|
|
... |
|
... |
330 |
const MpdStatus::State st = mpds.state;
|
388 |
const MpdStatus::State st = mpds.state;
|
331 |
|
389 |
|
332 |
// Check that we support the audio format for the input uri.
|
390 |
// Check that we support the audio format for the input uri.
|
333 |
UpSong metaformpd;
|
391 |
UpSong metaformpd;
|
334 |
if (!m_dev->checkContentFormat(uri, metadata, &metaformpd)) {
|
392 |
if (!m_dev->checkContentFormat(uri, metadata, &metaformpd)) {
|
335 |
LOGERR("set(Next)AVTRansportURI: unsupported format: uri " << uri <<
|
393 |
LOGERR("set(Next)AVTransportURI: unsupported format: uri " << uri <<
|
336 |
" metadata " << metadata);
|
394 |
" metadata " << metadata);
|
337 |
return UPNP_E_INVALID_PARAM;
|
395 |
return UPNP_E_INVALID_PARAM;
|
338 |
}
|
396 |
}
|
339 |
|
397 |
|
340 |
if ((m_dev->m_options & UpMpd::upmpdOwnQueue) && !setnext) {
|
398 |
if ((m_dev->m_options & UpMpd::upmpdOwnQueue) && !setnext) {
|