mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #133, finish rtsp sdp, start rtp.
This commit is contained in:
parent
f14af45413
commit
45c0b12958
3 changed files with 48 additions and 3 deletions
|
@ -486,6 +486,11 @@ bool SrsRtspRequest::is_setup()
|
|||
return method == __SRS_METHOD_SETUP;
|
||||
}
|
||||
|
||||
bool SrsRtspRequest::is_record()
|
||||
{
|
||||
return method == __SRS_METHOD_RECORD;
|
||||
}
|
||||
|
||||
SrsRtspResponse::SrsRtspResponse(int cseq)
|
||||
{
|
||||
seq = cseq;
|
||||
|
@ -513,6 +518,11 @@ int SrsRtspResponse::encode(stringstream& ss)
|
|||
<< "Pragma: no-cache" << __SRS_RTSP_CRLF
|
||||
<< "Server: " << RTMP_SIG_SRS_SERVER << __SRS_RTSP_CRLF;
|
||||
|
||||
// session if specified.
|
||||
if (!session.empty()) {
|
||||
ss << __SRS_TOKEN_SESSION << ":" << session << __SRS_RTSP_CRLF;
|
||||
}
|
||||
|
||||
if ((ret = encode_header(ss)) != ERROR_SUCCESS) {
|
||||
srs_error("rtsp: encode header failed. ret=%d", ret);
|
||||
return ret;
|
||||
|
@ -730,6 +740,13 @@ int SrsRtspStack::do_recv_message(SrsRtspRequest* req)
|
|||
srs_error("rtsp: parse transport failed, transport=%s. ret=%d", transport.c_str(), ret);
|
||||
return ret;
|
||||
}
|
||||
} else if (token == __SRS_TOKEN_SESSION) {
|
||||
if ((ret = recv_token_eof(req->session)) != ERROR_SUCCESS) {
|
||||
if (!srs_is_client_gracefully_close(ret)) {
|
||||
srs_error("rtsp: parse %s failed. ret=%d", __SRS_TOKEN_SESSION, ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
// unknown header name, parse util EOF.
|
||||
SrsRtspTokenState state = SrsRtspTokenStateNormal;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue