This switches from accepting a sample rate and convert to channel
size over to accepting the channel size.
Instead of InitializeIfNeeded:
* Offer a way to explicitly initialize PushResampler via the ctor
(needed for VoiceActivityDetectorWrapper)
* Implicitly check for the right configuration from within Resample().
(All calls to Resample() were preceded by a call to Initialize)
As part of this, refactor VoiceActivityDetectorWrapper (VADW):
* VADW is now initialized in the constructor and more const.
* Remove VADW::Initialize() and instead reconstruct VADW if needed.
Add constants for max sample rate and num channels to audio_util.h
In many cases the numbers for these values are embedded in the code
which has led to some inconsistency.
Bug: chromium:335805780
Change-Id: Iead0d52eb1b261a8d64e93f51401147c8fba32f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353360
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42587}
Trying to fix the error:
bad request: build: constraints for webrtc:try not found
Change-Id: Icf96d5082ce09a60d079b91117a3786ddb97269c
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356301
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#42585}
Tried 'led' today and it resulted in the below error:
rpc error: code = PermissionDenied desc = user does not have permission "buildbucket.builds.create"
Change-Id: I361859b6f6ee58a67ac08e615cb88761fb39d67e
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356300
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42583}
Some dependencies still exist but are a bit more complex to remove.
This CL removes either unused or easily replaced with ToString()
instances of ostream usage. In one case, moving the operator<<
implementation to the one test file that requires it.
Bug: webrtc:8982
Change-Id: Ia5c840b12a42893494af401317a3daf2fe50ba9b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356240
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42582}
Also adding more checks around parameter valuesm since the
`sample_rate_hz` argument is technically not needed, but will be
removed in a follow-up CL.
Bug: chromium:335805780
Change-Id: Ia7e50658f8a686ab71980f9c59cce5f097b0af40
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353340
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42581}
Currently, if the single-encoder mode fails to initialize, the
callback is cleared on the encoder with Release() call.
Below, the encoder_context for the first stream will be reused but
then we only intercept the callback for the stream_idx>0.
Therefore if RegisterEncodeCompleteCallback() is called before the InitEncode(), the first stream will end up with nullptr callback.
To ensure this doesn't happen, restore the callback on the reusable encoder.
Bug: none
Change-Id: I1c830f3bf71f64807d5cc1a3000b73834011bde4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356180
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42580}
* FrameCombiner is simpler. No additional channel pointers for buffers.
* Improve consistency in using views in downstream classes.
* Deprecate older methods (some have upstream dependencies).
* Use samples per channel instead of sample rate where the former is
really what's needed.
Bug: chromium:335805780
Change-Id: I0dde8ed7a5a187bbddd18d3b6c649aa0865e6d4a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352582
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42575}
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}
The new constructor exposes an already existing constructor,
and is used to create a (test) UDPPort
with a socket...so that one does not (really) need a
socket factory.
Bug: b/339018639
Change-Id: Ib591fe6ae61519fe29cdea819192694448b071e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356141
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42571}
Add default values and a static Create() function that determines
the parameters to use based on the specified codec and potential
field trial overrides.
Bug: chromium:328598314
Change-Id: I7a9331a1fd0ed4bd258788760592ea84e535e43b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355903
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Markus Handell <handellm@google.com>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42567}
The quality convergence monitor will be used for screenshare streams
to determine if encoded video frames have reached the target quality.
This is a generalization of the static threshold that is currently
used for VP8 in VideoStreamEncoder.
Internal design document: go/qp-convergence-detection
Bug: chromium:328598314
Change-Id: I13e32ee6efb54cbdb4e8a814c525087af8cd2759
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355902
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42566}
This reverts commit 86ff48adaea08fd4e7044595e1c25a22fcceac34.
Reason for revert: Speculative revert due to failing downstream tests
Original change's description:
> Rewrite simulcast config to equivalent SVC for vp9 simulcast
>
> This allows to utilize libvpx optimizations considerably improving performance.
> The change happens inside libvpx_vp9_encoder and is invisible to other parts of webrtc.
>
> This CL includes unit tests, an E2E test already exists: StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.Simulcast/VP9 in peerconnection_unittests.
>
> Bug: webrtc:347737882
> Change-Id: Ic48316ad597700ed07e594d592413cf84b6b20d4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355003
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42554}
Bug: webrtc:347737882
Change-Id: Ib84c9c0e20763348abfae838f2fb1aff31581a55
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355943
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#42564}
Otherwise targets which don't need threads but transitively include this
fail to build due to missing thread priority symbols as described in the
bug.
Bug: webrtc:349961287
Change-Id: I33098a150387b8d20ab9344f49d7c7cb19be2db4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355901
Auto-Submit: Tony Herre <herre@google.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42563}
The idea is to reduce the risk of calculating a packet as lost if a
packet is reordered between two feedback reports.
It works as long as the recevied feedback does not complete an
observation.
Bug: webrtc:42222865 b/349765923
Change-Id: Iaf1595e624f546951baf3998d161f4cd1d5d491b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355942
Reviewed-by: Diep Bui <diepbp@google.com>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42562}
std::optional<T>::emplace() without an initializer is broken on clang++
with gnu libstdc++. this workarounds the bug by removing the
absl::optional wrapping, which is actually pointless.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101227
Bug: chromium:41455655
Change-Id: I05354e57cc4cdda3fa6d3cd23f46462b69cc3bee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355900
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Diep Bui <diepbp@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42561}
With this commit we'll have a full reland of https://webrtc-review.googlesource.com/c/src/+/355520.
First time the CL landed it triggered a jni_zero dependency cycle which seems to be fixed somehow...
This commit roll these changes:
a90b1f4c5a..91945cadc2
Change-Id: Iff6fd7ab808a240c4172373f1baa6d9388823c91
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355940
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42560}
The minimum QP field will be used to signal what the QP value will be
once the encoder reach its target video quality. This will be used
in the generalized QP convergence detection.
Bug: chromium:328598314
Change-Id: I82299cd921e3c091e651218d1e3f337875176567
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355701
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Markus Handell <handellm@google.com>
Cr-Commit-Position: refs/heads/main@{#42559}
This will generate a JSON compilation database for all build targets by
default. This is useful for LSP servers and other tools for properly
interacting with the build system. Previously, users have been able to
this manually by appending a flag to gn gen.
Bug: None
Change-Id: I9cdf501b5c392314eae53010ef2d9928769809a8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355941
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42558}
Libvpx works without this, so the existing tests pass. However, other
encoder implementations (like rtc_video_encoder in Chrome) look at
different fields and get confused about the configuration.
Test: Integration tests with Chrome and windows hardware encoders.
Bug: webrtc:348342168
Change-Id: Id0d96cff34eb34c7e019a24255623f3aeeca5772
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355500
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42555}
This allows to utilize libvpx optimizations considerably improving performance.
The change happens inside libvpx_vp9_encoder and is invisible to other parts of webrtc.
This CL includes unit tests, an E2E test already exists: StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.Simulcast/VP9 in peerconnection_unittests.
Bug: webrtc:347737882
Change-Id: Ic48316ad597700ed07e594d592413cf84b6b20d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355003
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42554}
Set is_steady_state_refresh_frame true if the update rectangle of the
corresponding VideoFrame is empty. Set it to false otherwise.
Rename FillTimingInfo to FillMetadataAndTimingInfo.
Bug: chromium:328598314
Change-Id: I7a3e89b180432473b087e849fce636ce1b329637
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355780
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42551}
The field is_steady_state_refresh_frame_ can be used to determine
if the encoded video frame is a repeated frame that should be considered
for QP convergence detection.
Bug: chromium:328598314
Change-Id: Iffba0f9f70af8b41b9bde25cf40b08b77dad8021
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355702
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42550}
As mentioned, this CL adds the yuv input file support, also checks the
PSNR and bitrate validation in video encoder tool.
the output example is like:
(video_encoder.cc:487): VideoBitrateAllocation [ [272000] ]
(ivf_file_writer.cc:165): Created IVF file for codec data of type AV1 at resolution 640 x 360, using 90kHz clock resolution.
(video_encoder.cc:266): PSNRPassed Average PSNR: 35.6536 Average bitrate: 273960 Bitrate deviation: 0.720588 %
Bug: None
Change-Id: Idaf2545fc272ec636165104784eae79aaee731f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355360
Commit-Queue: Zhaoliang Ma <zhaoliang.ma@intel.com>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42549}
Set cursor position to (-1,-1) to indicate it's not valid when it goes
off the screen or it gets hidden by the compositor. Compositors indicate
invalid or hidden cursor by unsetting the cursor id in cursor metadata
and using spa_meta_cursor_is_valid() will tell us the needed information
for this.
Bug: chromium:346608851
Change-Id: I71b3222ca161b7fd8e964f4f4e12b9983179beba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355080
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Jan Grulich <grulja@gmail.com>
Cr-Commit-Position: refs/heads/main@{#42548}
In https://webrtc-review.googlesource.com/c/src/+/355181 I supposed to add RTC_EXPORT to the TimeUTCMicros function. However in the code I added it to TimeUTCMillis(). I hadn't realized there where two similar functions, so I did a poor error check.
I think it make sense to have RTC_EXPORT on both of them, since they are similar. So I opted to not revert the change in the previous faulty CL.
Bug: chromium:333359951
Change-Id: Icb3d3adeebd4fbf56244986a9e801bee84ff04df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355760
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42546}
This target then will be filled with writer related part from "video_test_support"
This allows downstream to migrate on the new target keeping dependency on the old one.
Bug: None
Change-Id: Ie0b2f0ff9c7896c70b9a204ffedf15afac43c143
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355580
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42539}
Its header and its compilation configs have been removed by
https://webrtc-review.googlesource.com/c/src/+/323004.
Bug: webrtc:12598
Change-Id: I5ecf0c5ab273d09b90e663c1f70d10e4cc593aec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355260
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42538}