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

Side by Side Diff: media/cast/audio_sender/audio_sender.cc

Issue 236123003: Cast: Provide more meaningful stats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fix Created 6 years, 8 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/cast/audio_sender/audio_sender.h" 5 #include "media/cast/audio_sender/audio_sender.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "media/cast/audio_sender/audio_encoder.h" 10 #include "media/cast/audio_sender/audio_encoder.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 void AudioSender::ResendPackets( 97 void AudioSender::ResendPackets(
98 const MissingFramesAndPacketsMap& missing_frames_and_packets) { 98 const MissingFramesAndPacketsMap& missing_frames_and_packets) {
99 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 99 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
100 transport_sender_->ResendPackets(true, missing_frames_and_packets); 100 transport_sender_->ResendPackets(true, missing_frames_and_packets);
101 } 101 }
102 102
103 void AudioSender::IncomingRtcpPacket(scoped_ptr<Packet> packet) { 103 void AudioSender::IncomingRtcpPacket(scoped_ptr<Packet> packet) {
104 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 104 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
105 cast_environment_->Logging()->InsertGenericEvent(
106 cast_environment_->Clock()->NowTicks(), kAudioRtcpPacketReceived, 0);
105 rtcp_.IncomingRtcpPacket(&packet->front(), packet->size()); 107 rtcp_.IncomingRtcpPacket(&packet->front(), packet->size());
106 } 108 }
107 109
108 void AudioSender::ScheduleNextRtcpReport() { 110 void AudioSender::ScheduleNextRtcpReport() {
109 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 111 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
110 base::TimeDelta time_to_next = 112 base::TimeDelta time_to_next =
111 rtcp_.TimeToSendNextRtcpReport() - cast_environment_->Clock()->NowTicks(); 113 rtcp_.TimeToSendNextRtcpReport() - cast_environment_->Clock()->NowTicks();
112 114
113 time_to_next = std::max( 115 time_to_next = std::max(
114 time_to_next, base::TimeDelta::FromMilliseconds(kMinSchedulingDelayMs)); 116 time_to_next, base::TimeDelta::FromMilliseconds(kMinSchedulingDelayMs));
(...skipping 17 matching lines...) Expand all
132 // We don't send audio logging messages since all captured audio frames will 134 // We don't send audio logging messages since all captured audio frames will
133 // be sent. 135 // be sent.
134 transport::RtcpSenderLogMessage empty_msg; 136 transport::RtcpSenderLogMessage empty_msg;
135 rtp_stats_.UpdateInfo(cast_environment_->Clock()->NowTicks()); 137 rtp_stats_.UpdateInfo(cast_environment_->Clock()->NowTicks());
136 rtcp_.SendRtcpFromRtpSender(empty_msg, rtp_stats_.sender_info()); 138 rtcp_.SendRtcpFromRtpSender(empty_msg, rtp_stats_.sender_info());
137 ScheduleNextRtcpReport(); 139 ScheduleNextRtcpReport();
138 } 140 }
139 141
140 } // namespace cast 142 } // namespace cast
141 } // namespace media 143 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698