Commit graph

1187 commits

Author SHA1 Message Date
Markus Handell
f70fbc8411 Introduces rtc_base/synchronization/mutex.h.
This change introduces a new non-reentrant mutex to WebRTC. It
enables eventual migration to Abseil's mutex.

The mutex types supportable by webrtc::Mutex are

- absl::Mutex
- CriticalSection (Windows only)
- pthread_mutex (POSIX only)

In addition to introducing the mutexes, the CL also changes
PacketBuffer to use the new mutex instead of rtc::CriticalSection.

The method of yielding from critical_section.cc was given a
mini-cleanup and YieldCurrentThread() was added to
rtc_base/synchronization/yield.h/cc.

Additionally, google_benchmark benchmarks for the mutexes were added
(test courtesy of danilchap@), and some results from a pthread/Abseil
shootout were added showing Abseil has the advantage in higher
contention.

Bug: webrtc:11567, webrtc:11634
Change-Id: Iaec324ccb32ec3851bf6db3fd290f5ea5dee4c81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176230
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31443}
2020-06-04 09:55:12 +00:00
Danil Chapovalov
aa40b89006 Add Scalability structure tests for individual frame configurations
Bug: webrtc:10342
Change-Id: Ia768f6b37a4e9b0ce66139e799833746054e3a4e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176443
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31438}
2020-06-04 07:32:06 +00:00
Jerome Jiang
7f7fb830ba Reland "Add av1 test running real video clips."
This reverts commit 6958d2c6f0.

Disable the test on iOS.

Bug: None
Change-Id: Ie42fada10a92bd4a802c6c79caeb4965410ddf6a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176461
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#31437}
2020-06-04 06:32:46 +00:00
Jerome Jiang
6813767e52 Av1 wrapper: only use speed 6 on cores > 2
Bug: None
Change-Id: Iacddfbca1d2579c3a397339a1c18008a10238348
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176463
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#31436}
2020-06-04 03:23:54 +00:00
Jerome Jiang
1220c39953 av1: add a few controls to wrapper
this will speed up realtime encoding.

Change-Id: I39d42f3c195d2f520f04f7357e72b0903905ea81
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176383
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#31431}
2020-06-03 20:56:00 +00:00
Danil Chapovalov
649aa3416e in libaom decoder use public control function instead of internal one
to unblock rolling new version where private function is no longer available

Bug: None
Change-Id: I9c35fede3f331f7688cc97acfbda1250b42348a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176441
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31427}
2020-06-03 15:03:07 +00:00
Danil Chapovalov
40f1fe9cff Add unittests to validate scalability structures without encoder
Bug: webrtc:10342
Change-Id: I66407e635502b7c87f8d4ab49c95f5c1326da4a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176412
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31423}
2020-06-03 12:59:25 +00:00
Danil Chapovalov
4b1ab57283 Add av1 test with spatial scalability.
Bug: webrtc:11404
Change-Id: I6faa72a86d6f48b21b1e1cd6c2a1d748e168d018
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176366
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31410}
2020-06-02 13:27:57 +00:00
Ying Wang
6958d2c6f0 Revert "Add av1 test running real video clips."
This reverts commit 3a2be87b80.

Reason for revert: break internal test

Original change's description:
> Add av1 test running real video clips.
> 
> Bug: None
> Change-Id: I93bb8b3bf15d607d061aa74ad9e34609ffb2ef0a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175821
> Commit-Queue: Jerome Jiang <jianj@google.com>
> Commit-Queue: Stefan Holmer <holmer@google.com>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31401}

TBR=danilchap@webrtc.org,jianj@google.com,stefan@webrtc.org,holmer@google.com,marpan@webrtc.org

Change-Id: I2689ab4f7f26af6e26a4a188a2aa0b4f90a1a92f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176374
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31405}
2020-06-02 10:40:38 +00:00
Jerome Jiang
3a2be87b80 Add av1 test running real video clips.
Bug: None
Change-Id: I93bb8b3bf15d607d061aa74ad9e34609ffb2ef0a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175821
Commit-Queue: Jerome Jiang <jianj@google.com>
Commit-Queue: Stefan Holmer <holmer@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31401}
2020-06-02 07:36:20 +00:00
Danil Chapovalov
00b172a6fa Add av1 test with temporal scalability.
Bug: webrtc:11404
Change-Id: Iaf2fcca0dd450f7b296bd0250a119b8e7dfef270
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176181
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31397}
2020-06-01 14:28:45 +00:00
Mirko Bonadei
9ca7365a8c Deprecate webrtc::NackModule.
This CL moves webrtc::NackModule to a deprecated folder and annotates
the type with RTC_DEPRECATED.

Since the header should not be used outside of WebRTC, this CL doesn't
created a forward header.

Bug: webrtc:11611
Change-Id: I4d5899d473d78b8c7f4a6a018e2805648244b5f1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176360
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31394}
2020-05-30 16:34:44 +00:00
Jerome Jiang
85b288b0ff av1: enable error resilient, set max intra rate and disable order hint
error resilient needs to be enabled for layered encoding.

Bug: None
Change-Id: I399dc227507d4f48f21358141aa1874d126e92a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176340
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#31391}
2020-05-30 03:10:27 +00:00
Danil Chapovalov
a4d70a802c Configure libaom encoder with scalability parameters
Bug: webrtc:11404
Change-Id: I9535d9dec2e0e0d85bf3435f921d6e78034c7bf8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175653
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31373}
2020-05-28 09:06:11 +00:00
Markus Handell
3eac111115 PacketBuffer: remove lock recursions.
This change removes lock recursions and adds thread annotations.

