Commit graph

1400 commits

Author SHA1 Message Date
Rezaul Barbhuiya
82c2248511 Calculate pacing delay based on decode start time
Schedule the frames to be decoded based on the pacing delay from the
last decode scheduled time. In the current implementation, multiple
threads and different functions in same thread can call
MaxWaitingTime(), thereby increasing the wait time each time the
function is called. Instead of returning the wait time for a future
frame based on the number of times the function is called, return the
wait time only for the next frame to be decoded. Threads can call the
function repeatedly to check the waiting time for next frame and wake
up and then go back to waiting if an encoded frame is not available.

Change-Id: I00886c1619599f94bde5d5eb87405572e435bd73
Bug: chromium:1237402
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226502
Reviewed-by: Johannes Kron <kron@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34660}
2021-08-06 11:25:17 +00:00
Björn Terelius
53adc7b1c8 Revert "Enable WebRTC-Vp9DependencyDescriptor by default"
This reverts commit 4727071506.

Reason for revert: Suspected cause for crashes in perf tests.

Original change's description:
> Enable WebRTC-Vp9DependencyDescriptor by default
>
> Bug: chromium:1178444
> Change-Id: I420e1e9b3c557b8b186cb08c15b962a779e1ca17
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226941
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34584}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:1178444
Change-Id: I582d6d1c9d2091ca37b0943235b5cea8d4e2790d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227282
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34619}
2021-08-02 09:52:24 +00:00
Emil Lundmark
4727071506 Enable WebRTC-Vp9DependencyDescriptor by default
Bug: chromium:1178444
Change-Id: I420e1e9b3c557b8b186cb08c15b962a779e1ca17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226941
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34584}
2021-07-28 12:08:36 +00:00
Danil Chapovalov
5219c6f7ad Delete legacy forwarding header svc_rate_allocator.h
Bug: None
Change-Id: I8a73f1139560b8e5a654948497751e9515aa7b92
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227029
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34581}
2021-07-28 08:54:03 +00:00
Byoungchan Lee
75ac5ab859 Remove workaround for Android VideoFrame's ToI420() returning wrong type
Bug: webrtc:12602
Change-Id: I466a2751314fcff53051b63d77e4d5298368a095
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227040
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/master@{#34574}
2021-07-27 20:27:52 +00:00
Sergey Silkin
d4b087c6cf Use **** code for codec of unknown type
This allows dumping kVideoCodecGeneric to IVF.

Bug: none
Change-Id: I71ae5f11dc226f68aa60e4423556feb1af96d11c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226865
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34543}
2021-07-23 21:04:59 +00:00
Markus Handell
06a2bf09a4 NackModule2: Rename to NackRequester.
The alternative new name proposed, NackTracker, is already in
use in audio_coding.

Fixed: webrtc:11594
Change-Id: I6a05fafc05fa7ddb18ea4f64886a135e5ef59f7e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226744
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34539}
2021-07-23 08:30:33 +00:00
Tony Herre
b0ed12099f Update links to point at main branch
As part of go/coil update code search links to not point to the
"master" branch.

Bug: chromium:1226942
Change-Id: I0ae9e84ecc660f789a69fe0b226f93bbc39a8a66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226081
Commit-Queue: Tony Herre <toprice@chromium.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34531}
2021-07-22 16:41:26 +00:00
Mirko Bonadei
190244bb59 Remove all #include <assert.h>/<cassert> and usage in Obj-C code.
This CL completes the removal of assert() and relative headers from
the codebase (excluded
//examples/objc/AppRTCMobile/third_party/SocketRocket which is in a
third_party sub-directory).

Bug: webrtc:6779
Change-Id: I93ed57168d2c0e011626873d66529488c5f484f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225546
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34528}
2021-07-22 14:00:26 +00:00
Markus Handell
0e62f7aa98 NackModule2: coalesce repeating tasks.
NackModule2 creates repeating tasks, but as there are
many modules (one per receiver) these tasks execute out
of phase with each other, multipliying the amount of wakeups
caused.

Fix this by creating a single wakeup source that serves all
NackModule2 instances in a call.

Bug: webrtc:12989
Change-Id: Ia9c84307eb57349679e42b673474feb2cb43f08e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226464
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34527}
2021-07-22 12:11:13 +00:00
philipel
dbab1be1d1 Always unwrap VP9 TL0PicIdx forward if the frame is newer.
Bug: webrtc:12979
Change-Id: Idcc14f8f61b04f9eb194b55ffa40fb95319a881c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226463
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34513}
2021-07-20 09:34:59 +00:00
Erik Språng
62af58448e Revert "Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields."
This reverts commit 3097008de0.

Reason for revert: suspected crash
Bug: chromium:1230239
TBR=philipel@webrtc.org

Original change's description:
> Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields.
>
> These fields will be used for bitstream validation in upcoming CLs.
> A new vp9_constants.h file is also added, containing common constants
> defined by the bitstream spec.
>
> Bug: webrtc:12354
> Change-Id: If04256d83409069c8bee43ad41aed41c3707dfd3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226060
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34476}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:12354
Change-Id: Ia4d5180d593c66a053d5747e714a579c62ea2a37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226327
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34496}
2021-07-17 18:00:23 +00:00
Erik Språng
3097008de0 Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields.
These fields will be used for bitstream validation in upcoming CLs.
A new vp9_constants.h file is also added, containing common constants
defined by the bitstream spec.

Bug: webrtc:12354
Change-Id: If04256d83409069c8bee43ad41aed41c3707dfd3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226060
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34476}
2021-07-15 11:25:25 +00:00
Sergey Silkin
d6afbead2d Correctly set number of reference buffers in H264 encoder
iNumRefFrame specifies total number of reference buffers to allocate.
For N temporal layers we need at least (N - 1) buffers to store last
encoded frames of all reference temporal layers.

There is no API in OpenH254 encoder to specify exact set of references
to be used to prediction of a given frame. Encoder can theoretically
use all available references.

Note that there is logic in OpenH264 which overrides iNumRefFrame to
max(iNumRefFrame, N - 1): https://source.chromium.org/chromium/chromium/src/+/main:third_party/openh264/src/codec/encoder/core/src/au_set.cpp;drc=8e90a2775c5b9448324fe8fef11d177cb65f36cc;l=122.
I.e., this change has no real effect. It only makes setup more clear.

Bug: none
Change-Id: If4b4970007e1cc55d8f052ea05213ab2e89a878f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225480
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34445}
2021-07-09 13:49:41 +00:00
Mirko Bonadei
25ab3228f3 Replace assert() with RTC_DCHECK().
CL partially auto-generated with:

git grep -l "\bassert(" | grep "\.[c|h]" | \
  xargs sed -i 's/\bassert(/RTC_DCHECK(/g'

And with:

git grep -l "RTC_DCHECK(false)" |  \
  xargs sed -i 's/RTC_DCHECK(false)/RTC_NOTREACHED()/g'

With some manual changes to include "rtc_base/checks.h" where
needed.

A follow-up CL will remove assert() from Obj-C code as well
and remove the #include of <assert.h>.

The choice to replace with RTC_DCHECK is because assert()
is because RTC_DCHECK has similar behavior as assert()
based on NDEBUG.

This CL also contains manual changes to switch from
basic RTC_DCHECK to other (preferred) versions like
RTC_DCHECK_GT (and similar).

Bug: webrtc:6779
Change-Id: I00bed8886e03d685a2f42324e34aef2c9b7a63b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224846
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34442}
2021-07-09 07:49:43 +00:00
Erik Språng
5a5d751aa5 VP9 parser: undo r34393 and fix incorrect return statement.
Some code was deleted in
https://webrtc-review.googlesource.com/c/src/+/224266/2/modules/video_coding/utility/vp9_uncompressed_header_parser.cc
since it was detected as unreachable.
The root cause was an early return that should have been a
RETURN_IF_FALSE(x).

Bug: webrtc:12924
Change-Id: Ifadded9bbb4748d56cf65c30fd8f87e92fde10d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225040
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34422}
2021-07-06 14:39:57 +00:00
Sergey Silkin
54388a876a Fix a comment in FrameDropper
Bug: webrtc:12810
Change-Id: I340b1c84785070b3b12490aa873ca17aab2e423a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225100
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34421}
2021-07-06 14:06:20 +00:00
Jerome Jiang
d45f9300b7 Add missing rate control settings for av1 wrapper
Bug: None
Change-Id: Ib2c22ca6ec57e85c7da5ebb0ac884ca9eeae3e5f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224523
Reviewed-by: Marco Paniconi <marpan@google.com>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#34404}
2021-07-01 21:34:56 +00:00
Peter Kasting
286b1db1b2 Fix -Wunreachable-code-aggressive.
Bug: chromium:1066980
Change-Id: I6888ea1fbc458c9b3063b3f60a7732af16ab5fc9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224266
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#34393}
2021-06-30 11:14:37 +00:00
Johannes Kron
985905d42d Add fieldtrial to enable minimum pacing of video frames
If the RTP header extension playout-delay is used and set
to min=0, max>=0, frames are scheduled to be decoded as
soon as possible. There's a risk that too many frames are
sent to the decoder at once, which may cause problems
further down in the video pipeline.

This CL adds the fieldtrial WebRTC-ZeroPlayoutDelay with
the parameter min_pacing that determines the minimum
pacing interval between two frames scheduled for
decoding.

Bug: None
Change-Id: I471f7718761cfce9789b3aa8adea3e8a16ecb2fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223742
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34387}
2021-06-29 19:37:42 +00:00
Christoffer Jansson
da9dfae850 Re-enable ChangeFramerateVP8 & ChangeBitrateVP8 for Android and iOS
Update expectations for ARM SOC's

Bug: webrtc:9267
Change-Id: I8d0d720ab7d4d086ccff92310396fc35f2222128
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223661
Commit-Queue: Christoffer Jansson <jansson@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34384}
2021-06-29 09:56:12 +00:00
Evan Shrubsole
f906ec40d4 Handle null return from ToI420 in encoders
In cases where ToI420 fails it should be able to return null.

Bug: webrtc:12877
Change-Id: Ia13859c104d978a29712ae10f8e15acada8406ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222613
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#34342}
2021-06-21 12:45:11 +00:00
Johannes Kron
ac82bd386a Add timestamp to log message in generic_decoder.cc
Bug: None
Change-Id: Ib558247d887aff880853ef824f8d80d8e7e4feee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222610
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34319}
2021-06-17 10:14:14 +00:00
Henrik Boström
58126f92bf Update the only 3 remaining kFilterBilinear to kFilterBox.
Bilinear is faster but lesser quality, box is best quality. Our code
base has disagreed about which filter to use for quite some time,
causing aliasing bug reports. In an effort to avoid aliasing artifacts
and make our scaling filters more predictable, we're updating all uses
to kFilterBox.

WebRTC already uses kFilterBox everywhere except for these three
places. The main discrepency was between Chromium and WebRTC but that
has already been fixed. This CL fixes the last remaining bilinears.

This brings the WebRTC kFilterBox use count up from 11 to 14 and the
kFilterBilinear use count down from 3 to 0.

Bug: chromium:1212630
Change-Id: I5fe4aa92b9275d65b91ea97925533055d190d317
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221372
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34248}
2021-06-08 13:19:23 +00:00
Markus Handell
fccb052ee3 Add event traces to interesting places in WebRTC.
Bug: webrtc:12840
Change-Id: I2fe749039059c9f3d6da064dce10d9c24a27d02e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221044
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34199}
2021-06-02 13:06:04 +00:00
Erik Språng
486b0401c5 Make VP8 DefaultTemporalLayers always report TL count even with no rate.
If at creation of a VP8 encoder there is not enough bitrate to enable a
given spatial layer - the configuration won't be updated to indicate
the correct temporal layer count. This means GetEncoderInfo() will
indicate lack of temporal layer support, which triggers issues with
rate allocation.

