Fix simulcast svc controller to reuse dropped frame configuration,
same as full svc and k-svc controllers do.
This fuzzer reminded the issue was still there.
Bug: webrtc:11999
Change-Id: I74156bd743124723562e99deb48de5b5018a81d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212281
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33568}
This reverts commit 2072b87261a6505a88561bdeab3e7405d7038eaa.
Reason for revert: Causing test failure.
Original change's description:
> Reland "[Battery]: Delay start of TaskQueuePacedSender." Take 2
>
> This is a reland of 89cb65ed663a9000b9f7c90a78039bd85731e9ae
> ... and f28aade91dcc2cb8f590dc1379ac7ab5c1981909
>
> Reason for revert: crashes due to uninitialized pacing_bitrate_
> crbug.com/1190547
> Apparently pacer() is sometimes being used before EnsureStarted()
> Fix: Instead of delaying first call to SetPacingRates(),
> this CL no-ops MaybeProcessPackets() until EnsureStarted()
> is called for the first time.
>
> Original change's description:
> > [Battery]: Delay start of TaskQueuePacedSender.
> >
> > To avoid unnecessary repeating tasks, TaskQueuePacedSender is started
> > only upon RtpTransportControllerSend::EnsureStarted().
> >
> > More specifically, the repeating task happens in
> > TaskQueuePacedSender::MaybeProcessPackets() every 500ms, using a self
> > task_queue_.PostDelayedTask().
> >
> > Bug: chromium:1152887
> > Change-Id: I72c96d2c4b491d5edb45a30b210b3797165cbf48
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208560
> > Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> > Reviewed-by: Henrik Boström <hbos@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#33421}
>
> Bug: chromium:1152887
> Change-Id: I9aba4882a64bbee7d97ace9059dea8a24c144f93
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212880
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#33554}
TBR=hbos@webrtc.org,sprang@webrtc.org,etiennep@chromium.org
Change-Id: I430fd31c7602702c8ec44b9e38e68266abba8854
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1152887
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212965
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33559}
This is a reland of 89cb65ed663a9000b9f7c90a78039bd85731e9ae
... and f28aade91dcc2cb8f590dc1379ac7ab5c1981909
Reason for revert: crashes due to uninitialized pacing_bitrate_
crbug.com/1190547
Apparently pacer() is sometimes being used before EnsureStarted()
Fix: Instead of delaying first call to SetPacingRates(),
this CL no-ops MaybeProcessPackets() until EnsureStarted()
is called for the first time.
Original change's description:
> [Battery]: Delay start of TaskQueuePacedSender.
>
> To avoid unnecessary repeating tasks, TaskQueuePacedSender is started
> only upon RtpTransportControllerSend::EnsureStarted().
>
> More specifically, the repeating task happens in
> TaskQueuePacedSender::MaybeProcessPackets() every 500ms, using a self
> task_queue_.PostDelayedTask().
>
> Bug: chromium:1152887
> Change-Id: I72c96d2c4b491d5edb45a30b210b3797165cbf48
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208560
> Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33421}
Bug: chromium:1152887
Change-Id: I9aba4882a64bbee7d97ace9059dea8a24c144f93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212880
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#33554}
This API should allow existing factories to be used unmodified, but
offers a new API that documents ownership better and does not use
sigslot.
Bug: webrtc:12598
Change-Id: I0f68371059cd4a18ab07b87fc0e7526dcc0ac669
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212609
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33553}
At the point where an EncodedImage is reported to the
EncoderBitrateAdjuster (in order to estimate utilization), the image
data has been cleared so the size is 0 - meaning the esimtated
utilization is 0 so pushback is in effect only applied at the
beginning before an estimate is available.
This CL fixes that by explicitly using spatial/temporal id and size in
bytes, rather than passing along the EncodedImage proxy.
It is unclear when this broke, but the regression seems rather old.
This CL will affect the encoded bitrate (and thus indirectly BWE
ramp-up rate), but should avoid exessive delay at low bitrates.
Perf bots will likely trigger alerts, this is expected.
In case there are undesired side-effects, we can entirely disable the
adjuster using existing field-trials.
Bug: webrtc:12606
Change-Id: I936c2045f554696d8b4bb518eee6871ffc12c47d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212900
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33550}
Deleting obsolete stats. Spec: https://www.w3.org/TR/webrtc-stats/
1. RTCInbound/OutboundRtpStats.isRemote: No longer useful with remote stream stats
2. RTCIceCandidateStats.deleted: This field was obsoleted because if the ICE candidate is deleted it no longer appears in getStats()
I also marked as many other obsoleted stats possible according to spec. I am not as confident to delete them but feel free to comment to let me know if anything is off / can be deleted.
Bug: webrtc:12583
Change-Id: I688d0076270f85caa86256349753e5f0e0a44931
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211781
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33549}
Follow-up CL to VP8 and VP9 encoders taking care of mapping.
Context again:
This CL is part of Optimized Scaling efforts. In Chromium, the native
frame buffer is getting an optimized CropAndScale() implementation. To
support HW accelerated scaling, returning pre-scaled images and skipping
unnecessary intermediate downscales, WebRTC needs to 1) use CropAndScale
instead of libyuv::XXXXScale and 2) only map buffers it actually intends
to encode.
In this CL, VideoStreamEncoder no longer calls GetMappedFrameBuffer() on
behalf of the encoders, since the encoders are now able to either do the
mapping or performs ToI420() anyway.
- Tests for old VSE behaviors are updated to test the new behavior (i.e.
that native frames are pretty much always forwarded).
- The "having to call ToI420() twice" workaround to Android bug
https://crbug.com/webrtc/12602 is added to H264 and AV1 encoders.
Bug: webrtc:12469
Change-Id: Ibdc2e138d4782a140f433c8330950e61b9829f43
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211940
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#33548}
`RTCInboundRtpStreamStats.lastPacketReceivedTimestamp` must be a time
value in milliseconds with Unix epoch as time origin (see
bugs.webrtc.org/12605#c4).
This change fixes both audio and video `RTCInboundRtpStreamStats` stats.
Tested: verified from chrome://webrtc-internals during an appr.tc call
Bug: webrtc:12605
Change-Id: I68157fcf01a5933f3d4e5d3918b4a9d3fbd64f16
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212865
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33547}
Changes:
- adding the `RTCRemoteOutboundRtpStreamStats` dictionary (see [1])
- collection of remote outbound stats (only for audio streams)
- adding `remote_id` to the inbound stats and set with the ID of the
corresponding remote outbound stats only if the latter are available
- unit tests
[1] https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats
Tested: verified from chrome://webrtc-internals during an appr.tc call
Bug: webrtc:12529
Change-Id: Ide91dc04a3c387ba439618a9c6b64a95994a1940
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211042
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33545}
In refactoring CL https://webrtc-review.googlesource.com/c/src/+/210340,
the RTCRemoteInboundRtpStreamStats hierarchy was updated to inherit from
RTCReceivedRtpStreamStats but we forgot to update the
WEBRTC_RTCSTATS_IMPL() macro to say that RTCReceivedRtpStreamStats is
the parent. As a consequence, RTCReceivedRtpStreamStats's members
(jitter and packetsLost) were not included when iterating over all
members of RTCRemoteInboundRtpStreamStats, which means these two merics
stopped being exposed to JavaScript in Chromium.
There is sadly no way to safe-guard against this, but the fix is simple.
TBR=hta@webrtc.org,meetwudi@gmail.com
Bug: webrtc:12532
Change-Id: I0179dad6eaa592ee36cfe48978f2fc22133b8f45
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212866
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33543}
This patch adds support for sending zero video layer allocations
header extensions. This can be used to signal that a stream is
turned off.
Bug: webrtc:12000
Change-Id: Id18fbbff2216ca23179c58ef7bbe2ebea5e242af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212743
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33541}
The motivation is making it easier to catch exceptions for these
kind of failures only.
Bug: b/182561645
Change-Id: I09527d8665fda0fa24144cb05e9fd24c041549a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212608
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33540}
The timestamps must correspond to the time elapsed since the Unix epoch
and not since Jan 1 1900 (which is used by the RTCP SRs).
Bug: webrtc:12529,webrtc:12605
Change-Id: I6013cf3d9bf9915b5f5db8661f7b2b84231cca57
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212606
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33538}
This is a follow-up to the VP9, fixing VP8 this time. Context again:
This CL is part of Optimized Scaling efforts. In Chromium, the native
frame buffer is getting an optimized CropAndScale() implementation. To
support HW accelerated scaling, returning pre-scaled images and skipping
unnecessary intermediate downscales, WebRTC needs to 1) use CropAndScale
instead of libyuv::XXXXScale and 2) only map buffers it actually intends
to encode.
- To achieve this, WebRTC encoders are updated to map kNative video
buffers so that in a follow-up CL VideoStreamEncoder can stop mapping
intermediate buffer sizes.
Bug: webrtc:12469, chromium:1157072
Change-Id: I026527ae77e36f66d02e149ad6fe304f6a8ccb05
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212600
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#33537}
Namespace used because of copy-pasting an old pattern, should never have been used in the first place. Removing it now to make followup refactoring prettier.
Bug: webrtc:12579
Change-Id: I00a80958401cfa368769dc0a1d8bbdd76aaa4ef5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212603
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33536}
WgcCaptureSession would crash when copying the frame data for an image
from a portrait oriented monitor. This is because we were using the
height of the image multiplied by the rowpitch of the buffer to
determine the size of the data to be copied. However, in portrait
mode the height measures the same dimension as the rowpitch, leading
to us overrunning the frame buffer.
The fix is to use the height and width of the image multiplied by
the number of bytes per pixel to determine how much data to copy
out of the buffer, and only use the rowpitch to advance the pointer
in the source data buffer. This has the added benefit of giving us
contiguous data, reducing the size of the DesktopFrame that we output.
Bug: webrtc:12490
Change-Id: I4c26f8864cb57ac566a742af70fea1da504b9706
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209501
Reviewed-by: Joe Downing <joedow@chromium.org>
Commit-Queue: Austin Orion <auorion@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#33532}
Both inbound RTP stats `estimatedPlayoutTimestamp` and
`lastPacketReceivedTimestamp` are surfaced to JS land as
`DOMHighResTimeStamp` - i.e., time values in milliseconds.
This CL fixes `lastPacketReceivedTimestamp` which is incorrectly
surfaced as time value in seconds.
Bug: webrtc:12605
Change-Id: I290103071cca3331d2a3066b6b6b9fcb4f4fd0af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212742
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33530}
This CL is part of Optimized Scaling efforts. In Chromium, the native
frame buffer is getting an optimized CropAndScale() implementation. To
support HW accelerated scaling, returning pre-scaled images and skipping
unnecessary intermediate downscales, WebRTC needs to 1) use CropAndScale
instead of libyuv::XXXXScale and 2) only map buffers it actually intends
to encode.
- To achieve this, WebRTC encoders are updated to map kNative video
buffers so that in a follow-up CL VideoStreamEncoder can stop mapping
intermediate buffer sizes.
In this CL LibvpxVp9Encoder is updated to map kNative buffers of pixel
formats it supports and convert ToI420() if the kNative buffer is
something else. A fake native buffer that keeps track of which
resolutions were mapped, MappableNativeBuffer, is added.
Because VP9 is currently an SVC encoder and not a simulcast encoder, it
does not need to invoke CropAndScale.
This CL also fixes MultiplexEncoderAdapter, but because it simply
forwards frames it only cares about the pixel format when
|supports_augmented_data_| is true so this is the only time we map it.
Because this encoder is not used with kNative in practise, we don't care
to make this path optimal.
Bug: webrtc:12469, chromium:1157072
Change-Id: I74edf85b18eccd0d250776bbade7a6444478efce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212580
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#33526}