mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 17:16:51 +00:00
Support HTTP HEAD requests with external remuxer
This commit is contained in:
parent
e7bcc9349c
commit
be9da74958
1
HISTORY
1
HISTORY
@ -1,6 +1,7 @@
|
|||||||
VDR Plugin 'streamdev' Revision History
|
VDR Plugin 'streamdev' Revision History
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
- Support HTTP HEAD requests with external remuxer
|
||||||
- Fixed always using priority 0 for HTTP HEAD requests
|
- Fixed always using priority 0 for HTTP HEAD requests
|
||||||
- Start writer right after creating it
|
- Start writer right after creating it
|
||||||
- Corrected typos (thanks to Ville Skyttä)
|
- Corrected typos (thanks to Ville Skyttä)
|
||||||
|
@ -295,7 +295,7 @@ void cTSExt::Put(const uchar *Data, int Count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cExternRemux::cExternRemux(const cServerConnection *Connection, const cChannel *Channel, const int *Apids, const int *Dpids):
|
cExternRemux::cExternRemux(const cServerConnection *Connection, const cChannel *Channel, const int *Apids, const int *Dpids):
|
||||||
m_ResultBuffer(new cRingBufferLinear(WRITERBUFSIZE, TS_SIZE * 2)),
|
m_ResultBuffer(new cRingBufferLinear(WRITERBUFSIZE)),
|
||||||
m_Remux(new cTSExt(m_ResultBuffer, Connection, Channel, Apids, Dpids))
|
m_Remux(new cTSExt(m_ResultBuffer, Connection, Channel, Apids, Dpids))
|
||||||
{
|
{
|
||||||
m_ResultBuffer->SetTimeouts(500, 100);
|
m_ResultBuffer->SetTimeouts(500, 100);
|
||||||
|
@ -188,34 +188,40 @@ bool cConnectionHTTP::ProcessRequest(void)
|
|||||||
&& Respond("");
|
&& Respond("");
|
||||||
}
|
}
|
||||||
} else if (it_method->second.compare("HEAD") == 0 && ProcessURI(it_pathinfo->second)) {
|
} else if (it_method->second.compare("HEAD") == 0 && ProcessURI(it_pathinfo->second)) {
|
||||||
DeferClose();
|
if (m_ChannelList) {
|
||||||
if (m_ChannelList)
|
DeferClose();
|
||||||
return Respond("%s", true, m_ChannelList->HttpHeader().c_str());
|
return Respond("%s", true, m_ChannelList->HttpHeader().c_str());
|
||||||
|
}
|
||||||
else if (m_Channel != NULL) {
|
else if (m_Channel != NULL) {
|
||||||
if (ProvidesChannel(m_Channel, StreamdevServerSetup.HTTPPriority)) {
|
if (ProvidesChannel(m_Channel, StreamdevServerSetup.HTTPPriority)) {
|
||||||
if (m_StreamType == stEXT) {
|
if (m_StreamType == stEXT) {
|
||||||
// TODO
|
m_LiveStreamer = new cStreamdevLiveStreamer(StreamdevServerSetup.HTTPPriority, this);
|
||||||
return Respond("HTTP/1.0 200 OK")
|
m_LiveStreamer->SetChannel(m_Channel, m_StreamType, m_Apid[0] ? m_Apid : NULL, m_Dpid[0] ? m_Dpid : NULL);
|
||||||
&& Respond("");
|
return Respond("HTTP/1.0 200 OK");
|
||||||
} else if (m_StreamType == stES && (m_Apid[0] || m_Dpid[0] || ISRADIO(m_Channel))) {
|
} else if (m_StreamType == stES && (m_Apid[0] || m_Dpid[0] || ISRADIO(m_Channel))) {
|
||||||
|
DeferClose();
|
||||||
return Respond("HTTP/1.0 200 OK")
|
return Respond("HTTP/1.0 200 OK")
|
||||||
&& Respond("Content-Type: audio/mpeg")
|
&& Respond("Content-Type: audio/mpeg")
|
||||||
&& Respond("icy-name: %s", true, m_Channel->Name())
|
&& Respond("icy-name: %s", true, m_Channel->Name())
|
||||||
&& Respond("");
|
&& Respond("");
|
||||||
} else if (ISRADIO(m_Channel)) {
|
} else if (ISRADIO(m_Channel)) {
|
||||||
|
DeferClose();
|
||||||
return Respond("HTTP/1.0 200 OK")
|
return Respond("HTTP/1.0 200 OK")
|
||||||
&& Respond("Content-Type: audio/mpeg")
|
&& Respond("Content-Type: audio/mpeg")
|
||||||
&& Respond("");
|
&& Respond("");
|
||||||
} else {
|
} else {
|
||||||
|
DeferClose();
|
||||||
return Respond("HTTP/1.0 200 OK")
|
return Respond("HTTP/1.0 200 OK")
|
||||||
&& Respond("Content-Type: video/mpeg")
|
&& Respond("Content-Type: video/mpeg")
|
||||||
&& Respond("");
|
&& Respond("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DeferClose();
|
||||||
return Respond("HTTP/1.0 503 Service unavailable")
|
return Respond("HTTP/1.0 503 Service unavailable")
|
||||||
&& Respond("");
|
&& Respond("");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
DeferClose();
|
||||||
return Respond("HTTP/1.0 404 not found")
|
return Respond("HTTP/1.0 404 not found")
|
||||||
&& Respond("");
|
&& Respond("");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user