Commit graph

38 commits

Author SHA1 Message Date
Michael Horowitz
12910caf29 Apply resolution-bitrate limits collected from field trial (cl/294600) for AV1.
Bug: webrtc:14931
Change-Id: I1e8471a499bc884cb9479609a2b093de90f638d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296120
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39582}
2023-03-16 19:04:32 +00:00
Jonas Oreland
e62c2f2c77 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 12/inf
rename WebRtcKeyValueConfig to FieldTrialsView

Bug: webrtc:10335
Change-Id: If725bd498c4c3daf144bee638230fa089fdde833
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256965
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36365}
2022-03-29 10:14:00 +00:00
Jonas Oreland
c7f691a71a WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 2
convert call/ (and the collaterals)

Bug: webrtc:10335
Change-Id: I8f6bc13c032713aa2a947724b464f6f35454d39a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254320
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36165}
2022-03-09 22:17:52 +00:00
Artem Titov
6cae2d5513 Reland "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"
This reverts commit 3f87250a4f.

Reason for revert: Downstream is fixed

Original change's description:
> Revert "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"
>
> This reverts commit 5f0eb93d2a.
>
> Reason for revert: Breaks downstream project. I'm going to fix that one and create a reland of this CL after.
>
> Original change's description:
> > Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely
> >
> > Bug: webrtc:13555, webrtc:13082
> > Change-Id: Iff2cda6f516739419e97e975e03f77a98f74be03
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249260
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Artem Titov <titovartem@webrtc.org>
> > Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
> > Cr-Commit-Position: refs/heads/main@{#35805}
>
> TBR=hta@webrtc.org,titovartem@webrtc.org,daniel.l@hpcnt.com,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I33d497f1132adfe6d151023195a388d9b7d548f9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:13555, webrtc:13082
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249364
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Owners-Override: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Andrey Logvin <landrey@webrtc.org>
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35807}

# Not skipping CQ checks because this is a reland.

Bug: webrtc:13555, webrtc:13082
Change-Id: I7ef1ef3b6e3c41b1a96014aa75f003c0fcf33949
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249365
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35814}
2022-01-27 12:55:44 +00:00
Artem Titov
3f87250a4f Revert "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"
This reverts commit 5f0eb93d2a.

Reason for revert: Breaks downstream project. I'm going to fix that one and create a reland of this CL after.

Original change's description:
> Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely
>
> Bug: webrtc:13555, webrtc:13082
> Change-Id: Iff2cda6f516739419e97e975e03f77a98f74be03
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249260
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
> Cr-Commit-Position: refs/heads/main@{#35805}

TBR=hta@webrtc.org,titovartem@webrtc.org,daniel.l@hpcnt.com,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I33d497f1132adfe6d151023195a388d9b7d548f9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:13555, webrtc:13082
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249364
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Owners-Override: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35807}
2022-01-26 14:56:14 +00:00
Byoungchan Lee
5f0eb93d2a Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely
Bug: webrtc:13555, webrtc:13082
Change-Id: Iff2cda6f516739419e97e975e03f77a98f74be03
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249260
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35805}
2022-01-26 14:22:16 +00:00
Danil Chapovalov
46cc32d89f Replace ABSL_FALLTHROUGH_INTENDED with c++17 attribute
the new spelling is more standard and more compact, in particular doesn't need extra include and thus dependency

Bug: None
Change-Id: Iaea69d2154e4d9eff2468514f5734cb3fe016ff8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245080
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35709}
2022-01-17 14:55:02 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Harald Alvestrand
97597c0f51 Remove usage of INFO alias for LS_INFO in log messages
Bug: webrtc:13362
Change-Id: Ifda893861a036a85c045cd366f9eab33c62ebde0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237221
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35310}
2021-11-04 13:46:17 +00:00
Artem Titov
ea24027e83 Use backticks not vertical bars to denote variables in comments for /call
Bug: webrtc:12338
Change-Id: I8f92127b61352bd4b98a0690e9a0435bb6c6f870
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226943
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34569}
2021-07-27 18:29:33 +00:00
Åsa Persson
f5f7e8e806 Ensure that fps adaptation count can go back to zero when framerate is unrestricted.
Bug: webrtc:12867
Change-Id: I1c11d1a1154ea3d802cdc01e260f72a7e9d17e99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221373
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#34265}
2021-06-10 16:00:39 +00:00
Åsa Persson
1d2b22e193 Use pixels from single active stream if set for balanced degradation settings.
Bug: none
Change-Id: Id9d8dd5a447ea99f080fc597b28afd9fbbe90db2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220922
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34213}
2021-06-03 10:20:56 +00:00
Åsa Persson
1dd94a023a Use pixels from single active stream if set in CanDecreaseResolutionTo
Simulcast with one active stream:
Use pixels from single active stream if set (instead of input stream which could be larger) to avoid going below the min_pixel_per_frame limit when downgrading resolution.

Bug: none
Change-Id: I65acb12cc53e46f726ccb5bfab8ce08ff0c4cf78
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208101
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33309}
2021-02-22 10:25:32 +00:00
Artem Titov
d15a575ec3 Use SequenceChecker from public API
Bug: webrtc:12419
Change-Id: I00cca16a0ec70246156ba00b97aa7ae5ccbf5364
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205323
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33220}
2021-02-10 15:04:55 +00:00
Henrik Boström
ad70609509 Implement fake PixelLimitResource for TestBed.
This CL implements a Resource that aggressively reports overuse or
underuse until the encoded stream has the max pixels specified. The
pixel limit is controlled with a field trial, e.g:

--force-fieldtrials="WebRTC-PixelLimitResource/Enabled-307200/"

This caps the resolution to 307200 (=640x480). This can be used by the
TestBed to simulate being CPU limited. Note that the resource doesn't
care about degradation preference at the moment, so if the degradation
preference would be set to "maintain-resolution" the PixelLimitResource
would never stop reporting overuse and we would quickly get a low-FPS
stream.

PixelLimitResource runs a repeating task and reports overuse, underuse
or neither every 5 seconds. This ensures we quickly reach the desired
resolution.

Unit tests are added. I did not add any integration tests (I think
that's overkill for a testing-only resource) but I have manually
verified that this works as intended.

This CL also moves the FakeVideoStreamInputStateProvider into a test/
folder and exposes video_stream_adapter.cc's GetLowerResolutionThan().

Bug: webrtc:12261
Change-Id: Ifbf7c4c05e9dd2843543589bebef3f49b18c38c0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195600
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32771}
2020-12-04 10:35:53 +00:00
Karl Wiberg
c95b939667 Introduce RTC_CHECK_NOTREACHED(), an always-checking RTC_NOTREACHED()
And use it in a few places that were using RTC_CHECK(false) or FATAL()
to do the exact same job. There should be no change in behavior.

Bug: none
Change-Id: I36d5e6bcf35fd41534e08a8c879fa0811b4f1967
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191963
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32567}
2020-11-09 10:47:55 +00:00
Fabien Vallée
f8b5bfeaf2 Fix "control reaches end of non-void function" warnings
"warning: control reaches end of non-void function [-Wreturn-type]"
Reported by gcc (8.3)

In all the reported cases, the end of function is never actually
reached. Add RTC_CHECK(false) to ensure the compiler is aware that
this path is a dead-end.

Bug: webrtc:12008
Change-Id: I7f816fde3d1897ed2774057c7e05da66e1895e60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189784
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Fabien VALLÉE <fabien.vallee@netgem.com>
Cr-Commit-Position: refs/heads/master@{#32503}
2020-10-27 10:22:23 +00:00
Evan Shrubsole
d73d421565 [Adaptation] Move min pixel limit logic out of adaptation processor
This is in preperation for eventual multi-stream and multi-mitigation
adaptation. This logic only applied to a single stream and thus is
better fit in the VideoStreamAdapter.

Bug: webrtc:11754
Change-Id: Icc5c7920038c82b574f4b5f7efbc92698691076f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181585
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31944}
2020-08-17 10:33:44 +00:00
Evan Shrubsole
b93ad75c94 [Adaptation] Apply AdaptationConstraints to all resources
Some restrictions previously were preventing adaptation up caused by the quality resource. However, it makes sense to use the same restrictions in the case of other resources. This CL removes now unneeded wire-up of reason/resource causing adaptation.

Bug: webrtc:11771
Change-Id: Iec301a59d2a41d32d23b6be340f3b5637d697e52
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181580
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31926}
2020-08-13 13:49:43 +00:00
Evan Shrubsole
b9c1654cc7 [Adaptation] Delete AdaptationListener
It was not used by any class and all future uses can use the
VideoSourceRestrictionsListener.

Bug: webrtc:11834
Change-Id: I5c71b93cc503f458dce0ccdd78b91b5a1debc56d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181062
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31896}
2020-08-10 17:43:56 +00:00
Evan Shrubsole
a1c77f6d0d [Adaptation] Move Balanced MinFpsDiff logic to VideoStreamAdapter
This way can double adapt right away instead of relying
on the qp scaler checking soon into the future.

Bug: webrtc:11830
Change-Id: I8e878168303cf6a4c3edcf3997dd8ac2413a4479
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181060
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31895}
2020-08-10 15:56:07 +00:00
Evan Shrubsole
73ecede5ad [Adaptation] Move AdaptationConstraints to VideoStreamAdapter
Bug: webrtc:11754
Change-Id: Ic51059834ea61c08e977a3a6b5bba48abc86f873
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178906
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31688}
2020-07-09 13:06:56 +00:00
Evan Shrubsole
dc4d422738 [Adaptation] Move AdaptationListeners to VideoStreamAdapter
This is a step needed for multi-stream and new mitigations. It also
cleans up needing to signal adaptation changes in mutiple places
from ResourceAdaptationProcessor.

R=hbos@webrtc.org

Bug: webrtc:11754
Change-Id: Ib185dc9f66fbb4a087eb9e970c68c3f47eafb17f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178874
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31684}
2020-07-09 11:10:36 +00:00
Evan Shrubsole
3444a49d77 [Adaptation] Remove deg.prefs from ResourceAdaptationProcessor
Changes in effective degradation preference is now done directly
on the VideoStreamAdapter. This means that the
DegradationPreferenceListener class can be removed.

Bug: webrtc:11700
Change-Id: I9ce4b627de0279df5ef2e5a38435a6d352fbb135
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178609
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31642}
2020-07-07 08:37:05 +00:00
Evan Shrubsole
afd1dcbde0 [Adaptation] Move TriggerAdaptationDueToFrameDroppedDueToSize
It has no relevance in ResourceAdaptationProcessorInterface.
The logic moves to an interaction directly on the VideoStreamAdapter.

Bug: webrtc:11700
Change-Id: I4c7b3e1e1361722a69b71e8f9bde33f5909c011a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178380
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31634}
2020-07-06 11:45:30 +00:00
Evan Shrubsole
d7d2f27b1b [Adaptation] Adaptation holds restrictions
This refactoring enables us to do multi-step adaptations
instead of the normal single step adaptations.

This work is required pre-requisite work to remove the
DropDueToSize methods from the ResourceAdaptationProcessorInterface.

This work also gives a path to fixing webrtc:11719, since double
adaptations can be done in a controlled manner with this API.


Bug: webrtc:11700,webrtc:11719
Change-Id: Ic7d27a49c82d0cf7ebaf79d7bdf0bc6f382770ed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178200
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31631}
2020-07-06 09:12:23 +00:00
Evan Shrubsole
34b1a42de8 [Adaptation] Move input state into VideoStreamAdapter
Bug: webrtc:11700
Change-Id: I81a060b914f91f6724f13a9b672234c9c4a65fae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177104
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31616}
2020-07-02 14:01:58 +00:00
Evan Shrubsole
ec0af26ff8 [Adaptation] VideoStreamAdapter broadcasts adaptations
This moves this responsibility from the ResourceAdaptaitonProcessor
to the VideoStreamAdapter. A new interface for listening to adaptation
changes was added, and the ResourceAdaptationProcessor now listens on
the VideoStreamAdapter for those changes.

This means that going forward,

1. We can do adaptations outside of resource limitations, like setting
prior adaptations on a resource like initial frame dropper is designed
to.
2. Adaptations can be on a different queue than the
ResourceAdaptaitonProcessor's queue since updates are pushed through
the listener.


Bug: webrtc:11700
Change-Id: I6de0dec748dba095e702f0b9893c5afa50b51aa9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176859
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31615}
2020-07-02 12:16:25 +00:00
Evan Shrubsole
ce971b0f10 [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}
2020-06-15 09:39:04 +00:00
Evan Shrubsole
64469037b7 Only allow most limited resource to trigger adapt up
A more detailed explaination is in the bug, but this changes
the way that adaptation happens when multiple resources are
limited. Only the one that is most limited can trigger an
adaptation up. If multiple resources are most limited both
need to underuse to adapt up.

Some of the changes in this patch to make it all work:

* VideoStreamEncoder unittests that did not reflect this
new behaviour have been changed.

* PeekNextRestrictions returns the adaptation counters as
well as the restrictions.

* Adaptation statstics have changed so that when adapting
up all resources are tagged as triggering the adaptation.
Additionally the statistics for the current adaptation is
now the total number of adaptations per reason, rather then
the number of adaptations due to that reason.

* PreventAdaptUpDueToActiveCounts is removed as most limited
resource is a strong implementation of that.

Bug: webrtc:11553
Change-Id: If1545a201c8e019598edf82657a1befde8b05268
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176128
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31497}
2020-06-11 09:59:42 +00:00
Evan Shrubsole
b940a7d97b [Adaptation] Add const to Can* methods in VideoSourceRestrictor
R=hbos@webrtc.org

Bug: None
Change-Id: I36e3f2d55b4a5bca6087baf04099dce5093629ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176301
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31384}
2020-05-29 09:46:54 +00:00
Henrik Boström
f0eef12e68 [Adaptation] Add more ResourceAdaptationProcessor logging.
This should help debugging when adaptation is or is not happening
unexpectedly. Log spam is prevented by not logging if the same
result happened to the same resource already and we haven't
adapted since then.

