Index: webrtc/video/video_send_stream.cc |
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc |
index 4ec923f7888403c938124dbdf7a0f9e6bbbcc45c..67e8a9c59594d31f68d6d602d14a2c8fd36539e4 100644 |
--- a/webrtc/video/video_send_stream.cc |
+++ b/webrtc/video/video_send_stream.cc |
@@ -370,6 +370,16 @@ bool VideoSendStream::ReconfigureVideoEncoder( |
static_cast<unsigned char>(streams.size()); |
video_codec.minBitrate = streams[0].min_bitrate_bps / 1000; |
RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams)); |
+ if (video_codec.codecType == kVideoCodecVP9) { |
+ // If the vector is empty, bitrates will be configured automatically. |
+ RTC_DCHECK(config.spatial_layers.empty() || |
+ config.spatial_layers.size() == |
+ video_codec.codecSpecific.VP9.numberOfSpatialLayers); |
+ RTC_DCHECK_LE(video_codec.codecSpecific.VP9.numberOfSpatialLayers, |
+ kMaxSimulcastStreams); |
+ for (size_t i = 0; i < config.spatial_layers.size(); ++i) |
+ video_codec.spatialLayers[i] = config.spatial_layers[i]; |
+ } |
for (size_t i = 0; i < streams.size(); ++i) { |
SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; |
RTC_DCHECK_GT(streams[i].width, 0u); |