Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Unified Diff: webrtc/modules/video_coding/main/source/timestamp_map.h

Issue 1358863002: Simplify VCMTimestampMap. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « webrtc/modules/video_coding/main/source/generic_decoder.cc ('k') | webrtc/modules/video_coding/main/source/timestamp_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698