2403 Commits

Author SHA1 Message Date
Harald Alvestrand
9acd4d1201 Deprecate ByteBufferWriter::WriteBytes
and switch usages to ByteBufferWriter::Write
This is part of getting rid of "pointer + length" arguments.

Bug: webrtc:42225170
Change-Id: I65a9b9550868022c0eb1f63b547195dadfbea678
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/377461
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43916}
2025-02-18 08:24:45 -08:00
Emil Vardar
ba0d9713ba Prevent missing corruption header because of floating point errors.
Sometimes the blurred value gets to be a little above 255 because of
floating point errors. This prevents the header from being sent, losing
1 second of information. This can easily be prevented with the changes
in this CL.

Bug: webrtc:358039777
Change-Id: Ibad1c8f41272260e28fe58557c623e52a6af8294
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/376740
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Cr-Commit-Position: refs/heads/main@{#43906}
2025-02-17 10:21:11 -08:00
Henrik Boström
b9f1cffef6 Delete 'num_temporal_layers > 4' dead code path.
At some point this code path was used for the
WebRTC-VP8ConferenceTemporalLayers experiment, but that has been
deleted.

The API does not allow creating more than 3 temporal layers so this
should be dead code and deleting it causes no test failures.

Bug: None
Change-Id: Ie13bc09a7af996d081ab5702d1bb8d17c6021ce4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/377300
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43900}
2025-02-17 02:37:10 -08:00
Qiu Jianlin
6d2579ef25 Update H.265 single-cast bitrate limits.
Update to use similar bitrate limits as VP9, depending on whether QP
from encoder is trusted or not.

Bug: chromium:392060821
Change-Id: I305182fecf7acfe84dbd2e049f9ce712a7a30ede
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/376762
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43898}
2025-02-17 02:30:59 -08:00
Danil Chapovalov
d964a5444a Cleanup WebRTC-Vp9ExternalRefCtrl field trial
This field trial was enabled by default for a long while.

Bug: webrtc:42234783
Change-Id: If050f88a3649c43d895110f4f68160f020f854e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/376421
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43885}
2025-02-13 08:33:41 -08:00
Qiu Jianlin
c592e766a0 Reland "Follow pref order for codec fallback."
This is a reland of commit 1ad3e14e9981772554a848c5034c7c555680aef7

The original CL removes all sending streams since all codec types has
been attempted for encoding and we have no other codecs to fallback to.

However some downstream applications will still attempt to set the codec
preferences even all send streams have been removed.
As a result, we follow previous logic to keep the send streams, to avoid
the regression.

Original change's description:
> Follow codec preference order for sending codec fallback.
>
> When encoder selector is not enabled, currently we always fallback to
> VP8 no matter how the codec preference is setup. Update to follow codec
> preference order for the fallback.
>
> Bug: chromium:378566918
> Change-Id: Ia3fbfc9d407683ef7b3d6246af7e9ec58535dc89
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370707
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43566}

Bug: chromium:378566918, b/384725754
Change-Id: Ifd48b30b80ae51c3ede9391ed62e8ce408864aa0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374852
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43874}
2025-02-11 16:42:55 -08:00
Danil Chapovalov
8a97881882 Deprecate EmulatedNetworkManagerInterface::network_dependencies
That accessor forces test helpers to create BasicPortAllocator themself
rather than deligate such task to PeerConnectionFactory

Bug: webrtc:42232556
Change-Id: I262e032da110222198e6308f57a5e5f2d7ba4601
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/376741
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43870}
2025-02-11 07:07:18 -08:00
Qiu Jianlin
1ad51fe73c Use similar bitrate allocations as VP9 for H.265 simulcast streams.
Now that there is not requirement of base-heavy for H.265 simulcast, it
should follow VP9 on simulcast bitrate allocations per stream.

Bug: chromium:392060821
Change-Id: I245def7f27022a943a31e96a51552db7505b7546
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/376620
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43865}
2025-02-10 04:38:51 -08:00
Henrik Boström
fe25b0e928 Report 'outbound-rtp.targetBitrate' correctly and per-RTP stream.
This CL fixes two issues with the old way targetBitrate was reported:
1. The target is per encoder, i.e. per SSRC, but the old way to report
   it was per sender and was approximately the sum of all encodings'
   targetBitrate in most cases.
2. The old value did not come directly from the VideoBitrateAllocation
   and tended to be greater than the sum of all targets (don't know
   why).

We know the old value was wrong and the new value correct because
the actual bytes produced by the encoder closely matches the configured
target, which wasn't always the case with the old metric implementation.

Tested with unit tests and manually in Chrome by going to
https://henbos.github.io/codec-quality/src/index.html and ensuring
target ~= actual bytes produced. It also matches the debug logging of
video_stream_encoder.cc.

Bug: webrtc:42225524, chromium:392424845
Change-Id: I7a6f69e053ebc3fd972c2c4b7712750e721c0acc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/376460
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43854}
2025-02-06 09:55:11 -08:00
Danil Chapovalov
87b7c1aa6e Reduce warning logging when minimum playout delay exceed maximum
There can be error log each frame when maximum playout delay sent with the frame exceed delay derived from the av-sync.
In such scenario prefer to limit the playout delay by the one attached to the received frame.

Bug: b/390043766
Change-Id: Ia57969df72f7a649e5a9280d5bb29986f5ea14b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374284
Reviewed-by: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43814}
2025-01-28 03:34:18 -08:00
Fanny Linderborg
39da6f3a75 Move corruption_detection_message from common_video to api/transport/rtp
Bug: webrtc:358039777
Change-Id: Ic27e162d67c64958844908cdd8413c406e88ea39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375201
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43804}
2025-01-27 03:23:51 -08:00
k-wasniowski
eafee5e3d6 fix: h26x packet buffer video artifacts
This change resolves an issue that arises when there is a gap in the
sequence numbers of packets associated with a single frame.

Before this change, the H26x packet buffer could potentially assemble a
frame using only a subset of the packets in the buffer if a packet was
missing in the middle and a packet with a marker bit arrived.

To address this, the change introduces a check before assembling a
frame. This ensures that all packets belonging to a single frame are
correctly collected by iterating backward until the first packet in the
frame is identified.

Bug: webrtc:384391181
Change-Id: I4d09a3d6d569624ece204264cb32e5076ed090a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374183
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Jianlin Qiu <jianlin.qiu@intel.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43793}
2025-01-24 02:47:35 -08:00
Åsa Persson
88833e6d22 Update video stats documentation.
Bug: b/363185297
Change-Id: I70d33f40c3dab09e49076a503069b8ce0eab8eb2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374307
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43755}
2025-01-17 06:01:14 -08:00
Sergey Silkin
a65c453f9e Reduce default max QP for AV1 from 56 to 52
Before this CL VP8 and AV1 used the same max QP=56. Tests show that at this QP AV1 delivers a worse PSNR than VP8. We want AV1 min quality to be not worse than VP8. This CL reduces the default max QP for AV1 to 52. With this value libaom AV1 encoder delivers PSNR close to libvpx VP8 at QP 56.

Bug: webrtc:351644568, b/369540380
Change-Id: I2e27ddab562f9c9710b11dc09076b03d7b308bb0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374041
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43751}
2025-01-16 10:55:53 -08:00
Evan Shrubsole
f3dafd1d43 Replace WAIT_UNTIL macros in video_stream_encoder_unittest
Bug: webrtc:381524905
Change-Id: I8515238a0921dd0e0c9ce00eadf12ddcb6dbe87d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/372301
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43716}
2025-01-13 02:10:17 -08:00
Boris Tsirkin
59b1d32c35 Format /video folder
Formatting done via:

git ls-files | grep -E '^video\/.*\.(h|cc|mm)' | xargs clang-format -i

No-Iwyu: Includes didn't change and it isn't related to formatting
Bug: webrtc:42225392
Change-Id: Ie7a700221e73a07fab702f84afc3871ddef269f3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373904
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43686}
2025-01-08 10:37:30 -08:00
Mirko Bonadei
7976b77345 Revert "Follow codec preference order for sending codec fallback."
This reverts commit 1ad3e14e9981772554a848c5034c7c555680aef7.

Reason for revert: Breaks downstream project. We are investigating into a potential problem when running on mobile platforms. We will get back with info or reland.

Original change's description:
> Follow codec preference order for sending codec fallback.
>
> When encoder selector is not enabled, currently we always fallback to
> VP8 no matter how the codec preference is setup. Update to follow codec
> preference order for the fallback.
>
> Bug: chromium:378566918
> Change-Id: Ia3fbfc9d407683ef7b3d6246af7e9ec58535dc89
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370707
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43566}

Bug: chromium:378566918
Change-Id: I09086b5ad100a8f66e87df167e903d0b5fe5b589
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/372080
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43600}
2024-12-18 09:16:09 -08:00
Shunbo Li
6f866347ff Fix H26xPacketBuffer Behavior Changes for Padding Packets
This commit fixes the issue of H26xPacketBuffer not supporting the
 RTP padding packet.

Bug: webrtc:383841353
Change-Id: Ibd87cd9c18577d990fa56a2fdfed1552d33b58a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371840
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43586}
2024-12-17 03:35:55 -08:00
Qiu Jianlin
1ad3e14e99 Follow codec preference order for sending codec fallback.
When encoder selector is not enabled, currently we always fallback to
VP8 no matter how the codec preference is setup. Update to follow codec
preference order for the fallback.

Bug: chromium:378566918
Change-Id: Ia3fbfc9d407683ef7b3d6246af7e9ec58535dc89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370707
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43566}
2024-12-13 15:38:18 -08:00
Danil Chapovalov
3e98919a6a Reland "Validate frame consistency when writing DependencyDescriptor"
This reverts commit 81aa059b85949001dabbedaaf99574dc6390882f.

Reason for revert: downstream tests fixed

Original change's description:
> Revert "Validate frame consistency when writing DependencyDescriptor"
>
> This reverts commit 200fd82771ae29d23b2be40194be674b3437f0ab.
>
> Reason for revert: breaks downstream
>
> Original change's description:
> > Validate frame consistency when writing DependencyDescriptor
> >
> > To write DependencyDescriptor frame properties should be consistent with
> > the FrameDependencyStructure.
> > Historically that was ensured by webrtc codec wrappers, but with with frame transform api interface there are now more ways to inject video frame for packetizing.
> > Thus DependencyDescriptorWriter should be more protective to avoid crashes.
> >
> > Bug: chromium:379282549
> > Change-Id: I98f226ff09c32154e18888c8e811e7981567ad45
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371301
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#43551}
>
> Bug: chromium:379282549
> Change-Id: I7711756f774648cbb85c51b61424bb950c1d3775
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371420
> Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
> Owners-Override: Jeremy Leconte <jleconte@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#43556}

Bug: chromium:379282549
Change-Id: I71ef363d710b7f28b298d11543e1c8ad6c884f15
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371304
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43563}
2024-12-13 10:17:33 -08:00
Jeremy Leconte
81aa059b85 Revert "Validate frame consistency when writing DependencyDescriptor"
This reverts commit 200fd82771ae29d23b2be40194be674b3437f0ab.

Reason for revert: breaks downstream

Original change's description:
> Validate frame consistency when writing DependencyDescriptor
>
> To write DependencyDescriptor frame properties should be consistent with
> the FrameDependencyStructure.
> Historically that was ensured by webrtc codec wrappers, but with with frame transform api interface there are now more ways to inject video frame for packetizing.
> Thus DependencyDescriptorWriter should be more protective to avoid crashes.
>
> Bug: chromium:379282549
> Change-Id: I98f226ff09c32154e18888c8e811e7981567ad45
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371301
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43551}

Bug: chromium:379282549
Change-Id: I7711756f774648cbb85c51b61424bb950c1d3775
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371420
Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
Owners-Override: Jeremy Leconte <jleconte@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#43556}
2024-12-13 00:19:47 -08:00
Danil Chapovalov
200fd82771 Validate frame consistency when writing DependencyDescriptor
To write DependencyDescriptor frame properties should be consistent with
the FrameDependencyStructure.
Historically that was ensured by webrtc codec wrappers, but with with frame transform api interface there are now more ways to inject video frame for packetizing.
Thus DependencyDescriptorWriter should be more protective to avoid crashes.

Bug: chromium:379282549
Change-Id: I98f226ff09c32154e18888c8e811e7981567ad45
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371301
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43551}
2024-12-12 08:54:04 -08:00
Markus Handell
74ace1a6e3 Remove libevent task queue.
Previous CLs that disabled the rtc_enable_libevent build flag
did not reveal issues. Now continue to remove the source code for
the task queue.

Bug: webrtc:42224654
Change-Id: I0866b4b56f0a8d8b56a5b604c31a426d77ab8d04
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370801
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43550}
2024-12-12 08:43:25 -08:00
Fanny Linderborg
3a1f2e6a69 Delete FrameToRender from VCMReceiveCallback
The `FrameToRender` method is deprecated and has been replaced by
`OnFrameToRender`.

Bug: webrtc:358039777
Change-Id: Ibe56bd43cf045d814137ba8c4374bc9b9ce8ef6c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371302
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43547}
2024-12-12 07:34:08 -08:00
Takuto Ikuta
000f04375b add missing includes for the build with use_libcxx_modules
This is to fix build error when we set use_libcxx_modules=true in
chromium build.

Bug: chromium:40440396
Change-Id: I5ab1cfcc0d060021892aae0e5ff3f0b647ae4266
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370860
Commit-Queue: Takuto Ikuta <tikuta@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Auto-Submit: Takuto Ikuta <tikuta@google.com>
Cr-Commit-Position: refs/heads/main@{#43541}
2024-12-11 17:32:19 -08:00
Andreas Pehrson
0c282c471b Reset encoder on simulcast layer maxFramerate changes
Without this, Firefox wasn't passing WPT
webrtc/simulcast/setParameters-maxFramerate.https.html.

The main issue is the SetRates API's RateControlParameters doesn't have
a way to model maxFramerate for simulcast layers.

A long term fix would probably be to represent maxFramerate for all
simulcast layers in RateControlParameters. This change is a short term
fix, and resets the encoder iff a simulcast layer's maxFramerate has
changed, and also differs from the maxFramerate of the codec (passed to
SetRates), which matches the layer with the highest maxFramerate.

Bug: None
Change-Id: I088dda0fe88092fe5a5cc61114e10847f072a87b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370124
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43497}
2024-12-05 08:40:11 +00:00
Erik Språng
94f2b91f11 Fix maybe incorrect spatial id when reading corruption detection message
In addition, avoid empty conversion when no message is present.

Bug: chromium:379326016
Change-Id: I855069fa89a157ba862b5162c56858825ebc1a40
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370160
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43487}
2024-12-03 17:19:00 +00:00
Erik Språng
00ec2afc80 Deflake VideoSendStreamTest::TestNackRetransmission.
Rewrites some of the logic to better takine account RTX padding and
potential acking from transport cc. This should make it both more
robust and a bit faster.

Bug: webrtc:381216373
Change-Id: I1a395c6bd86445ba3e63d79bdc766c7ff582e2a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370060
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43483}
2024-12-03 11:38:52 +00:00
Erik Språng
5fc7489aa0 Fix corruption score not being calculated on higher spatial layers.
This is a re-upload of
https://webrtc-review.googlesource.com/c/src/+/369020

Bug: webrtc:358039777
Change-Id: I7456940965084d0ce55b29b3b9bc98162cfff948
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/369862
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43478}
2024-12-02 14:46:45 +00:00
Erik Språng
b4d09df6c2 Fix bug that can cause invalid reset of corruption detection state.
`VideoStreamEncoder` should not recreate the
`FrameInstrumentationGenerator` instace unless the encoder is actually
released. Otherwise it will restart and expect a keyframe the encoder
will likely not produce for a while.

Bug: webrtc:358039777
Change-Id: I111149d5e9b632df9eeb88bbbe8a07969c3e3f1d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/369740
Auto-Submit: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43468}
2024-11-28 19:21:24 +00:00
Qiu Jianlin
d171832b6c Set default simulcast temporal layer to 1 if not configured.
For H.265 when scalability mode is not configured for simulcast layers,
the default mode of L1T1 should be assumed instead of L1T3, as that is
the most commonly supported temporal scalability on all devices for
H.265.

Bug: chromium:41480904
Change-Id: Ia9bc91729eb393850dfe5e8fb04280b4f784560d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/369080
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43452}
2024-11-26 04:07:52 +00:00
Erik Språng
e5f6f1fab4 Add optional corruption filter settings to EncodedImage.
This is a prerequisite for enabling implementation-specific filter
settings for automatic corruption detection.

Bug: webrtc:358039777
Change-Id: I363c592aa35164f690dd4ad1204e90afc0277d8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368940
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43443}
2024-11-22 12:10:31 +00:00
Erik Språng
9aeed0c5f4 Avoid potential deadlock due to queue in corruption detection.
In particular, some platforms have a limited pool of frames in the
capturer stack, so we need to avoid stashing raw frames in the frame
instrumentation generator that may be dropped by limiting the size of
the queue and avoid putting anything in there until we know we will
send it to the encoder.

Bug: webrtc:358039777
Change-Id: I054ae53dd5e6ac6a22da39c5049f47788561e77a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368641
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43432}
2024-11-20 22:50:41 +00:00
Harald Alvestrand
752235261e Remove all references to codec-level transport-cc functions and flags.
This seems to have no effect on tests, so it appears that these were
not used after all.
The goal is to make transport-cc a media-section-level attribute.

Bug: webrtc:378698658
Change-Id: Ia20ca5b91472b02db30f911ad1a1892cf36cd682
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368440
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43411}
2024-11-18 10:20:01 +00:00
Qiu Jianlin
f54707cd71 Reuse VP9 simulcast stream limits for H.265.
H.265 should have limits probably between VP9 and AV1, instead of using
VP8 tables. For now we reuse VP9 tables but eventually we may create
table for H.265.

Bug: chromium:41480904
Change-Id: I6dc2ec629142ee06f1c82a2df30d753ec1353496
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368240
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Cr-Commit-Position: refs/heads/main@{#43404}
2024-11-15 10:58:16 +00:00
Emil Vardar
4c171e84c3 Prevent upscaling when calculating sample values.
Bug: webrtc:358039777
Change-Id: I33edc12f312d0d37eac0c39a913313a1aa6f1de5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366942
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43394}
2024-11-13 14:57:14 +00:00
Qiu Jianlin
4405d06b97 Add H.265 to codecs that supports temporal scalability.
Also updated the test to cover IsTemporalLayersSupported() for all types
of codecs.

Bug: chromium:41480904
Change-Id: I25788a87737aba7308b1d6980ad5b2c26b0e225f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367570
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43369}
2024-11-07 14:24:42 +00:00
Evan Shrubsole
7589689774 Replace cricket::LeastCommonMultiple and cricket::GreatestCommonDivisor with std::lcm and std::gcd.
The std::lcm and std::gcd functions are part of the C++ standard
library. The existing functions are marked as deprecated rather than
deleted in the case of possible third party uses.

#rtc_cleanup

Bug: webrtc:377205743
Change-Id: I174e663f152d750c984a35dc7136bc18dc01bc8e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367440
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@google.com>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43368}
2024-11-07 13:30:28 +00:00
Emil Vardar
a5676c17b3 Change scale factor to 0.5
The tests shows that using a scale factor around 0.5 gives the best precision and F1 score.

Bug: webrtc:358039777
Change-Id: I22557eb9e6318ecaa726b56d3ccb2125fdf65f7e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367681
Reviewed-by: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Cr-Commit-Position: refs/heads/main@{#43366}
2024-11-07 10:32:41 +00:00
Evan Shrubsole
b444820216 Update freshness of adaptation documentation
Checked wording and that all links are functional.

Bug: b/363184959
Change-Id: Idc15a5671b49d7ab1bf71cee00c704c51bee7474
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367780
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@google.com>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43362}
2024-11-06 14:53:01 +00:00
Qiu Jianlin
faef5de87c Cleanup H.265 TODOs.
Cleanup some of the TODOs for H.265. They are either invalid or their handling should be merged with other codec types.

Bug: chromium:41480904
Change-Id: I76263354b1b87035e240d77283b21a9a26dcb45b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366044
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43359}
2024-11-05 14:06:18 +00:00
Danil Chapovalov
037ab2627d In tests replace AudioProcessingBuilder with BuiltinAudioProcessingBuilder
To move towards deprecating AudioProcessingBuilder

Bug: webrtc:369904700
Change-Id: I7998b331eca26c2185c94c39c1310ef7b6faa717
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367221
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43347}
2024-11-01 12:38:34 +00:00
Danil Chapovalov
141dfb036d Remove webrtc::ToLogString as no longer needed
These function were replaced with AbslStringify

Bug: None
Change-Id: Ia34b98ed4e0ed18bb52fe9370cff7a6f70caae6d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364621
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43346}
2024-11-01 11:12:52 +00:00
Palak Agarwal
c4f61fbde3 Rename capture_time_identifier to presentation_timestamp
After landing this change, we can change the corresponding usage in
blink to start using presentation_timestamp as well and then delete
the remaining usage of capture_time_identifier.


Bug: webrtc:373365537
Change-Id: I0c4f2b6b3822df42d6e3387df2c243c3684d8a41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365640
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Palak Agarwal <agpalak@google.com>
Cr-Commit-Position: refs/heads/main@{#43317}
2024-10-28 12:11:38 +00:00
Henrik Boström
e8c97c0d09 Reland "Rename requested_resolution to scale_resolution_down_to."
This is a reland of commit 82617ac51e7825db53451818f4d1ad52b69761fd

The reason for the revert was a downstream use of
`rtc::VideoSinkWants::requested_resolution`, so in this reland we don't
rename this field, it's fine just to rename the one in
RtpEncodingParameters for now.

Original change's description:
> Rename `requested_resolution` to `scale_resolution_down_to`.
>
> This is a pure refactor/rename CL without any changes in behavior.
>
> This field is called scaleResolutionDownTo in the spec and JavaScript.
> Let's make C++ match to avoid confusion.
>
> In order not to break downstream during the transition a variable with
> the old name being a pure reference to the renamed attribute is added.
> This means we have to add custom constructors, but we can change this
> back to "= default" when the transition is completed, which should only
> be a couple of CLs away.
>
> Bug: webrtc:375048799
> Change-Id: If755102ccd79d46020ce5b33acd3dfcc29799e47
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366560
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43300}

NOTRY=True

Bug: webrtc:375048799
Change-Id: Ic4ee156c1d50aa36070a8d84059870791dcbbe5e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366660
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43304}
2024-10-25 08:39:49 +00:00
Sergio Garcia Murillo
b5289d72be Unregister previous external decoders when creating a new one.
When switching between payload types on same ssrc, a HW decoder is only
used the first payload type received, falling back to SW decoding if
payload type is changed.

This change unregister any external decoder previously registered so it
can be re-initialized if received again.

Bug: webrtc:375097852
Change-Id: Ic04951c5676d9a3854eefb2ab8836ef8a2645d78
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366580
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43302}
2024-10-24 15:12:05 +00:00
Florent Castelli
af44d8ff06 Revert "Rename requested_resolution to scale_resolution_down_to."
This reverts commit 82617ac51e7825db53451818f4d1ad52b69761fd.

Reason for revert: Break downstream projects

Original change's description:
> Rename `requested_resolution` to `scale_resolution_down_to`.
>
> This is a pure refactor/rename CL without any changes in behavior.
>
> This field is called scaleResolutionDownTo in the spec and JavaScript.
> Let's make C++ match to avoid confusion.
>
> In order not to break downstream during the transition a variable with
> the old name being a pure reference to the renamed attribute is added.
> This means we have to add custom constructors, but we can change this
> back to "= default" when the transition is completed, which should only
> be a couple of CLs away.
>
> Bug: webrtc:375048799
> Change-Id: If755102ccd79d46020ce5b33acd3dfcc29799e47
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366560
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43300}

Bug: webrtc:375048799
Change-Id: Ie41723a39420e12e7b5b681d3d00ccd14f66b4b1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366642
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#43301}
2024-10-24 14:51:29 +00:00
Henrik Boström
82617ac51e Rename requested_resolution to scale_resolution_down_to.
This is a pure refactor/rename CL without any changes in behavior.

This field is called scaleResolutionDownTo in the spec and JavaScript.
Let's make C++ match to avoid confusion.

In order not to break downstream during the transition a variable with
the old name being a pure reference to the renamed attribute is added.
This means we have to add custom constructors, but we can change this
back to "= default" when the transition is completed, which should only
be a couple of CLs away.

Bug: webrtc:375048799
Change-Id: If755102ccd79d46020ce5b33acd3dfcc29799e47
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366560
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43300}
2024-10-24 11:38:21 +00:00
Olov Brändström
05666b4db7 Function that Converts NtpTime to a Timestamp with UTC epoch in Clock.
danilchap@webrtc.org suggested to add a converter for NtpTime <-> UTC Timestamp for in https://webrtc-review.googlesource.com/c/src/+/365641.

This CL add a NtpTime -> UTC Timestamp in Clock, and change code to start to use the new function.

Bug: None
Change-Id: If4af6cb8e31c1731692edfb8358e67b7a43226a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366001
Commit-Queue: Olov Brändström <brandstrom@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43293}
2024-10-23 14:19:08 +00:00
Fanny Linderborg
b280cb95c6 Add a basic end-to-end test for corruption detection.
This adds a Call-based test, that sets up video-pipeline with a VP8
encoder and the corruption detection header extension configured.
It then verifies that the corruption likelihood metrics are populated
in the receive stream stats.

Bug: webrtc:358039777
Change-Id: Ide005459a801778de4238e786f13efc8c3245f3f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365860
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43254}
2024-10-17 09:25:41 +00:00