mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Refine stream/ssrc/sdp structure
This commit is contained in:
parent
426938cc8a
commit
991672bf41
11 changed files with 2204 additions and 563 deletions
|
|
@ -46,7 +46,7 @@ if (!getline(is,word,delim)) {\
|
|||
return srs_error_new(ERROR_RTC_SDP_DECODE, "fetch with delim failed");\
|
||||
}\
|
||||
|
||||
static std::vector<std::string> split_str(const std::string& str, const std::string& delim)
|
||||
std::vector<std::string> split_str(const std::string& str, const std::string& delim)
|
||||
{
|
||||
std::vector<std::string> ret;
|
||||
size_t pre_pos = 0;
|
||||
|
|
@ -176,6 +176,16 @@ SrsSSRCInfo::SrsSSRCInfo()
|
|||
ssrc_ = 0;
|
||||
}
|
||||
|
||||
SrsSSRCInfo::SrsSSRCInfo(uint32_t ssrc, std::string cname, std::string stream_id, std::string track_id)
|
||||
{
|
||||
ssrc_ = ssrc;
|
||||
cname_ = cname;
|
||||
msid_ = stream_id;
|
||||
msid_tracker_ = track_id;
|
||||
mslabel_ = msid_;
|
||||
label_ = msid_tracker_;
|
||||
}
|
||||
|
||||
SrsSSRCInfo::~SrsSSRCInfo()
|
||||
{
|
||||
}
|
||||
|
|
@ -802,6 +812,13 @@ void SrsSdp::set_ice_pwd(const std::string& pwd)
|
|||
}
|
||||
}
|
||||
|
||||
void SrsSdp::set_dtls_role(const std::string& dtls_role)
|
||||
{
|
||||
for (std::vector<SrsMediaDesc>::iterator iter = media_descs_.begin(); iter != media_descs_.end(); ++iter) {
|
||||
iter->session_info_.setup_ = dtls_role;
|
||||
}
|
||||
}
|
||||
|
||||
void SrsSdp::set_fingerprint_algo(const std::string& algo)
|
||||
{
|
||||
for (std::vector<SrsMediaDesc>::iterator iter = media_descs_.begin(); iter != media_descs_.end(); ++iter) {
|
||||
|
|
@ -849,6 +866,16 @@ std::string SrsSdp::get_ice_pwd() const
|
|||
return "";
|
||||
}
|
||||
|
||||
std::string SrsSdp::get_dtls_role() const
|
||||
{
|
||||
// Becaues we use BUNDLE, so we can choose the first element.
|
||||
for (std::vector<SrsMediaDesc>::const_iterator iter = media_descs_.begin(); iter != media_descs_.end(); ++iter) {
|
||||
return iter->session_info_.setup_;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
srs_error_t SrsSdp::parse_line(const std::string& line)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue