Commit graph

91 commits

Author SHA1 Message Date
Danil Chapovalov
73588223c1 Require webrtc::Environment to create H264 Encoder
Bug: webrtc:15860
Change-Id: I76517ee3603847ff064f16fddc9423a3568818a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/345741
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42004}
2024-04-05 13:25:30 +00:00
Per K
0fa90887c5 Deprecate VideoFrame::timestamp() and set_timestamp
Instead, add rtp_timestamp and set_rtp_timestamp.

Bug: webrtc:13756
Change-Id: Ic4266394003e0d49e525d71f4d830f5e518299cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342781
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41894}
2024-03-13 11:08:37 +00:00
Danil Chapovalov
b4913a549f Add factory functions to pass Environment to VideoEncoders
Bug: webrtc:15860
Change-Id: I4a9d2678dcfe5b0f178863242e27600fcc95325d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342480
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41879}
2024-03-12 09:43:14 +00:00
Byoungchan Lee
11376fb992 Reset H.264 SVC Controller on key frame
Sometimes OpenH264 returns a key frame even though we have not
requested one. However, SVC controller does not know about this
and will not reset its state. Since we are comparing expected tid
from SVC controller with actual tid from OpenH264, and drop frames
if they do not match, that causes a missing frame.

This CL resets the SVC controller state on key frames, ensuring
that it accurately maintains its state and does not drop frames.
Also, changes the message of the error log to be more descriptive.
Now, it will print the expected tid and actual tid.

Bug: webrtc:14877
Change-Id: I6c9e7532b2478773f03e5707bf7a1ca56e4f7b99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324001
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40972}
2023-10-19 09:51:14 +00:00
Danil Chapovalov
9c58483b5a Rename EncodedImage property Timetamp to RtpTimestamp
To avoid name collision with Timestamp type,
To avoid confusion with capture time represented as Timestamp

Bug: webrtc:9378
Change-Id: I8438a9cf4316e5f81d98c2af9dc9454c21c78e70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320601
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40796}
2023-09-24 20:06:48 +00:00
Philipp Hancke
b660b7a89c Enable multithreaded OpenH264 encoding behind field trial
This uses the field trial introduced is crbug.com/1406331 and
extends the usage to OpenH264. This simplifies experimentation
whether this change improves performance without requiring
multi-slice encoding.

BUG=webrtc:14368

Change-Id: I0031e59059f7113dd5453234869c957d46f311bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294340
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39371}
2023-02-22 14:26:33 +00:00
Henrik Boström
2e540a28c0 Introduce EncodedImage.SimulcastIndex().
As part of go/unblocking-vp9-simulcast (Step 1), EncodedImage is being
upgraded to be able to differentiate between what is a simulcast index
and what is a spatial index.

In order not to break existing code assuming that "if codec != VP9,
SpatialIndex() is the simulcast index", SimulcastIndex() has fallback
logic to return the value of spatial_index_ in the event that
SetSimulcastIndex() has not been called. This allows migrating external
code from (Set)SpatialIndex() to (Set)SimulcastIndex(). During this
intermediate time, codec gates are still necessary in some places of
the code, see TODOs added.

In a follow-up CL, after having fixed dependencies, we'll be able to
remove the fallback logic and rely on SimulcastIndex() and
SpatialIndex() actually being the advertised index and "if codec..."
hacks will be a thing of the past!

Bug: webrtc:14884
Change-Id: I70095c091d0ce2336640451150888a3c3841df80
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293343
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39318}
2023-02-15 15:02:57 +00:00
Evan Shrubsole
9b235cd93b Add scalability mode to RTCOutboundRtpStreamStats stats
This is in the webrtc-stats spec at
https://www.w3.org/TR/webrtc-stats/#dom-rtcoutboundrtpstreamstats-scalabilitymode.

This adds the scalability mode to CodecSpecificInfo which is used to
plumb the modes for each simulcast layer.

