Ignore title parameter for navigator.registerProtocolHandler
[chromium-blink-merge.git] / media / cast / framer / frame_buffer.h
blob65df021d2542c963f88ff370006942f9ac495b4b
1 // Copyright 2013 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_FRAMER_FRAME_BUFFER
6 #define MEDIA_CAST_FRAMER_FRAME_BUFFER
8 #include <map>
9 #include <vector>
11 #include "media/cast/cast_config.h"
12 #include "media/cast/rtp_receiver/rtp_receiver_defines.h"
14 namespace media {
15 namespace cast {
17 typedef std::map<uint16, std::vector<uint8> > PacketMap;
19 class FrameBuffer {
20 public:
21 FrameBuffer();
22 ~FrameBuffer();
23 void InsertPacket(const uint8* payload_data,
24 size_t payload_size,
25 const RtpCastHeader& rtp_header);
26 bool Complete() const;
28 bool GetEncodedAudioFrame(transport::EncodedAudioFrame* audio_frame) const;
30 bool GetEncodedVideoFrame(transport::EncodedVideoFrame* video_frame) const;
32 bool is_key_frame() const { return is_key_frame_; }
34 uint32 last_referenced_frame_id() const { return last_referenced_frame_id_; }
36 private:
37 uint32 frame_id_;
38 uint16 max_packet_id_;
39 uint16 num_packets_received_;
40 bool is_key_frame_;
41 size_t total_data_size_;
42 uint32 last_referenced_frame_id_;
43 uint32 rtp_timestamp_;
44 PacketMap packets_;
46 DISALLOW_COPY_AND_ASSIGN(FrameBuffer);
49 } // namespace cast
50 } // namespace media
52 #endif // MEDIA_CAST_FRAMER_FRAME_BUFFER