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

Side by Side Diff: media/cast/net/rtcp/rtcp_utility.cc

Issue 1875433002: Reset NACK/ACK list when parsing a new RTCP packet. The NACK/ACK frames/packets list need to be res… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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/net/rtcp/rtcp_utility.h" 5 #include "media/cast/net/rtcp/rtcp_utility.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 uint8_t last_frame_id; 284 uint8_t last_frame_id;
285 uint8_t number_of_lost_fields; 285 uint8_t number_of_lost_fields;
286 if (!reader->ReadU8(&last_frame_id) || 286 if (!reader->ReadU8(&last_frame_id) ||
287 !reader->ReadU8(&number_of_lost_fields) || 287 !reader->ReadU8(&number_of_lost_fields) ||
288 !reader->ReadU16(&cast_message_.target_delay_ms)) 288 !reader->ReadU16(&cast_message_.target_delay_ms))
289 return false; 289 return false;
290 290
291 // Please note, this frame_id is still only 8-bit! 291 // Please note, this frame_id is still only 8-bit!
292 cast_message_.ack_frame_id = last_frame_id; 292 cast_message_.ack_frame_id = last_frame_id;
293 293
294 cast_message_.missing_frames_and_packets.clear();
295 cast_message_.received_later_frames.clear();
xjz 2016/04/07 19:42:42 I think this line should be removed, as Cst2 chang
294 for (size_t i = 0; i < number_of_lost_fields; i++) { 296 for (size_t i = 0; i < number_of_lost_fields; i++) {
295 uint8_t frame_id; 297 uint8_t frame_id;
296 uint16_t packet_id; 298 uint16_t packet_id;
297 uint8_t bitmask; 299 uint8_t bitmask;
298 if (!reader->ReadU8(&frame_id) || 300 if (!reader->ReadU8(&frame_id) ||
299 !reader->ReadU16(&packet_id) || 301 !reader->ReadU16(&packet_id) ||
300 !reader->ReadU8(&bitmask)) 302 !reader->ReadU8(&bitmask))
301 return false; 303 return false;
302 cast_message_.missing_frames_and_packets[frame_id].insert(packet_id); 304 cast_message_.missing_frames_and_packets[frame_id].insert(packet_id);
303 if (packet_id != kRtcpCastAllPacketsLost) { 305 if (packet_id != kRtcpCastAllPacketsLost) {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 uint32_t ssrc_of_sender; 480 uint32_t ssrc_of_sender;
479 base::BigEndianReader big_endian_reader( 481 base::BigEndianReader big_endian_reader(
480 reinterpret_cast<const char*>(rtcp_buffer), length); 482 reinterpret_cast<const char*>(rtcp_buffer), length);
481 big_endian_reader.Skip(4); // Skip header. 483 big_endian_reader.Skip(4); // Skip header.
482 big_endian_reader.ReadU32(&ssrc_of_sender); 484 big_endian_reader.ReadU32(&ssrc_of_sender);
483 return ssrc_of_sender; 485 return ssrc_of_sender;
484 } 486 }
485 487
486 } // namespace cast 488 } // namespace cast
487 } // namespace media 489 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698