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

Unified Diff: webrtc/modules/video_coding/utility/simulcast_rate_allocator.h

Issue 2510583002: Reland #2 of Issue 2434073003: Extract bitrate allocation ... (Closed)
Patch Set: Addressed comments Created 4 years, 1 month 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/utility/simulcast_rate_allocator.h
diff --git a/webrtc/modules/video_coding/utility/simulcast_rate_allocator.h b/webrtc/modules/video_coding/utility/simulcast_rate_allocator.h
index e7ee772b3c49613eabad795cf2addb1bb2fe9b31..149e86658813a95bba43344f01bdc152244b41d6 100644
--- a/webrtc/modules/video_coding/utility/simulcast_rate_allocator.h
+++ b/webrtc/modules/video_coding/utility/simulcast_rate_allocator.h
@@ -11,24 +11,36 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_UTILITY_SIMULCAST_RATE_ALLOCATOR_H_
#define WEBRTC_MODULES_VIDEO_CODING_UTILITY_SIMULCAST_RATE_ALLOCATOR_H_
-#include <vector>
+#include <map>
+#include <memory>
#include "webrtc/base/basictypes.h"
#include "webrtc/base/constructormagic.h"
+#include "webrtc/common_video/include/video_bitrate_allocator.h"
+#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
#include "webrtc/video_encoder.h"
namespace webrtc {
-class SimulcastRateAllocator {
+class SimulcastRateAllocator : public VideoBitrateAllocator,
+ public TemporalLayersListener {
public:
- explicit SimulcastRateAllocator(const VideoCodec& codec);
+ explicit SimulcastRateAllocator(
+ const VideoCodec& codec,
+ std::unique_ptr<TemporalLayersFactory> tl_factory);
- std::vector<uint32_t> GetAllocation(uint32_t bitrate_kbps) const;
- uint32_t GetPreferedBitrate() const;
+ void OnTemporalLayersCreated(int simulcast_id,
+ TemporalLayers* layers) override;
+
+ BitrateAllocation GetAllocation(uint32_t total_bitrate_bps,
+ uint32_t framerate) override;
+ uint32_t GetPreferredBitrateBps(uint32_t framerate) override;
const VideoCodec& GetCodec() const;
private:
const VideoCodec codec_;
+ std::map<uint32_t, TemporalLayers*> temporal_layers_;
+ std::unique_ptr<TemporalLayersFactory> tl_factory_;
RTC_DISALLOW_COPY_AND_ASSIGN(SimulcastRateAllocator);
};

Powered by Google App Engine
This is Rietveld 408576698