| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 const bool is_last_aggressive_report = | 139 const bool is_last_aggressive_report = |
| 140 (num_aggressive_rtcp_reports_sent_ == kNumAggressiveReportsSentAtStart); | 140 (num_aggressive_rtcp_reports_sent_ == kNumAggressiveReportsSentAtStart); |
| 141 VLOG_IF(1, is_last_aggressive_report) << "Sending last aggressive report."; | 141 VLOG_IF(1, is_last_aggressive_report) << "Sending last aggressive report."; |
| 142 SendRtcpReport(is_last_aggressive_report); | 142 SendRtcpReport(is_last_aggressive_report); |
| 143 } | 143 } |
| 144 | 144 |
| 145 if (send_target_playout_delay_) { | 145 if (send_target_playout_delay_) { |
| 146 encoded_frame->new_playout_delay_ms = | 146 encoded_frame->new_playout_delay_ms = |
| 147 target_playout_delay_.InMilliseconds(); | 147 target_playout_delay_.InMilliseconds(); |
| 148 } | 148 } |
| 149 transport_sender_->InsertCodedAudioFrame(*encoded_frame); | 149 transport_sender_->InsertFrame(ssrc_, *encoded_frame); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void AudioSender::ScheduleNextResendCheck() { | 152 void AudioSender::ScheduleNextResendCheck() { |
| 153 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 153 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 154 DCHECK(!last_send_time_.is_null()); | 154 DCHECK(!last_send_time_.is_null()); |
| 155 base::TimeDelta time_to_next = | 155 base::TimeDelta time_to_next = |
| 156 last_send_time_ - cast_environment_->Clock()->NowTicks() + | 156 last_send_time_ - cast_environment_->Clock()->NowTicks() + |
| 157 target_playout_delay_; | 157 target_playout_delay_; |
| 158 time_to_next = std::max( | 158 time_to_next = std::max( |
| 159 time_to_next, base::TimeDelta::FromMilliseconds(kMinSchedulingDelayMs)); | 159 time_to_next, base::TimeDelta::FromMilliseconds(kMinSchedulingDelayMs)); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 261 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 262 DCHECK(!last_send_time_.is_null()); | 262 DCHECK(!last_send_time_.is_null()); |
| 263 VLOG(1) << "Resending last packet of frame " << last_sent_frame_id_ | 263 VLOG(1) << "Resending last packet of frame " << last_sent_frame_id_ |
| 264 << " to kick-start."; | 264 << " to kick-start."; |
| 265 last_send_time_ = cast_environment_->Clock()->NowTicks(); | 265 last_send_time_ = cast_environment_->Clock()->NowTicks(); |
| 266 transport_sender_->ResendFrameForKickstart(ssrc_, last_sent_frame_id_); | 266 transport_sender_->ResendFrameForKickstart(ssrc_, last_sent_frame_id_); |
| 267 } | 267 } |
| 268 | 268 |
| 269 } // namespace cast | 269 } // namespace cast |
| 270 } // namespace media | 270 } // namespace media |
| OLD | NEW |