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

Side by Side 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: Fix missing brace (rebase oops). 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
« no previous file with comments | « media/cast/sender/frame_sender.cc ('k') | media/cast/sender/rtp_timestamp_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_CAST_SENDER_RTP_TIMESTAMP_HELPER_H_
6 #define MEDIA_CAST_SENDER_RTP_TIMESTAMP_HELPER_H_
7
8 #include "base/basictypes.h"
9 #include "base/time/time.h"
10
11 namespace media {
12 namespace cast {
13
14 // A helper class used to convert current time ticks into RTP timestamp.
15 class RtpTimestampHelper {
16 public:
17 explicit RtpTimestampHelper(int frequency);
18 ~RtpTimestampHelper();
19
20 // Compute a RTP timestamp using current time, last encoded time and
21 // last encoded RTP timestamp.
22 // Return true if |rtp_timestamp| is computed.
23 bool GetCurrentTimeAsRtpTimestamp(const base::TimeTicks& now,
24 uint32* rtp_timestamp) const;
25
26 // Store the capture time and the corresponding RTP timestamp for the
27 // last encoded frame.
28 void StoreLatestTime(base::TimeTicks capture_time, uint32 rtp_timestamp);
29
30 private:
31 int frequency_;
32 base::TimeTicks last_capture_time_;
33 uint32 last_rtp_timestamp_;
34
35 DISALLOW_COPY_AND_ASSIGN(RtpTimestampHelper);
36 };
37
38 } // namespace cast
39 } // namespace media
40
41 #endif // MEDIA_CAST_SENDER_RTP_TIMESTAMP_HELPER_H_
OLDNEW
« no previous file with comments | « media/cast/sender/frame_sender.cc ('k') | media/cast/sender/rtp_timestamp_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698