Commit graph

2613 commits

Author SHA1 Message Date
Henrik Boström
0f1376529a Delete RTC[NonStandard/Restricted]StatsMember.
Whether a metric is to be exposed to JavaScript or not is a blink
implementation detail that the WebRTC repository does not need to be
concerned with.

This CL removes unused code and paves the way for the possibility of
making the one and only RTCStatsMember class be absl::optional<>-based
in the future.

Bug: webrtc:15162
Change-Id: I578715f48b8fcc3534b72b4c700fd6567f8d553e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304722
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40139}
2023-05-25 08:39:48 +00:00
Henrik Boström
979b0479a1 Revert "Temporarily add dummy trackId to unblock roll."
This reverts commit 3df4178d59.

Reason for revert: This dummy variable is no longer needed to make
importer happy

Original change's description:
> Temporarily add dummy trackId to unblock roll.
>
> NOTRY=True
>
> Bug: webrtc:15198
> Change-Id: I3090b90c549da3f2368001f2049bbf1d66042af4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306400
> Reviewed-by: Markus Handell <handellm@webrtc.org>
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40130}

Bug: webrtc:15198
Change-Id: Ib47471259de72771292887050d1576707a473eec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306401
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40135}
2023-05-24 15:50:44 +00:00
Henrik Boström
2057d71775 [Stats] Delete unused NonStandardGroupId.
NonStandardGroupId is no longer wired up to Chrome, but if we did want
to only expose certain metrics if a field trial was enabled then the
right place to do that would be in blink, where WebIDL lives.

This was only used prior to the WebRtcStatsReportIdl launch and
experiments haven't been active in several years so its dead code.

Blocked on:
- https://chromium-review.googlesource.com/c/chromium/src/+/4514754

Bug: webrtc:15162
Change-Id: Ia41a4d21d7e5f029ddb121183fbd69ae7f98fac4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304720
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40132}
2023-05-24 14:08:32 +00:00
Henrik Boström
3df4178d59 Temporarily add dummy trackId to unblock roll.
NOTRY=True

Bug: webrtc:15198
Change-Id: I3090b90c549da3f2368001f2049bbf1d66042af4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306400
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40130}
2023-05-24 12:54:43 +00:00
Henrik Boström
4e231eedbd Delete deprecated 'track' and 'stream' metrics from WebRTC.
Track stats are roughly equal in size as the RTP stream stats which
are the largest objects making up the majority of the RTCStatsReport
size and scales with meeting size. Deleting track/stream reduces the
size in approximately half which should reduce performance overhead
and unblock code simplifications.

Blocked on:
- https://chromium-review.googlesource.com/c/chromium/src/+/4517530

# Relevant bots already passed
NOTRY=True

Bug: webrtc:14175, webrtc:14419
Change-Id: Ib7bdb84c10459b42b829228d11876498e5227312
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/289043
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40129}
2023-05-24 12:26:56 +00:00
Jonas Oreland
1d3452f31b RequestedResolution - Bug fix
Change default value of is_active to false,
this means that VideoRenderer or other VideoSinks
added with default rtc::VideoSinkWants() does not
block usage of RequestedResolution, e.g JNI_VideoTrack_AddSink.

This problem occurs when attaching a VideoRenderer directly to
the sending VideoTrack (which is a great solution!). But the
VideoRenderer is "passive" and should not block adaptations
from RequestedResolution.

Bug: webrtc:14451
Change-Id: I2ab02596245c7b82bf94fe86f8788f458c7ea286
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305024
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40105}
2023-05-22 13:58:50 +00:00
Henrik Boström
36fd351562 [Stats] Align RTCStatsMember<T> closer to absl::optional<T>.
Step 1: Make reading RTCStatsMember look the same as reading
        absl::optional (this CL).
Step 2: Migrate uses of "is_defined()" to "has_value()".
Step 3: Delete "is_defined()".
Step 4: Make RTCStatsMember+Interface an implementation detail of
        RTCStats::Members(), only used for abstract iteration ("for
        each metric"). Lazy instantiate it upon Members().
Step 5: Replace RTCStatsMember with absl::optional for use in RTCStats
        dictionaries (rtcstats_objects.h/cc).

Bug: webrtc:15164
Change-Id: I5a2c9fe56707e3c7d89e8ea62fb37171ae806a7c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304840
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40048}
2023-05-11 07:33:54 +00:00
Philipp Hancke
e0034a800e stats: remove media_type which was an alias for kind
The web compat requirement that was the reason for keeping
is now solved in Chromium and its stats bindings.

