diff options
author | Henrik Boström <hbos@webrtc.org> | 2020-06-11 12:07:14 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-11 12:43:21 +0000 |
commit | f4a9991cce74a37d006438ec0e366313ed33162e (patch) | |
tree | 17ca4e4760ef57c4e4254236e3f4ec33106fd1a7 /api/video/video_stream_encoder_interface.h | |
parent | 08ce986fda2e5423362de04ca97331ff44c6b5bc (diff) | |
download | webrtc-f4a9991cce74a37d006438ec0e366313ed33162e.tar.gz |
[Adaptation] Adding adaptation resources from Call.
This CL adds AddAdaptationResource to Call and
AddAdaptationResource/GetAdaptationResources method to relevant
VideoSendStream and VideoStreamEncoder interfaces and implementations.
Unittests are added to ensure that resources can be added to the Call
both before and after the creation of a VideoSendStream and that the
resources always gets added to the streams.
In a follow-up CL, we will continue to plumb the resources all the way
to PeerConnectionInterface, and an integration test will then be added
to ensure that injected resources are capable of triggering adaptation.
Bug: webrtc:11525
Change-Id: I499e9c23c3e359df943414d420b2e0ce2e9b2d56
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177002
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31499}
Diffstat (limited to 'api/video/video_stream_encoder_interface.h')
-rw-r--r-- | api/video/video_stream_encoder_interface.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/api/video/video_stream_encoder_interface.h b/api/video/video_stream_encoder_interface.h index 8e1df0f858..d8dd8e1599 100644 --- a/api/video/video_stream_encoder_interface.h +++ b/api/video/video_stream_encoder_interface.h @@ -13,8 +13,10 @@ #include <vector> +#include "api/adaptation/resource.h" #include "api/fec_controller_override.h" #include "api/rtp_parameters.h" // For DegradationPreference. +#include "api/scoped_refptr.h" #include "api/units/data_rate.h" #include "api/video/video_bitrate_allocator.h" #include "api/video/video_sink_interface.h" @@ -49,6 +51,15 @@ class VideoStreamEncoderInterface : public rtc::VideoSinkInterface<VideoFrame> { int min_transmit_bitrate_bps) = 0; }; + // If the resource is overusing, the VideoStreamEncoder will try to reduce + // resolution or frame rate until no resource is overusing. + // TODO(https://crbug.com/webrtc/11565): When the ResourceAdaptationProcessor + // is moved to Call this method could be deleted altogether in favor of + // Call-level APIs only. + virtual void AddAdaptationResource(rtc::scoped_refptr<Resource> resource) = 0; + virtual std::vector<rtc::scoped_refptr<Resource>> + GetAdaptationResources() = 0; + // Sets the source that will provide video frames to the VideoStreamEncoder's // OnFrame method. |degradation_preference| control whether or not resolution // or frame rate may be reduced. The VideoStreamEncoder registers itself with |