Commit graph

334 commits

Author SHA1 Message Date
Jonas Oreland
fb0da3a2aa Increase test coverage of InitialFrameDropper vs. ScaleResolutionDownBy
Bug: b/364252657
Change-Id: I40f3acac7b6473c98a8d1a71c2b68f69cd9d78d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362420
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43012}
2024-09-12 09:52:38 +00:00
Jonas Oreland
0d31d7b8dd Increase test coverage of InitialFrameDropper vs. RequestedResolution
Bug: b/364252657
Change-Id: I4924428c3f002a168eea12f111cb13890cad19f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362220
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43011}
2024-09-12 08:15:26 +00:00
Florent Castelli
8037fc6ffa Migrate absl::optional to std::optional
Bug: webrtc:342905193
No-Try: True
Change-Id: Icc968be43b8830038ea9a1f5f604307220457807
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361021
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42911}
2024-09-02 12:16:47 +00:00
Henrik Boström
41fffaa6f4 Fix requested_resolution bug where we get stuck with old restrictions.
Normally (scaleResolutionDownBy) restrictions are applied at the source
which changes the input frame size which triggers reconfiguration with
appropriate scaling factors.

But when requested_resolution is used, encoder settings are by
definition not relative to the input frame size. In order for
restrictions to have an effect, they are applied inside
ReconfigureEncoder(): you get the minimum between the requested
resolution and the restricted resolution.

ReconfigureEncoder() happens when you SetParameters(), but the bug
here is that we don't do it again once the restrictions are updated.
So if restrictions are 540p when you ask for 720p, you get 540p and
after restrictions change to unlimited you're still stuck in 540p.

The fix is to also trigger ReconfigureEncoder() inside
OnVideoSourceRestrictionsUpdated() when the restricted resolution is
changing and a requested_resolution is configured.

To ensure reconfiguring the encoder "on the fly" like this does not
reset initial frame dropping logic, InitialFrameDropper caring about
input frame size changing is made conditional on not using
requested_resolution.

# Slow purple bots failing but they are not affected by this change.
NOTRY=True

Bug: webrtc:361477261
Change-Id: I1389aa16cf408b0d14e0b5b6f68c2442db955be9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360200
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42882}
2024-08-29 12:26:17 +00:00
Sergey Silkin
5fe85d23a2 Reland "Pass true stream resolutions to GetSimulcastConfig()"
This is a reland of commit 09f03be548

Use max_num_layers instead of encoder_config.number_of_streams when calculation stream resolutions in EncoderStreamFactory::GetStreamResolutions().

Original change's description:
> Pass true stream resolutions to GetSimulcastConfig()
>
> Before this change GetSimulcastConfig() received only maximum resolution as an input parameter and derived resolutions for low quality simulcast streams assuming 1/2 scaling factor [1]. These days applications can configure resolution scaling factors via RtpEncodingParameters. If the configured resolution scaling factors were different from 1/2 then we got wrong bitrate limits from GetSimulcastConfig(). Now resolutions are calculated using scaling factor from RtpEncodingParameters (or default 1/2) for all streams in EncoderStreamFactory::CreateEncoderStreams() and then passed to GetSimulcastConfig().
>
> Moved tests from simulcast_unittest.cc to encoder_stream_factory_unittest.cc. Mapping of old to new tests:
> * GetConfigWithLimitedMaxLayersForResolution -> ReducesStreamCountWhenResolutionIsLow
> * GetConfigWithLowResolutionScreenshare -> ReducesLegacyScreencastStreamCountWhenResolutionIsLow
> * GetConfigWithNotLimitedMaxLayersForResolution -> KeepsStreamCountUnchangedWhenLegacyLimitIsDisabled
> * GetConfigWithNormalizedResolution -> AdjustsResolutionWhenUnaligned
> * GetConfigWithNormalizedResolutionDivisibleBy4 -> MakesResolutionDivisibleBy4
> * GetConfigWithNormalizedResolutionDivisibleBy8 -> not needed (MakesResolutionDivisibleBy4 should be enough).
> * GetConfigForLegacyLayerLimit -> KeepsStreamCountUnchangedWhenResolutionIsHigh and ReducesStreamCountWhenResolutionIsLow
> * GetConfigForLegacyLayerLimitWithRequiredHD -> KeepsStreamCountUnchangedWhenLegacyLimitIsDisabled
>
> [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/config/simulcast.cc;l=297-298;drc=1b78a7eb3f418460da03672b1d1af1d9488bb544
>
> Bug: webrtc:351644568, b/352504711
> Change-Id: I0028904ab0bb1e27b9c1b7cd3fb9a8ccf447fa35
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357280
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42651}

