Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: webrtc/media/engine/webrtcvideoengine_unittest.cc

Issue 3010983002: Revert of Use RtxReceiveStream. (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine.cc ('k') | webrtc/video/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine_unittest.cc
diff --git a/webrtc/media/engine/webrtcvideoengine_unittest.cc b/webrtc/media/engine/webrtcvideoengine_unittest.cc
index 1306082abf8715b2733109ce4c3f2ad4c1f884cd..c6adfd3976fa6b89d95223ec0c1eac001364c0b6 100644
--- a/webrtc/media/engine/webrtcvideoengine_unittest.cc
+++ b/webrtc/media/engine/webrtcvideoengine_unittest.cc
@@ -83,32 +83,6 @@
return false;
}
-// TODO(nisse): Duplicated in call.cc.
-const int* FindKeyByValue(const std::map<int, int>& m, int v) {
- for (const auto& kv : m) {
- if (kv.second == v)
- return &kv.first;
- }
- return nullptr;
-}
-
-bool HasRtxReceiveAssociation(
- const webrtc::VideoReceiveStream::Config& config,
- int payload_type) {
- return FindKeyByValue(config.rtp.rtx_associated_payload_types,
- payload_type) != nullptr;
-}
-
-// Check that there's an Rtx payload type for each decoder.
-bool VerifyRtxReceiveAssociations(
- const webrtc::VideoReceiveStream::Config& config) {
- for (const auto& decoder : config.decoders) {
- if (!HasRtxReceiveAssociation(config, decoder.payload_type))
- return false;
- }
- return true;
-}
-
rtc::scoped_refptr<webrtc::VideoFrameBuffer> CreateBlackFrameBuffer(
int width,
int height) {
@@ -136,6 +110,15 @@
cricket::MediaConfig media_config;
media_config.video.enable_cpu_overuse_detection = false;
return media_config;
+}
+
+// TODO(nisse): Duplicated in call.cc.
+const int* FindKeyByValue(const std::map<int, int>& m, int v) {
+ for (const auto& kv : m) {
+ if (kv.second == v)
+ return &kv.first;
+ }
+ return nullptr;
}
} // namespace
@@ -1333,12 +1316,9 @@
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
EXPECT_FALSE(
recv_stream->GetConfig().rtp.rtx_associated_payload_types.empty());
- EXPECT_TRUE(VerifyRtxReceiveAssociations(recv_stream->GetConfig()))
+ EXPECT_EQ(recv_stream->GetConfig().decoders.size(),
+ recv_stream->GetConfig().rtp.rtx_associated_payload_types.size())
<< "RTX should be mapped for all decoders/payload types.";
- EXPECT_TRUE(HasRtxReceiveAssociation(recv_stream->GetConfig(),
- GetEngineCodec("red").id))
- << "RTX should be mapped for the RED payload type";
-
EXPECT_EQ(rtx_ssrcs[0], recv_stream->GetConfig().rtp.rtx_ssrc);
}
@@ -1349,12 +1329,6 @@
params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]);
FakeVideoReceiveStream* recv_stream = AddRecvStream(params);
EXPECT_EQ(kRtxSsrcs1[0], recv_stream->GetConfig().rtp.rtx_ssrc);
-
- EXPECT_TRUE(VerifyRtxReceiveAssociations(recv_stream->GetConfig()))
- << "RTX should be mapped for all decoders/payload types.";
- EXPECT_TRUE(HasRtxReceiveAssociation(recv_stream->GetConfig(),
- GetEngineCodec("red").id))
- << "RTX should be mapped for the RED payload type";
}
TEST_F(WebRtcVideoChannelTest, RecvStreamNoRtx) {
@@ -3822,11 +3796,9 @@
recv_stream = fake_call_->GetVideoReceiveStreams()[0];
EXPECT_FALSE(
recv_stream->GetConfig().rtp.rtx_associated_payload_types.empty());
- EXPECT_TRUE(VerifyRtxReceiveAssociations(recv_stream->GetConfig()))
+ EXPECT_EQ(recv_stream->GetConfig().decoders.size(),
+ recv_stream->GetConfig().rtp.rtx_associated_payload_types.size())
<< "RTX should be mapped for all decoders/payload types.";
- EXPECT_TRUE(HasRtxReceiveAssociation(recv_stream->GetConfig(),
- GetEngineCodec("red").id))
- << "RTX should be mapped also for the RED payload type";
EXPECT_EQ(rtx_ssrcs[0], recv_stream->GetConfig().rtp.rtx_ssrc);
}
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine.cc ('k') | webrtc/video/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698