Bug: webrtc:11567
Change-Id: Ibc429571926693f4b3de78f97a5dc5501d93a4a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176240
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31369}
2020-05-27 15:45:16 +00:00
Tommi
63673fe2cc Remove locks and dependency on ProcessThread+Module from NackModule2.
Change-Id: I39975e7812d7722fd231ac57e261fd6add9de000
Bug: webrtc:11594
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175341
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31367}
2020-05-27 14:20:34 +00:00
Danil Chapovalov
df95f5d43f Add parametrized unit tests for av1 to check scalability structures
Bug: webrtc:11404
Change-Id: If92a4b0a0a78a12ff43ec3a27b189cdc7218c9c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175601
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31365}
2020-05-27 10:27:18 +00:00
Mirko Bonadei
621c33653f Remove //modules/video_coding:nack_module from API.
Bug: None
Change-Id: I8e6cc61ae8406993909d0ab97896ccbaa89349c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176082
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31349}
2020-05-26 06:48:06 +00:00
Danil Chapovalov
f2c0f15282 In media/ and modules/video_coding replace mock macros with unified MOCK_METHOD macro
Bug: webrtc:11564
Change-Id: I5c7f5dc99e62619403ed726c23201ab4fbd37cbe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175647
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31340}
2020-05-25 08:46:30 +00:00
Tommi
d3807da009 Fork NackModule and RtpVideoStreamReceiver
Bug: webrtc:11595
Change-Id: I4d14c0bf9c32e09d1624099a256f2778afebd4df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175901
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31337}
2020-05-22 17:07:16 +00:00
Jerome Jiang
3cc1a6509b Set av1 speed from resolution.
Use speed 6 for better quality for low resolution, speed 8 for HD for better speed.
This will better balance speed and quality.

Change-Id: I3d8dbd45533471ce58d53c1ac26f92c7b1106259
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175281
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#31336}
2020-05-20 20:06:46 +00:00
Tommi
430951a0d4 Update call expectations in ReceiveStatisticsProxy, add thread checks
Bug: chromium:1084619
Change-Id: If9042d44ad99eacd431ee2a5e84486cfaf282d7e
Tbr: stefan@webrtc.org
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175658
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31330}
2020-05-20 10:27:50 +00:00
Ilya Nikolaevskiy
43c108b7e9 Log decoder implementation name
Bug: none
Change-Id: I2c6b6a2a62bbcd058b8ed336e6e0f36b8b0d0844
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175220
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31321}
2020-05-19 12:23:30 +00:00
Åsa Persson
3361af35dd Add option to disable reduced jitter delay through field trial.
Bug: none
Change-Id: Id07cb7dd69cd6198eb95a5e9c0987943471f7da2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175565
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31320}
2020-05-19 11:51:29 +00:00
Danil Chapovalov
61bc0d1ed3 Introduce ChainDiffCalculator
to convert flags which chains a video frame part of into chain_diffs

Bug: webrtc:10342
Change-Id: I6fb899eae934078223b101c9f85e2ac101980d4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175108
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31306}
2020-05-18 14:22:44 +00:00
Danil Chapovalov
b471ac791c Introduce layering controller interface for av1 encoder
Add TODOs into AV1 encoder wrapper where it suppose to be used.

Bug: webrtc:11404
Change-Id: If049066b84be72829867d5084827a7d275648a7b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174806
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31278}
2020-05-15 15:25:42 +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
28da36a6ea Add unittest for av1 wrappers to test Encode and Decode functions
while helpful by itself, it is also a preparation
for adding unittests for (to be added) svc features of the encoder.

Bug: webrtc:11404
Change-Id: I62b0645f44579f21f228d406a206b4c01d80dd02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174580
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31189}
2020-05-08 11:57:27 +00:00
Tommi
553c869c58 Start consolidating management/querying of stats on the Call thread.
Call is instantiated on what we traditionally call the 'worker thread'
in PeerConnection terms. Call statistics are however gathered, processed
and reported in a number of different ways, which results in a lot of
locking, which is also unpredictable due to the those actions themselves
contending with other parts of the system.

Designating the worker thread as the general owner of the stats, helps
us keeps things regular and avoids loading unrelated task queues/threads
with reporting things like histograms or locking up due to a call to
GetStats().

This is a reland of remaining changes from https://webrtc-review.googlesource.com/c/src/+/172847:
This applies the changes from the above CL to the forked files and
switches call.cc over to using the forked implementation.

Bug: webrtc:11489
Change-Id: I93ad560500806ddd0e6df1448b1bcf5a1aae7583
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174000
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31186}
2020-05-08 07:24:39 +00:00
Danil Chapovalov
b63331bb8f Cleanup mocks for Video (en|de)coder factories
In particular remove proxy mocks in favor of lambdas and Return(ByMove(...))

Bug: None
Change-Id: If6b79601437e82a7116479d128d538e965622fab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174701
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31179}
2020-05-07 11:58:50 +00:00
philipel
cce86430d8 Removed spammy log message from the FrameBuffer.
Inserting old frames is not an error condition and should not print a warning, and given that it happens all the time it is also very spammy.

