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

Unified Diff: media/cast/sender/frame_sender.cc

Issue 545593002: [Cast] Track audio queued in encoder; account for it in ShouldDropNextFrame(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + MERGE (post-hubbe's refactoring changes) 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/sender/frame_sender.h ('k') | media/cast/sender/video_sender.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/frame_sender.cc
diff --git a/media/cast/sender/frame_sender.cc b/media/cast/sender/frame_sender.cc
index 8df8e7ee6f1669a2069f1802ca7b1effe8c3814a..300e8146ed8e0157b875a4edf9c0c869b4710d9c 100644
--- a/media/cast/sender/frame_sender.cc
+++ b/media/cast/sender/frame_sender.cc
@@ -29,7 +29,6 @@ FrameSender::FrameSender(scoped_refptr<CastEnvironment> cast_environment,
ssrc_(ssrc),
rtcp_interval_(rtcp_interval),
max_frame_rate_(max_frame_rate),
- frames_in_encoder_(0),
num_aggressive_rtcp_reports_sent_(0),
last_sent_frame_id_(0),
latest_acked_frame_id_(0),
@@ -163,15 +162,11 @@ RtpTimestamp FrameSender::GetRecordedRtpTimestamp(uint32 frame_id) const {
return frame_rtp_timestamps_[frame_id % arraysize(frame_rtp_timestamps_)];
}
-
void FrameSender::SendEncodedFrame(
int requested_bitrate_before_encode,
scoped_ptr<EncodedFrame> encoded_frame) {
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
- DCHECK_GT(frames_in_encoder_, 0) << " is_audio: " << is_audio_;
- frames_in_encoder_--;
-
const uint32 frame_id = encoded_frame->frame_id;
const bool is_first_frame_to_be_sent = last_send_time_.is_null();
@@ -315,11 +310,11 @@ bool FrameSender::ShouldDropNextFrame(base::TimeTicks capture_time) const {
capture_time - GetRecordedReferenceTime(oldest_unacked_frame_id);
}
}
- frames_in_flight += frames_in_encoder_;
+ frames_in_flight += GetNumberOfFramesInEncoder();
VLOG(2) << frames_in_flight
<< " frames in flight; last sent: " << last_sent_frame_id_
<< "; latest acked: " << latest_acked_frame_id_
- << "; frames in encoder: " << frames_in_encoder_
+ << "; frames in encoder: " << GetNumberOfFramesInEncoder()
<< "; duration in flight: "
<< duration_in_flight.InMicroseconds() << " usec ("
<< (target_playout_delay_ > base::TimeDelta() ?
« no previous file with comments | « media/cast/sender/frame_sender.h ('k') | media/cast/sender/video_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698