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_RTP_RTP_PACKETIZER_H_ | 5 #ifndef MEDIA_CAST_NET_RTP_RTP_PACKETIZER_H_ |
6 #define MEDIA_CAST_NET_RTP_RTP_PACKETIZER_H_ | 6 #define MEDIA_CAST_NET_RTP_RTP_PACKETIZER_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
11 | 11 |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "media/cast/common/rtp_time.h" |
13 #include "media/cast/net/rtp/packet_storage.h" | 14 #include "media/cast/net/rtp/packet_storage.h" |
14 | 15 |
15 namespace base { | 16 namespace base { |
16 class TickClock; | 17 class TickClock; |
17 } | 18 } |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 namespace cast { | 21 namespace cast { |
21 | 22 |
22 class PacedSender; | 23 class PacedSender; |
(...skipping 24 matching lines...) Expand all Loading... |
47 void SendFrameAsPackets(const EncodedFrame& frame); | 48 void SendFrameAsPackets(const EncodedFrame& frame); |
48 | 49 |
49 // Return the next sequence number, and increment by one. Enables unique | 50 // Return the next sequence number, and increment by one. Enables unique |
50 // incremental sequence numbers for every packet (including retransmissions). | 51 // incremental sequence numbers for every packet (including retransmissions). |
51 uint16 NextSequenceNumber(); | 52 uint16 NextSequenceNumber(); |
52 | 53 |
53 size_t send_packet_count() const { return send_packet_count_; } | 54 size_t send_packet_count() const { return send_packet_count_; } |
54 size_t send_octet_count() const { return send_octet_count_; } | 55 size_t send_octet_count() const { return send_octet_count_; } |
55 | 56 |
56 private: | 57 private: |
57 void BuildCommonRTPheader(Packet* packet, bool marker_bit, uint32 time_stamp); | 58 void BuildCommonRTPheader(Packet* packet, |
| 59 bool marker_bit, |
| 60 RtpTimeTicks rtp_timestamp); |
58 | 61 |
59 RtpPacketizerConfig config_; | 62 RtpPacketizerConfig config_; |
60 PacedSender* const transport_; // Not owned by this class. | 63 PacedSender* const transport_; // Not owned by this class. |
61 PacketStorage* packet_storage_; | 64 PacketStorage* packet_storage_; |
62 | 65 |
63 uint16 sequence_number_; | 66 uint16 sequence_number_; |
64 uint32 rtp_timestamp_; | |
65 uint16 packet_id_; | |
66 | 67 |
67 size_t send_packet_count_; | 68 size_t send_packet_count_; |
68 size_t send_octet_count_; | 69 size_t send_octet_count_; |
69 }; | 70 }; |
70 | 71 |
71 } // namespace cast | 72 } // namespace cast |
72 } // namespace media | 73 } // namespace media |
73 | 74 |
74 #endif // MEDIA_CAST_NET_RTP_RTP_PACKETIZER_H_ | 75 #endif // MEDIA_CAST_NET_RTP_RTP_PACKETIZER_H_ |
OLD | NEW |