TBR=orphis@webrtc.org

Tested: Compiled into Chrome and confirmed the scalability mode set for AV1, VP9, VP8 and H264 software encoders in chrome://webrtc-internals.
Bug: webrtc:14730
Change-Id: I71ceba8f6485a4f4a73e0856031b8d5f16f913f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285085
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38847}
2022-12-08 11:46:06 +00:00
Philipp Hancke
279b4b7d4f generateKeyframe: pass frame_types in bypass mode
Passes frame_types to the underlying encoder in bypass mode.
For libvpx this has no effect, for H264 this changes the behavior
to allow generating keyframes on a per-layer basis.

BUG=chromium:1354101

Change-Id: I26fc22d9e2ec4681a57ce591e9eafd0b1ec962b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285083
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#38821}
2022-12-06 10:54:59 +00:00
Bruce Dawson
d2a48e8226 Permanently switch to new openh264 include directory
Openh264 switched from api/svc to api/wels as the location for some
codec header files. During the transition it was necessary to
conditionally from either the old or new location, but now that the
switch is completed and has settled for about two weeks the conditionals
can be removed. This finishes the #include transition started by
webrtc-review.googlesource.com/c/280800

Bug: chromium:1218384
Change-Id: Ic0847428d134687908cc26fec1fdec0c612674b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38622}
2022-11-15 11:39:26 +00:00
Sergey Silkin
73f3393426 Select openh264 includes based on OPENH264_API_WELS
This should be landed after https://chromium-review.googlesource.com/c/chromium/src/+/3986032

Bug: chromium:1218384
Change-Id: Id4104d2914f811e722a083021f515fd06b69b910
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280800
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Bruce Dawson <brucedawson@google.com>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38515}
2022-10-31 19:51:58 +00:00
Byoungchan Lee
bc4796af94 Add the dependency descriptor for H.264 temporal scalability
And validate it using svc_e2e_tests.

Bug: webrtc:13961
Change-Id: Ie7edcf5a0684f46e4d26155b77cebbebbd46d21f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269541
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38153}
2022-09-21 12:18:23 +00:00
Philipp Hancke
2e61a8fa60 Revert "Enable Multithreaded H264 Encoding For OpenH264"
This reverts commit bc8a62b244.

Reason for revert: reverting per
  https://bugs.chromium.org/p/webrtc/issues/detail?id=14368#c5

This needs more careful consideration and should be put behind a finch flag or origin trial

Original change's description:
> Enable Multithreaded H264 Encoding For OpenH264
>
> Re-enabled multithreaded encoding using OpenH264, as the issue described in crbug.com/583348 no longer applies.
>
> Bug: webrtc:14368
> Change-Id: I5ae768a6edf3b40d99c13fb4ee4662626c993a66
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271820
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37837}

Bug: webrtc:14368
Change-Id: Icebedfe4eb8e3901670b9f90e229379fca95206b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272600
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37878}
2022-08-23 11:18:33 +00:00
Brett Hebert
bc8a62b244 Enable Multithreaded H264 Encoding For OpenH264
Re-enabled multithreaded encoding using OpenH264, as the issue described in crbug.com/583348 no longer applies.

Bug: webrtc:14368
Change-Id: I5ae768a6edf3b40d99c13fb4ee4662626c993a66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271820
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37837}
2022-08-19 10:30:37 +00:00
Zhaoliang Ma
e7696f771d Plumb color space from VP8/VP9/H264 encoder
Bug: None
Change-Id: If771d9486bde01d5a2775d904a01ecf3953e75df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268944
Commit-Queue: Zhaoliang Ma <zhaoliang.ma@intel.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37566}
2022-07-20 09:08:41 +00:00
Niels Möller
cb99ccd244 Update/delete old TODOs
Bug: webrtc:10198
Change-Id: I0341e068d792bc0b143db86e675988f4cd07ff2e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267822
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37454}
2022-07-06 07:49:04 +00:00
Niels Möller
807328fec7 Move frame drop config to VideoCodec and VideoEncoderConfig.
Intend to delete corresponding codec-specific settings in a followup.

