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

Unified Diff: webrtc/call/rampup_tests.cc

Issue 2783853002: Reland of Don't hardcode MediaType::ANY in FakeNetworkPipe. (Closed)
Patch Set: Fix braces. Add comment on use of demuxer. Created 3 years, 9 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
Index: webrtc/call/rampup_tests.cc
diff --git a/webrtc/call/rampup_tests.cc b/webrtc/call/rampup_tests.cc
index 292edc60836b4533d7ce5cb2c45fbee869821bd6..0a2a7384d8dd7d0ad1eec0a1c68a88ee3b8b939c 100644
--- a/webrtc/call/rampup_tests.cc
+++ b/webrtc/call/rampup_tests.cc
@@ -89,13 +89,34 @@ void RampUpTester::OnVideoStreamsCreated(
send_stream_ = send_stream;
}
+MediaType RampUpTester::SelectMediaType() {
+ if (num_video_streams_ > 0) {
+ if (num_audio_streams_ > 0) {
+ // Rely on call to set media type from payload type.
+ return MediaType::ANY;
+ } else {
+ return MediaType::VIDEO;
+ }
+ } else {
+ return MediaType::AUDIO;
+ }
+}
+
test::PacketTransport* RampUpTester::CreateSendTransport(Call* sender_call) {
send_transport_ = new test::PacketTransport(sender_call, this,
test::PacketTransport::kSender,
+ SelectMediaType(),
forward_transport_config_);
return send_transport_;
}
+test::PacketTransport* RampUpTester::CreateReceiveTransport() {
+ return new test::PacketTransport(nullptr, this,
+ test::PacketTransport::kReceiver,
+ SelectMediaType(),
+ FakeNetworkPipe::Config());
+}
+
size_t RampUpTester::GetNumVideoStreams() const {
return num_video_streams_;
}

Powered by Google App Engine
This is Rietveld 408576698