Revert "Omit calls to set composing region when pasting image."
[chromium-blink-merge.git] / media / cast / net / rtp / packet_storage.h
blobe086f8b29b15b9c511e60cc84d64bfe4858e3b74
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_
8 #include <deque>
10 #include "base/basictypes.h"
11 #include "media/cast/net/pacing/paced_sender.h"
13 namespace media {
14 namespace cast {
16 class PacketStorage {
17 public:
18 PacketStorage();
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;
35 private:
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.
41 size_t zombie_count_;
43 DISALLOW_COPY_AND_ASSIGN(PacketStorage);
46 } // namespace cast
47 } // namespace media
49 #endif // MEDIA_CAST_NET_RTP_SENDER_PACKET_STORAGE_PACKET_STORAGE_H_