Bug: webrtc:6883
Change-Id: I78ab07729a5aee1055f80d39d8f7289beb6721e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262244
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36882}
2022-05-13 13:40:14 +00:00
Niels Möller
13d163654a Delete support for has_internal_source
Bug: webrtc:12875
Change-Id: I9683e71e1fe5b24802033ffcb32a531ca685fc6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179220
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35353}
2021-11-16 11:29:40 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Harald Alvestrand
97597c0f51 Remove usage of INFO alias for LS_INFO in log messages
Bug: webrtc:13362
Change-Id: Ifda893861a036a85c045cd366f9eab33c62ebde0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237221
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35310}
2021-11-04 13:46:17 +00:00
Artem Titov
cfea2182f8 Use backticks not vertical bars to denote variables in comments
Bug: webrtc:12338
Change-Id: I89c8b3a328d04203177522cbdfd9e606fd4bce4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228246
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34696}
2021-08-10 10:40:03 +00:00
Artem Titov
dcd7fc7ea8 Use backticks not vertical bars to denote variables in comments for /modules/video_coding
Bug: webrtc:12338
Change-Id: Ia8a9adea291d594e4f59a6a1203a7bfb0758adac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227165
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34684}
2021-08-09 15:26:22 +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
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
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
Henrik Boström
56db9ff1e1 VideoStreamEncoder: Don't map kNative video frame buffers.
Follow-up CL to VP8 and VP9 encoders taking care of mapping.
Context again:
  This CL is part of Optimized Scaling efforts. In Chromium, the native
frame buffer is getting an optimized CropAndScale() implementation. To
support HW accelerated scaling, returning pre-scaled images and skipping
unnecessary intermediate downscales, WebRTC needs to 1) use CropAndScale
instead of libyuv::XXXXScale and 2) only map buffers it actually intends
to encode.

In this CL, VideoStreamEncoder no longer calls GetMappedFrameBuffer() on
behalf of the encoders, since the encoders are now able to either do the
mapping or performs ToI420() anyway.

- Tests for old VSE behaviors are updated to test the new behavior (i.e.
  that native frames are pretty much always forwarded).
- The "having to call ToI420() twice" workaround to Android bug
  https://crbug.com/webrtc/12602 is added to H264 and AV1 encoders.

Bug: webrtc:12469
Change-Id: Ibdc2e138d4782a140f433c8330950e61b9829f43
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211940
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#33548}
2021-03-24 09:43:11 +00:00
Niels Möller
6afa794b6e Delete deprecated H264BitstreamParser methods
Bug: webrtc:10439
Change-Id: I1513907f03f9adfcf5657298e69d60519af764ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/198121
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32934}
2021-01-11 09:31:54 +00:00
philipel
1b0d5437c9 Removed _completeFrame since we never allow incomplete frames.
In the old jitter buffer the two VCMVideoProtection modes |kProtectionNone| and |kProtectionFEC| could be set on the jitter buffer for it to not wait for NACK and instead generate incomplete frames. This has not been possible for a long time.

Bug: webrtc:9378, webrtc:7408
Change-Id: I0a2d3ec34d721126c1128306d5fad88314f8d59f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190680
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32513}
2020-10-28 16:00:27 +00:00
Sergey Silkin
18e6edd57a Change SPS/PPS id update strategy to SPS_LISTING.
INCREASING_ID, which is the default mode, triggers HW reset in chromium
decoder wrapper. Set eSpsPpsIdStrategy to SPS_LISTING to prevent that.

Note that WebRTC always resets the encoder on resolution change. This
makes all strategies except INCREASING_ID essentially equivalent to
CONSTANT_ID.

