mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Removed unnecessary PLAY commands and header callbacks.
This commit is contained in:
parent
276370afbb
commit
5ff54d27a3
3
HISTORY
3
HISTORY
@ -43,3 +43,6 @@ VDR Plugin 'satip' Revision History
|
|||||||
2014-04-12: Version 0.2.3
|
2014-04-12: Version 0.2.3
|
||||||
|
|
||||||
- Added Spanish translation (Thanks to Gabriel Bonich).
|
- Added Spanish translation (Thanks to Gabriel Bonich).
|
||||||
|
- Fixed parameters of the OPTIONS command.
|
||||||
|
- Added a device identication into the user agent string.
|
||||||
|
- Removed unnecessary PLAY commands and header callbacks.
|
||||||
|
2
device.c
2
device.c
@ -184,7 +184,7 @@ int cSatipDevice::SignalQuality(void) const
|
|||||||
|
|
||||||
bool cSatipDevice::ProvidesSource(int sourceP) const
|
bool cSatipDevice::ProvidesSource(int sourceP) const
|
||||||
{
|
{
|
||||||
debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
|
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
|
||||||
return (!SatipConfig.IsOperatingModeOff() && !!cSatipDiscover::GetInstance()->GetServer(sourceP));
|
return (!SatipConfig.IsOperatingModeOff() && !!cSatipDiscover::GetInstance()->GetServer(sourceP));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
33
tuner.c
33
tuner.c
@ -191,11 +191,6 @@ bool cSatipTuner::Connect(void)
|
|||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_VERBOSE, 1L);
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_VERBOSE, 1L);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Set callback
|
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_HEADERFUNCTION, cSatipTuner::HeaderCallback);
|
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_WRITEHEADER, this);
|
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_WRITEDATA, this);
|
|
||||||
|
|
||||||
// No progress meter and no signaling
|
// No progress meter and no signaling
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_NOPROGRESS, 1L);
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_NOPROGRESS, 1L);
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_NOSIGNAL, 1L);
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_NOSIGNAL, 1L);
|
||||||
@ -229,7 +224,6 @@ bool cSatipTuner::Connect(void)
|
|||||||
|
|
||||||
// Request server options
|
// Request server options
|
||||||
keepAliveM.Set(timeoutM);
|
keepAliveM.Set(timeoutM);
|
||||||
uri = cString::sprintf("rtsp://%s/", *streamAddrM);
|
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri);
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri);
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS);
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS);
|
||||||
SATIP_CURL_EASY_PERFORM(handleM);
|
SATIP_CURL_EASY_PERFORM(handleM);
|
||||||
@ -237,23 +231,33 @@ bool cSatipTuner::Connect(void)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Setup media stream: "&pids=all" for the whole mux
|
// Setup media stream: "&pids=all" for the whole mux
|
||||||
uri = cString::sprintf("rtsp://%s/?%s&pids=0", *streamAddrM, *streamParamM);
|
uri = cString::sprintf("rtsp://%s/?%s", *streamAddrM, *streamParamM);
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri);
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri);
|
||||||
transport = cString::sprintf("RTP/AVP;unicast;client_port=%d-%d", rtpSocketM->Port(), rtcpSocketM->Port());
|
transport = cString::sprintf("RTP/AVP;unicast;client_port=%d-%d", rtpSocketM->Port(), rtcpSocketM->Port());
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_TRANSPORT, *transport);
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_TRANSPORT, *transport);
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_SETUP);
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_SETUP);
|
||||||
|
// Set header callback for catching the session and timeout
|
||||||
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_HEADERFUNCTION, cSatipTuner::HeaderCallback);
|
||||||
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_WRITEHEADER, this);
|
||||||
SATIP_CURL_EASY_PERFORM(handleM);
|
SATIP_CURL_EASY_PERFORM(handleM);
|
||||||
|
// Session id is now known - disable header parsing
|
||||||
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_HEADERFUNCTION, NULL);
|
||||||
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_WRITEHEADER, NULL);
|
||||||
|
//SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_SESSION_ID, *sessionM);
|
||||||
if (!ValidateLatestResponse())
|
if (!ValidateLatestResponse())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Start playing
|
// Start playing
|
||||||
uri = cString::sprintf("rtsp://%s/stream=%d", *streamAddrM, streamIdM);
|
if (pidsM.Size()) {
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri);
|
uri = cString::sprintf("rtsp://%s/stream=%d?pids=", *streamAddrM, streamIdM);
|
||||||
//SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_SESSION_ID, *sessionM);
|
for (int i = 0; i < pidsM.Size(); ++i)
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_PLAY);
|
uri = cString::sprintf("%s%d%s", *uri, pidsM[i], (i == (pidsM.Size() - 1)) ? "" : ",");
|
||||||
SATIP_CURL_EASY_PERFORM(handleM);
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri);
|
||||||
if (!ValidateLatestResponse())
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_PLAY);
|
||||||
return false;
|
SATIP_CURL_EASY_PERFORM(handleM);
|
||||||
|
if (!ValidateLatestResponse())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
tunedM = true;
|
tunedM = true;
|
||||||
if (nextServerM) {
|
if (nextServerM) {
|
||||||
@ -307,6 +311,7 @@ bool cSatipTuner::Disconnect(void)
|
|||||||
cSatipDiscover::GetInstance()->UseServer(currentServerM, false);
|
cSatipDiscover::GetInstance()->UseServer(currentServerM, false);
|
||||||
tunedM = false;
|
tunedM = false;
|
||||||
timeoutM = eMinKeepAliveIntervalMs;
|
timeoutM = eMinKeepAliveIntervalMs;
|
||||||
|
pidUpdatedM = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user