Bug: chromium:1066819
Change-Id: Iad2b5edc5e62822c02e2bb2a53d4318f957be3bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173022
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31172}
2020-05-06 11:36:47 +00:00
Niels Möller
49f574b3b3 Delete EncodedImage methods buffer(), set_buffer() and mutable_data()
Bug: webrtc:9378
Change-Id: Iab21fe537f03a5cd130d8435cd94520952e693a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168494
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31164}
2020-05-05 09:11:40 +00:00
philipel
1b900b1322 Removed unused function EncodedFrame::SetEncodedSize.
Bug: none
Change-Id: I5b4ce351193198c14cf3c336f910eb1d910f034c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174380
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31158}
2020-05-04 16:44:12 +00:00
Mirko Bonadei
a81e9c82fc Wrap WebRTC OBJC API types with RTC_OBJC_TYPE.
This CL introduced 2 new macros that affect the WebRTC OBJC API symbols:

- RTC_OBJC_TYPE_PREFIX:
  Macro used to prepend a prefix to the API types that are exported with
  RTC_OBJC_EXPORT.

  Clients can patch the definition of this macro locally and build
  WebRTC.framework with their own prefix in case symbol clashing is a
  problem.

  This macro must only be defined by changing the value in
  sdk/objc/base/RTCMacros.h  and not on via compiler flag to ensure
  it has a unique value.

- RCT_OBJC_TYPE:
  Macro used internally to reference API types. Declaring an API type
  without using this macro will not include the declared type in the
  set of types that will be affected by the configurable
  RTC_OBJC_TYPE_PREFIX.

Manual changes:
https://webrtc-review.googlesource.com/c/src/+/173781/5..10

The auto-generated changes in PS#5 have been done with:
https://webrtc-review.googlesource.com/c/src/+/174061.

Bug: None
Change-Id: I0d54ca94db764fb3b6cb4365873f79e14cd879b8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173781
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31153}
2020-05-04 15:01:26 +00:00
Henrik Boström
012aa375b1 Asynchronous QualityScaler: Callback-based CheckQpTask.
This CL breaks up the CheckQp() operation into several steps managed
by the inner helper class CheckQpTask, making responding to high or
low QP an asynchronous operation. Why? Reconfiguring the stream in
response to QP overuse will in the future be handled on a separate
task queue. See Call-Level Adaptation Processing for more details:
https://docs.google.com/document/d/1ZyC26yOCknrrcYa839ZWLxD6o6Gig5A3lVTh4E41074/edit?usp=sharing

Instead of "bool AdaptDown()" when high QP is reported,
synchronously returning true or false depending on the result of
adaptation, this CL introduces
  void QualityScalerQpUsageHandlerInterface::OnReportQpUsageHigh(
      rtc::scoped_refptr<QualityScalerQpUsageHandlerCallback>);
Where
  QualityScalerQpUsageHandlerCallback::OnQpUsageHandled(
      bool clear_qp_samples);
Instructs the QualityScaler whether to clear samples before
checking QP the next time or to increase the frequency of checking
(corresponding to AdaptDown's return value prior to this CL).

QualityScaler no longer using AdaptationObserverInterface, this class
is renamed and moved to overuse_frame_detector.h.

The dependency between CheckQpTasks is made explicit with
CheckQpTask::Result and variables like observed_enough_frames_,
adapt_called_ and adapt_failed_ are moved there and given more
descriptive names.

Bug: webrtc:11521
Change-Id: I7faf795aeee5ded18ce75eb1617f88226e337228
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173760
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@{#31140}
2020-04-28 09:00:15 +00:00
Ilya Nikolaevskiy
1fb4a05e9e Reland "Launch external ref control for vp9 encoder"
This reverts commit 9665b7d101.

Reason for revert: Fixes are in the PS#2

Original change's description:
> Revert "Launch external ref control for vp9 encoder"
> 
> This reverts commit 9427b51d6f.
> 
> Reason for revert: Breaks downstream tests
> 
> Original change's description:
> > Launch external ref control for vp9 encoder
> > 
> > Change field trial condition to killswitch instead.
> > 
> > Finch trial is going to 100% public today.
> > 
> > Bug: chromium:1027108,webrtc:11319
> > Change-Id: I29494a7c8515a454706983dd15ae444d3f85271f
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173752
> > Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> > Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#31122}
> 
> TBR=ilnik@webrtc.org,ssilkin@webrtc.org
> 
> Change-Id: I44436febb2b646cdd350fa9afee1c3a7ea307d04
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:1027108, webrtc:11319
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173761
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31123}

TBR=ilnik@webrtc.org,ssilkin@webrtc.org

Change-Id: I8aed0edca2015297da512aa084515812103c6f48
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1027108, webrtc:11319
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173780
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31125}
2020-04-23 13:21:45 +00:00
Ilya Nikolaevskiy
9665b7d101 Revert "Launch external ref control for vp9 encoder"
This reverts commit 9427b51d6f.

Reason for revert: Breaks downstream tests

Original change's description:
> Launch external ref control for vp9 encoder
> 
> Change field trial condition to killswitch instead.
> 
> Finch trial is going to 100% public today.
> 
> Bug: chromium:1027108,webrtc:11319
> Change-Id: I29494a7c8515a454706983dd15ae444d3f85271f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173752
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31122}

TBR=ilnik@webrtc.org,ssilkin@webrtc.org

Change-Id: I44436febb2b646cdd350fa9afee1c3a7ea307d04
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1027108, webrtc:11319
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173761
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31123}
2020-04-23 09:25:19 +00:00
Ilya Nikolaevskiy
9427b51d6f Launch external ref control for vp9 encoder
Change field trial condition to killswitch instead.

Finch trial is going to 100% public today.

