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

Unified Diff: media/cast/sender/rtp_timestamp_helper.h

Issue 502333002: [Cast] In Audio/VideoSender, drop frames when too-long a duration is in-flight. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Based on TimeDelta rather than RTP delta. Created 6 years, 4 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
Index: media/cast/sender/rtp_timestamp_helper.h
diff --git a/media/cast/sender/rtp_timestamp_helper.h b/media/cast/sender/rtp_timestamp_helper.h
index 8f56681dac3651579884f8ce619a61718677c21a..28fe3a1e9801be442ddc1ca8b0b544a1f6fcfef4 100644
--- a/media/cast/sender/rtp_timestamp_helper.h
+++ b/media/cast/sender/rtp_timestamp_helper.h
@@ -17,11 +17,18 @@ class RtpTimestampHelper {
explicit RtpTimestampHelper(int frequency);
~RtpTimestampHelper();
- // Compute a RTP timestamp using current time, last encoded time and
- // last encoded RTP timestamp.
- // Return true if |rtp_timestamp| is computed.
- bool GetCurrentTimeAsRtpTimestamp(const base::TimeTicks& now,
- uint32* rtp_timestamp) const;
+ // Compute a RTP timestamp from a TimeTicks, or a TimeTicks from a RTP
+ // timestamp; based on the currently stored capture time and its corresponding
+ // RTP timestamp. Return true if |rtp_timestamp| is computed.
+ //
+ // The values are estimates because, ultimately, it's the encoders that decide
+ // what the RTP timestamps for each frame are going to be. For example, in
+ // the case of audio, the TimeTicks may never be precise to an exact frame
+ // boundary; and so the computation here will result in a |rtp_timestamp|
+ // value that is near, but never exact to one emitted by the encoder.
+ bool EstimateRtpTimestamp(const base::TimeTicks& t,
+ uint32* rtp_timestamp) const;
+ bool EstimateTimeTicks(uint32 rtp_timestamp, base::TimeTicks* t) const;
// Store the capture time and the corresponding RTP timestamp for the
// last encoded frame.

Powered by Google App Engine
This is Rietveld 408576698