BUG=webrtc:9674

Change-Id: Ifb722769414b2bcc5f4d36d7dff87a875336e039
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303860
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40024}
2023-05-09 11:46:52 +00:00
Tommi
301e546a68 Remove SequenceCheckerImpl::valid_system_queue_
As pointed out in issue webrtc:15146 this Mac/iOS specific variable,
makes the SequenceChecker behave incorrectly on those platforms.

The variable was introduced in a CL that merged the previous checker
classes, ThreadChecker and SequencedTaskChecker, but curiously neither
one of them had such a variable. So I'm not exactly sure what problem
was being solved. Hence I'm wondering if we actually need it.

Reference: https://webrtc-review.googlesource.com/c/src/+/129721

Bug: webrtc:15146
Change-Id: Ia7a9eb17b993c4f8a1e8204c658bf0b3dbdaa1e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304401
Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40019}
2023-05-09 09:40:51 +00:00
Markus Handell
c8c4a282a6 Introduce support for video packet batching.
This CL introduces a new feature enabling video packet send batches.
The feature is enabled via
PeerConnectionInterface
::RTCConfiguration
::MediaConfig
::enable_send_packet_batching.

PacketOptions have been augmented with attribute "batchable" (set for
all video packets) and attribute "last_packet_in_batch" which gives
injected AsyncPacketSockets a chance to understand when a batch begins
and ends.

When the feature is on, packets are collected in RtpSenderEgress. On
reception of OnBatchComplete from PacingController, RtpSenderEgress
sends the collected batch, setting "last_packet_in_batch" to true
in the last packet.

Bug: chromium:1439830
Change-Id: I1846b9d4a8a0efd227d617691213a2e048bdc8a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303720
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40012}
2023-05-08 16:24:03 +00:00
Jared Siskin
bceec84aee Format ^(api|call|common_audio|examples|media|net|p2p|pc)/
half of the remaining folders

git ls-files | grep -e  "\(\.h\|\.cc\)$" | grep -E "^(api|call|common_audio|examples|media|net|p2p|pc)/" | xargs clang-format -i ; git cl format
after landing: add to .git-blame-ignore-revs

Bug: webrtc:15082
Change-Id: I8b2cac13f4587d3ce9b2fccc7362967283f57ea2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302062
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39977}
2023-05-03 11:09:26 +00:00
Philipp Hancke
f78d1f211a stats: Implement receive RTX stats
* retransmittedBytesReceived
* retransmittedPacketsReceived
added to the specification in
  https://github.com/w3c/webrtc-stats/pull/735

BUG=webrtc:15096

Change-Id: I6770e5d8d09ac1c2693c918fd943b0ab257ec7ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295260
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39959}
2023-04-27 09:53:00 +00:00
Philipp Hancke
2b72d84733 stats: fix type of inbound-rtp frames_received
which gets assigned from a uint32_t VideoReceiverInfo::frames_received so should remain an unsigned type

BUG=None

Change-Id: I1db6a3f96c4ff49eee72dcce54eb6fff346c128c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302342
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39958}
2023-04-26 15:57:46 +00:00
Jakob Ivarsson
2bd878180a Add delayed packet outage event metric.
Can be used to calculate the average delayed packet outage duration and
number of packet loss events by subtracting from concealment events.

Only used in simulations currently.

Bug: None
Change-Id: I03740a2bcb781af09e28a4d13d9e41c0f84bc506
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303600
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39957}
2023-04-26 13:40:17 +00:00
Artem Titov
17d7eb4d52 Do not compile some test targets with chromium
Move copy_to_file_audio_capturer, copy_to_file_audio_capturer_unittest
and test_common under "!build_with_chromium"

Bug: b/272350185, webrtc:15081
Change-Id: Ie3f08e4ce5bec91647e802cc34040df2e01103d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303680
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39954}
2023-04-26 10:07:49 +00:00
Jeremy Leconte
4730201454 [DVQA] Add a GetSenderPeerName method.
Change-Id: I2b30510911865150881c116abc2f86be7821f34a
Bug: b/277851637
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301280
Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39875}
2023-04-17 13:05:33 +00:00
Florent Castelli
0a4a9846fc Extract common codec fields into RtpCodec
This creates the RtpCodec structure for the common fields
used in RtpCodecParameters and RtpCodecCapability.
Remove the unused fields from both that were defined from ORTC
and never implemented as well.

