OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_MAP_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_MAP_H_ |
12 #define WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_MAP_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_MAP_H_ |
13 | 13 |
14 #include "webrtc/base/scoped_ptr.h" | 14 #include <memory> |
| 15 |
15 #include "webrtc/typedefs.h" | 16 #include "webrtc/typedefs.h" |
16 | 17 |
17 namespace webrtc { | 18 namespace webrtc { |
18 | 19 |
19 struct VCMFrameInformation; | 20 struct VCMFrameInformation; |
20 | 21 |
21 class VCMTimestampMap { | 22 class VCMTimestampMap { |
22 public: | 23 public: |
23 explicit VCMTimestampMap(size_t capacity); | 24 explicit VCMTimestampMap(size_t capacity); |
24 ~VCMTimestampMap(); | 25 ~VCMTimestampMap(); |
25 | 26 |
26 // Empty the map. | 27 // Empty the map. |
27 void Reset(); | 28 void Reset(); |
28 | 29 |
29 void Add(uint32_t timestamp, VCMFrameInformation* data); | 30 void Add(uint32_t timestamp, VCMFrameInformation* data); |
30 VCMFrameInformation* Pop(uint32_t timestamp); | 31 VCMFrameInformation* Pop(uint32_t timestamp); |
31 | 32 |
32 private: | 33 private: |
33 struct TimestampDataTuple { | 34 struct TimestampDataTuple { |
34 uint32_t timestamp; | 35 uint32_t timestamp; |
35 VCMFrameInformation* data; | 36 VCMFrameInformation* data; |
36 }; | 37 }; |
37 bool IsEmpty() const; | 38 bool IsEmpty() const; |
38 | 39 |
39 rtc::scoped_ptr<TimestampDataTuple[]> ring_buffer_; | 40 std::unique_ptr<TimestampDataTuple[]> ring_buffer_; |
40 const size_t capacity_; | 41 const size_t capacity_; |
41 size_t next_add_idx_; | 42 size_t next_add_idx_; |
42 size_t next_pop_idx_; | 43 size_t next_pop_idx_; |
43 }; | 44 }; |
44 | 45 |
45 } // namespace webrtc | 46 } // namespace webrtc |
46 | 47 |
47 #endif // WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_MAP_H_ | 48 #endif // WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_MAP_H_ |
OLD | NEW |