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

Unified Diff: media/cast/video_receiver/video_receiver.cc

Issue 186043003: Cast: Using a min filter to compute time offset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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/video_receiver/video_receiver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/video_receiver/video_receiver.cc
diff --git a/media/cast/video_receiver/video_receiver.cc b/media/cast/video_receiver/video_receiver.cc
index 799da9a2d48b364b3bbf088c2a19d0035a299062..113845c69600a570229de991a0c81e2df898e97f 100644
--- a/media/cast/video_receiver/video_receiver.cc
+++ b/media/cast/video_receiver/video_receiver.cc
@@ -107,6 +107,7 @@ VideoReceiver::VideoReceiver(scoped_refptr<CastEnvironment> cast_environment,
incoming_payload_callback_.get()),
rtp_video_receiver_statistics_(
new LocalRtpReceiverStatistics(&rtp_receiver_)),
+ time_offset_counter_(0),
decryptor_(),
time_incoming_packet_updated_(false),
incoming_rtp_timestamp_(0),
@@ -365,6 +366,7 @@ base::TimeTicks VideoReceiver::GetRenderTime(base::TimeTicks now,
return now;
}
time_offset_ = time_incoming_packet_ - rtp_timestamp_in_ticks;
+ ++time_offset_counter_;
} else if (time_incoming_packet_updated_) {
if (rtcp_->RtpTimestampInSenderTime(kVideoFrequency,
incoming_rtp_timestamp_,
@@ -372,8 +374,9 @@ base::TimeTicks VideoReceiver::GetRenderTime(base::TimeTicks now,
// Time to update the time_offset.
base::TimeDelta time_offset =
time_incoming_packet_ - rtp_timestamp_in_ticks;
- time_offset_ = ((kTimeOffsetFilter - 1) * time_offset_ + time_offset) /
- kTimeOffsetFilter;
+ if (time_offset_counter_ < 10 && time_offset < time_offset_)
+ time_offset_ = time_offset;
+ ++time_offset_counter_;
hguihot1 2014/03/03 23:20:59 The previous filter was basically doing: time_off
mikhal1 2014/03/03 23:33:23 That is indeed part of the problem, which can be d
pwestin 2014/03/03 23:35:47 Mikhal based on the date we have seen in testing I
mikhal1 2014/03/04 00:02:37 True, just thought of it as I was responding to hg
}
}
// Reset |time_incoming_packet_updated_| to enable a future measurement.
« no previous file with comments | « media/cast/video_receiver/video_receiver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698