mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Added a multicast mode for the RTSP setup.
This commit is contained in:
parent
f884b23f7c
commit
29eaf994f8
15
rtsp.c
15
rtsp.c
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
cSatipRtsp::cSatipRtsp(cSatipTunerIf &tunerP)
|
cSatipRtsp::cSatipRtsp(cSatipTunerIf &tunerP)
|
||||||
: tunerM(tunerP),
|
: tunerM(tunerP),
|
||||||
|
modeM(cmUnicast),
|
||||||
handleM(NULL),
|
handleM(NULL),
|
||||||
headerListM(NULL)
|
headerListM(NULL)
|
||||||
{
|
{
|
||||||
@ -191,10 +192,22 @@ bool cSatipRtsp::Setup(const char *uriP, int rtpPortP, int rtcpPortP)
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
if (handleM && !isempty(uriP)) {
|
if (handleM && !isempty(uriP)) {
|
||||||
|
cString transport;
|
||||||
long rc = 0;
|
long rc = 0;
|
||||||
cTimeMs processing(0);
|
cTimeMs processing(0);
|
||||||
CURLcode res = CURLE_OK;
|
CURLcode res = CURLE_OK;
|
||||||
cString transport = cString::sprintf("RTP/AVP;unicast;client_port=%d-%d", rtpPortP, rtcpPortP);
|
|
||||||
|
switch (modeM) {
|
||||||
|
case cmMulticast:
|
||||||
|
// RTP/AVP;multicast;destination=<IP multicast address>;port=<RTP port>-<RTCP port>;ttl=<ttl>
|
||||||
|
transport = cString::sprintf("RTP/AVP;multicast;port=%d-%d", rtpPortP, rtcpPortP);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case cmUnicast:
|
||||||
|
// RTP/AVP;unicast;client_port=<client RTP port>-<client RTCP port>
|
||||||
|
transport = cString::sprintf("RTP/AVP;unicast;client_port=%d-%d", rtpPortP, rtcpPortP);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Setup media stream
|
// Setup media stream
|
||||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, uriP);
|
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, uriP);
|
||||||
|
2
rtsp.h
2
rtsp.h
@ -26,8 +26,10 @@ private:
|
|||||||
enum {
|
enum {
|
||||||
eConnectTimeoutMs = 1500, // in milliseconds
|
eConnectTimeoutMs = 1500, // in milliseconds
|
||||||
};
|
};
|
||||||
|
enum eCommunicationMode { cmUnicast, cmMulticast };
|
||||||
|
|
||||||
cSatipTunerIf &tunerM;
|
cSatipTunerIf &tunerM;
|
||||||
|
eCommunicationMode modeM;
|
||||||
CURL *handleM;
|
CURL *handleM;
|
||||||
struct curl_slist *headerListM;
|
struct curl_slist *headerListM;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user