Bug: chromium:1027108,webrtc:11319
Change-Id: I29494a7c8515a454706983dd15ae444d3f85271f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173752
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31122}
2020-04-23 09:03:06 +00:00
Ilya Nikolaevskiy
9ce77fda75 Remove redundant Dcheck in vp9 decoder
Bug: chromium:1070146
Change-Id: Ia4a07cfd16c154e2be3478c020c01fbcaf1c5bb0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173743
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31119}
2020-04-22 09:06:26 +00:00
philipel
00032698ac Clean up old GoPs when the RTP sequence number jump.
Bug: chromium:1065699
Change-Id: I2ed853559858ef82c6eb03b366cd77e8b3b0e799
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173703
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31102}
2020-04-17 14:33:45 +00:00
Mirko Bonadei
6415dcad7a Remove WebRTC-ExperimentalScreenshareSettings.
This field trial is unused.

Bug: webrtc:11503
Change-Id: Id79b0dc64fed3559b9b63ebcf539e5536ddad589
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173339
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31090}
2020-04-16 18:15:08 +00:00
Evan Shrubsole
ce0a11d5f9 Unify AdaptationReason and AdaptReason enums.
Moves the unified AdaptationReason to the api/ folder.

Bug: webrtc:11392
Change-Id: I28782e82ef6cc3ca3b061f65b0bbdc3766df1f9c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172583
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31084}
2020-04-16 13:33:49 +00:00
Ilya Nikolaevskiy
39fb817efd [Video, Svc] Remove inactive spatial layers in codec initializer
This is more logical way to remove inactive lower layers.
Current way is to notify the encoder that the layer is inactive,
then renumber layers at the packatization level.

This Cl will allow to simplify libvpx vp9 encoder, svcRateAllocator and
vp9 packetizer.

Bug: webrtc:11319
Change-Id: Idf0bb30b729f5ecc97e31454b32934546b681aa2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173182
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31058}
2020-04-14 09:37:44 +00:00
Tommi
eb03d286df Remove seemingly unused timer
Bug: none
Change-Id: I47cb2a22e6d62e0bfd094fc6246a27b48286b33d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172801
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30995}
2020-04-03 11:17:02 +00:00
Danil Chapovalov
5179469f4b Delete deprecated RtpFrameObject constructor
Bug: None
Change-Id: Ifd496d6681004f3afff43628bda2d4b888aef958
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172620
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30974}
2020-04-02 10:50:57 +00:00
Johannes Kron
3e98368ec5 Reland "Distinguish between send and receive codecs"
This reverts commit 8e8b36a94a.

Reason for revert: The CL has been improved with the following changes,
  - Fixed negotiation of send/receive only clients.
  - Handles the implicit assumption that any H264 decoder also can
    decode H264 constraint baseline.

Original change's description:
> Distinguish between send and receive codecs
>
> Even though send and receive codecs may be the same, they might have
> different support in HW. Distinguish between send and receive codecs
> to be able to keep track of which codecs have HW support.
>
> Bug: chromium:1029737
> Change-Id: Id119560becadfe0aaf861c892a6485f1c2eb378d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165763
> Commit-Queue: Johannes Kron <kron@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30284}

Change-Id: I834ed48ee78d04922c73e2836165e476925e1cc5
Bug: chromium:1029737
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168605
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30932}
2020-03-29 21:03:27 +00:00
Erik Språng
c8fbd899bd Fixes temporal rate allocation issues.
This CL fixes a few issues where the reported fraction of frames
allocated to various temporal layers could be incorrect:
* In LibvpxVp8Encoder, calling GetEncoderInfo() while not initialized,
  or when first configuring with temporal layers and then without,
  could trigger incorrect fps allocations.
* In VP9 when different spatial layers have different max framerates,
  the layer fps should be compared to the layer with the highest
  configured fps, not codec_.maxFramerate which is updated to the
  current input fps on SetRates().
* In EncoderBitrateAdjuster, just warn and ignore if a layer has
  non-zero bps but zero fps, rather than passing down the chain and
  risk weird behavior or divide by zero.

Bug: b/152040235
Change-Id: I548fb3e099b1ec9f536a7b93313fb40c4d32e596
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171516
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30880}
2020-03-25 11:20:47 +00:00
Rasmus Brandt
52dd621a92 libvpx-vp8: Add external configurability of resolution/bitrate limits.
Bug: webrtc:11436
Change-Id: Iae34caf579e0931344c1b8706c7e561a5410c170
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171112
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30870}
2020-03-24 13:32:59 +00:00
Danil Chapovalov
a4c4425748 Restore setting encoder speed for AV1 encoder wrapper
Also add simple unittests for the wrapper.

Bug: webrtc:11404
Change-Id: I41d185da9bce392297d1982194c059bddb7881ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171481
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30867}
2020-03-24 12:34:27 +00:00
Ilya Nikolaevskiy
8d1f72852e [VP9 decoder] react to incorrect pixel format in the bitstream
Bug: chromium:1063490
Change-Id: Ibac3b43b42c1b088b6ac94ae327f23b11d3fd259
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171225
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30855}
2020-03-23 11:29:08 +00:00
Danil Chapovalov
f4306ebfea In PacketBuffer simplify stored buffer.
Bug: None
Change-Id: Iddcde9d2ab25d2fb7091c9ed8104138293fd9dee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168044
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30844}
2020-03-20 13:32:32 +00:00
Danil Chapovalov
976cc1ae19 Add AV1 encoder wrapper
Bug: webrtc:11404
Change-Id: Ibd5ded873c397bb91675a7e29591edab3c41f182
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170360
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30842}
2020-03-20 12:20:06 +00:00
Rasmus Brandt
2e6bd28381 libvpx-vp8: Add settings struct to constructor.
Migrate the injectable Vp8FrameBufferControllerFactory
into a settings struct, allowing for straight-forward
future extensions.

