| 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/video_sender.h" | 5 #include "media/cast/sender/video_sender.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 SendRtcpReport(is_last_aggressive_report); | 213 SendRtcpReport(is_last_aggressive_report); |
| 214 } | 214 } |
| 215 | 215 |
| 216 congestion_control_.SendFrameToTransport( | 216 congestion_control_.SendFrameToTransport( |
| 217 frame_id, encoded_frame->data.size() * 8, last_send_time_); | 217 frame_id, encoded_frame->data.size() * 8, last_send_time_); |
| 218 | 218 |
| 219 if (send_target_playout_delay_) { | 219 if (send_target_playout_delay_) { |
| 220 encoded_frame->new_playout_delay_ms = | 220 encoded_frame->new_playout_delay_ms = |
| 221 target_playout_delay_.InMilliseconds(); | 221 target_playout_delay_.InMilliseconds(); |
| 222 } | 222 } |
| 223 transport_sender_->InsertCodedVideoFrame(*encoded_frame); | 223 transport_sender_->InsertFrame(ssrc_, *encoded_frame); |
| 224 } | 224 } |
| 225 | 225 |
| 226 void VideoSender::ResendCheck() { | 226 void VideoSender::ResendCheck() { |
| 227 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 227 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 228 DCHECK(!last_send_time_.is_null()); | 228 DCHECK(!last_send_time_.is_null()); |
| 229 const base::TimeDelta time_since_last_send = | 229 const base::TimeDelta time_since_last_send = |
| 230 cast_environment_->Clock()->NowTicks() - last_send_time_; | 230 cast_environment_->Clock()->NowTicks() - last_send_time_; |
| 231 if (time_since_last_send > target_playout_delay_) { | 231 if (time_since_last_send > target_playout_delay_) { |
| 232 if (latest_acked_frame_id_ == last_sent_frame_id_) { | 232 if (latest_acked_frame_id_ == last_sent_frame_id_) { |
| 233 // Last frame acked, no point in doing anything | 233 // Last frame acked, no point in doing anything |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 356 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 357 DCHECK(!last_send_time_.is_null()); | 357 DCHECK(!last_send_time_.is_null()); |
| 358 VLOG(1) << "Resending last packet of frame " << last_sent_frame_id_ | 358 VLOG(1) << "Resending last packet of frame " << last_sent_frame_id_ |
| 359 << " to kick-start."; | 359 << " to kick-start."; |
| 360 last_send_time_ = cast_environment_->Clock()->NowTicks(); | 360 last_send_time_ = cast_environment_->Clock()->NowTicks(); |
| 361 transport_sender_->ResendFrameForKickstart(ssrc_, last_sent_frame_id_); | 361 transport_sender_->ResendFrameForKickstart(ssrc_, last_sent_frame_id_); |
| 362 } | 362 } |
| 363 | 363 |
| 364 } // namespace cast | 364 } // namespace cast |
| 365 } // namespace media | 365 } // namespace media |
| OLD | NEW |