OLD | NEW |
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_TRANSPORT_CAST_TRANSPORT_DEFINES_H_ | 5 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_DEFINES_H_ |
6 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_DEFINES_H_ | 6 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_DEFINES_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 kRtcpCast = 0x20000, | 86 kRtcpCast = 0x20000, |
87 kRtcpSenderLog = 0x40000, | 87 kRtcpSenderLog = 0x40000, |
88 kRtcpReceiverLog = 0x80000, | 88 kRtcpReceiverLog = 0x80000, |
89 }; | 89 }; |
90 | 90 |
91 // Each uint16 represents one packet id within a cast frame. | 91 // Each uint16 represents one packet id within a cast frame. |
92 typedef std::set<uint16> PacketIdSet; | 92 typedef std::set<uint16> PacketIdSet; |
93 // Each uint8 represents one cast frame. | 93 // Each uint8 represents one cast frame. |
94 typedef std::map<uint8, PacketIdSet> MissingFramesAndPacketsMap; | 94 typedef std::map<uint8, PacketIdSet> MissingFramesAndPacketsMap; |
95 | 95 |
| 96 // TODO(miu): UGLY IN-LINE DEFINITION IN HEADER FILE! Move to appropriate |
| 97 // location, separated into .h and .cc files. |
96 class FrameIdWrapHelper { | 98 class FrameIdWrapHelper { |
97 public: | 99 public: |
98 FrameIdWrapHelper() | 100 FrameIdWrapHelper() |
99 : first_(true), frame_id_wrap_count_(0), range_(kLowRange) {} | 101 : first_(true), frame_id_wrap_count_(0), range_(kLowRange) {} |
100 | 102 |
101 uint32 MapTo32bitsFrameId(const uint8 over_the_wire_frame_id) { | 103 uint32 MapTo32bitsFrameId(const uint8 over_the_wire_frame_id) { |
102 if (first_) { | 104 if (first_) { |
103 first_ = false; | 105 first_ = false; |
104 if (over_the_wire_frame_id == 0xff) { | 106 if (over_the_wire_frame_id == 0xff) { |
105 // Special case for startup. | 107 // Special case for startup. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 base::TimeDelta recorded_delta = time_ticks - zero_time; | 160 base::TimeDelta recorded_delta = time_ticks - zero_time; |
159 // Timestamp is in 90 KHz for video. | 161 // Timestamp is in 90 KHz for video. |
160 return static_cast<uint32>(recorded_delta.InMilliseconds() * 90); | 162 return static_cast<uint32>(recorded_delta.InMilliseconds() * 90); |
161 } | 163 } |
162 | 164 |
163 } // namespace transport | 165 } // namespace transport |
164 } // namespace cast | 166 } // namespace cast |
165 } // namespace media | 167 } // namespace media |
166 | 168 |
167 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_DEFINES_H_ | 169 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_DEFINES_H_ |
OLD | NEW |