This CL fixes that by always setting an initial bitrate of 0bps.

Bug: webrtc:12788
Change-Id: I10974e85446b58e597d2ca415eaf2550306ce986
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220929
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34198}
2021-06-02 10:35:07 +00:00
Erik Språng
f865444877 Make AV1 respect spatial layer active flag.
Bug: webrtc:12788
Change-Id: Ied629e1635b6ff9bf92fab2d1af708163f9dd28c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220928
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34189}
2021-06-01 16:07:25 +00:00
philipel
2182096e66 RtpFrameReferenceFinder return frames directly instead of via callback.
Bug: webrtc:12579
Change-Id: I41263f70a6f3dc60167e41f8b015a7d3b0dc3dd7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219633
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@google.com>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34136}
2021-05-26 15:47:03 +00:00
Ted Meyer
41a111d5b9 Switch to av_packet_alloc()
ffmpeg is going to be hiding the implementation of AVPacket, so we can't
allocate them on the stack anymore. av_init_packet is marked deprecated
on TOT ffmpeg, so remove its use everywhere in favor of av_packet_alloc
and av_packet_free.

Bug: chromium:1211508
Change-Id: I154311071123110dd749c71dec1ec2a0452b3908
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217780
Commit-Queue: Ted Meyer <tmathmeyer@google.com>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34106}
2021-05-24 23:33:08 +00:00
Henrik Boström
38f1d4bf8a [LibvpxVp8Encoder] Don't DCHECK crash if I420 is not equal to I420A.
In CL https://webrtc-review.googlesource.com/c/src/+/216323 we fixed
the issue where I420 and I420A not being equal would result in dropping
frames in release builds.

But we forgot to update the corresponding DCHECK, meaning the I420 not
being the same as I420A issue still causes crashes on debug builds.
(I must have been running a release build not to catch this before?)

This CL replaces the DCHECK_EQ with an RTC_NOTREACHED inside the
IsCompatibleVideoFrameBufferType check.

Because this only affects debug builds, this CL does not need to be
backmerged anywhere.

Bug: chromium:1203206
Change-Id: I101823e8bca293e94d0f7ce507fe78cedff3ea1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219281
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34048}
2021-05-19 08:48:46 +00:00
Björn Terelius
a77e16ca2c Update BitBuffer methods to style guide
Specifically, use reference instead of pointer for out parameter
and place the out parameter last, for the following methods

ReadUInt8
ReadUInt16
ReadUInt32
ReadBits
PeekBits
ReadNonSymmetric
ReadSignedExponentialGolomb
ReadExponentialGolomb

Bug: webrtc:11933
Change-Id: I3f1efe3e29155985277b0cd18700ddea25fe7914
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/218504
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34037}
2021-05-18 11:10:27 +00:00
Zhaoliang Ma
074edf6016 Fix the VideoFrameType of super frame construction in VideoProcessor
When VideoFrameType for svc upper layer is kVideoFrameDelta for key pic,
the svc unittest will fail due to the wrong frame type for the super
frame of first key picture.