Bug: webrtc:11616
Change-Id: Ia6c5cc35061d252f1c66f2f2bf3b94d2485498d6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176221
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31378}
2020-05-28 15:06:46 +00:00
Evan Shrubsole
84afe46549 Don't await adaptation after deg-pref change
Now we only await a previous adaptation if the degradataion
preference is the same as our current degradation preference.
Without this guard we can get stuck as detailed in the attached bug.

Bug: webrtc:11562
Change-Id: I91be48546446ef8d01fe901bc6889201a5b97ba6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174805
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31236}
2020-05-13 12:14:36 +00:00
Evan Shrubsole
95d40ee0df Remove unused VideoStream::balanced_settings()
R=hbos@webrtc.org

Bug: None
Change-Id: I86bc1040f1e8197ce14c16ad7cb7e18dd643b456
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175002
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31234}
2020-05-13 10:06:42 +00:00
Henrik Boström
722fa4d509 [Adaptation] Misc tests for processor, input provider and restrictions.
This CL adds miscellaneous unit tests for the
ResourceAdaptationProcessor, the VideoSourceRestrictions comparators and
the VideoStreamInputStateProvider.

Bug: webrtc:11172
Change-Id: If95f69644aaf2b43e3b19d5729bedef0b438c77b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174101
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31147}
2020-04-29 15:59:14 +00:00
Henrik Boström
91aa73255e [Adaptation] Add OnAdaptationApplied(), remove ResourceListenerResponse.
This CL is part of the Call-Level Adaptation Processing design doc:
https://docs.google.com/document/d/1ZyC26yOCknrrcYa839ZWLxD6o6Gig5A3lVTh4E41074/edit?usp=sharing

The ResourceListenerResponse was used to make the QualityScaler
not clear QP samples and instead increase its frequency of checking for
QP under certain circumstances, see enum description:
https://webrtc.googlesource.com/src.git/+/c70b1028d47c1aee4892545190cd66e97d09cd55/call/adaptation/resource.h#33

Because the QualityScaler depends on whether and how adaptation
happened it should listen to adaptation happening.

This CL moves the logic that was previously in VideoStreamAdapter closer
to the QualityScaler: QualityScalerResource::OnAdaptationApplied().

This would allow the VideoStreamAdapter to operate on a separate task
queue in the future, with no dependencies on any stream-specific
resources that might operate on other task queues.

Bug: webrtc:11172, webrtc:11521
Change-Id: I07971a8a5fab5715f4ccb7d2c63f1b92bd47170f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173090
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31143}
2020-04-29 09:08:46 +00:00
Henrik Boström
d2930c6c2b [Adaptation] Report AdaptationCounters OnVideoSourceRestrictionsUpdated.
This CL is part of the Call-Level Adaptation Processing design doc:
https://docs.google.com/document/d/1ZyC26yOCknrrcYa839ZWLxD6o6Gig5A3lVTh4E41074/edit?usp=sharing

By pushing VideoAdaptationCounters updates on VideoSourceRestrictions
changes, alongside the Resource* that triggered the adaptation, we are
able to update |active_counts_| without an explicit dependency on the
VideoStreamAdapter. This allows a future CL to split up "processor"
logic from "video stream encoder resource and active counts" logic,
which will ultimately be necessary in order to do processing on a
"processing queue" and encoder and stats logic on the "encoder queue".

If the restrictions got cleared by an API call
(ResetVideoSourceRestrictions() or SetDegradationPreference()) we pass
null as the "reason_resource". This allows is to clear the
active_counts_, and the code that invokes
OnVideoSourceRestrictionsUpdated() does not have to be aware of
active_counts_ (needed to split the processor module in two).

Bug: webrtc:11172
Change-Id: Icab6d5121c0ebd27d2a00f1bffc8191f8f05f562
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173000
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31103}
2020-04-17 15:10:15 +00:00
Henrik Boström
1d76654e21 [Adaptation] Move VideoStreamAdapter to call/adaptation/.
This CL is part of the Call-Level Adaptation Processing design doc:
https://docs.google.com/document/d/1ZyC26yOCknrrcYa839ZWLxD6o6Gig5A3lVTh4E41074/edit?usp=sharing

This is a pure move CL. In the future, the Processor will live in
call/adaptation/. This prevents circular dependencies.

Bug: webrtc:11172
Change-Id: Ib72503cc20e27ab6425538e3d55930c65e0b4a90
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172931
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#31100}
2020-04-17 13:23:42 +00:00
Renamed from video/adaptation/video_stream_adapter.cc (Browse further)