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

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

Issue 519443002: Cast: merge InsertCoded{Audio,Video}Frame into InsertFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698