OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 MediaPacket(); | 57 MediaPacket(); |
58 MediaPacket(int flow_id, | 58 MediaPacket(int flow_id, |
59 int64_t send_time_us, | 59 int64_t send_time_us, |
60 size_t payload_size, | 60 size_t payload_size, |
61 uint16_t sequence_number); | 61 uint16_t sequence_number); |
62 MediaPacket(int flow_id, | 62 MediaPacket(int flow_id, |
63 int64_t send_time_us, | 63 int64_t send_time_us, |
64 size_t payload_size, | 64 size_t payload_size, |
65 const RTPHeader& header); | 65 const RTPHeader& header); |
66 MediaPacket(int64_t send_time_us, uint32_t sequence_number); | 66 MediaPacket(int64_t send_time_us, uint32_t sequence_number); |
| 67 |
67 virtual ~MediaPacket() {} | 68 virtual ~MediaPacket() {} |
68 | 69 |
69 int64_t GetAbsSendTimeInMs() const { | 70 int64_t GetAbsSendTimeInMs() const { |
70 int64_t timestamp = header_.extension.absoluteSendTime | 71 int64_t timestamp = header_.extension.absoluteSendTime |
71 << kAbsSendTimeInterArrivalUpshift; | 72 << kAbsSendTimeInterArrivalUpshift; |
72 return 1000.0 * timestamp / static_cast<double>(1 << kInterArrivalShift); | 73 return 1000.0 * timestamp / static_cast<double>(1 << kInterArrivalShift); |
73 } | 74 } |
74 void SetAbsSendTimeMs(int64_t abs_send_time_ms); | 75 void SetAbsSendTimeMs(int64_t abs_send_time_ms); |
75 const RTPHeader& header() const { return header_; } | 76 const RTPHeader& header() const { return header_; } |
76 virtual Packet::Type GetPacketType() const { return kMedia; } | 77 virtual Packet::Type GetPacketType() const { return kMedia; } |
(...skipping 15 matching lines...) Expand all Loading... |
92 int64_t this_send_time_us, | 93 int64_t this_send_time_us, |
93 int64_t latest_send_time_ms) | 94 int64_t latest_send_time_ms) |
94 : Packet(flow_id, this_send_time_us, 0), | 95 : Packet(flow_id, this_send_time_us, 0), |
95 latest_send_time_ms_(latest_send_time_ms) {} | 96 latest_send_time_ms_(latest_send_time_ms) {} |
96 virtual ~FeedbackPacket() {} | 97 virtual ~FeedbackPacket() {} |
97 | 98 |
98 virtual Packet::Type GetPacketType() const { return kFeedback; } | 99 virtual Packet::Type GetPacketType() const { return kFeedback; } |
99 int64_t latest_send_time_ms() const { return latest_send_time_ms_; } | 100 int64_t latest_send_time_ms() const { return latest_send_time_ms_; } |
100 | 101 |
101 private: | 102 private: |
102 int64_t latest_send_time_ms_; // Time stamp for the latest sent packet. | 103 int64_t latest_send_time_ms_; // Time stamp for the latest sent FbPacket. |
103 }; | 104 }; |
104 | 105 |
105 class RembFeedback : public FeedbackPacket { | 106 class RembFeedback : public FeedbackPacket { |
106 public: | 107 public: |
107 RembFeedback(int flow_id, | 108 RembFeedback(int flow_id, |
108 int64_t send_time_us, | 109 int64_t send_time_us, |
109 int64_t latest_send_time_ms, | 110 int64_t latest_send_time_ms, |
110 uint32_t estimated_bps, | 111 uint32_t estimated_bps, |
111 RTCPReportBlock report_block); | 112 RTCPReportBlock report_block); |
112 virtual ~RembFeedback() {} | 113 virtual ~RembFeedback() {} |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 }; | 188 }; |
188 | 189 |
189 typedef std::list<Packet*> Packets; | 190 typedef std::list<Packet*> Packets; |
190 typedef std::list<Packet*>::iterator PacketsIt; | 191 typedef std::list<Packet*>::iterator PacketsIt; |
191 typedef std::list<Packet*>::const_iterator PacketsConstIt; | 192 typedef std::list<Packet*>::const_iterator PacketsConstIt; |
192 | 193 |
193 } // namespace bwe | 194 } // namespace bwe |
194 } // namespace testing | 195 } // namespace testing |
195 } // namespace webrtc | 196 } // namespace webrtc |
196 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_PACKET_H_ | 197 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_PACKET_H_ |
OLD | NEW |