Index: webrtc/modules/video_coding/main/source/timestamp_map.h |
diff --git a/webrtc/modules/video_coding/main/source/timestamp_map.h b/webrtc/modules/video_coding/main/source/timestamp_map.h |
index 14e06290ff94996be4fc151a8a96d51efe0a8eec..3d6f1bca0fb602f3cc8f4755d955b151c33c368c 100644 |
--- a/webrtc/modules/video_coding/main/source/timestamp_map.h |
+++ b/webrtc/modules/video_coding/main/source/timestamp_map.h |
@@ -11,40 +11,35 @@ |
#ifndef WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_MAP_H_ |
#define WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_MAP_H_ |
+#include "webrtc/base/scoped_ptr.h" |
#include "webrtc/typedefs.h" |
-namespace webrtc |
-{ |
+namespace webrtc { |
-struct VCMTimestampDataTuple |
-{ |
- uint32_t timestamp; |
- void* data; |
-}; |
- |
-class VCMTimestampMap |
-{ |
-public: |
- // Constructor. Optional parameter specifies maximum number of |
- // timestamps in map. |
- VCMTimestampMap(const int32_t length = 10); |
+struct VCMFrameInformation; |
- // Destructor. |
- ~VCMTimestampMap(); |
+class VCMTimestampMap { |
+ public: |
+ explicit VCMTimestampMap(size_t capacity); |
+ ~VCMTimestampMap(); |
- // Empty the map |
- void Reset(); |
+ // Empty the map. |
+ void Reset(); |
- int32_t Add(uint32_t timestamp, void* data); |
- void* Pop(uint32_t timestamp); |
+ void Add(uint32_t timestamp, VCMFrameInformation* data); |
+ VCMFrameInformation* Pop(uint32_t timestamp); |
-private: |
- bool IsEmpty() const; |
+ private: |
+ struct TimestampDataTuple { |
+ uint32_t timestamp; |
+ VCMFrameInformation* data; |
+ }; |
+ bool IsEmpty() const; |
- VCMTimestampDataTuple* _map; |
- int32_t _nextAddIx; |
- int32_t _nextPopIx; |
- int32_t _length; |
+ rtc::scoped_ptr<TimestampDataTuple[]> ring_buffer_; |
+ const size_t capacity_; |
+ size_t next_add_idx_; |
+ size_t next_pop_idx_; |
}; |
} // namespace webrtc |