Bug: webrtc:11436
Change-Id: I53e555eb6ef88cf5b10ee8a43abd6ef9c930d100
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170635
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30839}
2020-03-20 11:35:46 +00:00
Rasmus Brandt
9ce14e8c50 libvpx-vp8: Migrate to default member initializations.
Bug: webrtc:11436
Change-Id: I9c7751e63efc51f2bdc3490e014c36e6b35b4b54
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170634
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30835}
2020-03-19 16:43:25 +00:00
philipel
45cb8f65ba Drop duplicate VP8 frames in the RtpFrameReferenceFinder.
Bug: webrtc:11431
Change-Id: Ib74c05e7cf12b9a3f60423a268a5d459407fd00b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171060
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30834}
2020-03-19 16:39:24 +00:00
Danil Chapovalov
810b4ca386 Move AssembleFrame from PacketBuffer to RtpVideoStreamReceiver
this is a step towards resolving own todo: making AssembleFrame part of
the VideoRtpDepacketizer interface and replacing codec check with a
call to a virtual function.
RtpVideoStreamReceiver has access to the VideoRtpDepacketizers,
PacketBuffer - hasn't.

Bug: None
Change-Id: I83df09975c092bdb71bab270ced356d79a50683d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168056
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30833}
2020-03-19 16:35:14 +00:00
Danil Chapovalov
560e87aa81 Reenable libaom decoder by default
Bug: webrtc:11404
Change-Id: I165ce3b88d35b58b3f878246c77ab48c36cc9ddc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170636
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30823}
2020-03-18 18:04:41 +00:00
Danil Chapovalov
95e01a220b Overwrite dti for vp8 screenshare forced key frame
Bug: webrtc:11433
Change-Id: Ie04bdf9d1e3a835a3f9625ae71918bb33b334b07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170629
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30809}
2020-03-17 12:03:03 +00:00
Danil Chapovalov
c46385c346 Add Av1 Decoder wrapper behind a build flag
Bug: webrtc:11404
Change-Id: I090ffd173d667e8845de1b986af462516b7c76e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169452
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30757}
2020-03-11 11:20:56 +00:00
Minyue Li
21bccae341 Add NtpTimeMs as a method in EncodedImage.
Bug: b/151082828
Change-Id: Idaa6848f952f9cc9458899680d19ddf338a3ace1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170044
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30729}
2020-03-09 17:00:09 +00:00
Jerome Jiang
c93abcb341 VP9 test: change threshold to allow resizing for twice
Recent change in libvpx allows a second resize for low resolution.

Bug: None
Change-Id: I45a7ce376b274778b2fa183346de1993ef43bde7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169941
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30719}
2020-03-09 09:56:05 +00:00
Niels Möller
d3da6b05c1 Move EventWrapper class to target video_coding_legacy.
And remove some unneeded logic for WEBRTC_EVENT_INFINITE.

Bug: webrtc:3380
Change-Id: Ibf632493edc6ced1609bd9ced44c2020fe9878cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169846
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30700}
2020-03-06 08:39:35 +00:00
Danil Chapovalov
bb701b7b46 Fix dependency templates for VP8 3 temporal layers
Bug: None
Change-Id: I3c34fb949ba73c32cd36375aa5b96eeb1c11fc42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169730
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30692}
2020-03-05 14:49:05 +00:00
Ilya Nikolaevskiy
24dbb21383 Enable quality scaler for simulcast and SVC if only one stream is active
Also, make sure active flags are not lost in simulcast encoder adapter
which is needed in case of simulcast encoder adapter is used.

VP9 libvpx encoder currently ignores scaling setting for SVC, but libvpx
fix is incoming.

TESTED=On a manually patched chrome with singlecast-simulcast vp8 stream.

Bug: webrtc:11396
Change-Id: Ic81f014bec1bdaaf6d5d173743933e5d77d71ea2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169547
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30681}
2020-03-04 15:22:00 +00:00
Ilya Nikolaevskiy
ae92244054 Clean VP8 header parser
The old implementation has undefined behavior in it (unaligned read of uint32_t)
Now it's closer to the reference implementation:
https://tools.ietf.org/html/rfc6386#section-20.2

Also, added some comments and named some variables to make it more clear, that the
parser actually does.

Bug: chromium:1057551
Change-Id: I84c1912867e2794502e8a63302c938a0cbab2c4e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169545
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30661}
2020-03-02 15:05:48 +00:00
Guido Urdaneta
c8958e5a4f Add RTC_EXPORT to VCMEncodedFrame
This is needed to be able to use webrtc::video_coding::EncodedFrame
is unit tests in Chromium.

TBR=tommi@webrtc.org

Bug: webrtc:11380
Change-Id: Idb3b0ab667a548f5a968e02a8efd91f02585c3f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169451
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30651}
2020-02-28 16:59:10 +00:00
Danil Chapovalov
2c35da4c00 In Vp8 temporal layering fix generic info at non-first key frame
Bug: b/149907566
Change-Id: I5df5dea1680e95f15c38240df98f4acc3b5daf8e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168954
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30601}
2020-02-25 10:47:49 +00:00
Jerome Jiang
4a06666325 Only set vp9 config when it's changed.
~3-5% speed up on webrtc_perf_tests of vp9 on linux desktop.