Bug: webrtc:351644568, b/352504711
Change-Id: Ib3fd859257b61c2a5d695b8b8f45c95495117c0e
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357520
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42654}
2024-07-19 13:12:59 +00:00
Sergey Silkin
ede05c35e4 Revert "Pass true stream resolutions to GetSimulcastConfig()"
This reverts commit 09f03be548.

Reason for revert: breaks downstream projects

Original change's description:
> Pass true stream resolutions to GetSimulcastConfig()
>
> Before this change GetSimulcastConfig() received only maximum resolution as an input parameter and derived resolutions for low quality simulcast streams assuming 1/2 scaling factor [1]. These days applications can configure resolution scaling factors via RtpEncodingParameters. If the configured resolution scaling factors were different from 1/2 then we got wrong bitrate limits from GetSimulcastConfig(). Now resolutions are calculated using scaling factor from RtpEncodingParameters (or default 1/2) for all streams in EncoderStreamFactory::CreateEncoderStreams() and then passed to GetSimulcastConfig().
>
> Moved tests from simulcast_unittest.cc to encoder_stream_factory_unittest.cc. Mapping of old to new tests:
> * GetConfigWithLimitedMaxLayersForResolution -> ReducesStreamCountWhenResolutionIsLow
> * GetConfigWithLowResolutionScreenshare -> ReducesLegacyScreencastStreamCountWhenResolutionIsLow
> * GetConfigWithNotLimitedMaxLayersForResolution -> KeepsStreamCountUnchangedWhenLegacyLimitIsDisabled
> * GetConfigWithNormalizedResolution -> AdjustsResolutionWhenUnaligned
> * GetConfigWithNormalizedResolutionDivisibleBy4 -> MakesResolutionDivisibleBy4
> * GetConfigWithNormalizedResolutionDivisibleBy8 -> not needed (MakesResolutionDivisibleBy4 should be enough).
> * GetConfigForLegacyLayerLimit -> KeepsStreamCountUnchangedWhenResolutionIsHigh and ReducesStreamCountWhenResolutionIsLow
> * GetConfigForLegacyLayerLimitWithRequiredHD -> KeepsStreamCountUnchangedWhenLegacyLimitIsDisabled
>
> [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/config/simulcast.cc;l=297-298;drc=1b78a7eb3f418460da03672b1d1af1d9488bb544
>
> Bug: webrtc:351644568, b/352504711
> Change-Id: I0028904ab0bb1e27b9c1b7cd3fb9a8ccf447fa35
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357280
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42651}

Bug: webrtc:351644568, b/352504711
Change-Id: I7aadbe49419b7ac610db4db99284fdcdce9deff5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357500
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42653}
2024-07-19 09:46:34 +00:00
Sergey Silkin
09f03be548 Pass true stream resolutions to GetSimulcastConfig()
Before this change GetSimulcastConfig() received only maximum resolution as an input parameter and derived resolutions for low quality simulcast streams assuming 1/2 scaling factor [1]. These days applications can configure resolution scaling factors via RtpEncodingParameters. If the configured resolution scaling factors were different from 1/2 then we got wrong bitrate limits from GetSimulcastConfig(). Now resolutions are calculated using scaling factor from RtpEncodingParameters (or default 1/2) for all streams in EncoderStreamFactory::CreateEncoderStreams() and then passed to GetSimulcastConfig().

Moved tests from simulcast_unittest.cc to encoder_stream_factory_unittest.cc. Mapping of old to new tests:
* GetConfigWithLimitedMaxLayersForResolution -> ReducesStreamCountWhenResolutionIsLow
* GetConfigWithLowResolutionScreenshare -> ReducesLegacyScreencastStreamCountWhenResolutionIsLow
* GetConfigWithNotLimitedMaxLayersForResolution -> KeepsStreamCountUnchangedWhenLegacyLimitIsDisabled
* GetConfigWithNormalizedResolution -> AdjustsResolutionWhenUnaligned
* GetConfigWithNormalizedResolutionDivisibleBy4 -> MakesResolutionDivisibleBy4
* GetConfigWithNormalizedResolutionDivisibleBy8 -> not needed (MakesResolutionDivisibleBy4 should be enough).
* GetConfigForLegacyLayerLimit -> KeepsStreamCountUnchangedWhenResolutionIsHigh and ReducesStreamCountWhenResolutionIsLow
* GetConfigForLegacyLayerLimitWithRequiredHD -> KeepsStreamCountUnchangedWhenLegacyLimitIsDisabled

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/config/simulcast.cc;l=297-298;drc=1b78a7eb3f418460da03672b1d1af1d9488bb544

