OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_NET_CAST_TRANSPORT_DEFINES_H_ | 5 #ifndef MEDIA_CAST_NET_CAST_TRANSPORT_DEFINES_H_ |
6 #define MEDIA_CAST_NET_CAST_TRANSPORT_DEFINES_H_ | 6 #define MEDIA_CAST_NET_CAST_TRANSPORT_DEFINES_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 20 matching lines...) Expand all Loading... |
31 const size_t kMaxIpPacketSize = 1500; | 31 const size_t kMaxIpPacketSize = 1500; |
32 // Each uint16 represents one packet id within a cast frame. | 32 // Each uint16 represents one packet id within a cast frame. |
33 typedef std::set<uint16> PacketIdSet; | 33 typedef std::set<uint16> PacketIdSet; |
34 // Each uint8 represents one cast frame. | 34 // Each uint8 represents one cast frame. |
35 typedef std::map<uint8, PacketIdSet> MissingFramesAndPacketsMap; | 35 typedef std::map<uint8, PacketIdSet> MissingFramesAndPacketsMap; |
36 | 36 |
37 // Rtcp defines. | 37 // Rtcp defines. |
38 | 38 |
39 enum RtcpPacketFields { | 39 enum RtcpPacketFields { |
40 kPacketTypeLow = 194, // SMPTE time-code mapping. | 40 kPacketTypeLow = 194, // SMPTE time-code mapping. |
41 kPacketTypeInterArrivalJitterReport = 195, | |
42 kPacketTypeSenderReport = 200, | 41 kPacketTypeSenderReport = 200, |
43 kPacketTypeReceiverReport = 201, | 42 kPacketTypeReceiverReport = 201, |
44 kPacketTypeSdes = 202, | |
45 kPacketTypeBye = 203, | |
46 kPacketTypeApplicationDefined = 204, | 43 kPacketTypeApplicationDefined = 204, |
47 kPacketTypeGenericRtpFeedback = 205, | 44 kPacketTypeGenericRtpFeedback = 205, |
48 kPacketTypePayloadSpecific = 206, | 45 kPacketTypePayloadSpecific = 206, |
49 kPacketTypeXr = 207, | 46 kPacketTypeXr = 207, |
50 kPacketTypeHigh = 210, // Port Mapping. | 47 kPacketTypeHigh = 210, // Port Mapping. |
51 }; | 48 }; |
52 | 49 |
53 enum RtcpPacketField { | 50 enum RtcpPacketField { |
54 kRtcpSr = 0x0002, | 51 kRtcpSr = 0x0002, |
55 kRtcpRr = 0x0004, | 52 kRtcpRr = 0x0004, |
56 kRtcpBye = 0x0008, | |
57 kRtcpPli = 0x0010, | |
58 kRtcpNack = 0x0020, | |
59 kRtcpFir = 0x0040, | |
60 kRtcpSrReq = 0x0200, | |
61 kRtcpDlrr = 0x0400, | 53 kRtcpDlrr = 0x0400, |
62 kRtcpRrtr = 0x0800, | 54 kRtcpRrtr = 0x0800, |
63 kRtcpRpsi = 0x8000, | |
64 kRtcpRemb = 0x10000, | |
65 kRtcpCast = 0x20000, | 55 kRtcpCast = 0x20000, |
66 kRtcpSenderLog = 0x40000, | |
67 kRtcpReceiverLog = 0x80000, | 56 kRtcpReceiverLog = 0x80000, |
68 }; | 57 }; |
69 | 58 |
70 // Each uint16 represents one packet id within a cast frame. | 59 // Each uint16 represents one packet id within a cast frame. |
71 typedef std::set<uint16> PacketIdSet; | 60 typedef std::set<uint16> PacketIdSet; |
72 // Each uint8 represents one cast frame. | 61 // Each uint8 represents one cast frame. |
73 typedef std::map<uint8, PacketIdSet> MissingFramesAndPacketsMap; | 62 typedef std::map<uint8, PacketIdSet> MissingFramesAndPacketsMap; |
74 | 63 |
75 // TODO(miu): UGLY IN-LINE DEFINITION IN HEADER FILE! Move to appropriate | 64 // TODO(miu): UGLY IN-LINE DEFINITION IN HEADER FILE! Move to appropriate |
76 // location, separated into .h and .cc files. | 65 // location, separated into .h and .cc files. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 base::TimeTicks zero_time; | 127 base::TimeTicks zero_time; |
139 base::TimeDelta recorded_delta = time_ticks - zero_time; | 128 base::TimeDelta recorded_delta = time_ticks - zero_time; |
140 // Timestamp is in 90 KHz for video. | 129 // Timestamp is in 90 KHz for video. |
141 return static_cast<uint32>(recorded_delta.InMilliseconds() * 90); | 130 return static_cast<uint32>(recorded_delta.InMilliseconds() * 90); |
142 } | 131 } |
143 | 132 |
144 } // namespace cast | 133 } // namespace cast |
145 } // namespace media | 134 } // namespace media |
146 | 135 |
147 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_DEFINES_H_ | 136 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_DEFINES_H_ |
OLD | NEW |