mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 19:16:51 +02: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
|
||||
---------------------------------------
|
||||
|
||||
- Support HTTP HEAD requests with external remuxer
|
||||
- Fixed always using priority 0 for HTTP HEAD requests
|
||||
- Start writer right after creating it
|
||||
- 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):
|
||||
m_ResultBuffer(new cRingBufferLinear(WRITERBUFSIZE, TS_SIZE * 2)),
|
||||
m_ResultBuffer(new cRingBufferLinear(WRITERBUFSIZE)),
|
||||
m_Remux(new cTSExt(m_ResultBuffer, Connection, Channel, Apids, Dpids))
|
||||
{
|
||||
m_ResultBuffer->SetTimeouts(500, 100);
|
||||
|
@ -188,34 +188,40 @@ bool cConnectionHTTP::ProcessRequest(void)
|
||||
&& Respond("");
|
||||
}
|
||||
} else if (it_method->second.compare("HEAD") == 0 && ProcessURI(it_pathinfo->second)) {
|
||||
if (m_ChannelList) {
|
||||
DeferClose();
|
||||
if (m_ChannelList)
|
||||
return Respond("%s", true, m_ChannelList->HttpHeader().c_str());
|
||||
}
|
||||
else if (m_Channel != NULL) {
|
||||
if (ProvidesChannel(m_Channel, StreamdevServerSetup.HTTPPriority)) {
|
||||
if (m_StreamType == stEXT) {
|
||||
// TODO
|
||||
return Respond("HTTP/1.0 200 OK")
|
||||
&& Respond("");
|
||||
m_LiveStreamer = new cStreamdevLiveStreamer(StreamdevServerSetup.HTTPPriority, this);
|
||||
m_LiveStreamer->SetChannel(m_Channel, m_StreamType, m_Apid[0] ? m_Apid : NULL, m_Dpid[0] ? m_Dpid : NULL);
|
||||
return Respond("HTTP/1.0 200 OK");
|
||||
} else if (m_StreamType == stES && (m_Apid[0] || m_Dpid[0] || ISRADIO(m_Channel))) {
|
||||
DeferClose();
|
||||
return Respond("HTTP/1.0 200 OK")
|
||||
&& Respond("Content-Type: audio/mpeg")
|
||||
&& Respond("icy-name: %s", true, m_Channel->Name())
|
||||
&& Respond("");
|
||||
} else if (ISRADIO(m_Channel)) {
|
||||
DeferClose();
|
||||
return Respond("HTTP/1.0 200 OK")
|
||||
&& Respond("Content-Type: audio/mpeg")
|
||||
&& Respond("");
|
||||
} else {
|
||||
DeferClose();
|
||||
return Respond("HTTP/1.0 200 OK")
|
||||
&& Respond("Content-Type: video/mpeg")
|
||||
&& Respond("");
|
||||
}
|
||||
}
|
||||
DeferClose();
|
||||
return Respond("HTTP/1.0 503 Service unavailable")
|
||||
&& Respond("");
|
||||
}
|
||||
else {
|
||||
DeferClose();
|
||||
return Respond("HTTP/1.0 404 not found")
|
||||
&& Respond("");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user