Bug: webrtc:15064
Change-Id: I37b4c83e2051a888fc99cc0d9f7aeb8d74f0421d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301182
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39862}
2023-04-14 12:15:24 +00:00
Tony Herre
c381c33767 Make TransformableVideoFrameInterface::SetMetadata pure virtual
Bug: webrtc:14709
Change-Id: I9e131a041e80c1774b982f61197a0499b97c6ae7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301162
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Auto-Submit: Tony Herre <herre@google.com>
Reviewed-by: Stefan Holmer <holmer@google.com>
Cr-Commit-Position: refs/heads/main@{#39845}
2023-04-13 11:23:16 +00:00
Sergey Silkin
26d1b26277 Log metrics even if test failed
Set of codecs for testing is hardcoded to AV1, VP8, VP9, H264, H265. Some codecs may not be available due to lack of support on the platform or due to some issue in our code which would be a regression. Reporting zero metrics for failed tests would allow the perf tool to detect such a regression.

This also enables codec tests by default. The tests should not run on bots since video_codec_perf_tests binary is not included in any test suits yet.

Bug: webrtc:14852
Change-Id: I967160069055036f93e595d328c4d5f1ca483be9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300868
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39840}
2023-04-13 08:49:37 +00:00
Sergey Silkin
b4a45546b7 Dedicated build target for video codec perf tests
Bug: webrtc:14852
Change-Id: Ib56ef931b58058a7d09b97b7013ba39ee1767629
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300740
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39823}
2023-04-12 11:24:48 +00:00
Tommi
a50a81a150 [DataChannelInterface] Introduce DataChannelInterface::SendAsync()
One problem with the existing Send() method is that it has a return
value that is problematic for a fully async implementation.

A second problem with Send() is that the return value is bool and not
RTCError (webrtc:13289), which is why OnSendComplete() uses RTCError.

Also, start deprecating `bool Send()` in favor of `void SendAsync()` and
adding `network_safety_` flag for posting async operations to the
network thread. This flag also takes over from the
`connected_to_transport_` which can now be removed.

Bug: webrtc:11547, webrtc:13289
Change-Id: I87bbc7e9b964a52684bdfe0e6ebc5230be254e8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299760
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39817}
2023-04-11 19:46:36 +00:00
Tommi
a13b4d1d30 Partial reland: DataChannelObserver interface change.
This is a partial reland of:
https://webrtc-review.googlesource.com/c/src/+/299142

This CL includes the interface change in DataChannelObserver but
not the code behind it. The point of landing this change first is
to be able to override this method in downstream implementations in
preparation for relanding the rest of the changes.

Bug: webrtc:11547
Change-Id: Ic3fe4fb8084908ef12bd4916b763df5a75604113
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300362
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39776}
2023-04-06 08:47:53 +00:00
Daniel Cheng
0e1d3c5675 Add reference, pointer, and co type aliases for rtc::ArrayView.
Many STL containers define these type aliases, and they are easier to
work with than add_const_t<add_lvalue_reference_t<value_type>>.

In a followup, `WTF::Vector` in Blink's conversion constructor from
other containers will be SFINAE-guarded using these type aliases.

Bug: chromium:1408442
Change-Id: I7790e6f462a32e7e49bc6468afeda6b2e6d4b631
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300180
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#39771}
2023-04-05 20:18:57 +00:00
philipel
7ceb49c7b8 Fuzzy match the SdpVideoFormat in VideoEncoderFactoryTemplate::CreateVideoEncoder.
Bug: webrtc:13573
Change-Id: I1223f5f989d5298d3a6f7f6d06fd752e650adfd9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300342
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39766}
2023-04-05 11:48:26 +00:00
Andrey Logvin
7f16fcda0f Revert "[DataChannel] Send and receive packets on the network thread."
This reverts commit fe53fec24e.

Reason for revert: Speculative revert, may be breaking downstream project

