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

Side by Side Diff: webrtc/media/engine/fakewebrtccall.cc

Issue 2347843002: Add proper lifetime of encoder-specific settings (Closed)
Patch Set: nitpicks Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « webrtc/config.cc ('k') | webrtc/media/engine/webrtcvideoengine2.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 180
181 webrtc::VideoSendStream::Stats FakeVideoSendStream::GetStats() { 181 webrtc::VideoSendStream::Stats FakeVideoSendStream::GetStats() {
182 return stats_; 182 return stats_;
183 } 183 }
184 184
185 void FakeVideoSendStream::ReconfigureVideoEncoder( 185 void FakeVideoSendStream::ReconfigureVideoEncoder(
186 webrtc::VideoEncoderConfig config) { 186 webrtc::VideoEncoderConfig config) {
187 if (config.encoder_specific_settings != NULL) { 187 if (config.encoder_specific_settings != NULL) {
188 if (config_.encoder_settings.payload_name == "VP8") { 188 if (config_.encoder_settings.payload_name == "VP8") {
189 vpx_settings_.vp8 = *reinterpret_cast<const webrtc::VideoCodecVP8*>( 189 config.encoder_specific_settings->FillVideoCodecVp8(&vpx_settings_.vp8);
190 config.encoder_specific_settings);
191 if (!config.streams.empty()) { 190 if (!config.streams.empty()) {
192 vpx_settings_.vp8.numberOfTemporalLayers = static_cast<unsigned char>( 191 vpx_settings_.vp8.numberOfTemporalLayers = static_cast<unsigned char>(
193 config.streams.back().temporal_layer_thresholds_bps.size() + 1); 192 config.streams.back().temporal_layer_thresholds_bps.size() + 1);
194 } 193 }
195 } else if (config_.encoder_settings.payload_name == "VP9") { 194 } else if (config_.encoder_settings.payload_name == "VP9") {
196 vpx_settings_.vp9 = *reinterpret_cast<const webrtc::VideoCodecVP9*>( 195 config.encoder_specific_settings->FillVideoCodecVp9(&vpx_settings_.vp9);
197 config.encoder_specific_settings);
198 if (!config.streams.empty()) { 196 if (!config.streams.empty()) {
199 vpx_settings_.vp9.numberOfTemporalLayers = static_cast<unsigned char>( 197 vpx_settings_.vp9.numberOfTemporalLayers = static_cast<unsigned char>(
200 config.streams.back().temporal_layer_thresholds_bps.size() + 1); 198 config.streams.back().temporal_layer_thresholds_bps.size() + 1);
201 } 199 }
202 } else { 200 } else {
203 ADD_FAILURE() << "Unsupported encoder payload: " 201 ADD_FAILURE() << "Unsupported encoder payload: "
204 << config_.encoder_settings.payload_name; 202 << config_.encoder_settings.payload_name;
205 } 203 }
206 } 204 }
205 codec_settings_set_ = config.encoder_specific_settings != NULL;
207 encoder_config_ = std::move(config); 206 encoder_config_ = std::move(config);
208 codec_settings_set_ = config.encoder_specific_settings != NULL;
209 ++num_encoder_reconfigurations_; 207 ++num_encoder_reconfigurations_;
210 } 208 }
211 209
212 void FakeVideoSendStream::Start() { 210 void FakeVideoSendStream::Start() {
213 sending_ = true; 211 sending_ = true;
214 } 212 }
215 213
216 void FakeVideoSendStream::Stop() { 214 void FakeVideoSendStream::Stop() {
217 sending_ = false; 215 sending_ = false;
218 } 216 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } 489 }
492 490
493 bool FakeCall::StartEventLog(rtc::PlatformFile log_file, 491 bool FakeCall::StartEventLog(rtc::PlatformFile log_file,
494 int64_t max_size_bytes) { 492 int64_t max_size_bytes) {
495 return false; 493 return false;
496 } 494 }
497 495
498 void FakeCall::StopEventLog() {} 496 void FakeCall::StopEventLog() {}
499 497
500 } // namespace cricket 498 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/config.cc ('k') | webrtc/media/engine/webrtcvideoengine2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698