Use VP8EncoderSimulcastProxy in VideoQualityTest.

This simplifies configuration, and it is a preparation for replaceing
encoder instance with an encoder factory in
VideoSendStream::Config::EncoderSettings.

Bug: webrtc:8830
Change-Id: Iaf4f6ad9e7cfaa76d8600c4fa68f393e2f3ea331
Reviewed-on: https://webrtc-review.googlesource.com/69809
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22859}
This commit is contained in:
Niels Möller
2018-04-13 13:37:52 +02:00
committed by Commit Bot
parent 4e140da62f
commit 19a68d405d
2 changed files with 6 additions and 12 deletions

View File

@ -19,6 +19,7 @@
#include "logging/rtc_event_log/output/rtc_event_log_output_file.h"
#include "media/engine/internalencoderfactory.h"
#include "media/engine/vp8_encoder_simulcast_proxy.h"
#include "media/engine/webrtcvideoengine.h"
#include "modules/audio_mixer/audio_mixer_impl.h"
#include "modules/rtp_rtcp/source/rtp_format.h"
@ -1375,23 +1376,15 @@ void VideoQualityTest::SetupVideo(Transport* send_transport,
H264Encoder::Create(cricket::VideoCodec("H264"));
payload_type = kPayloadTypeH264;
} else if (params_.video[video_idx].codec == "VP8") {
if (params_.screenshare[video_idx].enabled &&
params_.ss[video_idx].streams.size() > 1) {
// Simulcast screenshare needs a simulcast encoder adapter to work,
// since encoders usually can't natively do simulcast with different
// frame rates for the different layers.
video_encoders_[video_idx].reset(
new SimulcastEncoderAdapter(new InternalEncoderFactory()));
} else {
video_encoders_[video_idx] = VP8Encoder::Create();
}
video_encoders_[video_idx] =
rtc::MakeUnique<VP8EncoderSimulcastProxy>(&internal_encoder_factory_);
payload_type = kPayloadTypeVP8;
} else if (params_.video[video_idx].codec == "VP9") {
video_encoders_[video_idx] = VP9Encoder::Create();
payload_type = kPayloadTypeVP9;
} else if (params_.video[video_idx].codec == "multiplex") {
video_encoders_[video_idx] = rtc::MakeUnique<MultiplexEncoderAdapter>(
new InternalEncoderFactory(), SdpVideoFormat(cricket::kVp9CodecName));
&internal_encoder_factory_, SdpVideoFormat(cricket::kVp9CodecName));
payload_type = kPayloadTypeVP9;
} else {
RTC_NOTREACHED() << "Codec not supported!";

View File

@ -15,7 +15,7 @@
#include <string>
#include <vector>
#include "media/engine/simulcast_encoder_adapter.h"
#include "media/engine/internalencoderfactory.h"
#include "test/call_test.h"
#include "test/frame_generator.h"
#include "test/layer_filtering_transport.h"
@ -148,6 +148,7 @@ class VideoQualityTest : public test::CallTest {
std::vector<std::unique_ptr<test::VideoCapturer>> video_capturers_;
std::vector<std::unique_ptr<test::VideoCapturer>> thumbnail_capturers_;
InternalEncoderFactory internal_encoder_factory_;
std::vector<std::unique_ptr<VideoEncoder>> video_encoders_;
std::vector<std::unique_ptr<VideoEncoder>> thumbnail_encoders_;