Avoid going thru a lot of unnecessary code checks.

Change-Id: I2cb0d794bcf239c5057dfc04cd07a496f89a5016
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167640
Commit-Queue: Jerome Jiang <jianj@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30586}
2020-02-21 20:09:31 +00:00
Ilya Nikolaevskiy
1dea1ea412 [VP9 encoder] Set temporal id also on disabled spatial layers
Bug: chromium:1051476
Change-Id: Iaf2b6ab6640cd314a620dbdf1547d8f1b2f40693
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168921
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30581}
2020-02-21 12:03:09 +00:00
Mirko Bonadei
4a14f4997c Remove wildcard ownership for build files.
No-Try: True
Bug: webrtc:10381
Change-Id: I852d9a2da7e0c5c12f508a1c788b0b5753503aba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168769
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30558}
2020-02-19 14:05:46 +00:00
Mirko Bonadei
e52115a33e Remove inactive OWNERS.
No-Try: True
Bug: webrtc:10381
Change-Id: I3b56c74d913a47e4297518005b0cb19de8fafbff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168421
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30556}
2020-02-19 13:37:36 +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
Danil Chapovalov
e209fe6c68 Do not propagate generic descriptor on receiving frame
It was used only for the frame decryptor.
Decryptor needs only raw representation that it can recreate
in a way compatible with the new version of the descriptor.

This relands commit abf73de8ea.
with adjustments.

Change-Id: I935977179bef31d8e1023964b967658e9a7db92d
Bug: webrtc:10342
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168489
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30532}
2020-02-17 14:52:03 +00:00
Mirta Dvornicic
6799d732d5 Delete DefaultVideoBitrateAllocator.
It was removed from tests in https://webrtc-review.googlesource.com/c/src/+/123540.

If simulcast is not used, SimulcastRateAllocator returns the
same allocation as DefaultVideoBitrateAllocator.

Bug: webrtc:10164
Change-Id: I3d3e1aefe2fcc2bf853cd63c75e008b86eff9241
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168496
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30509}
2020-02-12 21:29:09 +00:00
Danil Chapovalov
02d71fb882 Populate generic descriptor based on GenericFrameInfo when available.
Bug: webrtc:10342
Change-Id: Iff769d2604fd79784bcb09874d2803793d20bde5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167000
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30505}
2020-02-12 10:55:41 +00:00
Danil Chapovalov
bc1750d52b Revert "Do not propagate generic descriptor on receiving frame"
This reverts commit abf73de8ea.

Reason for revert: breaks downstream tests

Original change's description:
> Do not propagate generic descriptor on receiving frame
> 
> It was used only for the frame decryptor.
> Decryptor needs only raw representation that it can recreate
> in a way compatible with the new version of the descriptor.
> 
> Bug: webrtc:10342
> Change-Id: Ie098235ebb87c6f5e2af42d0022d2365cd6bfa29
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166163
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30501}

TBR=danilchap@webrtc.org,sprang@webrtc.org,philipel@webrtc.org

Change-Id: I6634df06ee75aa8cdfda614994ab11f7a5845c70
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10342
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168488
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30502}
2020-02-11 16:54:07 +00:00
Danil Chapovalov
abf73de8ea Do not propagate generic descriptor on receiving frame
It was used only for the frame decryptor.
Decryptor needs only raw representation that it can recreate
in a way compatible with the new version of the descriptor.

Bug: webrtc:10342
Change-Id: Ie098235ebb87c6f5e2af42d0022d2365cd6bfa29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166163
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30501}
2020-02-11 16:12:16 +00:00
Ilya Nikolaevskiy
03d909634b Ensure that the first active layer isn't disabled by too low input resolution
If e.g. CPU adaptation reduces input video size too much, video pipeline would
reduce the number of used simulcast streams/spatial layers. This may result in
disabled video if some streams are disabled by Rtp encoding parameters API.

