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

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

Issue 2641133002: Reland of Add experimental simulcast screen content mode (Closed)
Patch Set: Rebase Created 3 years, 11 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/utility/simulcast_rate_allocator.cc
diff --git a/webrtc/modules/video_coding/utility/simulcast_rate_allocator.cc b/webrtc/modules/video_coding/utility/simulcast_rate_allocator.cc
index 311568b6a2785cfe66bfc3a35a35742e455dbede..0a815507813b7e78fa9f3ddd221fd767a617d760 100644
--- a/webrtc/modules/video_coding/utility/simulcast_rate_allocator.cc
+++ b/webrtc/modules/video_coding/utility/simulcast_rate_allocator.cc
@@ -106,23 +106,24 @@ BitrateAllocation SimulcastRateAllocator::GetAllocation(
const int num_temporal_streams = std::max<uint8_t>(
1, codec_.numberOfSimulcastStreams == 0
? codec_.VP8().numberOfTemporalLayers
- : codec_.simulcastStream[0].numberOfTemporalLayers);
+ : codec_.simulcastStream[simulcast_id].numberOfTemporalLayers);
uint32_t max_bitrate_kbps;
- if (num_spatial_streams == 1) {
- max_bitrate_kbps = codec_.maxBitrate;
-
- // TODO(holmer): This is a temporary hack for screensharing, where we
+ // Legacy temporal-layered only screenshare, or simulcast screenshare
+ // with legacy mode for simulcast stream 0.
+ if (codec_.mode == kScreensharing && codec_.targetBitrate > 0 &&
+ ((num_spatial_streams == 1 && num_temporal_streams == 2) || // Legacy.
+ (num_spatial_streams > 1 && simulcast_id == 0))) { // Simulcast.
+ // TODO(holmer): This is a "temporary" hack for screensharing, where we
// interpret the startBitrate as the encoder target bitrate. This is
// to allow for a different max bitrate, so if the codec can't meet
// the target we still allow it to overshoot up to the max before dropping
// frames. This hack should be improved.
- if (codec_.mode == kScreensharing && codec_.targetBitrate > 0 &&
- num_temporal_streams == 2) {
- int tl0_bitrate = std::min(codec_.targetBitrate, target_bitrate_kbps);
- max_bitrate_kbps = std::min(codec_.maxBitrate, target_bitrate_kbps);
- target_bitrate_kbps = tl0_bitrate;
- }
+ int tl0_bitrate = std::min(codec_.targetBitrate, target_bitrate_kbps);
+ max_bitrate_kbps = std::min(codec_.maxBitrate, target_bitrate_kbps);
+ target_bitrate_kbps = tl0_bitrate;
+ } else if (num_spatial_streams == 1) {
+ max_bitrate_kbps = codec_.maxBitrate;
} else {
max_bitrate_kbps = codec_.simulcastStream[simulcast_id].maxBitrate;
}
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc ('k') | webrtc/modules/video_coding/video_codec_initializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698