From 213168f4c3cc98705345554d7348e8d31e5c71ec Mon Sep 17 00:00:00 2001 From: tzik Date: Thu, 16 Aug 2018 10:59:08 +0900 Subject: [PATCH] Remove a static initializer in default_temporal_layers.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit kAllBuffers in default_temporal_layers.cc introduces a static initializer, that is banned in Chromium, and that blocks WebRTC roll into Chromium. This CL removes it to unblock. Bug: webrtc:9012 Change-Id: Ide181f63d85748dc2d09199024f1b80868d485fd Reviewed-on: https://webrtc-review.googlesource.com/94460 Commit-Queue: Erik Språng Reviewed-by: Erik Språng Cr-Commit-Position: refs/heads/master@{#24307} --- .../video_coding/codecs/vp8/default_temporal_layers.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/video_coding/codecs/vp8/default_temporal_layers.cc b/modules/video_coding/codecs/vp8/default_temporal_layers.cc index 93209381e4..8389eff16e 100644 --- a/modules/video_coding/codecs/vp8/default_temporal_layers.cc +++ b/modules/video_coding/codecs/vp8/default_temporal_layers.cc @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -60,9 +61,9 @@ TemporalLayers::FrameConfig::FrameConfig(TemporalLayers::BufferFlags last, namespace { static constexpr uint8_t kUninitializedPatternIndex = std::numeric_limits::max(); -static const std::set kAllBuffers = { - Vp8BufferReference::kLast, Vp8BufferReference::kGolden, - Vp8BufferReference::kAltref}; +static constexpr std::array kAllBuffers = { + {Vp8BufferReference::kLast, Vp8BufferReference::kGolden, + Vp8BufferReference::kAltref}}; std::vector GetTemporalIds(size_t num_layers) { switch (num_layers) { @@ -113,7 +114,8 @@ uint8_t GetUpdatedBuffers(const TemporalLayers::FrameConfig& config) { // Find the set of buffers that are never updated by the given pattern. std::set FindKfBuffers( const std::vector& frame_configs) { - std::set kf_buffers = kAllBuffers; + std::set kf_buffers(kAllBuffers.begin(), + kAllBuffers.end()); for (TemporalLayers::FrameConfig config : frame_configs) { // Get bit-masked set of update buffers for this frame config. uint8_t updated_buffers = GetUpdatedBuffers(config);