Bug: webrtc:351644568, b/352504711
Change-Id: I0028904ab0bb1e27b9c1b7cd3fb9a8ccf447fa35
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357280
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42651}
2024-07-19 08:47:09 +00:00
Johannes Kron
f6a804826c Add QualityConvergenceController to VideoStreamEncoder
QualityConvergenceController is a layer between VideoStreamEncoder
and QualityConvergenceMonitor that takes care of the simulcast
logic.

Bug: chromium:328598314
Change-Id: Iad8a9d9138e69a60fd508a7ef038220947888f0a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356420
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42642}
2024-07-16 10:20:27 +00:00
Sergey Silkin
3172d16ea0 Clean up EncoderStreamFactory
* Simplified ctor. Get settings (max_qp, content_type, etc) from encoder_config passed to CreateEncoderStreams().

* Some tests assigned VideoEncoderConfig::video_stream_factory to EncoderStreamFactory they created. That's not really needed. VideoStreamEncoder creates the factory if video_stream_factory is not provided [1]. Removed video_stream_factory initialization in tests.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/video_stream_encoder.cc;l=1002;drc=1d7d0e6e2c5002815853be251ce43fe88779ac85

Bug: b/347150850, webrtc:42233936
Change-Id: Ie0322abb6c48e1a9bd10e9ed3879e3ed484fea5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355321
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42608}
2024-07-09 09:47:55 +00:00
Erik Språng
db65fda82f Wire up trial for alternative EncoderBitrateAdjuster behavior.
Behind a flag, the new behavior changes how the "media rate" utilization
is calculated:

* Instead of per spatial & temporal layer, it's per spatial layer only.
* Overshoot is compared to real target vs adjusted target.
* Window takes quite periods/frame drops more into consideration.

This should lead to less push-back when not network constrained and
complex content is used causing bursty behavior.

Bug: b/349561566
Change-Id: I402e6531183493c963fec48ae363ce0b859b396a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356480
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42593}
2024-07-05 13:36:26 +00:00
Erik Språng
fe4c1dd6dc Fix logic reading spatial/temporal id in VideoStreamEncoder.
The temporal id must be read from `EncodedImage` rather than codec
specifics for AV1. Furthermore, in some configs the spatial id of
`EncodedImage` is populated and set to 0 while the simulcast id can
also be simultaneously populated and set to values, including non-zero.
To solve this, just take the max of the two.

Bug: b/349561566
Change-Id: I46c61b7f0fff7a7ab8d7262c3a8d413f49b3286a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355904
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42573}
2024-07-02 14:15:52 +00:00
Harald Alvestrand
c74412b304 Deprecate rtc::RefCountInterface
and move usages to webrtc::RefCountInterface

This CL also moves more stuff to webrtc:: and adds backwards
compatible aliases for them.

Bug: webrtc:42225969
Change-Id: Iefb8542cff793bd8aa46bef8f2f3c66a1e979d07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353720
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42446}
2024-06-07 09:47:26 +00:00
Johannes Kron
1d7d0e6e2c Remove WebRTC-AutomaticAnimationDetectionScreenshare experiment
The experiment has been disabled for several years and the code
is not maintained.

Bug: webrtc:42221141
Change-Id: I631e4bd476ca01eb5312d4077c9467e77c42ff78
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351143
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42364}
2024-05-22 10:36:49 +00:00
Danil Chapovalov
f317f7106a Remove option to parse RateControlSettings from the global field trial string
Bug: webrtc:42220378
Change-Id: Iff016f0f53f427ff59df816d8d87dc4a8119db65
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350921
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42348}
2024-05-20 10:38:14 +00:00
Danil Chapovalov
fd89ff5d93 Provide Environment to SimulcastRateAllocator at construction
So that this class can use propagated field trials instead of the global

