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

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

Issue 250363002: [Cast] Clean-up RtpCastHeader and RtpParser, removing the last WebRTC dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed hubbe's comment. Created 6 years, 8 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
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 #include "media/cast/framer/frame_buffer.h" 5 #include "media/cast/framer/frame_buffer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media { 9 namespace media {
10 namespace cast { 10 namespace cast {
(...skipping 10 matching lines...) Expand all
21 FrameBuffer::~FrameBuffer() {} 21 FrameBuffer::~FrameBuffer() {}
22 22
23 void FrameBuffer::InsertPacket(const uint8* payload_data, 23 void FrameBuffer::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 // Is this the first packet in the frame? 26 // Is this the first packet in the frame?
27 if (packets_.empty()) { 27 if (packets_.empty()) {
28 frame_id_ = rtp_header.frame_id; 28 frame_id_ = rtp_header.frame_id;
29 max_packet_id_ = rtp_header.max_packet_id; 29 max_packet_id_ = rtp_header.max_packet_id;
30 is_key_frame_ = rtp_header.is_key_frame; 30 is_key_frame_ = rtp_header.is_key_frame;
31 if (rtp_header.is_reference) { 31 last_referenced_frame_id_ = rtp_header.reference_frame_id;
32 last_referenced_frame_id_ = rtp_header.reference_frame_id; 32 rtp_timestamp_ = rtp_header.rtp_timestamp;
33 } else {
34 last_referenced_frame_id_ = rtp_header.frame_id - 1;
35 }
36
37 rtp_timestamp_ = rtp_header.webrtc.header.timestamp;
38 } 33 }
39 // Is this the correct frame? 34 // Is this the correct frame?
40 if (rtp_header.frame_id != frame_id_) 35 if (rtp_header.frame_id != frame_id_)
41 return; 36 return;
42 37
43 // Insert every packet only once. 38 // Insert every packet only once.
44 if (packets_.find(rtp_header.packet_id) != packets_.end()) { 39 if (packets_.find(rtp_header.packet_id) != packets_.end()) {
45 return; 40 return;
46 } 41 }
47 42
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 PacketMap::const_iterator it; 93 PacketMap::const_iterator it;
99 for (it = packets_.begin(); it != packets_.end(); ++it) { 94 for (it = packets_.begin(); it != packets_.end(); ++it) {
100 video_frame->data.insert( 95 video_frame->data.insert(
101 video_frame->data.end(), it->second.begin(), it->second.end()); 96 video_frame->data.end(), it->second.begin(), it->second.end());
102 } 97 }
103 return true; 98 return true;
104 } 99 }
105 100
106 } // namespace cast 101 } // namespace cast
107 } // namespace media 102 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/framer/cast_message_builder_unittest.cc ('k') | media/cast/framer/frame_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698