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

Unified Diff: media/cast/receiver/frame_receiver.cc

Issue 339743002: Cast: Make vp8 3-buffer mode work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor test fix 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/net/rtp/framer.cc ('k') | media/cast/sender/video_encoder_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/receiver/frame_receiver.cc
diff --git a/media/cast/receiver/frame_receiver.cc b/media/cast/receiver/frame_receiver.cc
index 6b5ef86a4c3c4e00598af30da09b4b5b0e5a87eb..095e6115533cacb65ca72b8658aeb59eb0bdbeec 100644
--- a/media/cast/receiver/frame_receiver.cc
+++ b/media/cast/receiver/frame_receiver.cc
@@ -216,9 +216,10 @@ void FrameReceiver::EmitAvailableEncodedFrames() {
// skipping one or more frames. Skip if the missing frame wouldn't complete
// playing before the start of playback of the available frame.
if (!is_consecutively_next_frame) {
- // TODO(miu): Also account for expected decode time here?
+ // This assumes that decoding takes as long as playing, which might
+ // not be true.
const base::TimeTicks earliest_possible_end_time_of_missing_frame =
- now + expected_frame_duration_;
+ now + expected_frame_duration_ * 2;
if (earliest_possible_end_time_of_missing_frame < playout_time) {
VLOG(1) << "Wait for next consecutive frame instead of skipping.";
if (!is_waiting_for_consecutive_frame_) {
@@ -234,6 +235,11 @@ void FrameReceiver::EmitAvailableEncodedFrames() {
}
}
+ // At this point, we have the complete next frame, or a decodable
+ // frame from somewhere later in the stream, AND we have given up
+ // on waiting for any frames in between, so now we can ACK the frame.
+ framer_.AckFrame(encoded_frame->frame_id);
+
// Decrypt the payload data in the frame, if crypto is being used.
if (decryptor_.is_activated()) {
std::string decrypted_data;
« no previous file with comments | « media/cast/net/rtp/framer.cc ('k') | media/cast/sender/video_encoder_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698