MCPcopy Create free account
hub / github.com/Barracuda09/SATPI / methodSetup

Method methodSetup

src/RtspServer.cpp:56–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void RtspServer::methodSetup(Stream &stream, int clientID, std::string &htmlBody) {
57 StreamClient &client = stream.getStreamClient(clientID);
58 switch (stream.getStreamingType()) {
59 case Stream::StreamingType::RTP_TCP: {
60 static const char *RTSP_SETUP_OK =
61 "RTSP/1.0 200 OK\r\n" \
62 "CSeq: %1\r\n" \
63 "Session: %2;timeout=%3\r\n" \
64 "Transport: RTP/AVP/TCP;unicast;client_ip=%4;interleaved=0-1\r\n" \
65 "com.ses.streamID: %5\r\n" \
66 "\r\n";
67
68 // setup reply
69 htmlBody = StringConverter::stringFormat(RTSP_SETUP_OK,
70 client.getCSeq(),
71 client.getSessionID(),
72 client.getSessionTimeout(),
73 client.getIPAddressOfStream(),
74 stream.getStreamID());
75 break;
76 }
77 case Stream::StreamingType::RTSP_UNICAST: {
78 static const char *RTSP_SETUP_OK =
79 "RTSP/1.0 200 OK\r\n" \
80 "CSeq: %1\r\n" \
81 "Session: %2;timeout=%3\r\n" \
82 "Transport: RTP/AVP;unicast;client_ip=%4;client_port=%5-%6\r\n" \
83 "com.ses.streamID: %7\r\n" \
84 "\r\n";
85
86 // setup reply
87 htmlBody = StringConverter::stringFormat(RTSP_SETUP_OK,
88 client.getCSeq(),
89 client.getSessionID(),
90 client.getSessionTimeout(),
91 client.getIPAddressOfStream(),
92 client.getRtpSocketAttr().getSocketPort(),
93 client.getRtcpSocketAttr().getSocketPort(),
94 stream.getStreamID());
95 break;
96 }
97 case Stream::StreamingType::RTSP_MULTICAST: {
98 static const char *RTSP_SETUP_OK =
99 "RTSP/1.0 200 OK\r\n" \
100 "CSeq: %1\r\n" \
101 "Session: %2;timeout=%3\r\n" \
102 "Transport: RTP/AVP;multicast;destination=%4;port=%5-%6;ttl=5\r\n" \
103 "com.ses.streamID: %7\r\n" \
104 "\r\n";
105
106 // setup reply
107 htmlBody = StringConverter::stringFormat(RTSP_SETUP_OK,
108 client.getCSeq(),
109 client.getSessionID(),
110 client.getSessionTimeout(),
111 client.getIPAddressOfStream(),
112 client.getRtpSocketAttr().getSocketPort(),
113 client.getRtcpSocketAttr().getSocketPort(),

Callers

nothing calls this directly

Calls 7

getStreamingTypeMethod · 0.80
getCSeqMethod · 0.80
getSessionIDMethod · 0.80
getSessionTimeoutMethod · 0.80
getIPAddressOfStreamMethod · 0.80
getSocketPortMethod · 0.80
getStreamIDMethod · 0.45

Tested by

no test coverage detected