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 24 matching lines...) Expand all Loading... |
35 | 35 |
36 virtual int flow_id() const { return flow_id_; } | 36 virtual int flow_id() const { return flow_id_; } |
37 virtual void set_send_time_us(int64_t send_time_us); | 37 virtual void set_send_time_us(int64_t send_time_us); |
38 virtual int64_t send_time_us() const { return send_time_us_; } | 38 virtual int64_t send_time_us() const { return send_time_us_; } |
39 virtual int64_t sender_timestamp_us() const { return sender_timestamp_us_; } | 39 virtual int64_t sender_timestamp_us() const { return sender_timestamp_us_; } |
40 virtual size_t payload_size() const { return payload_size_; } | 40 virtual size_t payload_size() const { return payload_size_; } |
41 virtual Packet::Type GetPacketType() const = 0; | 41 virtual Packet::Type GetPacketType() const = 0; |
42 virtual void set_sender_timestamp_us(int64_t sender_timestamp_us) { | 42 virtual void set_sender_timestamp_us(int64_t sender_timestamp_us) { |
43 sender_timestamp_us_ = sender_timestamp_us; | 43 sender_timestamp_us_ = sender_timestamp_us; |
44 } | 44 } |
| 45 virtual void set_paced(bool paced) { paced_ = paced; } |
| 46 virtual bool paced() const { return paced_; } |
45 virtual int64_t creation_time_ms() const { | 47 virtual int64_t creation_time_ms() const { |
46 return (creation_time_us_ + 500) / 1000; | 48 return (creation_time_us_ + 500) / 1000; |
47 } | 49 } |
48 virtual int64_t sender_timestamp_ms() const { | 50 virtual int64_t sender_timestamp_ms() const { |
49 return (sender_timestamp_us_ + 500) / 1000; | 51 return (sender_timestamp_us_ + 500) / 1000; |
50 } | 52 } |
51 virtual int64_t send_time_ms() const { return (send_time_us_ + 500) / 1000; } | 53 virtual int64_t send_time_ms() const { return (send_time_us_ + 500) / 1000; } |
52 | 54 |
53 protected: | 55 protected: |
54 int flow_id_; | 56 int flow_id_; |
55 int64_t creation_time_us_; // Time when the packet was created. | 57 int64_t creation_time_us_; // Time when the packet was created. |
56 int64_t send_time_us_; // Time the packet left last processor touching it. | 58 int64_t send_time_us_; // Time the packet left last processor touching it. |
57 int64_t sender_timestamp_us_; // Time the packet left the Sender. | 59 int64_t sender_timestamp_us_; // Time the packet left the Sender. |
58 size_t payload_size_; // Size of the (non-existent, simulated) payload. | 60 size_t payload_size_; // Size of the (non-existent, simulated) payload. |
| 61 bool paced_; // True if sent through paced sender. |
59 }; | 62 }; |
60 | 63 |
61 class MediaPacket : public Packet { | 64 class MediaPacket : public Packet { |
62 public: | 65 public: |
63 MediaPacket(); | 66 MediaPacket(); |
64 MediaPacket(int flow_id, | 67 MediaPacket(int flow_id, |
65 int64_t send_time_us, | 68 int64_t send_time_us, |
66 size_t payload_size, | 69 size_t payload_size, |
67 uint16_t sequence_number); | 70 uint16_t sequence_number); |
68 MediaPacket(int flow_id, | 71 MediaPacket(int flow_id, |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 }; | 196 }; |
194 | 197 |
195 typedef std::list<Packet*> Packets; | 198 typedef std::list<Packet*> Packets; |
196 typedef std::list<Packet*>::iterator PacketsIt; | 199 typedef std::list<Packet*>::iterator PacketsIt; |
197 typedef std::list<Packet*>::const_iterator PacketsConstIt; | 200 typedef std::list<Packet*>::const_iterator PacketsConstIt; |
198 | 201 |
199 } // namespace bwe | 202 } // namespace bwe |
200 } // namespace testing | 203 } // namespace testing |
201 } // namespace webrtc | 204 } // namespace webrtc |
202 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_PACKET_H_ | 205 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_PACKET_H_ |
OLD | NEW |