mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Fix RTP over TCP with a nasty hack.
This commit is contained in:
parent
8130a4b4e5
commit
98ecd22a27
22
rtsp.c
22
rtsp.c
@ -206,6 +206,28 @@ bool cSatipRtsp::SetInterface(const char *bindAddrP)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cSatipRtsp::Receive(const char *uriP)
|
||||||
|
{
|
||||||
|
debug1("%s (%s) [device %d]", __PRETTY_FUNCTION__, uriP, tunerM.GetId());
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
if (handleM && !isempty(uriP) && modeM == cSatipConfig::eTransportModeRtpOverTcp) {
|
||||||
|
long rc = 0;
|
||||||
|
cTimeMs processing(0);
|
||||||
|
CURLcode res = CURLE_OK;
|
||||||
|
|
||||||
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_URL, uriP);
|
||||||
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, uriP);
|
||||||
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS); // FIXME: this really should be CURL_RTSPREQ_RECEIVE, but getting timeout errors
|
||||||
|
SATIP_CURL_EASY_PERFORM(handleM);
|
||||||
|
|
||||||
|
result = ValidateLatestResponse(&rc);
|
||||||
|
debug5("%s (%s) Response %ld in %" PRIu64 " ms [device %d]", __PRETTY_FUNCTION__, uriP, rc, processing.Elapsed(), tunerM.GetId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
bool cSatipRtsp::Options(const char *uriP)
|
bool cSatipRtsp::Options(const char *uriP)
|
||||||
{
|
{
|
||||||
debug1("%s (%s) [device %d]", __PRETTY_FUNCTION__, uriP, tunerM.GetId());
|
debug1("%s (%s) [device %d]", __PRETTY_FUNCTION__, uriP, tunerM.GetId());
|
||||||
|
1
rtsp.h
1
rtsp.h
@ -59,6 +59,7 @@ public:
|
|||||||
cString RtspUnescapeString(const char *strP);
|
cString RtspUnescapeString(const char *strP);
|
||||||
void Reset(void);
|
void Reset(void);
|
||||||
bool SetInterface(const char *bindAddrP);
|
bool SetInterface(const char *bindAddrP);
|
||||||
|
bool Receive(const char *uriP);
|
||||||
bool Options(const char *uriP);
|
bool Options(const char *uriP);
|
||||||
bool Setup(const char *uriP, int rtpPortP, int rtcpPortP, bool useTcpP);
|
bool Setup(const char *uriP, int rtpPortP, int rtcpPortP, bool useTcpP);
|
||||||
bool SetSession(const char *sessionP);
|
bool SetSession(const char *sessionP);
|
||||||
|
14
tuner.c
14
tuner.c
@ -175,6 +175,7 @@ void cSatipTuner::Action(void)
|
|||||||
idleCheck.Set(eIdleCheckTimeoutMs);
|
idleCheck.Set(eIdleCheckTimeoutMs);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Receive();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error("Unknown tuner status %d [device %d]", currentStateM, deviceIdM);
|
error("Unknown tuner status %d [device %d]", currentStateM, deviceIdM);
|
||||||
@ -544,6 +545,19 @@ bool cSatipTuner::UpdatePids(bool forceP)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cSatipTuner::Receive(void)
|
||||||
|
{
|
||||||
|
debug16("%s tunerState=%s [device %d]", __PRETTY_FUNCTION__, TunerStateString(currentStateM), deviceIdM);
|
||||||
|
cMutexLock MutexLock(&mutexM);
|
||||||
|
if (!isempty(*streamAddrM)) {
|
||||||
|
cString uri = GetBaseUrl(*streamAddrM, streamPortM);
|
||||||
|
if (!rtspM.Receive(*uri))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool cSatipTuner::KeepAlive(bool forceP)
|
bool cSatipTuner::KeepAlive(bool forceP)
|
||||||
{
|
{
|
||||||
debug16("%s (%d) tunerState=%s [device %d]", __PRETTY_FUNCTION__, forceP, TunerStateString(currentStateM), deviceIdM);
|
debug16("%s (%d) tunerState=%s [device %d]", __PRETTY_FUNCTION__, forceP, TunerStateString(currentStateM), deviceIdM);
|
||||||
|
1
tuner.h
1
tuner.h
@ -128,6 +128,7 @@ private:
|
|||||||
|
|
||||||
bool Connect(void);
|
bool Connect(void);
|
||||||
bool Disconnect(void);
|
bool Disconnect(void);
|
||||||
|
bool Receive(void);
|
||||||
bool KeepAlive(bool forceP = false);
|
bool KeepAlive(bool forceP = false);
|
||||||
bool ReadReceptionStatus(bool forceP = false);
|
bool ReadReceptionStatus(bool forceP = false);
|
||||||
bool UpdatePids(bool forceP = false);
|
bool UpdatePids(bool forceP = false);
|
||||||
|
Loading…
Reference in New Issue
Block a user