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); |
}; |