Skip to content

Commit cb0768c

Browse files
TommiWebRTC LUCI CQ
authored andcommitted
[Merge to M93] - VideoSendStream: Don't disable the alive flag when updating layers.
When implicit start/stop happens via activation/deactivation of layers occurs, don't change the state of the 'alive' flag since further activations following full de-activation need to be allowed to happen when Stop() has not been called. (cherry picked from commit 264cf54) Bug: chromium:1234779 Change-Id: Ic3cae387990122eaa2f48de096ff9dafa7c34414 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228242 Reviewed-by: Magnus Flodman <[email protected]> Commit-Queue: Tommi <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#34698} Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228900 Reviewed-by: Mirko Bonadei <[email protected]> Cr-Commit-Position: refs/branch-heads/4577@{#6} Cr-Branched-From: 5196931-refs/heads/master@{#34463}
1 parent 2afcec3 commit cb0768c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

video/video_send_stream.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,9 @@ void VideoSendStream::UpdateActiveSimulcastLayers(
208208
RTC_LOG(LS_INFO) << "UpdateActiveSimulcastLayers: "
209209
<< active_layers_string.str();
210210

211-
rtp_transport_queue_->PostTask(ToQueuedTask(
212-
transport_queue_safety_, [this, active_layers, was_running = running_] {
211+
rtp_transport_queue_->PostTask(
212+
ToQueuedTask(transport_queue_safety_, [this, active_layers] {
213213
send_stream_.UpdateActiveSimulcastLayers(active_layers);
214-
const bool running = rtp_video_sender_->IsActive();
215-
if (was_running != running) {
216-
running ? transport_queue_safety_->SetAlive()
217-
: transport_queue_safety_->SetNotAlive();
218-
}
219214
}));
220215

221216
running_ = running;

video/video_send_stream_tests.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,19 @@ TEST_F(VideoSendStreamTest, VideoSendStreamUpdateActiveSimulcastLayers) {
22872287
});
22882288
EXPECT_TRUE(encoder.WaitBitrateChanged(false));
22892289

2290+
// Re-activating a layer should resume sending and trigger a bitrate change.
2291+
GetVideoEncoderConfig()->simulcast_layers[0].active = true;
2292+
SendTask(RTC_FROM_HERE, task_queue(), [this]() {
2293+
GetVideoSendStream()->UpdateActiveSimulcastLayers({true, false});
2294+
EXPECT_TRUE(GetVideoSendStream()->started());
2295+
});
2296+
EXPECT_TRUE(encoder.WaitBitrateChanged(true));
2297+
2298+
// Stop and clean up.
2299+
SendTask(RTC_FROM_HERE, task_queue(),
2300+
[this]() { GetVideoSendStream()->Stop(); });
2301+
EXPECT_TRUE(encoder.WaitBitrateChanged(false));
2302+
22902303
SendTask(RTC_FROM_HERE, task_queue(), [this]() {
22912304
DestroyStreams();
22922305
DestroyCalls();

0 commit comments

Comments
 (0)