mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #133, alloc and free rtp port.
This commit is contained in:
parent
d4ceff649f
commit
f14af45413
9 changed files with 183 additions and 38 deletions
|
@ -746,6 +746,18 @@ int SrsRtspStack::do_recv_message(SrsRtspRequest* req)
|
|||
}
|
||||
}
|
||||
|
||||
// for setup, parse the stream id from uri.
|
||||
if (req->is_setup()) {
|
||||
size_t pos = string::npos;
|
||||
if ((pos = req->uri.rfind("/")) != string::npos) {
|
||||
req->stream_id = req->uri.substr(pos + 1);
|
||||
}
|
||||
if ((pos = req->stream_id.find("=")) != string::npos) {
|
||||
req->stream_id = req->stream_id.substr(pos + 1);
|
||||
}
|
||||
srs_info("rtsp: setup stream id=%s", req->stream_id.c_str());
|
||||
}
|
||||
|
||||
// parse rdp body.
|
||||
long consumed = 0;
|
||||
while (consumed < req->content_length) {
|
||||
|
|
|
@ -337,6 +337,7 @@ public:
|
|||
* assumed. It is interpreted according to [H14.14].
|
||||
*/
|
||||
long content_length;
|
||||
|
||||
/**
|
||||
* the sdp in announce, NULL for no sdp.
|
||||
*/
|
||||
|
@ -345,6 +346,10 @@ public:
|
|||
* the transport in setup, NULL for no transport.
|
||||
*/
|
||||
SrsRtspTransport* transport;
|
||||
/**
|
||||
* for setup message, parse the stream id from uri.
|
||||
*/
|
||||
std::string stream_id;
|
||||
public:
|
||||
SrsRtspRequest();
|
||||
virtual ~SrsRtspRequest();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue