Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/transport/rtp_sender/packet_storage/packet_storage.h" | 5 #include "media/cast/net/rtp/packet_storage.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "media/cast/cast_defines.h" | |
|
wtc
2014/07/11 22:31:35
Just curious: why is this header needed?
Alpha Left Google
2014/07/12 01:37:54
It defines kMaxUnackedFrames.
| |
| 10 | 11 |
| 11 namespace media { | 12 namespace media { |
| 12 namespace cast { | 13 namespace cast { |
| 13 namespace transport { | |
| 14 | 14 |
| 15 PacketStorage::PacketStorage(size_t stored_frames) | 15 PacketStorage::PacketStorage(size_t stored_frames) |
| 16 : max_stored_frames_(stored_frames), | 16 : max_stored_frames_(stored_frames), |
| 17 first_frame_id_in_list_(0), | 17 first_frame_id_in_list_(0), |
| 18 last_frame_id_in_list_(0) { | 18 last_frame_id_in_list_(0) { |
| 19 } | 19 } |
| 20 | 20 |
| 21 PacketStorage::~PacketStorage() { | 21 PacketStorage::~PacketStorage() { |
| 22 } | 22 } |
| 23 | 23 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 53 const SendPacketVector* PacketStorage::GetFrame8(uint8 frame_id_8bits) const { | 53 const SendPacketVector* PacketStorage::GetFrame8(uint8 frame_id_8bits) const { |
| 54 // The requested frame ID has only 8-bits so convert the first frame ID | 54 // The requested frame ID has only 8-bits so convert the first frame ID |
| 55 // in list to match. | 55 // in list to match. |
| 56 uint8 index_8bits = first_frame_id_in_list_ & 0xFF; | 56 uint8 index_8bits = first_frame_id_in_list_ & 0xFF; |
| 57 index_8bits = frame_id_8bits - index_8bits; | 57 index_8bits = frame_id_8bits - index_8bits; |
| 58 if (index_8bits >= frames_.size()) | 58 if (index_8bits >= frames_.size()) |
| 59 return NULL; | 59 return NULL; |
| 60 return &(frames_[index_8bits]); | 60 return &(frames_[index_8bits]); |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace transport | |
| 64 } // namespace cast | 63 } // namespace cast |
| 65 } // namespace media | 64 } // namespace media |
| OLD | NEW |