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_SENDER_PACKET_STORAGE_PACKET_STORAGE_H_ | 5 #ifndef MEDIA_CAST_NET_RTP_SENDER_PACKET_STORAGE_PACKET_STORAGE_H_ |
6 #define MEDIA_CAST_NET_RTP_SENDER_PACKET_STORAGE_PACKET_STORAGE_H_ | 6 #define MEDIA_CAST_NET_RTP_SENDER_PACKET_STORAGE_PACKET_STORAGE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/basictypes.h" | |
11 #include "media/cast/net/pacing/paced_sender.h" | 10 #include "media/cast/net/pacing/paced_sender.h" |
12 | 11 |
13 namespace media { | 12 namespace media { |
14 namespace cast { | 13 namespace cast { |
15 | 14 |
16 class PacketStorage { | 15 class PacketStorage { |
17 public: | 16 public: |
18 PacketStorage(); | 17 PacketStorage(); |
19 virtual ~PacketStorage(); | 18 virtual ~PacketStorage(); |
20 | 19 |
21 // Store all of the packets for a frame. | 20 // Store all of the packets for a frame. |
22 void StoreFrame(uint32 frame_id, const SendPacketVector& packets); | 21 void StoreFrame(uint32_t frame_id, const SendPacketVector& packets); |
23 | 22 |
24 // Release all of the packets for a frame. | 23 // Release all of the packets for a frame. |
25 void ReleaseFrame(uint32 frame_id); | 24 void ReleaseFrame(uint32_t frame_id); |
26 | 25 |
27 // Returns a list of packets for a frame indexed by a 8-bits ID. | 26 // Returns a list of packets for a frame indexed by a 8-bits ID. |
28 // It is the lowest 8 bits of a frame ID. | 27 // It is the lowest 8 bits of a frame ID. |
29 // Returns NULL if the frame cannot be found. | 28 // Returns NULL if the frame cannot be found. |
30 const SendPacketVector* GetFrame8(uint8 frame_id_8bits) const; | 29 const SendPacketVector* GetFrame8(uint8_t frame_id_8bits) const; |
31 | 30 |
32 // Get the number of stored frames. | 31 // Get the number of stored frames. |
33 size_t GetNumberOfStoredFrames() const; | 32 size_t GetNumberOfStoredFrames() const; |
34 | 33 |
35 private: | 34 private: |
36 std::deque<SendPacketVector> frames_; | 35 std::deque<SendPacketVector> frames_; |
37 uint32 first_frame_id_in_list_; | 36 uint32_t first_frame_id_in_list_; |
38 | 37 |
39 // The number of frames whose packets have been released, but the entry in the | 38 // The number of frames whose packets have been released, but the entry in the |
40 // |frames_| queue has not yet been popped. | 39 // |frames_| queue has not yet been popped. |
41 size_t zombie_count_; | 40 size_t zombie_count_; |
42 | 41 |
43 DISALLOW_COPY_AND_ASSIGN(PacketStorage); | 42 DISALLOW_COPY_AND_ASSIGN(PacketStorage); |
44 }; | 43 }; |
45 | 44 |
46 } // namespace cast | 45 } // namespace cast |
47 } // namespace media | 46 } // namespace media |
48 | 47 |
49 #endif // MEDIA_CAST_NET_RTP_SENDER_PACKET_STORAGE_PACKET_STORAGE_H_ | 48 #endif // MEDIA_CAST_NET_RTP_SENDER_PACKET_STORAGE_PACKET_STORAGE_H_ |
OLD | NEW |