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}
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}
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}
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}
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}
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}
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}
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}
* 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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}