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
11 #include "media/cast/cast_config.h"
12 #include "media/cast/rtp_receiver/rtp_receiver_defines.h"
17 typedef std::map
<uint16
, std::vector
<uint8
> > PacketMap
;
23 void InsertPacket(const uint8
* payload_data
,
25 const RtpCastHeader
& rtp_header
);
26 bool Complete() const;
28 // If a frame is complete, sets the frame IDs and RTP timestamp in |frame|,
29 // and also copies the data from all packets into the data field in |frame|.
30 // Returns true if the frame was complete; false if incomplete and |frame|
32 bool AssembleEncodedFrame(transport::EncodedFrame
* frame
) const;
34 bool is_key_frame() const { return is_key_frame_
; }
36 uint32
last_referenced_frame_id() const { return last_referenced_frame_id_
; }
40 uint16 max_packet_id_
;
41 uint16 num_packets_received_
;
43 size_t total_data_size_
;
44 uint32 last_referenced_frame_id_
;
45 uint32 rtp_timestamp_
;
48 DISALLOW_COPY_AND_ASSIGN(FrameBuffer
);
54 #endif // MEDIA_CAST_FRAMER_FRAME_BUFFER