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

Unified Diff: webrtc/modules/video_coding/codecs/vp8/screenshare_layers.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/codecs/vp8/screenshare_layers.h
diff --git a/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h b/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h
index 8392bc4f35568fc91f68e5dfc04db03fea0d3f12..e4d3c76aabaa095daac343ee0037a2c9928b7013 100644
--- a/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h
+++ b/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h
@@ -9,9 +9,7 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_SCREENSHARE_LAYERS_H_
#define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_SCREENSHARE_LAYERS_H_
-#include <list>
-
-#include "vpx/vpx_encoder.h"
+#include <vector>
#include "webrtc/base/timeutils.h"
#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
@@ -41,10 +39,15 @@ class ScreenshareLayers : public TemporalLayers {
// and/or update the reference buffers.
int EncodeFlags(uint32_t timestamp) override;
- bool ConfigureBitrates(int bitrate_kbps,
- int max_bitrate_kbps,
- int framerate,
- vpx_codec_enc_cfg_t* cfg) override;
+ // Update state based on new bitrate target and incoming framerate.
+ // Returns the bitrate allocation for the active temporal layers.
+ std::vector<uint32_t> OnRatesUpdated(int bitrate_kbps,
+ int max_bitrate_kbps,
+ int framerate) override;
+
+ // Update the encoder configuration with target bitrates or other parameters.
+ // Returns true iff the configuration was actually modified.
+ bool UpdateConfiguration(vpx_codec_enc_cfg_t* cfg) override;
void PopulateCodecSpecific(bool base_layer_sync,
CodecSpecificInfoVP8* vp8_info,
@@ -54,11 +57,6 @@ class ScreenshareLayers : public TemporalLayers {
int CurrentLayerId() const override;
- // Allows the layers adapter to update the encoder configuration prior to a
- // frame being encoded. Return true if the configuration should be updated
- // and false if now change is needed.
- bool UpdateConfiguration(vpx_codec_enc_cfg_t* cfg) override;
-
private:
bool TimeToSync(int64_t timestamp) const;
@@ -75,7 +73,8 @@ class ScreenshareLayers : public TemporalLayers {
int min_qp_;
int max_qp_;
uint32_t max_debt_bytes_;
- int frame_rate_;
+ int framerate_;
+ bool bitrate_updated_;
static const int kMaxNumTemporalLayers = 2;
struct TemporalLayer {

Powered by Google App Engine
This is Rietveld 408576698