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

Side by Side Diff: media/cast/cast_defines.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, 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 | « no previous file | media/cast/sender/audio_sender.h » ('j') | media/cast/sender/audio_sender.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_CAST_CAST_DEFINES_H_ 5 #ifndef MEDIA_CAST_CAST_DEFINES_H_
6 #define MEDIA_CAST_CAST_DEFINES_H_ 6 #define MEDIA_CAST_CAST_DEFINES_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 ntp_time_us - 188 ntp_time_us -
189 (kUnixEpochInNtpSeconds * base::Time::kMicrosecondsPerSecond)); 189 (kUnixEpochInNtpSeconds * base::Time::kMicrosecondsPerSecond));
190 return base::TimeTicks::UnixEpoch() + elapsed_since_unix_epoch; 190 return base::TimeTicks::UnixEpoch() + elapsed_since_unix_epoch;
191 } 191 }
192 192
193 inline base::TimeDelta RtpDeltaToTimeDelta(int64 rtp_delta, int rtp_timebase) { 193 inline base::TimeDelta RtpDeltaToTimeDelta(int64 rtp_delta, int rtp_timebase) {
194 DCHECK_GT(rtp_timebase, 0); 194 DCHECK_GT(rtp_timebase, 0);
195 return rtp_delta * base::TimeDelta::FromSeconds(1) / rtp_timebase; 195 return rtp_delta * base::TimeDelta::FromSeconds(1) / rtp_timebase;
196 } 196 }
197 197
198 inline int64 TimeDeltaToRtpDelta(base::TimeDelta delta, int rtp_timebase) {
199 DCHECK_GT(rtp_timebase, 0);
200 return delta * rtp_timebase / base::TimeDelta::FromSeconds(1);
201 }
202
198 } // namespace cast 203 } // namespace cast
199 } // namespace media 204 } // namespace media
200 205
201 #endif // MEDIA_CAST_CAST_DEFINES_H_ 206 #endif // MEDIA_CAST_CAST_DEFINES_H_
OLDNEW
« no previous file with comments | « no previous file | media/cast/sender/audio_sender.h » ('j') | media/cast/sender/audio_sender.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698