Original change's description:
> [DataChannel] Send and receive packets on the network thread.
>
> This updates sctp channels, including work that happens between the
> data channel controller and the transport, to run on the network
> thread. Previously all network traffic related to data channels was
> routed through the signaling thread before going to either the network
> thread or the caller's thread (e.g. js thread in chrome). Now the
> calls can go straight from the network thread to the JS thread with
> enabling a special flag on the observer (see below) and similarly
> calls to send data, involve 2 threads instead of 3.
>
> * Custom data channel observer adapter implementation that
>   maintains compatibility with existing observer implementations in
>   that notifications are delivered on the signaling thread.
>   The adapter can be explicitly disabled for implementations that
>   want to optimize the callback path and promise to not block the
>   network thread.
> * Remove the signaling thread copy of data channels in the controller.
> * Remove several PostTask operations that were needed to keep things
>   in sync (but the need has gone away).
> * Update tests for the controller to consistently call
>   TeardownDataChannelTransport_n to match with production.
> * Update stats collectors (current and legacy) to fetch the data
>   channel stats on the network thread where they're maintained.
> * Remove the AsyncChannelCloseTeardown test since the async teardown
>   step has gone away.
> * Remove `sid_s` in the channel code since we only need the network
>   state now.
> * For the custom observer support (with and without data adapter) and
>   maintain compatibility with existing implementations, added a new
>   proxy macro that allows an implementation to selectively provide
>   its own implementation without being proxied. This is used for
>   registering/unregistering a data channel observer.
> * Update the data channel proxy to map most methods to the network
>   thread, avoiding the interim jump to the signaling thread.
> * Update a plethora of thread checkers from signaling to network.
>
> Bug: webrtc:11547
> Change-Id: Ib4cff1482e31c46008e187189a79e967389bc518
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299142
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39760}

Bug: webrtc:11547
Change-Id: Id0d65594bf727ccea5c49093c942b09714d101ad
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300341
Auto-Submit: Andrey Logvin <landrey@webrtc.org>
Owners-Override: Andrey Logvin <landrey@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39764}
2023-04-05 09:34:23 +00:00
Tommi
fe53fec24e [DataChannel] Send and receive packets on the network thread.
This updates sctp channels, including work that happens between the
data channel controller and the transport, to run on the network
thread. Previously all network traffic related to data channels was
routed through the signaling thread before going to either the network
thread or the caller's thread (e.g. js thread in chrome). Now the
calls can go straight from the network thread to the JS thread with
enabling a special flag on the observer (see below) and similarly
calls to send data, involve 2 threads instead of 3.

* Custom data channel observer adapter implementation that
  maintains compatibility with existing observer implementations in
  that notifications are delivered on the signaling thread.
  The adapter can be explicitly disabled for implementations that
  want to optimize the callback path and promise to not block the
  network thread.
* Remove the signaling thread copy of data channels in the controller.
* Remove several PostTask operations that were needed to keep things
  in sync (but the need has gone away).
* Update tests for the controller to consistently call
  TeardownDataChannelTransport_n to match with production.
* Update stats collectors (current and legacy) to fetch the data
  channel stats on the network thread where they're maintained.
* Remove the AsyncChannelCloseTeardown test since the async teardown
  step has gone away.
* Remove `sid_s` in the channel code since we only need the network
  state now.
* For the custom observer support (with and without data adapter) and
  maintain compatibility with existing implementations, added a new
  proxy macro that allows an implementation to selectively provide
  its own implementation without being proxied. This is used for
  registering/unregistering a data channel observer.
* Update the data channel proxy to map most methods to the network
  thread, avoiding the interim jump to the signaling thread.
* Update a plethora of thread checkers from signaling to network.

Bug: webrtc:11547
Change-Id: Ib4cff1482e31c46008e187189a79e967389bc518
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299142
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39760}
2023-04-04 16:49:17 +00:00
Henrik Boström
8481f6358e Remove IsSinglecastOrAllNonFirstLayersInactive() helper.
As of recent changes, we can simply look at numberOfSimulcastStreams
because in the {active,inactive,inactive} case we get a single
webrtc::VideoStream here[1] which results in numberOfSimulcastStreams
being 1 here[2].

Looking at numberOfSimulcastStreams instead of using a helper is
preferred because it is more descriptive and in the future, when
{inactive,active,inactive} or {inactive,inactive,active} cases of VP9
simulcast is also supported (webrtc:15046) then this gating will work
even when the first layer is not the active one.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/config/encoder_stream_factory.cc;l=146;drc=c99753ac8f051e379ae68e281aaef04b0a5ca8f2