Bug: webrtc:42220378
Change-Id: Ic1dba0c4967735606904329f7e9e6c09f186b809
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350641
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42326}
2024-05-16 13:32:54 +00:00
Danil Chapovalov
179f96de7e Provide Environment to construct VideoBitrateAllocator
To allow various VideoBitrateAllocators to use propagated rather than global field trials

This relands the
https://webrtc-review.googlesource.com/c/src/+/349920
where patchset#1 is identical to the original change,
patchset#2 undoes (postpones) the expectation downstream propagates the Environment too.

Bug: webrtc:42220378
Change-Id: I4a9a32bb0926a875d37f3ba19dd5309e97546553
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350364
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42298}
2024-05-14 11:36:42 +00:00
Jeremy Leconte
16fb7903e5 Revert "Provide Environment to construct VideoBitrateAllocator"
This reverts commit 4bf4e1753c.

Reason for revert: break upstream 

Original change's description:
> Provide Environment to construct VideoBitrateAllocator
>
> To allow various VideoBitrateAllocators to use propagated rather than global field trials
>
> Bug: webrtc:42220378
> Change-Id: I52816628169a54b18a4405d84fee69b101f92f72
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349920
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42288}

Bug: webrtc:42220378
Change-Id: I7d47eb635c2d312d97a870c2a8eca0b23d2f86a0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350307
Owners-Override: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#42290}
2024-05-13 13:32:28 +00:00
Danil Chapovalov
4bf4e1753c Provide Environment to construct VideoBitrateAllocator
To allow various VideoBitrateAllocators to use propagated rather than global field trials

Bug: webrtc:42220378
Change-Id: I52816628169a54b18a4405d84fee69b101f92f72
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349920
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42288}
2024-05-13 12:12:01 +00:00
Danil Chapovalov
8b7d89a85f Cleanup expired field trial WebRTC-Video-QualityRampupSettings
Bug: webrtc:42221607
Change-Id: I72f271a2063ed543cd45b771991ce73208ed45c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349721
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42225}
2024-05-03 15:04:51 +00:00
Danil Chapovalov
44ab20021d In EncoderStreamFactory pass field trials as required parameter
Instead of passing it as optional parameter during construction, pass field trials as required parameters on use.
Test that create the EncoderStreamFactory might not have an easy access to the actual field trials, but prod code has appropriate field trials when uses the factory.

This way EncoderStreamFactory doesn't need to depend on global field trial string through FieldTrialBaseConfig class.

Bug: webrtc:10335
Change-Id: I8f7030e41579ff2c5dd362c491a4e1624b23e690
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347700
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42098}
2024-04-17 12:53:30 +00:00
Markus Handell
a57229bf36 Hard-code WebRTC-ZeroHertzScreenshare default-on.
The field trial has been default on for ages. This CL removes it.

Bug: b/40200151
Change-Id: I171f663a3e725b856238b14b26d083f6684586e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347621
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42080}
2024-04-16 09:29:39 +00:00
Danil Chapovalov
b065f1bbd8 Require webrtc::Environment to create fake video encoders
Bug: webrtc:15860
Change-Id: Ie1b03811f8082d5584434b46e552003bfbe5ea96
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/346620
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42078}
2024-04-16 08:43:09 +00:00
Danil Chapovalov
1c35107cdc Propagate environment into OveruseFrameDetector
Thus use propagated instead of global field trials.

Bug: webrtc:10335
Change-Id: I6b1923cc90a2054efc4d878a425b99536d60885c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/346560
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42041}
2024-04-11 17:10:34 +00:00
Per K
e975b44a45 Reland "FrameCadenceAdapter keep track of Input framerate"
This reverts commit d427e83a15.

Reason for revert: Flaky test fixed.

Refactor FrameCandenceAdapter to keep track of input frame rate. This fixes an issue where frame rate is calculated too low if congestion window drop a frame.

Also a field trial WebRTC-FrameCadenceAdapter-UseVideoFrameTimestamp is added to control if VideoFrame timestamp should be used or local clock when calculating frame rate.
Uma is recorded to tell if input frame timestamp is monotonically increasing.

Bug: webrtc:10481, webrtc:15887, webrtc:15893
Change-Id: I76268aa0991dbc99c1b881fb251a76aa54ff2673
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344561
Reviewed-by: Erik Språng <sprang@google.com>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41972}
2024-03-27 12:58:03 +00:00
Per Kjellander
d427e83a15 Revert "FrameCadenceAdapter keep track of Input framerate"
This reverts commit 784af1f42e.

