Bug 1425873 - Part 2: Sync send stream ids even when there is no send track. r+drno r=drno

MozReview-Commit-ID: 7s3f1Q8sCI1

--HG--
extra : rebase_source : a3c0446e31cff547b8277c8811de2e5e0967de93
This commit is contained in:
Byron Campen [:bwc] 2017-12-18 11:52:01 -06:00
Родитель 8ed5c25fbc
Коммит 2d7be6de42
1 изменённых файлов: 20 добавлений и 18 удалений

Просмотреть файл

@ -417,30 +417,32 @@ TransceiverImpl::SyncWithJS(dom::RTCRtpTransceiver& aJsTransceiver,
return;
}
std::string trackId = mJsepTransceiver->mSendTrack.GetTrackId();
if (sendTrack) {
nsString wideTrackId;
sendTrack->GetId(wideTrackId);
std::string trackId = NS_ConvertUTF16toUTF8(wideTrackId).get();
trackId = NS_ConvertUTF16toUTF8(wideTrackId).get();
MOZ_ASSERT(!trackId.empty());
nsTArray<RefPtr<DOMMediaStream>> streams;
sender->GetStreams(streams, aRv);
if (aRv.Failed()) {
return;
}
std::vector<std::string> streamIds;
for (const auto& stream : streams) {
nsString wideStreamId;
stream->GetId(wideStreamId);
std::string streamId = NS_ConvertUTF16toUTF8(wideStreamId).get();
MOZ_ASSERT(!streamId.empty());
streamIds.push_back(streamId);
}
mJsepTransceiver->mSendTrack.UpdateTrackIds(streamIds, trackId);
}
nsTArray<RefPtr<DOMMediaStream>> streams;
sender->GetStreams(streams, aRv);
if (aRv.Failed()) {
return;
}
std::vector<std::string> streamIds;
for (const auto& stream : streams) {
nsString wideStreamId;
stream->GetId(wideStreamId);
std::string streamId = NS_ConvertUTF16toUTF8(wideStreamId).get();
MOZ_ASSERT(!streamId.empty());
streamIds.push_back(streamId);
}
mJsepTransceiver->mSendTrack.UpdateTrackIds(streamIds, trackId);
// Update RTCRtpParameters
// TODO: Both ways for things like ssrc, codecs, header extensions, etc