[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/video_codec_initializer.cc;l=77;drc=4baea5b07f2fd309892845cf2d1c0f4ca77862d3

# No need to wait for win chrome bot, everything else green
NOTRY=True

Bug: webrtc:15046
Change-Id: I8aaea2e8cc350bd01fb00cc7fd85032b7fdfe24d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299942
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39759}
2023-04-04 13:59:07 +00:00
philipel
31af34ba8c Update Dav1dDecoderTemplateAdapater to include AV1 profile1 support.
Bug: webrtc:13573
Change-Id: Ibc81b6400eb8e22ce28ae434c83a22013ef96c79
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299946
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39757}
2023-04-04 12:40:17 +00:00
Jeremy Leconte
40a0e3191a Remove AudioConfig::Mode.
The Mode is currently redundant with the optional input_file_name.

Change-Id: Ib4f0a363e86d925107d61867a7f743d6663e7071
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298743
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#39754}
2023-04-04 08:44:23 +00:00
Tommi
0fe65102cc Add support for detaching and merging of StatsCollection contents.
This is needed in order to be able to update the legacy stats
collector to fetch data channel stats from the network thread, which
is part of an upcoming change to data channels.

Bug: webrtc:11547
Change-Id: Ic205b0314b9f11a024d36d714c223cbddd0f3df3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299462
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39732}
2023-03-31 15:46:07 +00:00
Tony Herre
e7482b403d Remove deprecated TransformableVideoFrameInterface::GetMetadata
Bug: chromium:1420245
Change-Id: I4cc008bf8a4af2404f33589aededa8a16b774764
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299263
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39712}
2023-03-29 08:33:46 +00:00
Artem Titov
089758dbc5 Allow creation of TestVideoTrackSource not on the signaling thread
Bug: b/272350185
Change-Id: I1bc18f35e2d0b36791966a5954eb28886c569a9b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299261
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39704}
2023-03-28 13:33:35 +00:00
Harald Alvestrand
d32e5b3078 Deprecate non-refcount CreateVideoTrack
Bug: webrtc:15017
Change-Id: I978a14dcb2fac7777a12c3f89b1a7207dd896b37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299075
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39700}
2023-03-28 11:58:36 +00:00
Danil Chapovalov
e14abcb20b Cleanup FieldTrialView
Delete alias WebRtcKeyValueConfig as unused
Replace .find() == 0 with absl::StartsWith per clang-tidy recommendation
https://clang.llvm.org/extra/clang-tidy/checks/abseil/string-find-startswith.html

Bug: webrtc:10335
Change-Id: I1f09c262844c0678a8d8c0d0d3274df3d947737c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299181
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39690}
2023-03-27 17:06:33 +00:00
Jeremy Leconte
a3f7b54518 [DVQA] Don't check if peer exists on Pause/Resume.
Change-Id: I0f26444c6a420017caaa4c27520e75e4146ecfd4
Bug: webrtc:14995
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299077
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39689}
2023-03-27 16:23:52 +00:00
Artem Titov
6fd5f33d45 Extend TestVideoTrackSource API
Bug: b/272350185
Change-Id: Ibc53e7a9ee8f572475d86fc78de1c1ed71078910
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299140
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39678}
2023-03-25 21:35:23 +00:00
Jakob Ivarsson
94b51210f8 Include packet waiting time in concealment decision.
This is to be more robust to packet loss during DTX and paused streams.

Without it, we can wait to decode an available packet when in CNG or
PLC mode until more packets arrive, which for DTX and paused streams
can take a long time.

We already include the waiting time if the last packet in the buffer
is a DTX packet.

Bug: webrtc:13322
Change-Id: Iaf5b3894500140d6f83377ba2cd65b44e0cdac05
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299009
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39667}
2023-03-24 13:18:58 +00:00
Tommi
c848268ab1 Use SequenceChecker(SequenceChecker::kDetached) in a few places.
This CL is partly a test to see if there's an impact on binary size:
- Not a big difference for binaries (decrease): -776b to -4Kb
- For libraries (libwebrtc.a) it actually increases the size: +40Kb

Secondarily this CL is basically to introduce this pattern to the
code base. In terms of LOC, this makes things slightly more compact.

From:

  class Foo {
   public:
     Foo() {
       checker_.Detach();
     }
   private:
    SequenceChecker checker_;
  };

To:

  class Foo {
   public:
     Foo() = default;
   private:
    SequenceChecker checker_{SequenceChecker::kDetached};
  };

Bug: none
Change-Id: I59fc34ccea10847e13455a349851ce9a0af458e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299020
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39664}
2023-03-24 07:44:18 +00:00
Henrik Boström
4baea5b07f Make VP9 simulcast behave like singlecast for single active layer cases.
Various "if streams == 1" cases are updated to "if
IsSinglecastOrAllNonFirstLayersInactive()" in order not to cause subtle
differences between VP9 {active} and VP9 {active,inactive,inactive}.