Reason for revert: Seems like test test_support_unittests 
 ResolutionAdaptsToAvailableBandwidth is flaky with this cl.

Original change's description:
> FrameCadenceAdapter keep track of Input framerate
>
> Refactor FrameCandenceAdapter to keep track of input frame rate.
>
> Also a field trial WebRTC-FrameCadenceAdapter-UseVideoFrameTimestamp is added to control if VideoFrame timestamp should be used or local clock when calculating frame rate.
> Uma is recorded to tell if input frame timestamp is monotonically increasing.
>
> Bug: webrtc:10481, webrtc:15887
> Change-Id: I6d698e9f9dcfe8c023d2d35371435c47f70102b0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342760
> Commit-Queue: Per Kjellander <perkj@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41967}

Bug: webrtc:10481, webrtc:15887
Change-Id: Id9672764768f2f40f8e711e990ad8ac18c28efcc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344560
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41969}
2024-03-26 15:56:15 +00:00
Per K
784af1f42e FrameCadenceAdapter keep track of Input framerate
Refactor FrameCandenceAdapter to keep track of input frame rate.

Also a field trial WebRTC-FrameCadenceAdapter-UseVideoFrameTimestamp is added to control if VideoFrame timestamp should be used or local clock when calculating frame rate.
Uma is recorded to tell if input frame timestamp is monotonically increasing.

Bug: webrtc:10481, webrtc:15887
Change-Id: I6d698e9f9dcfe8c023d2d35371435c47f70102b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342760
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41967}
2024-03-26 10:44:29 +00:00
Danil Chapovalov
be9d13a305 Pass webrtc::Environment when constructing video encoders in video/ tests
Bug: webrtc:15860
Change-Id: I44725bddfb5c80d94ad29406c2b0cab013595ce3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343762
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41954}
2024-03-22 13:48:58 +00:00
Per K
709374b333 Reland "Propagate known Encoder SinkWants when configured instead of after first frame."
This reverts commit c39712b515.

Reason for revert: Fixed issue where frame rate not adapted to highest "active" requested frame rate.

Patchset 1 contains original cl.
Later patchsets contains modifications.

Original change's description:
 > Propagate known Encoder SinkWants when configured instead of after first frame.
 >
 > Propagate requested resolution and max frame rate to the source when
 > configured rather than after the first frame.
 > This is so that the source can be configured immediately. There is no
 > reason why source should be updated until after first frame since it may lead
 > to unnecessary reconfigurations and thread jumps. Wants that depend on actual frame size is not moved.
 >
 > Cl also change default behaviour in VideoStreamEncoderTest to not
 > set restriction on max frame rate.
 >

Bug: webrtc:14451
Change-Id: I2668db44bd17586efcf511ad3cd975065c503ec5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343122
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41941}
2024-03-21 14:19:57 +00:00
Per Kjellander
c39712b515 Revert "Propagate known Encoder SinkWants when configured instead of after first frame."
This reverts commit 1ee24a650c.

Reason for revert: Suspected upstream test breakage. 

Original change's description:
> Propagate known Encoder SinkWants when configured instead of after first frame.
>
> Propagate requested resolution and max frame rate to the source when
> configured rather than after the first frame.
> This is so that the source can be configured immediately. There is no
> reason why source should be updated until after first frame since it may lead
> to unnecessary reconfigurations and thread jumps. Wants that depend on actual frame size is not moved.
>
> Cl also change default behaviour in VideoStreamEncoderTest to not
> set restriction on max frame rate. This aligns with how its used.
>
> Bug: webrtc:14451
> Change-Id: I96a3675d3ccabb1d2ecb4354b6932bc6563b1760
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342801
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Per Kjellander <perkj@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41906}

Bug: webrtc:14451
Change-Id: I3aa669f8cc61a43b0820a06edf1497f3c86e3958
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343220
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Owners-Override: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41911}
2024-03-15 17:41:26 +00:00
Per K
1ee24a650c Propagate known Encoder SinkWants when configured instead of after first frame.
Propagate requested resolution and max frame rate to the source when
configured rather than after the first frame.
This is so that the source can be configured immediately. There is no
reason why source should be updated until after first frame since it may lead
to unnecessary reconfigurations and thread jumps. Wants that depend on actual frame size is not moved.

