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
3 // found in the LICENSE file.
5 #ifndef MEDIA_CAST_NET_RTP_SENDER_PACKET_STORAGE_PACKET_STORAGE_H_
6 #define MEDIA_CAST_NET_RTP_SENDER_PACKET_STORAGE_PACKET_STORAGE_H_
10 #include "base/basictypes.h"
11 #include "media/cast/net/pacing/paced_sender.h"
19 virtual ~PacketStorage();
21 // Store all of the packets for a frame.
22 void StoreFrame(uint32 frame_id
, const SendPacketVector
& packets
);
24 // Release all of the packets for a frame.
25 void ReleaseFrame(uint32 frame_id
);
27 // 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.
29 // Returns NULL if the frame cannot be found.
30 const SendPacketVector
* GetFrame8(uint8 frame_id_8bits
) const;
32 // Get the number of stored frames.
33 size_t GetNumberOfStoredFrames() const;
36 std::deque
<SendPacketVector
> frames_
;
37 uint32 first_frame_id_in_list_
;
39 // The number of frames whose packets have been released, but the entry in the
40 // |frames_| queue has not yet been popped.
43 DISALLOW_COPY_AND_ASSIGN(PacketStorage
);
49 #endif // MEDIA_CAST_NET_RTP_SENDER_PACKET_STORAGE_PACKET_STORAGE_H_