This CL also affects a line that conditionally sets
`simulcastStream[0].active = codec_active` so it seemed fitting to
improve the test coverage of "if all streams are inactive, don't send".

Bug: webrtc:15028
Change-Id: I8872dc8be0f2dfc1d8914bdba5e6433f9ba8cbfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298881
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39656}
2023-03-23 14:49:22 +00:00
Per K
7effd7657b Change visibility on target mock_network_control
This is to allow external tests to depend on it.

Bug: none
Change-Id: Ic8e2f864041d959f673e7f2c18eb563a13274dcc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298745
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39646}
2023-03-22 19:53:04 +00:00
Per K
452d94047b Add mock for NetworkControllerInterface
Bug: none
Change-Id: Ibdd72011932a36348a4382caa5d0bf0ab2c02dd9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298742
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39641}
2023-03-22 15:49:32 +00:00
Harald Alvestrand
041ecb87f5 New PeerConnectionFactory::CreateVideoTrack with refcounted source
Bug: webrtc:15017
Change-Id: I04c794d8959583bb4cc5c3898f4175783ec49f16
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249363
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39635}
2023-03-22 09:10:27 +00:00
Philipp Hancke
f0f435e983 Remove deprecated RTCStatsReport(int64) and timestamp_us
BUG=webrtc:14813

Change-Id: I80c2ba8f57354ef63cf2cc7b767d1f64dd0dd766
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298444
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39633}
2023-03-22 08:00:53 +00:00
Sergey Silkin
ebb5383fd8 Dump codec input
Add functionality for dumping encoder and decoder input to file in video codec test.

Bug: b/261160916, webrtc:14852
Change-Id: I49a84a886d87903c601cf5c35bd723b6393c2a75
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298051
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39626}
2023-03-21 16:54:19 +00:00
Henrik Boström
62dc65b537 Add test that attempting HW is still possible after SW fallback.
Based on previous discussions I would have thought that this test would
fail, but it turns out that it passes. See referenced bug for context.

Bug: webrtc:15021
Change-Id: I845b48f688fb25942e3b770d50cafbf8a0bafe94
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298562
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39625}
2023-03-21 15:02:34 +00:00
Artem Titov
6a78e93346 [PCLF] Introduce test video source and make it more controllable
Bug: b/272350185
Change-Id: I15572b7e4d0cb0ce41da676a4eedbc1e138510fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298047
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39621}
2023-03-21 14:15:24 +00:00
Jeremy Leconte
2148f8ed71 [DVQA] Change API to pause and resume all streams from a sender.
Also make it possible to pause an already paused stream by making it a no-op.

Change-Id: Id10f74a4c6464067ae63208162194f020c6470eb
Bug: b/271542055
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298202
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39620}
2023-03-21 14:05:03 +00:00
Jonas Oreland
122d777943 Add new stun attribute GOOG_DELTA_SYNC_REQ
Assigned by IANA: https://www.iana.org/assignments/stun-parameters/stun-parameters.xhtml

Bug: webrtc:0
Change-Id: Ie910e112afe33f3dbf7f2a221edc96af5ac7b139
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298560
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39617}
2023-03-21 13:28:43 +00:00
Tommi
3da04a93cd Allow SequenceChecker to be initialized detached.
The motivation for this is to not have to implement this pattern:

foo.h:

class Foo {
 public:
  Foo();
 private:
  SequenceChecker checker_;
};

foo.cc:

Foo::Foo() {
  checker_.Detach();
}

And instead be able to do this inline in the .h file:

class Foo {
 public:
  Foo();
 private:
  SequenceChecker checker_{SequenceChecker::kDetached};
};

Bug: none
Change-Id: Idd7ca82d15c2f77f3aaccf26f1943a49f4b40661
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298445
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39616}
2023-03-21 12:34:15 +00:00
Sergey Silkin
aa17f2f0a9 Add Initialize() to Encoder/Decoder API in video codec tester
Initialization of Android HW codecs takes hundreds milliseconds. Exclude this time from frame processing time of first frame by initializing codecs before starting encoding/decoding.

Bug: b/261160916, webrtc:14852
Change-Id: I9ec84c6b12c1d9821b59965cf521170224066563
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298304
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39613}
2023-03-21 08:04:48 +00:00