aboutsummaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorEvan Shrubsole <eshr@google.com>2020-06-12 16:00:03 +0200
committerCommit Bot <commit-bot@chromium.org>2020-06-15 09:39:04 +0000
commitce971b0f10c6c84f8e4c080514065e8899805ec7 (patch)
treee3b606edada59e63982251e6836d281cb08b5574 /video
parent7a2f0fa99fc48953f07d87d4fde4ab5efe9cd523 (diff)
downloadwebrtc-ce971b0f10c6c84f8e4c080514065e8899805ec7.tar.gz
[Adaptation] Implement remove for most limited resources.
When a resource is removed from the ResourceAdaptationProcessor, and the resource is the most limited resource, we reset the current adaptation to the next most limited resource level. In the case that this resource is the only adapted resource then we reset all adaptations. Bug: webrtc:11636 Change-Id: I29acc5a3934f42f00db79b3bb2171156b1313937 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176406 Commit-Queue: Evan Shrubsole <eshr@google.com> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31520}
Diffstat (limited to 'video')
-rw-r--r--video/video_stream_encoder.cc15
1 files changed, 0 insertions, 15 deletions
diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc
index 9c17e30efb..ef02cc2343 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -324,7 +324,6 @@ void VideoStreamEncoder::Stop() {
&shutdown_adaptation_processor_event] {
RTC_DCHECK_RUN_ON(&resource_adaptation_queue_);
if (resource_adaptation_processor_) {
- resource_adaptation_processor_->StopResourceAdaptation();
for (auto& resource : stream_resource_manager_.MappedResources()) {
resource_adaptation_processor_->RemoveResource(resource);
}
@@ -399,11 +398,7 @@ void VideoStreamEncoder::AddAdaptationResource(
// this task had a chance to execute. No action needed.
return;
}
- // TODO(hbos): When https://webrtc-review.googlesource.com/c/src/+/176406
- // has landed, there is no need to Stop+Start when adding a resource.
- resource_adaptation_processor_->StopResourceAdaptation();
resource_adaptation_processor_->AddResource(resource);
- resource_adaptation_processor_->StartResourceAdaptation();
add_resource_event.Set();
});
add_resource_event.Wait(rtc::Event::kForever);
@@ -788,16 +783,6 @@ void VideoStreamEncoder::ReconfigureEncoder() {
// invoked later in this method.)
stream_resource_manager_.StopManagedResources();
stream_resource_manager_.StartEncodeUsageResource();
- resource_adaptation_queue_.PostTask([this] {
- RTC_DCHECK_RUN_ON(&resource_adaptation_queue_);
- if (!resource_adaptation_processor_) {
- // The VideoStreamEncoder was stopped and the processor destroyed before
- // this task had a chance to execute. No action needed.
- return;
- }
- // Ensures started. If already started this is a NO-OP.
- resource_adaptation_processor_->StartResourceAdaptation();
- });
pending_encoder_creation_ = false;
}