diff options
Diffstat (limited to 'media/cast/cast_defines.h')
-rw-r--r-- | media/cast/cast_defines.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/media/cast/cast_defines.h b/media/cast/cast_defines.h index 6860797..d839b59 100644 --- a/media/cast/cast_defines.h +++ b/media/cast/cast_defines.h @@ -13,37 +13,38 @@ namespace cast { // TODO(miu): All remaining functions in this file are to be replaced with // methods in well-defined data types. http://crbug.com/530839 -inline bool IsNewerFrameId(uint32 frame_id, uint32 prev_frame_id) { +inline bool IsNewerFrameId(uint32_t frame_id, uint32_t prev_frame_id) { return (frame_id != prev_frame_id) && - static_cast<uint32>(frame_id - prev_frame_id) < 0x80000000; + static_cast<uint32_t>(frame_id - prev_frame_id) < 0x80000000; } -inline bool IsNewerRtpTimestamp(uint32 timestamp, uint32 prev_timestamp) { +inline bool IsNewerRtpTimestamp(uint32_t timestamp, uint32_t prev_timestamp) { return (timestamp != prev_timestamp) && - static_cast<uint32>(timestamp - prev_timestamp) < 0x80000000; + static_cast<uint32_t>(timestamp - prev_timestamp) < 0x80000000; } -inline bool IsOlderFrameId(uint32 frame_id, uint32 prev_frame_id) { +inline bool IsOlderFrameId(uint32_t frame_id, uint32_t prev_frame_id) { return (frame_id == prev_frame_id) || IsNewerFrameId(prev_frame_id, frame_id); } -inline bool IsNewerPacketId(uint16 packet_id, uint16 prev_packet_id) { +inline bool IsNewerPacketId(uint16_t packet_id, uint16_t prev_packet_id) { return (packet_id != prev_packet_id) && - static_cast<uint16>(packet_id - prev_packet_id) < 0x8000; + static_cast<uint16_t>(packet_id - prev_packet_id) < 0x8000; } -inline bool IsNewerSequenceNumber(uint16 sequence_number, - uint16 prev_sequence_number) { +inline bool IsNewerSequenceNumber(uint16_t sequence_number, + uint16_t prev_sequence_number) { // Same function as IsNewerPacketId just different data and name. return IsNewerPacketId(sequence_number, prev_sequence_number); } -inline base::TimeDelta RtpDeltaToTimeDelta(int64 rtp_delta, int rtp_timebase) { +inline base::TimeDelta RtpDeltaToTimeDelta(int64_t rtp_delta, + int rtp_timebase) { DCHECK_GT(rtp_timebase, 0); return rtp_delta * base::TimeDelta::FromSeconds(1) / rtp_timebase; } -inline int64 TimeDeltaToRtpDelta(base::TimeDelta delta, int rtp_timebase) { +inline int64_t TimeDeltaToRtpDelta(base::TimeDelta delta, int rtp_timebase) { DCHECK_GT(rtp_timebase, 0); return delta * rtp_timebase / base::TimeDelta::FromSeconds(1); } |