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

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

Issue 2047513002: Add proper lifetime of encoder-specific settings. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: typo Created 4 years, 6 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
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 webrtc::VideoSendStream::Stats FakeVideoSendStream::GetStats() { 167 webrtc::VideoSendStream::Stats FakeVideoSendStream::GetStats() {
168 return stats_; 168 return stats_;
169 } 169 }
170 170
171 void FakeVideoSendStream::ReconfigureVideoEncoder( 171 void FakeVideoSendStream::ReconfigureVideoEncoder(
172 const webrtc::VideoEncoderConfig& config) { 172 const webrtc::VideoEncoderConfig& config) {
173 encoder_config_ = config; 173 encoder_config_ = config;
174 if (config.encoder_specific_settings != NULL) { 174 if (config.encoder_specific_settings != NULL) {
175 if (config_.encoder_settings.payload_name == "VP8") { 175 if (config_.encoder_settings.payload_name == "VP8") {
176 vpx_settings_.vp8 = *reinterpret_cast<const webrtc::VideoCodecVP8*>( 176 config.encoder_specific_settings->FillVideoCodecVp8(&vpx_settings_.vp8);
177 config.encoder_specific_settings);
178 if (!config.streams.empty()) { 177 if (!config.streams.empty()) {
179 vpx_settings_.vp8.numberOfTemporalLayers = static_cast<unsigned char>( 178 vpx_settings_.vp8.numberOfTemporalLayers = static_cast<unsigned char>(
180 config.streams.back().temporal_layer_thresholds_bps.size() + 1); 179 config.streams.back().temporal_layer_thresholds_bps.size() + 1);
181 } 180 }
182 } else if (config_.encoder_settings.payload_name == "VP9") { 181 } else if (config_.encoder_settings.payload_name == "VP9") {
183 vpx_settings_.vp9 = *reinterpret_cast<const webrtc::VideoCodecVP9*>( 182 config.encoder_specific_settings->FillVideoCodecVp9(&vpx_settings_.vp9);
184 config.encoder_specific_settings);
185 if (!config.streams.empty()) { 183 if (!config.streams.empty()) {
186 vpx_settings_.vp9.numberOfTemporalLayers = static_cast<unsigned char>( 184 vpx_settings_.vp9.numberOfTemporalLayers = static_cast<unsigned char>(
187 config.streams.back().temporal_layer_thresholds_bps.size() + 1); 185 config.streams.back().temporal_layer_thresholds_bps.size() + 1);
188 } 186 }
189 } else { 187 } else {
190 ADD_FAILURE() << "Unsupported encoder payload: " 188 ADD_FAILURE() << "Unsupported encoder payload: "
191 << config_.encoder_settings.payload_name; 189 << config_.encoder_settings.payload_name;
192 } 190 }
193 } 191 }
194 codec_settings_set_ = config.encoder_specific_settings != NULL; 192 codec_settings_set_ = config.encoder_specific_settings != NULL;
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 case webrtc::MediaType::ANY: 458 case webrtc::MediaType::ANY:
461 ADD_FAILURE() 459 ADD_FAILURE()
462 << "SignalChannelNetworkState called with unknown parameter."; 460 << "SignalChannelNetworkState called with unknown parameter.";
463 } 461 }
464 } 462 }
465 463
466 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { 464 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) {
467 last_sent_packet_ = sent_packet; 465 last_sent_packet_ = sent_packet;
468 } 466 }
469 } // namespace cricket 467 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698