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/rtp/framer.h" | 5 #include "media/cast/net/rtp/framer.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 26 matching lines...) Expand all Loading... |
37 const RtpCastHeader& rtp_header, | 37 const RtpCastHeader& rtp_header, |
38 bool* duplicate) { | 38 bool* duplicate) { |
39 *duplicate = false; | 39 *duplicate = false; |
40 uint32 frame_id = rtp_header.frame_id; | 40 uint32 frame_id = rtp_header.frame_id; |
41 | 41 |
42 if (rtp_header.is_key_frame && waiting_for_key_) { | 42 if (rtp_header.is_key_frame && waiting_for_key_) { |
43 last_released_frame_ = static_cast<uint32>(frame_id - 1); | 43 last_released_frame_ = static_cast<uint32>(frame_id - 1); |
44 waiting_for_key_ = false; | 44 waiting_for_key_ = false; |
45 } | 45 } |
46 | 46 |
47 VLOG(0) << "InsertPacket frame:" << frame_id | 47 VLOG(1) << "InsertPacket frame:" << frame_id |
48 << " packet:" << static_cast<int>(rtp_header.packet_id) | 48 << " packet:" << static_cast<int>(rtp_header.packet_id) |
49 << " max packet:" << static_cast<int>(rtp_header.max_packet_id); | 49 << " max packet:" << static_cast<int>(rtp_header.max_packet_id); |
50 | 50 |
51 if (IsOlderFrameId(frame_id, last_released_frame_) && !waiting_for_key_) { | 51 if (IsOlderFrameId(frame_id, last_released_frame_) && !waiting_for_key_) { |
52 // Packet is too old. | 52 // Packet is too old. |
53 return false; | 53 return false; |
54 } | 54 } |
55 | 55 |
56 // Update the last received frame id. | 56 // Update the last received frame id. |
57 if (IsNewerFrameId(frame_id, newest_frame_id_)) { | 57 if (IsNewerFrameId(frame_id, newest_frame_id_)) { |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 // Do we have the reference frame? | 279 // Do we have the reference frame? |
280 if (IsOlderFrameId(frame->last_referenced_frame_id(), last_released_frame_)) { | 280 if (IsOlderFrameId(frame->last_referenced_frame_id(), last_released_frame_)) { |
281 return true; | 281 return true; |
282 } | 282 } |
283 return frame->last_referenced_frame_id() == last_released_frame_; | 283 return frame->last_referenced_frame_id() == last_released_frame_; |
284 } | 284 } |
285 | 285 |
286 | 286 |
287 } // namespace cast | 287 } // namespace cast |
288 } // namespace media | 288 } // namespace media |
OLD | NEW |