mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge cf1fae1dca
into 93cba246bc
This commit is contained in:
commit
b39389ade4
2 changed files with 10 additions and 8 deletions
|
@ -3274,17 +3274,17 @@ srs_error_t SrsRtcConnection::generate_play_local_sdp(SrsRequest* req, SrsSdp& l
|
||||||
std::string cname = srs_random_str(16);
|
std::string cname = srs_random_str(16);
|
||||||
|
|
||||||
if (audio_before_video) {
|
if (audio_before_video) {
|
||||||
if ((err = generate_play_local_sdp_for_audio(local_sdp, stream_desc, cname)) != srs_success) {
|
if ((err = generate_play_local_sdp_for_audio(local_sdp, stream_desc, cname, stream_id)) != srs_success) {
|
||||||
return srs_error_wrap(err, "audio");
|
return srs_error_wrap(err, "audio");
|
||||||
}
|
}
|
||||||
if ((err = generate_play_local_sdp_for_video(local_sdp, stream_desc, unified_plan, cname)) != srs_success) {
|
if ((err = generate_play_local_sdp_for_video(local_sdp, stream_desc, unified_plan, cname, stream_id)) != srs_success) {
|
||||||
return srs_error_wrap(err, "video");
|
return srs_error_wrap(err, "video");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((err = generate_play_local_sdp_for_video(local_sdp, stream_desc, unified_plan, cname)) != srs_success) {
|
if ((err = generate_play_local_sdp_for_video(local_sdp, stream_desc, unified_plan, cname, stream_id)) != srs_success) {
|
||||||
return srs_error_wrap(err, "video");
|
return srs_error_wrap(err, "video");
|
||||||
}
|
}
|
||||||
if ((err = generate_play_local_sdp_for_audio(local_sdp, stream_desc, cname)) != srs_success) {
|
if ((err = generate_play_local_sdp_for_audio(local_sdp, stream_desc, cname, stream_id)) != srs_success) {
|
||||||
return srs_error_wrap(err, "audio");
|
return srs_error_wrap(err, "audio");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3292,13 +3292,14 @@ srs_error_t SrsRtcConnection::generate_play_local_sdp(SrsRequest* req, SrsSdp& l
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsRtcConnection::generate_play_local_sdp_for_audio(SrsSdp& local_sdp, SrsRtcSourceDescription* stream_desc, std::string cname)
|
srs_error_t SrsRtcConnection::generate_play_local_sdp_for_audio(SrsSdp& local_sdp, SrsRtcSourceDescription* stream_desc, std::string cname, std::string stream_id)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
// generate audio media desc
|
// generate audio media desc
|
||||||
if (stream_desc->audio_track_desc_) {
|
if (stream_desc->audio_track_desc_) {
|
||||||
SrsRtcTrackDescription* audio_track = stream_desc->audio_track_desc_;
|
SrsRtcTrackDescription* audio_track = stream_desc->audio_track_desc_;
|
||||||
|
audio_track->msid_ = stream_id;
|
||||||
|
|
||||||
local_sdp.media_descs_.push_back(SrsMediaDesc("audio"));
|
local_sdp.media_descs_.push_back(SrsMediaDesc("audio"));
|
||||||
SrsMediaDesc& local_media_desc = local_sdp.media_descs_.back();
|
SrsMediaDesc& local_media_desc = local_sdp.media_descs_.back();
|
||||||
|
@ -3358,12 +3359,13 @@ srs_error_t SrsRtcConnection::generate_play_local_sdp_for_audio(SrsSdp& local_sd
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsRtcConnection::generate_play_local_sdp_for_video(SrsSdp& local_sdp, SrsRtcSourceDescription* stream_desc, bool unified_plan, std::string cname)
|
srs_error_t SrsRtcConnection::generate_play_local_sdp_for_video(SrsSdp& local_sdp, SrsRtcSourceDescription* stream_desc, bool unified_plan, std::string cname, std::string stream_id)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
for (int i = 0; i < (int)stream_desc->video_track_descs_.size(); ++i) {
|
for (int i = 0; i < (int)stream_desc->video_track_descs_.size(); ++i) {
|
||||||
SrsRtcTrackDescription* track = stream_desc->video_track_descs_[i];
|
SrsRtcTrackDescription* track = stream_desc->video_track_descs_[i];
|
||||||
|
track->msid_ = stream_id;
|
||||||
|
|
||||||
if (!unified_plan) {
|
if (!unified_plan) {
|
||||||
// for plan b, we only add one m= for video track.
|
// for plan b, we only add one m= for video track.
|
||||||
|
|
|
@ -554,8 +554,8 @@ private:
|
||||||
//TODO: Use StreamDescription to negotiate and remove first negotiate_play_capability function
|
//TODO: Use StreamDescription to negotiate and remove first negotiate_play_capability function
|
||||||
srs_error_t negotiate_play_capability(SrsRtcUserConfig* ruc, std::map<uint32_t, SrsRtcTrackDescription*>& sub_relations);
|
srs_error_t negotiate_play_capability(SrsRtcUserConfig* ruc, std::map<uint32_t, SrsRtcTrackDescription*>& sub_relations);
|
||||||
srs_error_t generate_play_local_sdp(SrsRequest* req, SrsSdp& local_sdp, SrsRtcSourceDescription* stream_desc, bool unified_plan, bool audio_before_video);
|
srs_error_t generate_play_local_sdp(SrsRequest* req, SrsSdp& local_sdp, SrsRtcSourceDescription* stream_desc, bool unified_plan, bool audio_before_video);
|
||||||
srs_error_t generate_play_local_sdp_for_audio(SrsSdp& local_sdp, SrsRtcSourceDescription* stream_desc, std::string cname);
|
srs_error_t generate_play_local_sdp_for_audio(SrsSdp& local_sdp, SrsRtcSourceDescription* stream_desc, std::string cname, std::string stream_id);
|
||||||
srs_error_t generate_play_local_sdp_for_video(SrsSdp& local_sdp, SrsRtcSourceDescription* stream_desc, bool unified_plan, std::string cname);
|
srs_error_t generate_play_local_sdp_for_video(SrsSdp& local_sdp, SrsRtcSourceDescription* stream_desc, bool unified_plan, std::string cname, std::string stream_id);
|
||||||
srs_error_t create_player(SrsRequest* request, std::map<uint32_t, SrsRtcTrackDescription*> sub_relations);
|
srs_error_t create_player(SrsRequest* request, std::map<uint32_t, SrsRtcTrackDescription*> sub_relations);
|
||||||
srs_error_t create_publisher(SrsRequest* request, SrsRtcSourceDescription* stream_desc);
|
srs_error_t create_publisher(SrsRequest* request, SrsRtcSourceDescription* stream_desc);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue