@@ -47,7 +47,8 @@ std::string micro_rtsp_requests::handle_options(unsigned long cseq)
4747 << " CSeq: " << cseq << " \r\n "
4848 << std::put_time (std::gmtime (&now), " Date: %a, %b %d %Y %H:%M:%S GMT" ) << " \r\n "
4949 << " Content-Length: 0\r\n "
50- << " Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE" ;
50+ << " Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE\r\n "
51+ << " \r\n " ;
5152 return oss.str ();
5253}
5354
@@ -85,7 +86,7 @@ std::string micro_rtsp_requests::handle_describe(unsigned long cseq, const std::
8586 oss << " RTSP/1.0 200 OK\r\n "
8687 << " CSeq: " << cseq << " \r\n "
8788 << std::put_time (std::gmtime (&now), " Date: %a, %b %d %Y %H:%M:%S GMT" ) << " \r\n "
88- << " Content-Base: rtsp://" << host << " :" << port << path << " \r\n "
89+ << " Content-Base: rtsp://" << host << " :" << port << path << " / " << " \r\n "
8990 << " Content-Type: application/sdp\r\n "
9091 << " Content-Length: " << body.size () << " \r\n "
9192 << " \r\n "
@@ -118,15 +119,15 @@ std::string micro_rtsp_requests::handle_setup(unsigned long cseq, const std::map
118119 if (tcp_transport_)
119120 ostransport << " RTP/AVP/TCP;unicast;interleaved=0-1" ;
120121 else
121- ostransport << " RTP/AVP;unicast;destination=127.0.0.1;source=127.0.0.1;client_port=" << start_client_port_ << " -" << end_client_port_ + 1 << " ;server_port=" << rtp_streamer_port_ << " -" << rtcp_streamer_port_;
122+ ostransport << " RTP/AVP;unicast;destination=127.0.0.1;source=127.0.0.1;client_port=" << start_client_port_ << " -" << end_client_port_ + 1 << " ;server_port=" << rtp_streamer_port_ << " -" << rtp_streamer_port_ /* rtcp_streamer_port_*/ ;
122123
123124 auto now = time (nullptr );
124125 std::ostringstream oss;
125126 oss << " RTSP/1.0 200 OK\r\n "
126127 << " CSeq: " << cseq << " \r\n "
127128 << std::put_time (std::gmtime (&now), " Date: %a, %b %d %Y %H:%M:%S GMT" ) << " \r\n "
128129 << " Transport: " << ostransport.str () << " \r\n "
129- << " Session: " << rtsp_session_id_;
130+ << " Session: " << rtsp_session_id_<< " \r\n " ;
130131 return oss.str ();
131132}
132133
@@ -144,7 +145,7 @@ std::string micro_rtsp_requests::handle_play(unsigned long cseq)
144145 << " Range: npt=0.000-\r\n "
145146 << " Session: " << rtsp_session_id_ << " \r\n "
146147 << " RTP-Info: url=rtsp://127.0.0.1:8554" << available_stream_name_ << " /track1" << " \r\n "
147- << " \r\n " ;
148+ << " \r\n " ;
148149 return oss.str ();
149150}
150151
@@ -158,7 +159,8 @@ std::string micro_rtsp_requests::handle_teardown(unsigned long cseq)
158159 std::ostringstream oss;
159160 oss << " RTSP/1.0 200 OK\r\n "
160161 << " CSeq: " << cseq << " \r\n "
161- << std::put_time (std::gmtime (&now), " Date: %a, %b %d %Y %H:%M:%S GMT" ) << " \r\n " ;
162+ << std::put_time (std::gmtime (&now), " Date: %a, %b %d %Y %H:%M:%S GMT" ) << " \r\n "
163+ << " \r\n " ;
162164 return oss.str ();
163165}
164166
@@ -185,8 +187,8 @@ std::string micro_rtsp_requests::process_request(const std::string &request)
185187 {
186188 if ((pos = line.find (' :' )) != std::string::npos)
187189 headers[line.substr (0 , pos)] = line.substr (pos + 1 );
188- else
189- log_e (" No : found for header: %s" , line.c_str ());
190+ // else
191+ // log_e("No : found for header: %s", line.c_str());
190192 }
191193
192194 log_i (" request_line: %s" , request_line.c_str ());
0 commit comments