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

Unified Diff: webrtc/video/loopback.cc

Issue 1287643002: Enabling spatial layers in VP9Impl. Filter layers in the loopback test. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing unit tests Created 5 years, 4 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/video/loopback.cc
diff --git a/webrtc/video/loopback.cc b/webrtc/video/loopback.cc
index ef382de33c145ad40338adffd2f811fb79ec4a5e..6b70d31b07716b801e813ee20a8c9c9913df8ef9 100644
--- a/webrtc/video/loopback.cc
+++ b/webrtc/video/loopback.cc
@@ -19,11 +19,14 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/call.h"
+#include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h"
+#include "webrtc/modules/rtp_rtcp/source/rtp_format.h"
+#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/system_wrappers/interface/clock.h"
-#include "webrtc/test/direct_transport.h"
#include "webrtc/test/encoder_settings.h"
#include "webrtc/test/fake_encoder.h"
+#include "webrtc/test/layer_filtering_transport.h"
#include "webrtc/test/run_loop.h"
#include "webrtc/test/testsupport/trace_to_stderr.h"
#include "webrtc/test/video_capturer.h"
@@ -40,7 +43,8 @@ static const uint32_t kSendRtxSsrc = 0x654322;
static const uint32_t kReceiverLocalSsrc = 0x123456;
static const uint8_t kRtxVideoPayloadType = 96;
-static const uint8_t kVideoPayloadType = 124;
+static const uint8_t kVideoPayloadTypeVP8 = 124;
+static const uint8_t kVideoPayloadTypeVP9 = 125;
Loopback::Loopback(const Config& config)
: config_(config), clock_(Clock::GetRealTimeClock()) {
@@ -67,7 +71,10 @@ void Loopback::Run() {
pipe_config.queue_length_packets = config_.queue_size;
pipe_config.queue_delay_ms = config_.avg_propagation_delay_ms;
pipe_config.delay_standard_deviation_ms = config_.std_propagation_delay_ms;
- test::DirectTransport transport(pipe_config);
+ LayerFilteringTransport transport(
+ pipe_config, kVideoPayloadTypeVP8, kVideoPayloadTypeVP9,
+ static_cast<uint8_t>(config_.tl_discard_threshold),
+ static_cast<uint8_t>(config_.sl_discard_threshold));
Call::Config call_config(&transport);
call_config.bitrate_config.min_bitrate_bps =
@@ -100,9 +107,11 @@ void Loopback::Run() {
RTC_NOTREACHED() << "Codec not supported!";
return;
}
+ const int payload_type =
+ config_.codec == "VP8" ? kVideoPayloadTypeVP8 : kVideoPayloadTypeVP9;
send_config.encoder_settings.encoder = encoder.get();
send_config.encoder_settings.payload_name = config_.codec;
- send_config.encoder_settings.payload_type = kVideoPayloadType;
+ send_config.encoder_settings.payload_type = payload_type;
VideoEncoderConfig encoder_config(CreateEncoderConfig());
@@ -116,8 +125,8 @@ void Loopback::Run() {
receive_config.rtp.local_ssrc = kReceiverLocalSsrc;
receive_config.rtp.nack.rtp_history_ms = 1000;
receive_config.rtp.remb = true;
- receive_config.rtp.rtx[kVideoPayloadType].ssrc = kSendRtxSsrc;
- receive_config.rtp.rtx[kVideoPayloadType].payload_type = kRtxVideoPayloadType;
+ receive_config.rtp.rtx[payload_type].ssrc = kSendRtxSsrc;
+ receive_config.rtp.rtx[payload_type].payload_type = kRtxVideoPayloadType;
receive_config.rtp.extensions.push_back(
RtpExtension(RtpExtension::kAbsSendTime, kAbsSendTimeExtensionId));
receive_config.renderer = loopback_video.get();

Powered by Google App Engine
This is Rietveld 408576698