Bug: webrtc:11319
Change-Id: Id7f157255599dcb6f494129b83477cda4bea982a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168480
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30498}
2020-02-11 14:57:51 +00:00
Danil Chapovalov
5528402ef8 Use newer version of TimeDelta and TimeStamp factories in modules/
This change generated with following commands:
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Micros<\(.*\)>()/TimeDelta::Micros(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Millis<\(.*\)>()/TimeDelta::Millis(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Seconds<\(.*\)>()/TimeDelta::Seconds(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::us/TimeDelta::Micros/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::ms/TimeDelta::Millis/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::seconds/TimeDelta::Seconds/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Micros<\(.*\)>()/Timestamp::Micros(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Millis<\(.*\)>()/Timestamp::Millis(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Seconds<\(.*\)>()/Timestamp::Seconds(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::us/Timestamp::Micros/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::ms/Timestamp::Millis/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::seconds/Timestamp::Seconds/g"
git cl format

Bug: None
Change-Id: I117d64a54950be040d996035c54bc0043310943a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168340
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30489}
2020-02-10 11:49:57 +00:00
Henrik Boström
48258acabf [Overuse] Implement Resource and ResourceUsageListener.
The Resource interface (previously a skeleton not used outside of
testing) is updated to inform listeners of changes to resource
usage. Debugging methods are removed (Name, UsageUnitsOfMeasurements,
CurrentUsage). The interface is implemented by
OveruseFrameDetectorResourceAdaptationModule's inner classes
EncodeUsageResource and QualityScalerResource.

The new ResourceUsageListener interface is implemented by
OveruseFrameDetectorResourceAdaptationModule. In order to avoid adding
AdaptationObserverInterface::AdaptReason to the ResourceUsageListener
interface, the module figures out if the reason is "kCpu" or "kQuality"
by looking which Resource object triggered
OnResourceUsageStateMeasured(). These resources no longer need an
explicit reference to OveruseFrameDetectorResourceAdaptationModule and
could potentially be used by a different module.

In this CL, AdaptationObserverInterface::AdaptDown()'s return value is
still needed by QualityScaler. This is mirrored in the return value of
ResourceUsageListener::OnResourceUsageStateMeasured(). A TODO is added
to remove it and a comment explains how the current implementation
seems to break the contract of the method (as was the case prior to
this CL).

Follow-up work include:
- Move EncodeUsageResource and QualityScalerResource to separate files.
- Make resources injectable, allowing fake resources in testing and
  removing OnResourceOveruseForTesting() methods.
  (Investigate adding the necessary input signals to the Resource
  interface or relevant sub-interfaces so that the module does not need
  to know which Resource implementation is used.)
- And more! See whiteboard :)

Bug: webrtc:11222
Change-Id: I0a46ace4a2e617874e3ee97e67e3a199fef420a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168180
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#30469}
2020-02-06 12:45:14 +00:00
Ilya Nikolaevskiy
ef0d76ae83 Add more VP9 header correctness check in RtpFrameReferenceFinder
Bug: chromium:1049129
Change-Id: I133673d86aadd6a87b3420a04bbf45ed53841a96
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168240
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30466}
2020-02-06 08:39:44 +00:00
Ilya Nikolaevskiy
72859e5e15 Make RtpEncodingParameters to not reverse active flags order
Bug: webrtc:11319
Change-Id: If63db02d282ee622c12405f85c0fbae1ba13fcb2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168196
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30459}
2020-02-05 17:36:26 +00:00
Danil Chapovalov
02b17a5507 Add helper to calculate frame dependencies based on encoder buffer usage
Bug: webrtc:10342
Change-Id: I1d856d060c2defcd10310f0d8639ce8a9554fff3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168194
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30458}
2020-02-05 16:19:10 +00:00
Niels Möller
2fca97168b Delete header file mock_vcm_callbacks.h
Move definitions of mock classes to the only user, the unit tests for
the deprecated class vcm::VideoReceiver.

Bug: webrtc:7408
Change-Id: I05e38ed8ebbe615bb2db0b631ec914773fb0a520
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168182
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30451}
2020-02-04 14:20:46 +00:00
Ilya Nikolaevskiy
f5d877847f Reland "[VP9] Shift spatial layers on RTP level to always start from 0."
This reverts commit 2181228624.

Reason for revert: Reland without changes as it's not the root cause.

Original change's description:
> Revert "[VP9] Shift spatial layers on RTP level to always start from 0."
> 
> This reverts commit 2e73a3d1e9.
> 
> Reason for revert: Fuzzer found some issues.
> 
> Original change's description:
> > [VP9] Shift spatial layers on RTP level to always start from 0.
> > 
> > This CL uses |width| and |height| in RTPVideoHeaderVP9 to pass information
> > about enabled layers from encoder to packetizer.
> > 
> > Bug: webrtc:11319
> > Change-Id: Idc1c337f8dfb3f7631506acb784d2a634b41b955
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167724
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#30428}
> 
> TBR=danilchap@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: webrtc:11319
> Change-Id: I27a7e82737fa604b8ab769ce6503fa93e46f4e86
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168123
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30448}

TBR=danilchap@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org

Change-Id: Ibcd9b6a075ee08c9402de8b0b9d99d77bf59d0ef
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11319
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168185
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30450}
2020-02-04 10:06:44 +00:00
Ilya Nikolaevskiy
2181228624 Revert "[VP9] Shift spatial layers on RTP level to always start from 0."
This reverts commit 2e73a3d1e9.

Reason for revert: Fuzzer found some issues.

Original change's description:
> [VP9] Shift spatial layers on RTP level to always start from 0.
> 
> This CL uses |width| and |height| in RTPVideoHeaderVP9 to pass information
> about enabled layers from encoder to packetizer.
> 
> Bug: webrtc:11319
> Change-Id: Idc1c337f8dfb3f7631506acb784d2a634b41b955
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167724
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30428}

TBR=danilchap@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org

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

Bug: webrtc:11319
Change-Id: I27a7e82737fa604b8ab769ce6503fa93e46f4e86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168123
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30448}
2020-02-03 14:15:44 +00:00
Danil Chapovalov
a118702566 in RtpFrameReferenceFinder VP9 case validate number of references in gof
number of references can't be invalid if gof was correctly parsed
from a vp9 packet, but RtpFrameReferenceFinder still better be
protected from the invalid data.

Bug: chromium:1048013
Change-Id: I548f5c87199421b7736409cbcacbec760ad799ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168124
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30444}
2020-02-03 10:31:38 +00:00
Danil Chapovalov
545c53e22f In RtpFrameReferenceFinder VP8 clean not yet received before filling it
To make it generally faster, specially in case of very large picture id gaps.

Bug: None
Change-Id: Ib0c49c17bd1281190da986def43bea8fc3440c0f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168055
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30438}
2020-01-31 18:10:48 +00:00
Ilya Nikolaevskiy
2e73a3d1e9 [VP9] Shift spatial layers on RTP level to always start from 0.
This CL uses |width| and |height| in RTPVideoHeaderVP9 to pass information
about enabled layers from encoder to packetizer.

