Delete nack_enabled flag in encoder configuration.

This is a followup to cl https://webrtc-review.googlesource.com/71380,
which reworked the way encoder resilience is done, and made the
nack_enabled flag unused.

Bug: webrtc:8830
Change-Id: I3de2508c97bc71e01c8f2232d16cd1f33e57fe4a
Reviewed-on: https://webrtc-review.googlesource.com/69986
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23080}
This commit is contained in:
Niels Möller
2018-04-26 09:51:47 +02:00
committed by Commit Bot
parent c3d8bb1c52
commit f133856dfa
8 changed files with 44 additions and 54 deletions

View File

@ -34,10 +34,20 @@ class VideoCodecInitializer {
static bool SetupCodec(
const VideoEncoderConfig& config,
const std::vector<VideoStream>& streams,
bool nack_enabled,
VideoCodec* codec,
std::unique_ptr<VideoBitrateAllocator>* bitrate_allocator);
// TODO(nisse): Deprecated, delete as soon as downstream projects are
// updated.
static bool SetupCodec(
const VideoEncoderConfig& config,
const std::vector<VideoStream>& streams,
bool /* nack_enabled */,
VideoCodec* codec,
std::unique_ptr<VideoBitrateAllocator>* bitrate_allocator) {
return SetupCodec(config, streams, codec, bitrate_allocator);
}
// Create a bitrate allocator for the specified codec.
static std::unique_ptr<VideoBitrateAllocator> CreateBitrateAllocator(
const VideoCodec& codec);
@ -45,8 +55,7 @@ class VideoCodecInitializer {
private:
static VideoCodec VideoEncoderConfigToVideoCodec(
const VideoEncoderConfig& config,
const std::vector<VideoStream>& streams,
bool nack_enabled);
const std::vector<VideoStream>& streams);
};
} // namespace webrtc

View File

@ -29,13 +29,12 @@ namespace webrtc {
bool VideoCodecInitializer::SetupCodec(
const VideoEncoderConfig& config,
const std::vector<VideoStream>& streams,
bool nack_enabled,
VideoCodec* codec,
std::unique_ptr<VideoBitrateAllocator>* bitrate_allocator) {
if (config.codec_type == kVideoCodecMultiplex) {
VideoEncoderConfig associated_config = config.Copy();
associated_config.codec_type = kVideoCodecVP9;
if (!SetupCodec(associated_config, streams, nack_enabled, codec,
if (!SetupCodec(associated_config, streams, codec,
bitrate_allocator)) {
RTC_LOG(LS_ERROR) << "Failed to create stereo encoder configuration.";
return false;
@ -45,7 +44,7 @@ bool VideoCodecInitializer::SetupCodec(
}
*codec =
VideoEncoderConfigToVideoCodec(config, streams, nack_enabled);
VideoEncoderConfigToVideoCodec(config, streams);
*bitrate_allocator = CreateBitrateAllocator(*codec);
return true;
@ -73,8 +72,7 @@ VideoCodecInitializer::CreateBitrateAllocator(const VideoCodec& codec) {
// TODO(sprang): Split this up and separate the codec specific parts.
VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
const VideoEncoderConfig& config,
const std::vector<VideoStream>& streams,
bool nack_enabled) {
const std::vector<VideoStream>& streams) {
static const int kEncoderMinBitrateKbps = 30;
RTC_DCHECK(!streams.empty());
RTC_DCHECK_GE(config.min_transmit_bitrate_bps, 0);

View File

@ -39,7 +39,7 @@ static const uint32_t kHighScreenshareTl1Bps = 1200000;
// TODO(sprang): Extend coverage to handle the rest of the codec initializer.
class VideoCodecInitializerTest : public ::testing::Test {
public:
VideoCodecInitializerTest() : nack_enabled_(false) {}
VideoCodecInitializerTest() {}
virtual ~VideoCodecInitializerTest() {}
protected:
@ -76,7 +76,7 @@ class VideoCodecInitializerTest : public ::testing::Test {
codec_out_ = VideoCodec();
bitrate_allocator_out_.reset();
temporal_layers_.clear();
if (!VideoCodecInitializer::SetupCodec(config_, streams_, nack_enabled_,
if (!VideoCodecInitializer::SetupCodec(config_, streams_,
&codec_out_,
&bitrate_allocator_out_)) {
return false;
@ -122,7 +122,6 @@ class VideoCodecInitializerTest : public ::testing::Test {
// Input settings.
VideoEncoderConfig config_;
std::vector<VideoStream> streams_;
bool nack_enabled_;
// Output.
VideoCodec codec_out_;