Bug: None
Change-Id: Iff026aaecb73890d3c45d2c88c9654a12d6fe3bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216461
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Zhaoliang Ma <zhaoliang.ma@intel.com>
Cr-Commit-Position: refs/heads/master@{#33986}
2021-05-12 02:21:45 +00:00
philipel
9599b3c582 Don't store RtpPacketInfo in the PacketBuffer.
Historically the PacketBuffer used a callback for assembled frames, and because of that RtpPacketInfos were piped through it even though they didn't have anything to do with the PacketBuffer.

With this CL RtpPacketInfos are stored in the RtpVideoStreamReceiver(2) instead.

Bug: webrtc:12579
Change-Id: Ia6285b59e135910eee7234b89b23425bb0fc0d2b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215320
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33980}
2021-05-11 10:37:46 +00:00
Erik Språng
fc88df81f6 Set new defaults for vp8 decoder deblocking params
Bug: webrtc:11551
Change-Id: Ica8d587c32b36500739120205dde954502e01c3f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217383
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33924}
2021-05-05 11:04:30 +00:00
Johannes Kron
f7de74c58c Use Timestamp to represent packet receive timestamps
Before this CL, timestamps of received packets were rounded
to the nearest millisecond and stored as int64_t. Due to the
rounding it sometimes happened that timestamps later in the
pipeline that are not rounded seem to occur even before the
video frame was received.

Change-Id: I92d8f3540b23baae2d4a1dc6a7cb3f58bcdaad18
Bug: webrtc:12722
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216398
Reviewed-by: Chen Xing <chxg@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33916}
2021-05-04 13:16:54 +00:00
Danil Chapovalov
c27c047e3e Set non-zero target bitrate for AV1 single spatial layer case
VideoCodecInitializer::SetupCodec never sets startBitrate,
so SetAv1SvcConfig shouldn't use it.

Bug: webrtc:12720
Change-Id: I04835dc27368f32c19132d93c72364173d7050fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217382
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33915}
2021-05-04 12:34:01 +00:00
Niels Möller
0694ce7d1b Mark AsyncInvoker as deprecated
Also fix similar annotation on NackModule to have effect
(when defining an alias with C++ using, ABSL_DEPRECATED should appear
on the left hand side).

Bug: webrtc:12339
Change-Id: Id80a20bf2c56a826777b8a40e06ac5c65e4f8db7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217242
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33905}
2021-05-03 16:27:10 +00:00
Tommi
87f7090fd9 Replace more instances of rtc::RefCountedObject with make_ref_counted.
This is essentially replacing `new rtc::RefCountedObject` with
`rtc::make_ref_counted` in many files. In a couple of places I
made minor tweaks to make things compile such as adding parenthesis
when they were missing.

Bug: webrtc:12701
Change-Id: I3828dbf3ee0eb0232f3a47067474484ac2f4aed2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215973
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33852}
2021-04-27 17:01:59 +00:00
Henrik Boström
065ce9cb22 [LibvpxVp8Encoder] Allow I420A to be scaled to I420.
In Chromium, the I420ABufferInterface implementation uses the default
CropAndScale() implementation which converts to I420 in the process.

This should be OK, because we do not encode the alpha channel anyway,
so having WebRTC scaling ignore the alpha channel might even be a good
thing. Unfortunatety, an if statement in the LibvpxVp8Encoder did not
consider I420A and I420 to be the same, resulting in dropping perfectly
valid frames.

This CL fixes that by considering I420A and I420 "compatible" in a
comparison helper function. The problem only happens in this encoder,
so only this encoder needs to be fixed.

Bug: chromium:1203206
Change-Id: Iec434d4ada897c79e09914cac823148fd5b05e57
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216323
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33845}
2021-04-27 11:06:41 +00:00
Tomas Gunnarsson
e249d195e0 Make RefCountedObject require overriding virtual methods
Bug: webrtc:12701
Change-Id: Ia4ae4ad2e857cb8790d6ccfb6f88f07d52a8e91b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215967
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33831}
2021-04-26 11:05:19 +00:00
Danil Chapovalov
e7b752b221 Add fuzzer to validate libvpx vp9 encoder wrapper
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.

This is a reland of https://webrtc-review.googlesource.com/c/src/+/212281

Bug: webrtc:11999
Change-Id: Id3b2cd6c7e0923adfffb4e04c35ed2d6faca6704
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215921
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33802}
2021-04-21 14:29:04 +00:00
Johannes Kron
c3fcee7c3a Move h264_profile_level_id and vp9_profile to api/video_codecs
This is a refactor to simplify a follow-up CL of adding
SdpVideoFormat::IsSameCodec.