Bug: chromium:1111273
Change-Id: I37405c97b3390f812d1dcaa111694b3b1d638035
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190440
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32505}
2020-10-27 10:56:54 +00:00
Evan Shrubsole
b556b08668 Allow encoders to receive preferred pixel formats from native buffers
Adds a field to EncoderInfo called preferred_pixel_formats which a
software encoder populates with the pixel formats it supports. When a
kNative frame is received for encoding, the VideoStreamEncoder will
first try to get a frame that is accessible by the software encoder in
that pixel format from the kNative frame. If this fails it will fallback
to converting the frame using ToI420.

This minimizes the number of conversions made in the case that the
encoder supports the pixel format of the native buffer or where
conversion can be accelerated. For example, in Chromium, the capturer can
emit an NV12 frame, which can be consumed by libvpx which supports NV12.

Testing: Tested in Chrome with media::VideoFrame adapters.

Bug: webrtc:11977
Change-Id: I9becc4100136b0c0128f4fa06dedf9ee4dc62f37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187121
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#32353}
2020-10-08 13:47:50 +00:00
Niels Möller
08ae7cea30 Reland "Delete the non-const version of the EncodedImage::data() method."
This is a reland of f2969fa868

Original change's description:
> Delete the non-const version of the EncodedImage::data() method.
>
> Bug: webrtc:9378
> Change-Id: I84ace3ca6a2eb4d0f7c3d4e62f815d77df581bfa
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185122
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32197}

Bug: webrtc:9378
Change-Id: I8521ac567749ea547f91cf7549eb48966baffa11
Tbr: ilnik@webrtc.org
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185807
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Marina Ciocea <marinaciocea@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32209}
2020-09-28 13:51:51 +00:00
Marina Ciocea
111de34102 Revert "Delete the non-const version of the EncodedImage::data() method."
This reverts commit f2969fa868.

Reason for revert: Breaks blink_platform_unittests; sample failure:
https://ci.chromium.org/p/chromium/builders/try/linux-rel/500046

Original change's description:
> Delete the non-const version of the EncodedImage::data() method.
>
> Bug: webrtc:9378
> Change-Id: I84ace3ca6a2eb4d0f7c3d4e62f815d77df581bfa
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185122
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32197}

TBR=ilnik@webrtc.org,nisse@webrtc.org,philipel@webrtc.org,titovartem@webrtc.org

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

Bug: webrtc:9378
Change-Id: I6374d263e2ee10da318ab1e040ed18bed7a96edd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185507
Reviewed-by: Marina Ciocea <marinaciocea@webrtc.org>
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32205}
2020-09-27 08:28:07 +00:00
Niels Möller
f2969fa868 Delete the non-const version of the EncodedImage::data() method.
Bug: webrtc:9378
Change-Id: I84ace3ca6a2eb4d0f7c3d4e62f815d77df581bfa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185122
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32197}
2020-09-25 12:14:50 +00:00
Danil Chapovalov
2549f174b5 Remove RTPFragmentationHeader creation and propagation through webrtc
Bug: webrtc:6471
Change-Id: I5cb1e10088aaecb5981888082b87ae9957bbaaef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181541
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31955}
2020-08-17 16:37:33 +00:00
Sergey Silkin
33d81a05eb Keep OpenH264 iMaxBitrate unspecified.
Max encoder bitrate in WebRTC and OpenH264 are different settings. In
WebRTC it is a cap for encoder target bitrate whilst in OpenH264 it is
a peak bitrate. I.e. OpenH264 is allowed to produce bitrate up to
iMaxBitrate for short time interval. That is not what WebRTC expects.

https://webrtc.googlesource.com/src/+/5ee6967c4edc667688d736c27db6f2e7be00dd0a
disabled encoders re-initialization on min/max bitrate change. Reinit of
some HW encoders takes hundreds of milliseconds and causes video freeze.
I missed that max bitrate is used by OpenH264. This caused regression
described in webrtc:11543.

