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

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

Issue 2935693005: Adding stats that can be used to compute output audio levels.
Patch Set: Created 3 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
« no previous file with comments | « webrtc/pc/rtcstats_integrationtest.cc ('k') | webrtc/stats/rtcstats_objects.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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 timestamp_us, 398 timestamp_us,
399 RTCMediaStreamTrackKind::kAudio)); 399 RTCMediaStreamTrackKind::kAudio));
400 SetMediaStreamTrackStatsFromMediaStreamTrackInterface( 400 SetMediaStreamTrackStatsFromMediaStreamTrackInterface(
401 audio_track, audio_track_stats.get()); 401 audio_track, audio_track_stats.get());
402 audio_track_stats->remote_source = true; 402 audio_track_stats->remote_source = true;
403 audio_track_stats->detached = false; 403 audio_track_stats->detached = false;
404 if (voice_receiver_info.audio_level >= 0) { 404 if (voice_receiver_info.audio_level >= 0) {
405 audio_track_stats->audio_level = DoubleAudioLevelFromIntAudioLevel( 405 audio_track_stats->audio_level = DoubleAudioLevelFromIntAudioLevel(
406 voice_receiver_info.audio_level); 406 voice_receiver_info.audio_level);
407 } 407 }
408 audio_track_stats->total_audio_energy =
409 voice_receiver_info.total_output_energy;
410 audio_track_stats->total_samples_duration =
411 voice_receiver_info.total_output_duration;
408 return audio_track_stats; 412 return audio_track_stats;
409 } 413 }
410 414
411 std::unique_ptr<RTCMediaStreamTrackStats> 415 std::unique_ptr<RTCMediaStreamTrackStats>
412 ProduceMediaStreamTrackStatsFromVideoSenderInfo( 416 ProduceMediaStreamTrackStatsFromVideoSenderInfo(
413 int64_t timestamp_us, 417 int64_t timestamp_us,
414 const VideoTrackInterface& video_track, 418 const VideoTrackInterface& video_track,
415 const cricket::VideoSenderInfo& video_sender_info) { 419 const cricket::VideoSenderInfo& video_sender_info) {
416 std::unique_ptr<RTCMediaStreamTrackStats> video_track_stats( 420 std::unique_ptr<RTCMediaStreamTrackStats> video_track_stats(
417 new RTCMediaStreamTrackStats( 421 new RTCMediaStreamTrackStats(
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 const std::string& type) { 1252 const std::string& type) {
1249 return CandidateTypeToRTCIceCandidateType(type); 1253 return CandidateTypeToRTCIceCandidateType(type);
1250 } 1254 }
1251 1255
1252 const char* DataStateToRTCDataChannelStateForTesting( 1256 const char* DataStateToRTCDataChannelStateForTesting(
1253 DataChannelInterface::DataState state) { 1257 DataChannelInterface::DataState state) {
1254 return DataStateToRTCDataChannelState(state); 1258 return DataStateToRTCDataChannelState(state);
1255 } 1259 }
1256 1260
1257 } // namespace webrtc 1261 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/pc/rtcstats_integrationtest.cc ('k') | webrtc/stats/rtcstats_objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698