Bug: webrtc:11319
Change-Id: Idc1c337f8dfb3f7631506acb784d2a634b41b955
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167724
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30428}
2020-01-30 16:07:32 +00:00
Danil Chapovalov
95cb56bd89 Add extra input validation to RtpFrameReferenceFinder for codec-specific cases
wrap ids before unwrapping: should be noop for ids arrived from the
network, but avoids DCHECKs for ids arrived from fuzzer.

for vp9 double check number of references doesn't exceed maximum.
for vp8 drop key frames for non-zero temporal id.
for general by seqnum code path do not set last_picture_id_:
it is not used there, but may confuse vp8 codepath.

as a slight speed up avoid copying RTPVideoTypeHeader for vp8 and vp9.

Bug: chromium:1046995, chromium:1047024, chromium:1047095, chromium:1047165, chromium:1047190
Change-Id: I1ab0833d32e2c023cbf5e3cfcc9e74f1c558e44b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168040
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30426}
2020-01-30 15:04:05 +00:00
philipel
190539717b Remove unused NextFrame function from FrameBuffer.
Also updated FrameBuffer unittests to use the GlobalSimulatedTimeController.

Bug: webrtc:7408, webrtc:9378
Change-Id: I8ade27492f66cdd8950b38f5f4a268714dbc35fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/164536
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30422}
2020-01-30 12:54:08 +00:00
Jerome Jiang
740ed473dc Add 444 support for vp9 decoder wrapper.
Chromting is trying vp9 444 to have better color. This fix is needed to decode 444 properly.

Bug: webrtc:11326
Change-Id: I4498930591d8876af9f6b7238a8c9fe450ecbfcc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166220
Commit-Queue: Jerome Jiang <jianj@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30410}
2020-01-29 16:32:10 +00:00
Danil Chapovalov
26b4cb3fc5 Detach RtpFrameReferenceFinder from RtpGenericFrameDescriptor
To allow to use the RtpFrameReferenceFinder with
an updated version of the frame descriptor extension

Bug: webrtc:10342
Change-Id: Ib60a505a714993862a008300aa64d0bb835c3377
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167361
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30407}
2020-01-29 12:36:10 +00:00
Evan Shrubsole
73a5e916a9 Remove task_queue dependency for QualityScaler
This allows for the possiblity to move the QualityScaler
out of the VideoStreamEncoder in the future.


Bug: webrtc:11222
Change-Id: I1d563cf08791e27ff5065ce90bcb150a7974d868
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167534
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#30406}
2020-01-29 12:14:10 +00:00
Danil Chapovalov
97ffbefdab Pass and store PacketBuffer::Packet by unique_ptr
to avoid expensive move of the Packet and prepare PacketBuffer
to return list of packets as a frame.

Bug: None
Change-Id: I19f0452c52238228bbe28284ebb197491eb2bf4e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167063
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30404}
2020-01-29 11:48:55 +00:00
Danil Chapovalov
b6bf0b2546 Pass picture_id from generic packetizer through codec-specific field
To free up RtpVideoHeader::generic field for codec agnostic details
from an rtp header extension.

Bug: webrtc:10342
Change-Id: I7b9d869b2ecfedb96dfd860be47ed8dffa058749
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166175
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30396}
2020-01-28 19:26:28 +00:00
Danil Chapovalov
159c414ff8 Detach LossNotificationController from RtpGenericFrameDescriptor
To allow to use the LossNotificationController with
an updated version of the frame descriptor extension

Bug: webrtc:10342
Change-Id: I5ac44dc5549dfcfc73bf81ad1e8eab8bd5dd136e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166166
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30369}
2020-01-24 11:53:28 +00:00
Henrik Boström
4bab2fcf6b [Overuse] Setting encoder configurations through the interface.
This squashes together several input signals that were spread out
through several calls into a single method and calling place:
SetEncoderSettings(), invoked from ReconfigureEncoder(). This is added
to the abstract interface.

This makes the following methods obsolete which are removed:
- SetEncoder(): The VideoEncoder was only used for GetEncoderInfo();
  the VideoEncoder::EncoderInfo is now part of the EncoderSettings.
- SetEncoderConfig(): The VideoEncoderConfig is part of
  EncoderSettings. The config is used for its codec_type and
  content_type enums.
- SetCodecMaxFrameRate(): The max frame rate was the same as
  VideoCodec::maxFramerate. VideoCodec is now part of EncoderSettings.

There may be some overlap in information between EncoderConfig and
VideoCodec, but that is outside the scope of this CL, which only makes
sure to bundle encoder settings-like information into one input signal.

Bug: webrtc:11222
Change-Id: I67c49c49c0a859cb7d5051939a461593c695a789
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166602
Reviewed-by: Erik Språng <sprang@webrtc.org>
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@{#30332}
2020-01-21 11:48:11 +00:00
Ilya Nikolaevskiy
7a709c0e85 RtpReferenceFrameFinder: protect against crashes due to large temporal idx value on the wire
Bug: chromium:1042933
Change-Id: Ide37812a73b72e744f45b671918dc9817775e1f4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166463
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30307}
2020-01-17 16:24:53 +00:00
Danil Chapovalov
64f1f3f04e Replace RTC_FALLTHROUGH with ABSL_FALLTHROUGH_INTENTED
Bug: None
Change-Id: I7287403f3fb13b8e30f92ca3cf1882b03bb53a6e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166176
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30283}
2020-01-16 15:20:35 +00:00