This change sets iMaxBitrate=UNSPECIFIED_BIT_RATE (which is the default
value). Settings iMaxBitrate=UNSPECIFIED_BIT_RATE disables the frame
dropping logic based on that parameter. But the encoder still will drop
frames based on buffer fullness, https://source.chromium.org/chromium/chromium/src/+/master:third_party/openh264/src/codec/encoder/core/src/ratectl.cpp;l=806-807

Bug: webrtc:10773, webrtc:11543
Change-Id: I728be49e0df8a0d9a8f4438299e4c7b4c1497a78
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174745
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31192}
2020-05-08 15:10:26 +00:00
Danil Chapovalov
cad3e0e2fa Replace DataSize and DataRate factories with newer versions
This is search and replace change:
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataSize::Bytes<\(.*\)>()/DataSize::Bytes(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataSize::bytes/DataSize::Bytes/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::BitsPerSec<\(.*\)>()/DataRate::BitsPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::BytesPerSec<\(.*\)>()/DataRate::BytesPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::KilobitsPerSec<\(.*\)>()/DataRate::KilobitsPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::bps/DataRate::BitsPerSec/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::kbps/DataRate::KilobitsPerSec/g"
git cl format

Bug: webrtc:9709
Change-Id: I65aaca69474ba038c1fe2dd8dc30d3f8e7b94c29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168647
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30545}
2020-02-18 16:09:50 +00:00
Jonas Olsson
b2b2031457 Concatenate string literals at compile time.
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format

After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.

This primary benefit of this change is a small reduction in binary size.

Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30251}
2020-01-14 14:47:48 +00:00
Jiwon Kim
077ee35774 Remove unused parameter in RtpFragmentize
Bug: None
Change-Id: Ic110e3561bc93cb2156240193bc2077e2646ed87
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161560
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/master@{#30118}
2019-12-20 11:22:33 +00:00
Erik Språng
f4e0c29ed1 SimulcastEncoderAdapter: support per layer fallback and single encoder proxying
This CL adds an optional second encoder factory to SimulcastEncoderAdapter,
that can be used to create software fallback adapter per simulcast layer.

It also adds logic to check if the encoder supports simulcast natively, if so
it only allocates a single instance and delegates the simulcast logic to that
encoder instead. This means we will be able to remove EncoderSimulcastProxy.

Bug: webrtc:11000
Change-Id: Ifd5f029cc281ee2cedf9d18efa5e7e460884d6ff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155171
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29364}
2019-10-01 17:31:44 +00:00
Florent Castelli
8bbdb5b9bd Update VideoBitrateAllocator allocate to take a struct with more fields
We want to evaluate more data in order to make better choices in the
bitrate allocators.
In order to freely update the parameter list without
breaking the API many times for projects customizing them, we'll use a
struct instead.

Bug: webrtc:10126
Change-Id: I443f86781c5134950294cdd1e3197a47447cf973
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141418
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28748}
2019-08-02 13:52:54 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Sergey Silkin
5ee6967c4e Don't reset encoder on max/min bitrate change.
- Don't reset encoder if max/min bitrate changed.
- Removed min/max bitrate DCHECKs from encoder wrappers.
- Reset encoder if start_bitrate changed. Only do this if encoding
  has not yet started.
- Updated ReconfigureBitratesSetsEncoderBitratesCorrectly test.
- Removed EncoderSetupPropagatesCommonEncoderConfigValues test since it
was a subset of ReconfigureBitratesSetsEncoderBitratesCorrectly.

