Skip to content

Commit

Permalink
Bug 1727196: stop making ssrc-group depend on stream-id. r=bwc
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Ohlmeier committed Aug 29, 2021
1 parent 5c43b95 commit d99d5fb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
3 changes: 1 addition & 2 deletions dom/media/webrtc/jsep/JsepTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ void JsepTrack::AddToMsection(const std::vector<JsConstraints>& constraintsList,
msection->GetAttributeList().SetAttribute(rids.release());
}

bool requireRtxSsrcs =
rtxEnabled && msection->IsSending() && !mStreamIds.empty();
bool requireRtxSsrcs = rtxEnabled && msection->IsSending();

if (mType != SdpMediaSection::kApplication && mDirection == sdp::kSend) {
UpdateSsrcs(ssrcGenerator, constraintsList.size());
Expand Down
32 changes: 30 additions & 2 deletions media/webrtc/signaling/gtest/jsep_session_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7126,6 +7126,34 @@ TEST_F(JsepSessionTest, TestOneWayRtx) {
}
}

TEST_F(JsepSessionTest, TestRtxNoSsrcGroup) {
mSessionOff->AddTransceiver(new JsepTransceiver(
SdpMediaSection::kVideo, SdpDirectionAttribute::kRecvonly));

OfferAnswer(CHECK_SUCCESS);

std::string offer = mSessionOff->GetLocalDescription(kJsepDescriptionCurrent);
ASSERT_EQ(std::string::npos, offer.find("FID")) << offer;

std::string answer =
mSessionOff->GetRemoteDescription(kJsepDescriptionCurrent);
ASSERT_EQ(std::string::npos, answer.find("FID")) << answer;
}

TEST_F(JsepSessionTest, TestRtxSsrcGroupOnlyOffered) {
mSessionOff->AddTransceiver(new JsepTransceiver(
SdpMediaSection::kVideo, SdpDirectionAttribute::kSendonly));

OfferAnswer(CHECK_SUCCESS);

std::string offer = mSessionOff->GetLocalDescription(kJsepDescriptionCurrent);
ASSERT_NE(std::string::npos, offer.find("FID")) << offer;

std::string answer =
mSessionOff->GetRemoteDescription(kJsepDescriptionCurrent);
ASSERT_EQ(std::string::npos, answer.find("FID")) << answer;
}

TEST_F(JsepSessionTest, TestOfferRtxNoMsid) {
for (auto& codec : mSessionOff->Codecs()) {
if (codec->mName == "VP8") {
Expand All @@ -7147,12 +7175,12 @@ TEST_F(JsepSessionTest, TestOfferRtxNoMsid) {
}
}

// If no MSID is present, we should not have a FID ssrc-group
// MSID stream absence should not influence FID ssrc-group
JsepOfferOptions options;
std::string offer;
JsepSession::Result result = mSessionOff->CreateOffer(options, &offer);
ASSERT_FALSE(result.mError.isSome());
ASSERT_EQ(std::string::npos, offer.find("FID")) << offer;
ASSERT_NE(std::string::npos, offer.find("FID")) << offer;
}

TEST_F(JsepSessionTest, TestDuplicatePayloadTypes) {
Expand Down

0 comments on commit d99d5fb

Please sign in to comment.