OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/sender/audio_sender.h" | 5 #include "media/cast/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/cast_defines.h" | 10 #include "media/cast/cast_defines.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 const bool is_last_aggressive_report = | 131 const bool is_last_aggressive_report = |
132 (num_aggressive_rtcp_reports_sent_ == kNumAggressiveReportsSentAtStart); | 132 (num_aggressive_rtcp_reports_sent_ == kNumAggressiveReportsSentAtStart); |
133 VLOG_IF(1, is_last_aggressive_report) << "Sending last aggressive report."; | 133 VLOG_IF(1, is_last_aggressive_report) << "Sending last aggressive report."; |
134 SendRtcpReport(is_last_aggressive_report); | 134 SendRtcpReport(is_last_aggressive_report); |
135 } | 135 } |
136 | 136 |
137 if (send_target_playout_delay_) { | 137 if (send_target_playout_delay_) { |
138 encoded_frame->new_playout_delay_ms = | 138 encoded_frame->new_playout_delay_ms = |
139 target_playout_delay_.InMilliseconds(); | 139 target_playout_delay_.InMilliseconds(); |
140 } | 140 } |
141 transport_sender_->InsertCodedAudioFrame(*encoded_frame); | 141 transport_sender_->InsertFrame(ssrc_, *encoded_frame); |
142 } | 142 } |
143 | 143 |
144 void AudioSender::OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback) { | 144 void AudioSender::OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback) { |
145 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 145 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
146 | 146 |
147 if (is_rtt_available()) { | 147 if (is_rtt_available()) { |
148 // Having the RTT values implies the receiver sent back a receiver report | 148 // Having the RTT values implies the receiver sent back a receiver report |
149 // based on it having received a report from here. Therefore, ensure this | 149 // based on it having received a report from here. Therefore, ensure this |
150 // sender stops aggressively sending reports. | 150 // sender stops aggressively sending reports. |
151 if (num_aggressive_rtcp_reports_sent_ < kNumAggressiveReportsSentAtStart) { | 151 if (num_aggressive_rtcp_reports_sent_ < kNumAggressiveReportsSentAtStart) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 << duration_in_flight.InMicroseconds() << " usec (" | 222 << duration_in_flight.InMicroseconds() << " usec (" |
223 << (target_playout_delay_ > base::TimeDelta() ? | 223 << (target_playout_delay_ > base::TimeDelta() ? |
224 100 * duration_in_flight / target_playout_delay_ : | 224 100 * duration_in_flight / target_playout_delay_ : |
225 kint64max) << "%)"; | 225 kint64max) << "%)"; |
226 return frames_in_flight >= max_unacked_frames_ || | 226 return frames_in_flight >= max_unacked_frames_ || |
227 duration_in_flight >= target_playout_delay_; | 227 duration_in_flight >= target_playout_delay_; |
228 } | 228 } |
229 | 229 |
230 } // namespace cast | 230 } // namespace cast |
231 } // namespace media | 231 } // namespace media |
OLD | NEW |