| 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 <list> | |
| 9 #include <map> | 8 #include <map> |
| 10 #include <set> | 9 #include <set> |
| 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 | 14 |
| 15 namespace media { | 15 namespace media { |
| 16 namespace cast { | 16 namespace cast { |
| 17 namespace transport { | 17 namespace transport { |
| 18 | 18 |
| 19 // TODO(mikhal): Implement and add more types. | 19 // TODO(mikhal): Implement and add more types. |
| 20 enum CastTransportStatus { | 20 enum CastTransportStatus { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 kPacketTypePayloadSpecific = 206, | 44 kPacketTypePayloadSpecific = 206, |
| 45 kPacketTypeXr = 207, | 45 kPacketTypeXr = 207, |
| 46 kPacketTypeHigh = 210, // Port Mapping. | 46 kPacketTypeHigh = 210, // Port Mapping. |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // Each uint16 represents one packet id within a cast frame. | 49 // Each uint16 represents one packet id within a cast frame. |
| 50 typedef std::set<uint16> PacketIdSet; | 50 typedef std::set<uint16> PacketIdSet; |
| 51 // Each uint8 represents one cast frame. | 51 // Each uint8 represents one cast frame. |
| 52 typedef std::map<uint8, PacketIdSet> MissingFramesAndPacketsMap; | 52 typedef std::map<uint8, PacketIdSet> MissingFramesAndPacketsMap; |
| 53 | 53 |
| 54 | |
| 55 class FrameIdWrapHelper { | 54 class FrameIdWrapHelper { |
| 56 public: | 55 public: |
| 57 FrameIdWrapHelper() | 56 FrameIdWrapHelper() |
| 58 : first_(true), | 57 : first_(true), |
| 59 frame_id_wrap_count_(0), | 58 frame_id_wrap_count_(0), |
| 60 range_(kLowRange) {} | 59 range_(kLowRange) {} |
| 61 | 60 |
| 62 uint32 MapTo32bitsFrameId(const uint8 over_the_wire_frame_id) { | 61 uint32 MapTo32bitsFrameId(const uint8 over_the_wire_frame_id) { |
| 63 if (first_) { | 62 if (first_) { |
| 64 first_ = false; | 63 first_ = false; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 base::TimeDelta recorded_delta = time_ticks - zero_time; | 120 base::TimeDelta recorded_delta = time_ticks - zero_time; |
| 122 // Timestamp is in 90 KHz for video. | 121 // Timestamp is in 90 KHz for video. |
| 123 return static_cast<uint32>(recorded_delta.InMilliseconds() * 90); | 122 return static_cast<uint32>(recorded_delta.InMilliseconds() * 90); |
| 124 } | 123 } |
| 125 | 124 |
| 126 } // namespace transport | 125 } // namespace transport |
| 127 } // namespace cast | 126 } // namespace cast |
| 128 } // namespace media | 127 } // namespace media |
| 129 | 128 |
| 130 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_DEFINES_H_ | 129 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_DEFINES_H_ |
| OLD | NEW |