Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: media/cast/framer/frame_buffer.h

Issue 288103002: [Cast] EncodedAudioFrame+EncodedVideoFrame+reference_time --> EncodedFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/cast/cast_receiver_impl.cc ('k') | media/cast/framer/frame_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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_FRAMER_FRAME_BUFFER 5 #ifndef MEDIA_CAST_FRAMER_FRAME_BUFFER
6 #define MEDIA_CAST_FRAMER_FRAME_BUFFER 6 #define MEDIA_CAST_FRAMER_FRAME_BUFFER
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
11 #include "media/cast/cast_config.h" 11 #include "media/cast/cast_config.h"
12 #include "media/cast/rtp_receiver/rtp_receiver_defines.h" 12 #include "media/cast/rtp_receiver/rtp_receiver_defines.h"
13 13
14 namespace media { 14 namespace media {
15 namespace cast { 15 namespace cast {
16 16
17 typedef std::map<uint16, std::vector<uint8> > PacketMap; 17 typedef std::map<uint16, std::vector<uint8> > PacketMap;
18 18
19 class FrameBuffer { 19 class FrameBuffer {
20 public: 20 public:
21 FrameBuffer(); 21 FrameBuffer();
22 ~FrameBuffer(); 22 ~FrameBuffer();
23 void InsertPacket(const uint8* payload_data, 23 void InsertPacket(const uint8* payload_data,
24 size_t payload_size, 24 size_t payload_size,
25 const RtpCastHeader& rtp_header); 25 const RtpCastHeader& rtp_header);
26 bool Complete() const; 26 bool Complete() const;
27 27
28 bool GetEncodedAudioFrame(transport::EncodedAudioFrame* audio_frame) const; 28 // If a frame is complete, sets the frame IDs and RTP timestamp in |frame|,
29 29 // and also copies the data from all packets into the data field in |frame|.
30 bool GetEncodedVideoFrame(transport::EncodedVideoFrame* video_frame) const; 30 // Returns true if the frame was complete; false if incomplete and |frame|
31 // remains unchanged.
32 bool AssembleEncodedFrame(transport::EncodedFrame* frame) const;
31 33
32 bool is_key_frame() const { return is_key_frame_; } 34 bool is_key_frame() const { return is_key_frame_; }
33 35
34 uint32 last_referenced_frame_id() const { return last_referenced_frame_id_; } 36 uint32 last_referenced_frame_id() const { return last_referenced_frame_id_; }
35 37
36 private: 38 private:
37 uint32 frame_id_; 39 uint32 frame_id_;
38 uint16 max_packet_id_; 40 uint16 max_packet_id_;
39 uint16 num_packets_received_; 41 uint16 num_packets_received_;
40 bool is_key_frame_; 42 bool is_key_frame_;
41 size_t total_data_size_; 43 size_t total_data_size_;
42 uint32 last_referenced_frame_id_; 44 uint32 last_referenced_frame_id_;
43 uint32 rtp_timestamp_; 45 uint32 rtp_timestamp_;
44 PacketMap packets_; 46 PacketMap packets_;
45 47
46 DISALLOW_COPY_AND_ASSIGN(FrameBuffer); 48 DISALLOW_COPY_AND_ASSIGN(FrameBuffer);
47 }; 49 };
48 50
49 } // namespace cast 51 } // namespace cast
50 } // namespace media 52 } // namespace media
51 53
52 #endif // MEDIA_CAST_FRAMER_FRAME_BUFFER 54 #endif // MEDIA_CAST_FRAMER_FRAME_BUFFER
OLDNEW
« no previous file with comments | « media/cast/cast_receiver_impl.cc ('k') | media/cast/framer/frame_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698