For #1998, support firefox

pull/2104/head
winlin 4 years ago
parent c5457e8241
commit 0c113ff084

@ -3051,11 +3051,28 @@ srs_error_t SrsRtcConnection::negotiate_play_capability(SrsRequest* req, SrsRtcS
std::vector<SrsRtcTrackDescription*> src_track_descs;
//negotiate audio media
if(NULL != req_stream_desc->audio_track_desc_) {
SrsRtcTrackDescription* req_audio_track = req_stream_desc->audio_track_desc_;
src_track_descs = source->get_track_desc("audio", "opus");
if (src_track_descs.size() > 0) {
// FIXME: use source sdp or subscribe sdp? native subscribe may have no sdp
SrsRtcTrackDescription *track = src_track_descs[0]->copy();
// Use remote/source/offer PayloadType.
track->media_->pt_of_publisher_ = track->media_->pt_;
track->media_->pt_ = req_audio_track->media_->pt_;
if (req_audio_track->red_ && track->red_) {
track->red_->pt_of_publisher_ = track->red_->pt_;
track->red_->pt_ = req_audio_track->red_->pt_;
}
track->mid_ = req_audio_track->mid_;
track->msid_ = req_audio_track->msid_;
sub_relations.insert(make_pair(track->ssrc_, track));
track->set_direction("sendonly");
track->ssrc_ = SrsRtcSSRCGenerator::instance()->generate_ssrc();
}
}
@ -3070,6 +3087,19 @@ srs_error_t SrsRtcConnection::negotiate_play_capability(SrsRequest* req, SrsRtcS
if(req_video->id_ == src_video->id_) {
// FIXME: use source sdp or subscribe sdp? native subscribe may have no sdp
SrsRtcTrackDescription *track = src_video->copy();
// Use remote/source/offer PayloadType.
track->media_->pt_of_publisher_ = track->media_->pt_;
track->media_->pt_ = req_video->media_->pt_;
if (req_video->red_ && track->red_) {
track->red_->pt_of_publisher_ = track->red_->pt_;
track->red_->pt_ = req_video->red_->pt_;
}
track->mid_ = req_video->mid_;
track->set_direction("sendonly");
sub_relations.insert(make_pair(track->ssrc_, track));
track->ssrc_ = SrsRtcSSRCGenerator::instance()->generate_ssrc();
}

@ -1191,7 +1191,7 @@ SrsCodecPayload* SrsCodecPayload::copy()
cp->type_ = type_;
cp->pt_ = pt_;
cp->pt_of_publisher_ = cp->pt_of_publisher_;
cp->pt_of_publisher_ = pt_of_publisher_;
cp->name_ = name_;
cp->sample_ = sample_;
cp->rtcp_fbs_ = rtcp_fbs_;
@ -1234,6 +1234,7 @@ SrsVideoPayload* SrsVideoPayload::copy()
cp->type_ = type_;
cp->pt_ = pt_;
cp->pt_of_publisher_ = pt_of_publisher_;
cp->name_ = name_;
cp->sample_ = sample_;
cp->rtcp_fbs_ = rtcp_fbs_;
@ -1328,6 +1329,7 @@ SrsAudioPayload* SrsAudioPayload::copy()
cp->type_ = type_;
cp->pt_ = pt_;
cp->pt_of_publisher_ = pt_of_publisher_;
cp->name_ = name_;
cp->sample_ = sample_;
cp->rtcp_fbs_ = rtcp_fbs_;
@ -1406,6 +1408,7 @@ SrsRedPayload* SrsRedPayload::copy()
cp->type_ = type_;
cp->pt_ = pt_;
cp->pt_of_publisher_ = pt_of_publisher_;
cp->name_ = name_;
cp->sample_ = sample_;
cp->rtcp_fbs_ = rtcp_fbs_;
@ -1446,6 +1449,7 @@ SrsRtxPayloadDes* SrsRtxPayloadDes::copy()
cp->type_ = type_;
cp->pt_ = pt_;
cp->pt_of_publisher_ = pt_of_publisher_;
cp->name_ = name_;
cp->sample_ = sample_;
cp->rtcp_fbs_ = rtcp_fbs_;

Loading…
Cancel
Save