| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 uint8_t last_frame_id; | 315 uint8_t last_frame_id; |
| 316 uint8_t number_of_lost_fields; | 316 uint8_t number_of_lost_fields; |
| 317 if (!reader->ReadU8(&last_frame_id) || | 317 if (!reader->ReadU8(&last_frame_id) || |
| 318 !reader->ReadU8(&number_of_lost_fields) || | 318 !reader->ReadU8(&number_of_lost_fields) || |
| 319 !reader->ReadU16(&cast_message_.target_delay_ms)) | 319 !reader->ReadU16(&cast_message_.target_delay_ms)) |
| 320 return false; | 320 return false; |
| 321 | 321 |
| 322 // Please note, this frame_id is still only 8-bit! | 322 // Please note, this frame_id is still only 8-bit! |
| 323 cast_message_.ack_frame_id = last_frame_id; | 323 cast_message_.ack_frame_id = last_frame_id; |
| 324 | 324 |
| 325 cast_message_.missing_frames_and_packets.clear(); |
| 326 cast_message_.received_later_frames.clear(); |
| 325 for (size_t i = 0; i < number_of_lost_fields; i++) { | 327 for (size_t i = 0; i < number_of_lost_fields; i++) { |
| 326 uint8_t frame_id; | 328 uint8_t frame_id; |
| 327 uint16_t packet_id; | 329 uint16_t packet_id; |
| 328 uint8_t bitmask; | 330 uint8_t bitmask; |
| 329 if (!reader->ReadU8(&frame_id) || | 331 if (!reader->ReadU8(&frame_id) || |
| 330 !reader->ReadU16(&packet_id) || | 332 !reader->ReadU16(&packet_id) || |
| 331 !reader->ReadU8(&bitmask)) | 333 !reader->ReadU8(&bitmask)) |
| 332 return false; | 334 return false; |
| 333 cast_message_.missing_frames_and_packets[frame_id].insert(packet_id); | 335 cast_message_.missing_frames_and_packets[frame_id].insert(packet_id); |
| 334 if (packet_id != kRtcpCastAllPacketsLost) { | 336 if (packet_id != kRtcpCastAllPacketsLost) { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 uint32_t ssrc_of_sender; | 539 uint32_t ssrc_of_sender; |
| 538 base::BigEndianReader big_endian_reader( | 540 base::BigEndianReader big_endian_reader( |
| 539 reinterpret_cast<const char*>(rtcp_buffer), length); | 541 reinterpret_cast<const char*>(rtcp_buffer), length); |
| 540 big_endian_reader.Skip(4); // Skip header. | 542 big_endian_reader.Skip(4); // Skip header. |
| 541 big_endian_reader.ReadU32(&ssrc_of_sender); | 543 big_endian_reader.ReadU32(&ssrc_of_sender); |
| 542 return ssrc_of_sender; | 544 return ssrc_of_sender; |
| 543 } | 545 } |
| 544 | 546 |
| 545 } // namespace cast | 547 } // namespace cast |
| 546 } // namespace media | 548 } // namespace media |
| OLD | NEW |