Cl also change default behaviour in VideoStreamEncoderTest to not
set restriction on max frame rate. This aligns with how its used.

Bug: webrtc:14451
Change-Id: I96a3675d3ccabb1d2ecb4354b6932bc6563b1760
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342801
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41906}
2024-03-15 12:53:06 +00:00
Per K
0fa90887c5 Deprecate VideoFrame::timestamp() and set_timestamp
Instead, add rtp_timestamp and set_rtp_timestamp.

Bug: webrtc:13756
Change-Id: Ic4266394003e0d49e525d71f4d830f5e518299cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342781
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41894}
2024-03-13 11:08:37 +00:00
Danil Chapovalov
c9bb2c6c4e Propagate Environment into VideoStreamEncoder
VideoStreamEncoder creates VideoEncoders. To pass an Environment to VideoEncoder, it should be available in the VideoStreamEncoder.

Bug: webrtc:15860
Change-Id: Id89ac024ce61fdd9673bb66f03f94f243fc0c7f7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/341840
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41861}
2024-03-05 09:33:02 +00:00
Markus Handell
97df932ecc Remove multiplex codec.
The feature isn't in use by Google and has proven to contain security
issues. It's time to remove it.

Bug: b/324864439
Change-Id: I80344eb2f2060469d2d69a54dc4519fdd02ab4ea
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340324
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41808}
2024-02-26 11:26:04 +00:00
Zhaoliang Ma
f089d7ea54 Reland "FrameCadenceAdapter: align video encoding to metronome"
This is a reland of commit b39c2a8464

Original change's description:
> FrameCadenceAdapter: align video encoding to metronome
>
> This CL aligns the video encoding tasks to metronome tick which
> similar with the metronome decoding.
>
> Design doc: https://docs.google.com/document/d/18PvEgS-DehClK6twCSCATOlX-j9acmXd-3vjb0tR9-Y
>
> Bug: b/304158952
> Change-Id: I262bd4a5097fdaeed559b9d7391a059ae86e2d63
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327460
> Reviewed-by: Markus Handell <handellm@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Zhaoliang Ma <zhaoliang.ma@intel.com>
> Cr-Commit-Position: refs/heads/main@{#41469}

Bug: b/304158952
Change-Id: Icf4e1ad91f5c98f3c32a88ffe4d6277e907353e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333464
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41479}
2024-01-08 13:54:56 +00:00
Björn Terelius
78a57efb29 Revert "FrameCadenceAdapter: align video encoding to metronome"
This reverts commit b39c2a8464.

Reason for revert: Breaks downstream build

Original change's description:
> FrameCadenceAdapter: align video encoding to metronome
>
> This CL aligns the video encoding tasks to metronome tick which
> similar with the metronome decoding.
>
> Design doc: https://docs.google.com/document/d/18PvEgS-DehClK6twCSCATOlX-j9acmXd-3vjb0tR9-Y
>
> Bug: b/304158952
> Change-Id: I262bd4a5097fdaeed559b9d7391a059ae86e2d63
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327460
> Reviewed-by: Markus Handell <handellm@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Zhaoliang Ma <zhaoliang.ma@intel.com>
> Cr-Commit-Position: refs/heads/main@{#41469}

Bug: b/304158952
Change-Id: I6f7a3d45cc24b63bc1fe92a93bf5c8d5058f32a8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333482
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Auto-Submit: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41471}
2024-01-04 20:02:49 +00:00
Zhaoliang Ma
b39c2a8464 FrameCadenceAdapter: align video encoding to metronome
This CL aligns the video encoding tasks to metronome tick which
similar with the metronome decoding.

Design doc: https://docs.google.com/document/d/18PvEgS-DehClK6twCSCATOlX-j9acmXd-3vjb0tR9-Y