The original files media/base/h264_profile_level_id.* and
media/base/vp9_profile.h must be kept until downstream projects
stop using them.

Bug: chroimium:1187565
Change-Id: Ib39eca095a3d61939a914d9bffaf4b891ddd222f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215236
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33782}
2021-04-20 09:42:05 +00:00
Erik Språng
edb7ea2e69 Refactors Vp9UncompressedHeaderParser.
Biggest change is a new helper class used to read data from the
bitstream and then pass the result to a function if reading was
successful. There's also helper to do if/else flow based on the read
values. This avoids a bunch of temporaries and in my view makes the
code esaier to read.

For example, this block:

uint32_t bit;
RETURN_FALSE_IF_ERROR(br->ReadBits(&bit, 1));
if (bit) {
  RETURN_FALSE_IF_ERROR(br->ConsumeBits(7));
}

...is now written as:

RETURN_IF_FALSE(
    br->IfNextBoolean([br] { return br->ConsumeBits(7); }));

In addition, we parse and put a few extra things in FrameInfo:
show_existing_frame, is_keyframe, and base_qp.

Bug: webrtc:12354
Change-Id: Ia0b707b223a1afe0a4521ce2b995437d41243c06
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215239
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33776}
2021-04-19 16:46:48 +00:00
Rasmus Brandt
b291da8d03 Add conceptual docs for modules/video_coding
Bug: webrtc:12558
Change-Id: I6d258fcd6b666453397ce833d906efc7a6ce3dbc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215071
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33754}
2021-04-16 08:46:12 +00:00
Byoungchan Lee
403e32898a Fix build with rtc_libvpx_build_vp9=false
Like aom and openh264, VP9 can be disabled with the gn argument.

Bug: None
Change-Id: I7d67e3946afae0bb4cac8a7e591445604dda9ce1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215260
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33737}
2021-04-15 08:42:20 +00:00
philipel
dad500a728 Remove PacketBuffers internal mutex.
In RtpVideoStreamReceiver2 it can be protected by the `worker_task_checker_` instead.

Bug: webrtc:12579
Change-Id: I4f7d64f16172139eddc7a3e07d1dbbf338beaf2e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215224
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33734}
2021-04-14 16:05:51 +00:00
philipel
ce423ce12d Track last packet receive times in RtpVideoStreamReceiver instead of the PacketBuffer.
Bug: webrtc:12579
Change-Id: I4adb8c6ada913127b9e65d97ddce0dc71ec6ccee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214784
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33713}
2021-04-13 18:24:45 +00:00
Åsa Persson
9071957da3 Remove unused members in tests.
VideoStreamEncoderTest: Remove unneeded set_timestamp_rtp in CreateFrame methods (the timestamp is set based on ntp_time_ms in VideoStreamEncoder::OnFrame).

Bug: none
Change-Id: I6b5531a9ac21cde5dac54df6de9b9d43261e90c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214488
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33683}
2021-04-12 07:21:03 +00:00
Johannes Kron
fc5d2762f5 Fix dropped frames not counted issue
There's been reports of dropped frames that are not counted and
correctly reported by getStats().

If a HW decoder is used and the system is provoked by stressing
the system, I've been able to reproduce this problem. It turns out
that we've missed frames that are dropped because there is no
callback to the Decoded() function.

This CL restructures the code so that dropped frames are counted
even in cases where there's no corresponding callback for some frames.

Bug: webrtc:11229
Change-Id: I0216edba3733399c188649908d459ee86a9093d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214783
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33671}
2021-04-09 14:47:52 +00:00
Erik Språng
b6c3e89a8a Optimize VP8 DefaultTemporalLayers by reducing set/map usage
...though the big issue was probably that pending frames weren't being
culled properly in the case of frame dropping.

Bug: webrtc:12596
Change-Id: I9a03282b2a99087aa7c5650e57ce30fe0f0d3036
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214127
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33638}
2021-04-07 13:02:25 +00:00