Bug: webrtc:10773
Change-Id: Id9cbb2ea229232fd95967819e2a937b26948de9f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144028
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28446}
2019-07-02 12:52:55 +00:00
Johnny Lee
c53850675b Enable H.264 temporal scalability in simulcast.
Bug: webrtc:10651
Change-Id: I58372186930ce33e925f85edb0f308657dbfe273
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/142840
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28381}
2019-06-26 09:21:32 +00:00
Niels Möller
4d504c76cb New interface EncodedImageBufferInterface, replacing use of CopyOnWriteBuffer
Bug: webrtc:9378
Change-Id: I62b7adbd9dd539c545b5b1b1520721482a4623c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138820
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28317}
2019-06-19 07:02:34 +00:00
Elad Alon
370f93a34a Reland "Inform VideoEncoder of negotiated capabilities"
This is a reland of 11dfff0878

Now that I am sure that WebRTC code is not calling the obsolete
versions, I will just remove the NOT_REACHED and call the
new version from the old ones, so as not to trip up downstream
projects.

Original change's description:
> Inform VideoEncoder of negotiated capabilities
>
> After this CL lands, an announcement will be made to
> discuss-webrtc about the deprecation of one version
> of InitEncode().
>
> Bug: webrtc:10720
> Change-Id: Ib992af0272bbb16ae16ef7e69491f365702d179e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140884
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Elad Alon <eladalon@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28224}

TBR=sakal@webrtc.org,kwiberg@webrtc.org,sprang@webrtc.org

Bug: webrtc:10720
Change-Id: I46c69e45c190805c07f7e51acbe277d7eebd1600
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141412
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28236}
2019-06-11 14:49:37 +00:00
Philip Eliasson
49d661a7d3 Revert "Inform VideoEncoder of negotiated capabilities"
This reverts commit 11dfff0878.

Reason for revert: Downstream import failure.

Original change's description:
> Inform VideoEncoder of negotiated capabilities
> 
> After this CL lands, an announcement will be made to
> discuss-webrtc about the deprecation of one version
> of InitEncode().
> 
> Bug: webrtc:10720
> Change-Id: Ib992af0272bbb16ae16ef7e69491f365702d179e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140884
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Elad Alon <eladalon@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28224}

TBR=sakal@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,kthelgason@webrtc.org,sprang@webrtc.org

Change-Id: I7f833055c67f1f879b01dd8c156ba7b8840e8747
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10720
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141411
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28225}
2019-06-11 11:56:04 +00:00
Elad Alon
11dfff0878 Inform VideoEncoder of negotiated capabilities
After this CL lands, an announcement will be made to
discuss-webrtc about the deprecation of one version
of InitEncode().

Bug: webrtc:10720
Change-Id: Ib992af0272bbb16ae16ef7e69491f365702d179e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140884
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28224}
2019-06-11 11:32:13 +00:00
Ilya Nikolaevskiy
ab62b2ee51 Don't copy video frame metadata in each encoder/decoder
As this is handled higher up the pipeline in a single
place for all encoders/decoders

Bug: webrtc:10460
Change-Id: I95b0a69aecaf07283c8776ac0d7e85d097e3576b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139882
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28172}
2019-06-05 15:33:49 +00:00
Mirko Bonadei
815b1a6f53 Use preprocessor to strip H264 implementation.
This CL makes it more flexible and easier to include/exclude H264 code
when using other build systems because it delegates the decision to
remove the code to the preprocessor instead of GN.

This CL should be a noop, and for WebRTC/Chromium the GN param
`rtc_use_h264` will still be the only thing to change in order to
include/exclude H264.

Moving code that requires ffmpeg or h264 out of the #ifdef/#endif
part should break the build since dependencies are only added if
`rtc_use_h264=true`.

Bug: webrtc:9213
Change-Id: Ibc04edc2f6b9e51489ffe638d5be4b32959cdca0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137430
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28055}
2019-05-24 11:33:07 +00:00
Sergey Silkin
e62a08a87a Request key frame on all layers.
Explicitly request key frame on all layers until proper mapping is
implemented (webrtc:10615).

Bug: webrtc:10585
Change-Id: I9722610920a753c50700d925ff6a1babf0011e2f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/136682
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27934}
2019-05-13 21:00:26 +00:00