Bug: b/304158952
Change-Id: I262bd4a5097fdaeed559b9d7391a059ae86e2d63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327460
Reviewed-by: Markus Handell <handellm@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Zhaoliang Ma <zhaoliang.ma@intel.com>
Cr-Commit-Position: refs/heads/main@{#41469}
2024-01-04 04:14:12 +00:00
henrika
8f16ce98c2 FrameCadenceAdapter: improves performance under repeat and high load
This change ensures that the FCA now is informed about a new max fps
when VideoStreamEncoder::OnVideoSourceRestrictionsUpdated is called.

The latest restricted frame rate which is provided to the FCA will
only affect the cadence of repeated non-idle (quality has not
converged) frames and the main goal is to ensure that the FCA reduces
its repeat rate in situations where the video source is constrained.

UpdateVideoSourceRestrictions is added to the FrameCadenceAdapter API
and it is called from the VideoStreamEncoder when its source
parameters (resolution and/or frame rate) are restricted.

This modification has no effect on the flow driven by
ProcessOnDelayedCadence (non repeated frames).

Bug: webrtc:15539
Change-Id: I26dee6480e5137f82c5ccf57091b737cad82dbf6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328300
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41308}
2023-12-04 13:37:24 +00:00
Markus Handell
84c016a024 FrameCadenceAdapter: use distinct signal for queue overload.
The FrameCadenceAdapterInterface::Callback::OnFrame method in
VideoStreamEncoder only changed frame handling on
frames_scheduled_for_processing being 1. This CL changes
the parameter to more explicitly signal queue overload via
boolean parameter.

Bug: None
Change-Id: I1eb46b34fc4d748b7e2f1921642497c939adf197
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327761
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41226}
2023-11-23 17:31:37 +00:00
Danil Chapovalov
9c58483b5a Rename EncodedImage property Timetamp to RtpTimestamp
To avoid name collision with Timestamp type,
To avoid confusion with capture time represented as Timestamp

Bug: webrtc:9378
Change-Id: I8438a9cf4316e5f81d98c2af9dc9454c21c78e70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320601
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40796}
2023-09-24 20:06:48 +00:00
qwu16
ae82df718c Add codec name H265 to support H265 in WebRTC
Bug: webrtc:13485
Change-Id: I352b15a65867f0d56fc8e9a9e03081bd3258108e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316283
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40773}
2023-09-20 09:25:32 +00:00
Sergey Silkin
c252a40b47 Use layer/encode target resolution in DropDueToSize
It used input frame resolution before this change which caused unnecessary resolution adaptations when resolution scaling is used.

Found that initial frame dropping was always enabled for AV1 SVC. After fixing DropDueToSize the AV1 SVC tests [1] started to fail ("number of encoded temporal layers is less than expected") on bots. The tests encode 1850x1110 in L3T3 for 5s using the default 300kbps start bitrate. Before the fix the initial frame dropping kicked in and reduced the resolution to a level that let encoder to generate all temporal layers. After the fix the resolution stayed at 1850x1110 and encoder dropped all T1 and T2 layer frames. Mitigated this by increasing test duration from 5 to 10s. This gives enough time for BWE to ramp up and for encoder to generate (stop dropping) all temporal layers.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/test/svc_e2e_tests.cc;l=460;bpv=1

Bug: chromium:1466809
Change-Id: I16802689e234f8fc16f891f024d5f644985de01c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315142
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40536}
2023-08-10 15:11:08 +00:00
Florent Castelli
5278b39fab Add H264Encoder::Create()
Most of the usage of the H264Encoder::Create(codec) method passes a
simple codec with just the H264 codec name. This simplified the call
sites in many places and removes references to the codec types.

Bug: webrtc:15214
Change-Id: I4039c0be4ce6e3147c14c7853df4635f344b7d70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307222
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40214}
2023-06-02 17:40:26 +00:00
Markus Handell
f67d1fd42c OveruseFrameDetector: complete removal of mac rules kill switch.
Finally remove bogus code after a year of no feedback on the matter.

Bug: webrtc:14138
Change-Id: I8083c9e1986e3779c9023a7d8935b717f63f0d86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306180
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40115}
2023-05-23 09:05:53 +00:00
Sergey Silkin
a0be70a87c Use CodecTypeToPayloadString
Bug: none
Change-Id: Ic1879497a35ca3c1aa362ca2d3834d8d80a6bc31
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296662
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39504}
2023-03-08 14:38:06 +00:00
Markus Handell
a1ceae206b Implement support for Chrome task origin tracing. #3.5/4
This CL migrates unit tests to the new TaskQueueBase interface.

Bug: chromium:1416199
Change-Id: Ic15c694b28eb67450ac99fdd56754de1246a4d95
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295621
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39434}
2023-03-01 11:11:37 +00:00
Henrik Boström
c5a4c938bb Reland "Make SimulcastIndex() and SpatialIndex() distinct (remove fallback)."
This is a reland of commit 8ad4924936

