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

Side by Side Diff: webrtc/api/rtcstatscollector.cc

Issue 2573443002: Skip RTCMediaStreamTrackStats.echoReturnLoss[Enhancement] default value. (Closed)
Patch Set: Unittest for the -100 = undefined case Created 4 years 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 | « no previous file | webrtc/api/rtcstatscollector_unittest.cc » ('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 2016 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2016 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 int signal_level; 310 int signal_level;
311 if (audio_track->GetSignalLevel(&signal_level)) { 311 if (audio_track->GetSignalLevel(&signal_level)) {
312 // Convert signal level from [0,32767] int to [0,1] double. 312 // Convert signal level from [0,32767] int to [0,1] double.
313 RTC_DCHECK_GE(signal_level, 0); 313 RTC_DCHECK_GE(signal_level, 0);
314 RTC_DCHECK_LE(signal_level, 32767); 314 RTC_DCHECK_LE(signal_level, 32767);
315 audio_track_stats->audio_level = signal_level / 32767.0; 315 audio_track_stats->audio_level = signal_level / 32767.0;
316 } 316 }
317 if (audio_track->GetAudioProcessor()) { 317 if (audio_track->GetAudioProcessor()) {
318 AudioProcessorInterface::AudioProcessorStats audio_processor_stats; 318 AudioProcessorInterface::AudioProcessorStats audio_processor_stats;
319 audio_track->GetAudioProcessor()->GetStats(&audio_processor_stats); 319 audio_track->GetAudioProcessor()->GetStats(&audio_processor_stats);
320 audio_track_stats->echo_return_loss = static_cast<double>( 320 if (audio_processor_stats.echo_return_loss != -100) {
321 audio_processor_stats.echo_return_loss); 321 audio_track_stats->echo_return_loss = static_cast<double>(
322 audio_track_stats->echo_return_loss_enhancement = static_cast<double>( 322 audio_processor_stats.echo_return_loss);
323 audio_processor_stats.echo_return_loss_enhancement); 323 }
324 if (audio_processor_stats.echo_return_loss_enhancement != -100) {
325 audio_track_stats->echo_return_loss_enhancement = static_cast<double>(
326 audio_processor_stats.echo_return_loss_enhancement);
327 }
324 } 328 }
325 report->AddStats(std::move(audio_track_stats)); 329 report->AddStats(std::move(audio_track_stats));
326 } 330 }
327 // Video Tracks 331 // Video Tracks
328 for (const rtc::scoped_refptr<VideoTrackInterface>& video_track : 332 for (const rtc::scoped_refptr<VideoTrackInterface>& video_track :
329 stream->GetVideoTracks()) { 333 stream->GetVideoTracks()) {
330 std::string id = RTCMediaStreamTrackStatsIDFromMediaStreamTrackInterface( 334 std::string id = RTCMediaStreamTrackStatsIDFromMediaStreamTrackInterface(
331 *video_track.get()); 335 *video_track.get());
332 if (report->Get(id)) { 336 if (report->Get(id)) {
333 // Skip track, stats already exist for it. 337 // Skip track, stats already exist for it.
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 const std::string& type) { 926 const std::string& type) {
923 return CandidateTypeToRTCIceCandidateType(type); 927 return CandidateTypeToRTCIceCandidateType(type);
924 } 928 }
925 929
926 const char* DataStateToRTCDataChannelStateForTesting( 930 const char* DataStateToRTCDataChannelStateForTesting(
927 DataChannelInterface::DataState state) { 931 DataChannelInterface::DataState state) {
928 return DataStateToRTCDataChannelState(state); 932 return DataStateToRTCDataChannelState(state);
929 } 933 }
930 934
931 } // namespace webrtc 935 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/rtcstatscollector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698