Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |