2004 Commits

Author SHA1 Message Date
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
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
thebongy
d23d04163d Fix to allow small negative jumps due to out of order packets in packet buffer
This resolves an issue where when packets appear out of order at the
beginning of a stream, packet_buffer.cc might drop the entire packet
buffer because it detects a "large negative jump" even though the
difference in sequence numbers is very minor and is caused by network
congestion / packet re-ordering. Currently, when the issue occurs, this
can cause video corruption/artifacts. More details and reproduction is
available on the attached webrtc bug report 390329776.

Bug: webrtc:390329776
Change-Id: Idb56eb2e066d596d8afd7ec904359baf0cb3feef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374540
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43753}
2025-01-17 00:52:36 -08:00
Boris Tsirkin
dadb9f4643 Format /modules folder
Formatting done via:

git ls-files | grep -E '^modules\/.*\.(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: I5154c8e290591a6a0599b53802eaf152038c5f47
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373703
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43677}
2025-01-08 03:46:30 -08:00
Jianjun Zhu
a23fbc694f Fix is_first_packet_in_frame flag for h26x_packet_buffer_unittests.
Update unit tests to follow video_rtp_depacketizer_h264's behavior of
setting is_first_packet_in_frame. This flag might be used to determine
if a frame can be assembled.

Bug: webrtc:384391181
Change-Id: I6750c20056e426e12c1d4e21eea4c641def7cfbd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373168
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43669}
2025-01-07 11:59:54 -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
Danil Chapovalov
29a3f928f9 In PacketBuffer do not attempt to clear before 1st packet
ClearTo logic relies on clear to sequence number follows first_seq_num_

Bug: chromium:370689424
Change-Id: I12874d5ce7adfdcf9c0691acacdd2b8ae41ce307
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371320
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43558}
2024-12-13 04:27:19 -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
Sergey Silkin
93f5f9e867 Restrict max number of threads in dav1d settings
Dav1d expects Dav1dSettings::n_threads to be in range [0,256]. http://google3/third_party/dav1d/src/lib.c;l=130;rcl=674317898

Bug: none
Change-Id: I4a7dfd15be733b84809aa1fc496b261d097ca5e7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370800
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43516}
2024-12-09 13:55:13 +00:00
Erik Språng
4c56c9ff9a Add helper class for determining ACD filter settings.
Further, add use of it in libvpx_vp8_encoder and with tuning for keyframes and lower bound of std_dev = 1.25 to work around some edge cases. Plus some minor cleanup.

Bug: webrtc:358039777
Change-Id: I6f624a6a8c7ccfe2fe656e4c089c225296f0264f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370061
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43513}
2024-12-09 10:21:43 +00:00
Björn Terelius
711e1a8beb Create a custom test launcher for android
Set use_default_launcher=false in rtc_test on android

Bug: webrtc:42223878
Change-Id: If05da40b420d5da8f9e0f39560eb07380ebada14
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368921
Owners-Override: Jeremy Leconte <jleconte@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43505}
2024-12-06 09:30:37 +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
林恩
253b8464ff Fix AV1 encoder do't set end_of_picture when the top layer is dropped
Bug: webrtc:357721007
Change-Id: I4e318618192aa9d58a2ef6338f7b1e2ee5140254
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366100
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43437}
2024-11-21 18:56:16 +00:00
Dor Hen
da7b7ca1c1 Comment unused variables in implemented functions 15\n
Bug: webrtc:370878648
Change-Id: I4529c17f54c653864cca27097e44c843210b9c52
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368061
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43429}
2024-11-20 11:50:20 +00:00
Dor Hen
69cc695699 Comment unused variables in implemented functions 14\n
Bug: webrtc:370878648
Change-Id: I7c48313e64fafb8f23121e9bae1d50c3d32f7d07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366983
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Cr-Commit-Position: refs/heads/main@{#43414}
2024-11-18 11:32:25 +00:00
Johannes Kron
bda11ca6da Add histogram WebRTC.Video.EstimatedClockDrift_ppm
TimestampExtrapolator maps RTP timestamps of received video frames
to local timestamps. As part of this mapping, the clock drift
between the local and remote clock is estimated.

Add the histogram WebRTC.Video.EstimatedClockDrift_ppm  to log the
relative clock drift in points per million.

Bug: b/363166487
Change-Id: I0c2e628ef72c05a93e1f3138c8f71c77467130b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368342
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43413}
2024-11-18 10:47:30 +00:00
Qiu Jianlin
c79be57b47 Reland "Set default scalability mode for H.265 to L1T1."
This is a reland of commit 775639e930f14a619974944594b40c633cc574a3

Original change's description:
> Set default scalability mode for H.265 to L1T1.
>
> H.265 does not have software fallback, and it may have issue supporting
> more than 1 temporal layers on some devices. Set default to L1T1 when
> scalability is not configured, or if a scalability mode is reported as
> not supported by encoder.
>
> Bug: chromium:41480904
> Change-Id: I53895c45ec821d65774ffe2db5f418184e3fb02a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367835
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
> Cr-Commit-Position: refs/heads/main@{#43389}

Bug: chromium:41480904
Change-Id: Idedf6249130bd01dd31261672c624b88c3f4c1de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368261
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43412}
2024-11-18 10:25:33 +00:00
Ilya Nikolaevskiy
54ed3ad524 Revert "Set default scalability mode for H.265 to L1T1."
This reverts commit 775639e930f14a619974944594b40c633cc574a3.

Reason for revert: Breaks internal tests.

Original change's description:
> Set default scalability mode for H.265 to L1T1.
>
> H.265 does not have software fallback, and it may have issue supporting
> more than 1 temporal layers on some devices. Set default to L1T1 when
> scalability is not configured, or if a scalability mode is reported as
> not supported by encoder.
>
> Bug: chromium:41480904
> Change-Id: I53895c45ec821d65774ffe2db5f418184e3fb02a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367835
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
> Cr-Commit-Position: refs/heads/main@{#43389}

Bug: chromium:41480904
No-Try: true
Change-Id: I5485b1abfd5f586ec187cc57817940aa2efd72af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368200
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43396}
2024-11-13 16:02:03 +00:00
Shunbo Li
b7f5e7fb29 Fix video renderer slowdown by wrong RenderTime
This commit fixes the issue of video playback in slow motion caused by VCMTiming being unable to provide the correct rendering time in
 scenarios of continuous network packet loss

WANT_LGTM=mbonadei

Bug: webrtc:376183208
Change-Id: I63617068506e536c4b812215ea084eec18e8ee06
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367000
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43392}
2024-11-13 14:45:29 +00:00
Qiu Jianlin
775639e930 Set default scalability mode for H.265 to L1T1.
H.265 does not have software fallback, and it may have issue supporting
more than 1 temporal layers on some devices. Set default to L1T1 when
scalability is not configured, or if a scalability mode is reported as
not supported by encoder.

Bug: chromium:41480904
Change-Id: I53895c45ec821d65774ffe2db5f418184e3fb02a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367835
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Cr-Commit-Position: refs/heads/main@{#43389}
2024-11-12 11:50:52 +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
Evan Shrubsole
e6f0c2fd23 SEA discards inactive encoders in implementation name
Inactive encoders are included in the string when they are paused due to
bitrate allocation being 0 for that simulcast layer.

#rtc_ktlo

Bug: webrtc:376804631
Change-Id: I4234b452b60fee58981907380df41962fda5bf40
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367660
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43367}
2024-11-07 11:04:27 +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
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
Jianjun Zhu
99058d99b7 Export webrtc::ScalabilityModeFromString.
This function will be used by RTCVideoEncoderFactory for converting
media::SVCScalabilityMode to webrtc::ScalabilityMode.

Bug: webrtc:41480904
Change-Id: I64d7696457705851657050d2ea2b8c1d845286e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366397
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43308}
2024-10-25 13:38:52 +00:00
Ilya Nikolaevskiy
ce45238398 Dont use SimulcastToSvcConverter if the middle stream is inactive
Bug: chromium:375048794
Change-Id: I0acc3b0096c81e00d60c9339b86f30fbe8f92212
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366523
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43296}
2024-10-24 08:26:08 +00:00
林恩
c382c84575 fix h264 encoder don't generate template_structure after first keyframe
Bug: webrtc:345993676
Change-Id: Ie71c08d9a29b33c5f5d74d3e0779084ead9b5505
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365962
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43265}
2024-10-18 11:33:55 +00:00
Fanny Linderborg
41d9a01f6a Prepare function for deprecation
The `FrameToRender` function is considered a part of WebRTC's API so it cannot just be removed all at once. Since it is a pure virtual function it needs some preparation for the deprecation. This CL implements a default implementation. It will now be possible to not implement the function, but it will kill the process in that case.

Bug: webrtc:358039777
Change-Id: Ia83c63ab035abda76beb30ba98b23f9cc835a6a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365500
Commit-Queue: Erik Språng <sprang@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43235}
2024-10-14 12:40:56 +00:00
Harald Alvestrand
d8bddfef88 Split up the call/video_stream_api target
The split shows that some places don't need it at all. Most other
places will depend on both send and receive stream targets.

Bug: webrtc:373151158
Change-Id: I788136a2ee84180c16345a7929b7f7bf3f97507b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365460
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43230}
2024-10-14 08:26:16 +00:00
Fanny Linderborg
518bd61cec Forward the corruption score from the decoder to ReceiveStatisticsProxy
Bug: webrtc:358039777
Change-Id: Iace01daa53d08b5d0c484b5f55da73ba230317da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365095
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43213}
2024-10-10 10:45:35 +00:00
Fanny Linderborg
e1adfc05ac Rename FrameToRender to OnFrameToRender
This is to make the name consistent with the other methods in the
interface and additionally to in the future not have a function that has
the same name as the `FrameToRender` struct.

Bug: webrtc:358039777
Change-Id: Iac727d93ab9e020a073477bd33d0f67f9983a0aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364961
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43195}
2024-10-08 16:29:01 +00:00
Fanny Linderborg
a507a08904 Calculate corruption score once the frame is decoded
Bug: webrtc:358039777
Change-Id: I291e8e505f2ea7f9f95da4c83cd7679b49f2bc56
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364600
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43192}
2024-10-08 13:26:00 +00:00
Fanny Linderborg
215401f651 Reland "Add a FrameToRender argument struct as input to FrameToRender"
This is a reland of commit 01f91c81f7660be842fa44e96bf804a8b2402f47

Original change's description:
> Add a FrameToRender argument struct as input to FrameToRender
>
> This is to make it easier to add new arguments to the method in the
> future. We will remove the already existing method accordingly to WebRTCs deprecation rules.
>
> Bug: webrtc:358039777
> Change-Id: Id0706de5216fbd0182cac80ebfccfc4a6a055ee8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364642
> Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43181}

Bug: webrtc:358039777
Change-Id: I404bb9660d9f4436c0658814fd3ac7d74e483f0f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364900
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43188}
2024-10-08 06:22:03 +00:00
Henrik Boström
1accaf91b5 Improve tests for reconfiguring encoder from 4:2:1 to non-power of two.
More test coverage for previously fixed bug
https://crbug.com/webrtc/369654168.

Two tests are added:
1. LibvpxVp9Encoder unit test that 4:2:1 720p can be reconfigured to
   singlecast (which is what happens for encodings[0] in the bug).
2. Integration test that 4:2:1 720p can change to 180p,360p,540p.
   This is the exact same test as was added in [1] but using
   requested_resolution instead of scale_resolution_down_by.

[1] https://webrtc-review.googlesource.com/c/src/+/363941

Bug: webrtc:369654168
Change-Id: I83456b9254c1c6f647586d340d0fe5864b5515c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364200
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43185}
2024-10-07 13:55:36 +00:00
Jeremy Leconte
5680d8199a Revert "Add a FrameToRender argument struct as input to FrameToRender"
This reverts commit 01f91c81f7660be842fa44e96bf804a8b2402f47.

Reason for revert: break downstream projects.

Original change's description:
> Add a FrameToRender argument struct as input to FrameToRender
>
> This is to make it easier to add new arguments to the method in the
> future. We will remove the already existing method accordingly to WebRTCs deprecation rules.
>
> Bug: webrtc:358039777
> Change-Id: Id0706de5216fbd0182cac80ebfccfc4a6a055ee8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364642
> Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43181}

Bug: webrtc:358039777
Change-Id: Id59633023a428fb63aadeb266421b09040e590bb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364841
Owners-Override: Jeremy Leconte <jleconte@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#43184}
2024-10-07 12:46:24 +00:00
Fanny Linderborg
01f91c81f7 Add a FrameToRender argument struct as input to FrameToRender
This is to make it easier to add new arguments to the method in the
future. We will remove the already existing method accordingly to WebRTCs deprecation rules.

Bug: webrtc:358039777
Change-Id: Id0706de5216fbd0182cac80ebfccfc4a6a055ee8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364642
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43181}
2024-10-07 11:47:17 +00:00
Sergio Garcia Murillo
6976a1e4ee Use rtc::Buffer and rtc::ByteBufferReader instead of raw data pointers in H264SpsPpsTracker
Bug: webrtc:42225170
Change-Id: I07ec0e8a1aba8eec04ed1dd5c6f7a4bbbdb7a43a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364641
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43180}
2024-10-07 11:19:29 +00:00
Fanny Linderborg
a49ab28fca Set CodecSpecific.FrameInstrumentationData in RtpFrameObject ctor
Bug: webrtc:358039777
Change-Id: Ib0a663f06b293c62a4eb0689b82b3bf919cff25f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364282
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43136}
2024-10-02 07:09:11 +00:00
Danil Chapovalov
bdb52e9767 Delete deprecated SvcRateAllocator constructor
To force SvcRateAllocator use propagated rather than global field trials

Bug: webrtc:42220378
Change-Id: I0ca3186ee2428aafe3d7f093603b708e03ada121
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362722
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43123}
2024-10-01 08:45:54 +00:00
Henrik Boström
a6fbb35ac1 Fix LibvpxVp9Encoder simulcast bug.
As of [1], a single VP9 encoder instance can produce simulcast 4:2:1.
When it does, the EncodedImage has its simulcast index set (0, 1, 2).

The bug is that if you then go back to a single encoder instance,
either because you're doing singlecast or because you're doing
simulcast with scaling factors that are not power of two (not 4:2:1),
then the simulcast index which was previously set to 2 is not reset due
to the old code path never calling SetSimulcastIndex.

Example repro:
1. Send VP9 simulcast {180p, 360p, 720p}, i.e. 4:2.1.
2. Reconfigure to {180p, 360p, 540p}, i.e. no longer 4:2:1.

What should happen: all three layers are sent.
What actually happened: 180p is not sent and the 540p layer flips flops
between 180p and 540p because the EncodedImage says simulcast index is
2 for both encodings[0] and encodings[2].

The fix is a one-line change: `SetSimulcastIndex(std::nullopt)` in the
case that we don't have a `simulcast_to_svc_converter_` that sets it
(0, 1, 2) for us.

[1] https://webrtc-review.googlesource.com/c/src/+/360280

Bug: chromium:370299916
Change-Id: I52bd4428bd12528f0e98869ec61626c06f589b43
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363941
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43109}
2024-09-30 14:20:15 +00:00
yingyingma
2152af8bb7 Export CreateScalabilityStructure API to chromium
RTCVideoEncoder in chromium use it to generate dependency template
and generic frame info for hw encode accelerators after encoding.
https://chromium-review.googlesource.com/c/chromium/src/+/5849272

Bug: chromium:40763991
Change-Id: I96396ad972bf18790b09508e428c6362aae24a65
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362151
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Yingying Ma <yingying.ma@intel.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43087}
2024-09-27 03:21:38 +00:00
Florent Castelli
b04af61b4e Remove VLA and implicit value capture of this in lambdas
Those trigger new warnings when importing the Chromium roll

Bug: None
Change-Id: Ica71cc83f5bbfd8fec4736185d389b9e82f2276e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363740
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43080}
2024-09-25 17:01:50 +00:00
Danil Chapovalov
52ea2c3d2a Propagate FieldTrialsView to query WebRTC-StableTargetRate field trial
Bug: webrtc:42220378
Change-Id: Ie2a2c3eccc36c98f09176eb6f4c5f06ded9f516f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362701
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43036}
2024-09-17 14:24:41 +00:00
Sergey Silkin
84273f56d9 Specify max number of consecutive drops using time units
AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR was added in https://aomedia-review.googlesource.com/c/aom/+/192402. It allows to configure max number of consecutive frame drops using time units. Use it instead of AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.

Bug: webrtc:351644568
Change-Id: I73265d5258d681926eb5b65e32c2a61b26c310ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360842
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42995}
2024-09-10 13:16:34 +00:00
Ilya Nikolaevskiy
363dc19f9d SimulcastToSvcConverter: Allow not setting scalability mode on frame
Bug: webrtc:347737882
Change-Id: I61e5a7a538bf43a9377fc9e3b8d399754232a2f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362081
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42983}
2024-09-09 13:33:52 +00:00
Sergey Silkin
26146bbce0 Add support for screencast with temporal layering to SvcRateAllocator
SvcRateAllocator assumed no temporal layering for screencast content and allocated all bitrate to base temporal layer. Now it distributes bitrate to spatial and temporal layers (if configured) no matter of content type.

Bug: webrtc:351644568, b/364190191
Change-Id: I445f0157d2c14cad033648693dc0564ae97023e9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362080
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42979}
2024-09-09 11:12:33 +00:00
Ilya Nikolaevskiy
5ac7495701 Prepare to use SimulcastToSvcConverter in chromium
Allow moving the class, add required RTC_EXPORTs

Bug: webrtc:347737882
Change-Id: Iac14e6f62adfa13ff1e757918a2f92009f5be36f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361760
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42962}
2024-09-05 12:20:57 +00:00
Fanny Linderborg
dac0805955 Add FrameInstrumentationData to RTPVideoHeader and CodecSpecificInfo
Bug: webrtc:358039777
Change-Id: If2659240047e1935f7666266bff25ed86a6a234c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361420
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42940}
2024-09-04 07:21:02 +00:00
yazdan0a
55a59337c8 Minor format to extrapolate local time
- Removing unnecessary else {} blocks for better readability.
- Consistent naming of: timestamp_diff with explicit typecast.

BUG=None

Change-Id: I35161ffed245737c789336316f0cfb6821b12349
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361060
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42939}
2024-09-04 07:19:15 +00:00