See diff between latest Patch Set and PS1. Fixes include:
- VideoStreamEncoder's call to bitrate_adjuster_->OnEncodedFrame()
  is updated to take stream index (spatial or simulcast index) instead
  of only looking at SpatialIndex().
- Migrate test-only helpers to use Spatial/SimulcastIndex correctly.

The fixes are to migrate
some test-only helpers that we had forgot to fix that are used by
external tests.

Original change's description:
> Make SimulcastIndex() and SpatialIndex() distinct (remove fallback).
>
> This CL removes the fallback logic to return the other index when the
> one requested has not been set. This means we can remove the codec gates
> that was previously needed because SpatialIndex() had multiple meanings,
> resolving the TODOs previously added in
> https://webrtc-review.googlesource.com/c/src/+/293343.
>
> We have already migrated all known external dependencies from
> SpatialIndex() to SimulcastIndex() where necessary, unblocking this CL.
>
> PSA: https://groups.google.com/g/discuss-webrtc/c/SDAVg6xJ3gY
>
> Bug: webrtc:14884
> Change-Id: I82787505ab10be151e5f64965b270c45465d63a9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293740
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39343}

Bug: webrtc:14884
Change-Id: Ib966924efca1a040dae881599f0789a7f2ab24a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294284
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39358}
2023-02-21 18:30:35 +00:00
Erik Språng
573f546197 Fix max bitrate not being resptected with some HW codecs.
This makes the max bitrate configured in RTP parameter to still be
respected, instead of being overridden by defaults in the case that an
encoder with untrusted QP is reconfigured (e.g. due to some adaptation).

Bug: webrtc:14914
Change-Id: I2d3ff645c069b80ec2e36887e6ce0ecd09a7ecbf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293944
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39357}
2023-02-21 13:57:53 +00:00
Henrik Boström
79a6f87648 Revert "Make SimulcastIndex() and SpatialIndex() distinct (remove fallback)."
This reverts commit 8ad4924936.

Reason for revert: Breaks downstream projects

Original change's description:
> Make SimulcastIndex() and SpatialIndex() distinct (remove fallback).
>
> This CL removes the fallback logic to return the other index when the
> one requested has not been set. This means we can remove the codec gates
> that was previously needed because SpatialIndex() had multiple meanings,
> resolving the TODOs previously added in
> https://webrtc-review.googlesource.com/c/src/+/293343.
>
> We have already migrated all known external dependencies from
> SpatialIndex() to SimulcastIndex() where necessary, unblocking this CL.
>
> PSA: https://groups.google.com/g/discuss-webrtc/c/SDAVg6xJ3gY
>
> Bug: webrtc:14884
> Change-Id: I82787505ab10be151e5f64965b270c45465d63a9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293740
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39343}

Bug: webrtc:14884
Change-Id: Ibcb834a1519930336fa50e8e9d8d0137972e28e6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294282
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39347}
2023-02-20 12:47:37 +00:00
Henrik Boström
8ad4924936 Make SimulcastIndex() and SpatialIndex() distinct (remove fallback).
This CL removes the fallback logic to return the other index when the
one requested has not been set. This means we can remove the codec gates
that was previously needed because SpatialIndex() had multiple meanings,
resolving the TODOs previously added in
https://webrtc-review.googlesource.com/c/src/+/293343.

We have already migrated all known external dependencies from
SpatialIndex() to SimulcastIndex() where necessary, unblocking this CL.

PSA: https://groups.google.com/g/discuss-webrtc/c/SDAVg6xJ3gY

Bug: webrtc:14884
Change-Id: I82787505ab10be151e5f64965b270c45465d63a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293740
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39343}
2023-02-20 10:48:24 +00:00
Erik Språng
17043b89ae Make sure VP9 encoders are reconfigured on layer activation.
When disabling a spatial layer, reconfiguration of the encoder is not
necessary (bitrate will never be assigned to the inactive layer anway).
This CL however makes sure we reconfigure the encoder when a spatial
layer is activated. Some encoder implementations may encoder the wrong
number of spatial layers if the active layers have not beens set
correctly.

Bug: webrtc:14809, b/261097903
Change-Id: I8d34aaec95eb50a9717c06ea38f25088e5a96429
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290560
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38999}
2023-01-04 15:24:57 +00:00