Commit graph

51 commits

Author SHA1 Message Date
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
Emil Lundmark
d891c4940a Configure generic temporal layer in VP8 screenshare
This ensures that the payload descriptor and potential generic
descriptors uses the same temporal layer.

Bug: b/200518293
Change-Id: I17e980b47fe6c814cb393fc459064576447aa27a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236520
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35275}
2021-10-28 14:32:49 +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
Danil Chapovalov
24263f4ffb Embed FrameDependencyTemplate builder helpers directly into the struct
Bug: None
Change-Id: I4c13bdabd08dd6a6011cb534c765c1dd09f218d1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176843
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31500}
2020-06-11 13:43:51 +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
Qingsi Wang
1c1b99e30f Revert "Delete RtpPayloadParams::SetDependenciesVp8Deprecated as unused"
This reverts commit dc7fe40f49.

Reason for revert: speculative revert for breaking downstream projects

Original change's description:
> Delete RtpPayloadParams::SetDependenciesVp8Deprecated as unused
> 
> Bug: webrtc:10242
> Change-Id: Iddad086d8ce3652bd9f0fb12788d5c73b5ebda76
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161945
> Reviewed-by: Niels Moller <nisse@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@{#30159}

TBR=danilchap@webrtc.org,eladalon@webrtc.org,nisse@webrtc.org,philipel@webrtc.org

Change-Id: Ie7f875291610a7b676539a5ccc4bac9a08011f42
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10242
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165240
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30173}
2020-01-07 19:16:48 +00:00
Danil Chapovalov
dc7fe40f49 Delete RtpPayloadParams::SetDependenciesVp8Deprecated as unused
Bug: webrtc:10242
Change-Id: Iddad086d8ce3652bd9f0fb12788d5c73b5ebda76
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161945
Reviewed-by: Niels Moller <nisse@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@{#30159}
2020-01-07 09:13:29 +00:00
Elad Alon
45befc5f1f Pass FecControllerOverride to Vp8FrameBufferControllerFactory::Create
Previously, FecControllerOverride was passed to
Vp8FrameBufferController::SetFecControllerOverride. Passing to
the factory is a more elegant way, since it's only used when
the controller is constructed.

TBR=kwiberg@webrtc.org

Bug: webrtc:10769
Change-Id: Iae599889e7ca9003e3200c2911239cbb763ee65a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144380
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28443}
2019-07-02 10:55:55 +00:00
Elad Alon
7e00c679a5 Pass FecControllerOverride to Vp8FrameBufferController
Bug: webrtc:10769
Change-Id: I06d875f5afdc7ebf290ad70934b6632e20ddf065
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143964
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28418}
2019-06-28 17:48:08 +00:00
Danil Chapovalov
c2f56862a6 Extend structures to store updated version of the dependency descriptor
Rename structures to match terminology in the spec

Bug: webrtc:10342
Change-Id: I1329abaca98ae7f82307451032d5ce1533e80772
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143960
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28402}
2019-06-27 12:10:38 +00:00
Elad Alon
fb0878197e Reland "Refactor handling of configuration overrides from Vp8FrameBufferController"
This is a reland of 4d6795f828

Original change's description:
> Refactor handling of configuration overrides from Vp8FrameBufferController
>
> Make Vp8FrameBufferController::UpdateConfiguration return a set
> of desired overrides. These overrides are cumulative with
> previously returned override sets.
>
> Bug: webrtc:10382
> Change-Id: I1aa9544ae0cf6c57115e80963b3bbcdc3101db5e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134649
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Elad Alon <eladalon@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27835}

TBR=brandtr@webrtc.org,sprang@webrtc.org

Bug: webrtc:10382
Change-Id: I0b313d19843edf429aeeaa4deafc5426c434a0fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135942
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27904}
2019-05-10 08:44:02 +00:00
Elad Alon
3d622d6e5c Revert "Refactor handling of configuration overrides from Vp8FrameBufferController"
This reverts commit 4d6795f828.

Reason for revert: chromium:961253

Original change's description:
> Refactor handling of configuration overrides from Vp8FrameBufferController
>
> Make Vp8FrameBufferController::UpdateConfiguration return a set
> of desired overrides. These overrides are cumulative with
> previously returned override sets.
>
> Bug: webrtc:10382
> Change-Id: I1aa9544ae0cf6c57115e80963b3bbcdc3101db5e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134649
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Elad Alon <eladalon@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27835}

TBR=brandtr@webrtc.org,eladalon@webrtc.org,sprang@webrtc.org


Bug: chromium:961253
Change-Id: I06f0eafd4f38c441ddbdfeebae8055b02465eb9b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135940
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27900}
2019-05-09 21:09:23 +00:00
Elad Alon
4d6795f828 Refactor handling of configuration overrides from Vp8FrameBufferController
Make Vp8FrameBufferController::UpdateConfiguration return a set
of desired overrides. These overrides are cumulative with
previously returned override sets.

Bug: webrtc:10382
Change-Id: I1aa9544ae0cf6c57115e80963b3bbcdc3101db5e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134649
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27835}
2019-05-03 09:12:56 +00:00
philipel
da5aa4ddf5 Use CodecBufferUsage to determine dependencies.
In this CL:
 - Assign frame IDs so that simulcast streams share one frame ID space.
 - Added a CodecBufferUsage class that represent how a particular buffer
   was used (updated, referenced or both).
 - Calculate frame dependencies based on the CodecBufferUsage information.

Bug: webrtc:10342
Change-Id: I4ed5ad703f9376a7d995c04bb757c7d214865ddb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131287
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27784}
2019-04-26 12:13:28 +00:00
Elad Alon
979c4426a4 Rename "UpdateLayerConfig" to "NextFrameConfig"
Rename "UpdateLayerConfig" to the more appropriate "NextFrameConfig".
Also update some comments in vp8_frame_buffer_controller.h.

Bug: None
Change-Id: Iba8227f84e33e5ebd28d2eeb10fe03e776036603
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133202
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27660}
2019-04-17 11:59:07 +00:00
Elad Alon
123ee9be8f OnLossNotification() receives references
A typo in a previous CL made OnLossNotification() accept its
single argument as a const-value, rather than a const-reference.

Bug: webrtc:10501
Change-Id: I5e6f9c79f15205b75ec90a53d3fccf3dd9927e33
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133343
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27659}
2019-04-17 11:47:25 +00:00
Elad Alon
6796ec2289 Add OnFrameDropped() to Vp8FrameBufferController
Prior to this CL, this was indicated by passing |size_bytes| = 0
to the method.

Bug: webrtc:10501
Change-Id: Icff3bb83344834dc62d62bde5ec5d05096a08e11
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132712
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27620}
2019-04-15 12:35:45 +00:00
Niels Möller
1f44bc1df2 Delete local convenience alias Buffer
Bug: webrtc:10524
Change-Id: I01d8e02b3b625288df7d41d08c36caeba08dd3aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132006
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27512}
2019-04-09 11:05:04 +00:00
Elad Alon
6c371ca700 Add OnLossNotification() to VideoEncoder and Vp8FrameBufferController
Bug: webrtc:10501
Change-Id: I33e8bfcf16cf24aadcfdf214d7d9bcd495bf9348
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131021
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27449}
2019-04-04 10:57:02 +00:00
Erik Språng
db6335efce Make sure screenshare_layers produce non-sync TL1 frames after keyframes
This fixes a regression introduces way back in August 2018:
https://webrtc-review.googlesource.com/c/src/+/91863/
For bonus points, also fixing an auxiliary test issue.

Bug: webrtc:10479, webrtc:10260
Change-Id: I4e99fe6e070446d10357d9d1a9d1ffc9dedcf419
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129926
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27409}
2019-04-02 09:16:30 +00:00
philipel
b19f27a5f9 Decode Target Information for VP8 libvpx encoder.
In this CL:
 - Created static helper function GenericFrameInfo::DecodeTargetInfo to
   convert DTI symbols to a list of GenericFrameInfo::OperatingPointIndication.
 - Added per frame DTI information for the different stream structures.

Bug: webrtc:10342
Change-Id: I62ff2e9fc9b380fe1d0447ff071e86b6b35ab249
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129923
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27350}
2019-03-28 18:18:43 +00:00
philipel
361855bac8 Rename OperatingPoint to DecodeTarget.
Bug: webrtc:10342
Change-Id: Ie82e23b2ccb921f3b6d86c3f8f2152264a9c26d5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130160
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27342}
2019-03-28 13:49:24 +00:00
Elad Alon
cde8ab265e Use single FrameBufferController in VP8, created by a factory.
This CL paves the way to making FrameBufferController injectable.

LibvpxVp8Encoder can manage multiple streams. Prior to this CL,
each stream had its own frame buffer controller, all of them held
in a vector by LibvpxVp8Encoder. This complicated the code and
produced some code duplication (cf. SetupTemporalLayers).

This CL:
1. Replaces CreateVp8TemporalLayers() by a factory. (Later CLs
   will make this factory injectable.)
2. Makes LibvpxVp8Encoder use a single controller. This single
   controller will, in the case of multiple streams, delegate
   its work to multiple controllers, but that fact is not visible
   to LibvpxVp8Encoder.

This CL also squashes CL #126046 (Send notifications of RTT and
PLR changes to Vp8FrameBufferController) into it.

Bug: webrtc:10382
Change-Id: Id9b55734bebb457acc276f34a7a9e52cc19c8eb9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126483
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27206}
2019-03-20 11:54:02 +00:00
philipel
9df335374a Generic Frame Descriptor (GFD) VP8 templates.
In this CL:
 - Updated Vp8TemporalLayers::OnEncodeDone to take a CodecSpecificInfo
   instead of a CodecSpecificInfoVP8, so that both the VP8 specific and
   generic information can be populated.
 - Added structs to represent the GFD template structure.
 - Added code to generate templates for video/screensharing.

Bug: webrtc:10342
Change-Id: I978f9d708597a6f86bbdc494e62acf7a7b400db3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/123422
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26987}
2019-03-06 11:03:09 +00:00
Sebastian Jansson
e64a688167 Replacing Clock in ScreenshareLayers.
there's no easy way to inject the Clock in ScreenshareLayers under
normal use. To allow faking the clock, rtc::TimeMillis is used instead.

Bug: webrtc:10365
Change-Id: I46c7f76514672190a0f0f5816a2c858bc6c76fa4
Reviewed-on: https://webrtc-review.googlesource.com/c/125189
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26946}
2019-03-04 10:49:01 +00:00
Elad Alon
819661a965 Pass explicit dependencies from ScreenshareLayers to GFD
This CL continues the work began by CL #119958, extending it
to ScreenshareLayers.

Bug: webrtc:10249
Change-Id: I59d0c062a93b288007977e00aa3a2e0929509e0c
Reviewed-on: https://webrtc-review.googlesource.com/c/120042
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26526}
2019-02-04 10:34:03 +00:00
Elad Alon
411b49be17 Break FrameConfig out of Vp8TemporalLayers
FrameConfig is not specific to temporal layers. Anything that
can control referenced/updated buffers could potentially use it.

Bug: webrtc:10259
Change-Id: I04ed177ee884693798c3b69e35fd4255ce1e9062
Reviewed-on: https://webrtc-review.googlesource.com/c/120355
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26448}
2019-01-29 14:13:55 +00:00
Erik Språng
4529fbcfab Move TemporalLayers to api/video_codecs.
Also renaming it Vp8TemporalLayers to show that it is codec specific.

Bug: webrtc:9012
Change-Id: I18187538b8142cdd7538f1a4ed1bada09d040f1f
Reviewed-on: https://webrtc-review.googlesource.com/c/104643
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25137}
2018-10-12 09:15:21 +00:00
Erik Språng
59021ba4e1 Refactoring of VP8 TemporalLayers interface.
This refactoring merged PopulateCodecSpecific and FrameEncoded into a
single callback method. It also removes the FrameConfig parameter and
instead relies on the temporal layer to remember it internally.

Bug: webrtc:9012
Change-Id: I489b76821b534398ad452643f1322f411d3455b1
Reviewed-on: https://webrtc-review.googlesource.com/95681
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24957}
2018-10-03 16:51:30 +00:00
Erik Språng
f141470d38 Store qp limits for ScreenshareLayers only once
Bug: webrtc:9745
Change-Id: Ie38b9d4991100657c1dc54660b39b80d86cc64fa
Reviewed-on: https://webrtc-review.googlesource.com/99940
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24716}
2018-09-13 08:53:10 +00:00
Erik Språng
fb2a66a58a libvpx vp8 encoder: get frame drop setting from temporal layer
Today, the internal frame dropper in libvpx vp8 encoder is enabled or
disabled based on video or screen content. This is then expected to
match up with screenshare vs default temporal layers implementation.

This cl makes libvpx query the temporal layers implementation as well,
breaking this implicit dependency and allows frames to be dropped if
default temporal layers is used with screen content.

Bug: webrtc:9734
Change-Id: If2523a211f4929f16e65a02fa7a6b4edf7328571
Reviewed-on: https://webrtc-review.googlesource.com/99062
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24645}
2018-09-10 11:10:11 +00:00
Erik Språng
506c569443 Don't drop keyframes even if TemporalLayers says so.
This CL is a minimum effort/low risk fix.
Later CLs take a more thorough approach.

Bug: webrtc:9634
Change-Id: I728a061a4e71b38a559ee438646de83cd2cb3517
Reviewed-on: https://webrtc-review.googlesource.com/94760
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24326}
2018-08-17 12:03:35 +00:00
Erik Språng
b75d6b8dc3 Refactor vp8 temporal layers with inferred sync and search order
This CL introduces a few changes to the default VP8 temporal layers:
* The pattern is now reset on keyframes
* The sync flag is inferred rather than hard-coded
* Support is added for buffer search order

Bug: webrtc:9012
Change-Id: Ice19d32413d20982368a01a7d2540d155e185ad4
Reviewed-on: https://webrtc-review.googlesource.com/91863
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24288}
2018-08-15 10:14:36 +00:00
Sergio Garcia Murillo
43800f95bf Generalize SimulcastEncoderAdapter, use for H264 & VP8.
* Move SimulcastEncoderAdapter out under modules/video_coding
* Move SimulcastRateAllocator back out to modules/video_coding/utility
* Move TemporalLayers and ScreenshareLayers to modules/video_coding/utility
* Move any VP8 specific code - such as temporal layer bitrate budgeting -
  under codec type dependent conditionals.
* Plumb the simulcast index for H264 in the codec specific and RTP format data structures.

TBR=sprang@webrtc.org,stefan@webrtc.org,titovartem@webrtc.org

Bug: webrtc:5840
Change-Id: I2d3b130622dd7ceec5528f3ab6c46f109e6bafb8
Reviewed-on: https://webrtc-review.googlesource.com/84743
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23715}
2018-06-21 15:57:43 +00:00
Mirko Bonadei
6f440ed5b5 Revert "Implement H264 simulcast support and generalize SimulcastEncoderAdapter use for H264 & VP8."
This reverts commit 07efe436c9.

Reason for revert: Breaks downstream project.

cricket::GetSimulcastConfig method signature has been updated.
I think you can get away with a default value for temporal_layers_supported (and then you can remove it after a few days when projects will be updated).


Original change's description:
> Implement H264 simulcast support and generalize SimulcastEncoderAdapter use for H264 & VP8.
> 
> * Move SimulcastEncoderAdapter out under modules/video_coding
> * Move SimulcastRateAllocator back out to modules/video_coding/utility
> * Move TemporalLayers and ScreenshareLayers to modules/video_coding/utility
> * Move any VP8 specific code - such as temporal layer bitrate budgeting -
>   under codec type dependent conditionals.
> * Plumb the simulcast index for H264 in the codec specific and RTP format data structures.
> 
> Bug: webrtc:5840
> Change-Id: Ieced8a00e38f273c1a6cfd0f5431a87d07b8f44e
> Reviewed-on: https://webrtc-review.googlesource.com/64100
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23705}

TBR=sprang@webrtc.org,stefan@webrtc.org,mflodman@webrtc.org,hta@webrtc.org,sergio.garcia.murillo@gmail.com,titovartem@webrtc.org,agouaillard@gmail.com

Change-Id: Ic9d3b1eeaf195bb5ec2063954421f5e77866d663
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:5840
Reviewed-on: https://webrtc-review.googlesource.com/84760
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23710}
2018-06-21 13:41:14 +00:00
Sergio Garcia Murillo
07efe436c9 Implement H264 simulcast support and generalize SimulcastEncoderAdapter use for H264 & VP8.
* Move SimulcastEncoderAdapter out under modules/video_coding
* Move SimulcastRateAllocator back out to modules/video_coding/utility
* Move TemporalLayers and ScreenshareLayers to modules/video_coding/utility
* Move any VP8 specific code - such as temporal layer bitrate budgeting -
  under codec type dependent conditionals.
* Plumb the simulcast index for H264 in the codec specific and RTP format data structures.

Bug: webrtc:5840
Change-Id: Ieced8a00e38f273c1a6cfd0f5431a87d07b8f44e
Reviewed-on: https://webrtc-review.googlesource.com/64100
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23705}
2018-06-21 12:23:03 +00:00
Yves Gerey
665174fdbb Reformat the WebRTC code base
Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
2018-06-19 14:00:39 +00:00
Erik Språng
e624d078bc Always update libvpx configuration if bitrate has changed.
OnRatesUpdated() is called every time the bitrate estimate, or once per
second. However, since we don't want to reconfigure libvpx too often,
just in case it interferes with the rate controller, so
ScreenshareLayers contains a boolean |bitrate_update_| which indicate
if the configuration should be updated on a call to
UpdateConfiguration().

However, it two rate updates happened between two frames, the first of
which changes the rates and second one does not, |bitrate_update_| will
be reset to false and the encoder won't get the desired config.

This CL makes sure we update the configuration iff the rate has changed
at any time since the last call to UpdateConfiguration().

Bug: webrtc:9012
Change-Id: I62af36cffe20ecb7d3f403b3eb11f23a9692d719
Reviewed-on: https://webrtc-review.googlesource.com/69040
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22826}
2018-04-11 15:27:56 +00:00
Niels Möller
150dcb0a9a Delete logic to set picture id and tl0 pic idx in encoders.
It would be nice to also delete the fields from CodecSpecificInfo,
but those fields are used on the receive side.

Bug: webrtc:8830
Change-Id: I1a3f13ea2c024cbd73b33fd9dd58e531d3576a55
Reviewed-on: https://webrtc-review.googlesource.com/64780
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22625}
2018-03-27 13:11:16 +00:00
Erik Språng
82fad3d513 Remove TemporalLayersFactory and associated classes
As the rate allocation has been moved into entirely into
SimulcastRateAllocator, and the listeners are thus no longer needed,
this class doesn't fill any other purpose than to determine if
ScreenshareLayers or TemporalLayers should be created for a given
simulcast stream. This can however be done just from looking at the
VideoCodec instance, so changing this into a static factory method.

Due to dependencies from upstream projects, keep the class name and
field in VideoCodec around for now.

Bug: webrtc:9012
Change-Id: I028fe6b2a19e0d16b35956cc2df01dcf5bfa7979
Reviewed-on: https://webrtc-review.googlesource.com/63264
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22529}
2018-03-21 10:20:48 +00:00
Erik Språng
bb60a3a5fa Refactor VP8 TemporalLayers
This CL moves all temporal layer rate allocation from
DefaultTemporalLayers and ScreenshareLayers into SimulcastRateAllocator.
This means we don't need an extra call-out to the TemporalLayers
interface to get the last allocation, which simplifies the code path a
lot.

It also paves the wave for removing the TemporalLayersFactory interface
(in a separate cl), which will further simplify the ownership model.

Bug: webrtc:9012
Change-Id: I6540b1848efa1a136dce449f13902ad479d5ee37
Reviewed-on: https://webrtc-review.googlesource.com/62420
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22502}
2018-03-19 18:14:21 +00:00
Anders Carlsson
beabdcb498 Break VP8 temporal_layers dependency on libvpx.
This is in preparation for
https://webrtc-review.googlesource.com/c/src/+/36340

With these changes we can avoid some strange #ifdefs in the code
that uses temporal layers.

Bug: webrtc:7925
Change-Id: I472210738ccc9f73812b8863951befeabec56f15
Reviewed-on: https://webrtc-review.googlesource.com/41280
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21759}
2018-01-25 10:37:21 +00:00
Erik Språng
db9e9d5486 Make screenshare_layers frame dropper less aggressive
Try to use frame timestamps first if they look reasonable, otherwise
use realtime clock.
Also, lower limit from 90% of target to 85%.

Bug: webrtc:4172, chromium:802290
Change-Id: Iad489be7c7cf637345be4795e5089936ab9fab07
Reviewed-on: https://webrtc-review.googlesource.com/41041
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21729}
2018-01-22 21:15:29 +00:00
Erik Språng
27a457d172 Smoother frame dropping when screenshare_layers limits fps
This is a reland of https://webrtc-review.googlesource.com/34380

The main problem with that CL was that we used frame timestamps as basis
for frame dropping, but those might not be continuous or even populated
in some circumstances.

Additionally, I found that the bitrate was off since the encoder does
not not take the dropped frames into account, so if we drop every other
frame continiusoly, the bitrate sent will be around half of the target.

Patch set 1 is the original CL, subsequent patch sets cotains fixes.

Bug: webrtc:4172
Change-Id: I8ec8dddcebf4ce44f28dd9055cf9c46bbd68e4a6
Reviewed-on: https://webrtc-review.googlesource.com/39201
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21601}
2018-01-12 14:40:40 +00:00
Erik Språng
afb3fc3558 Revert "Smoother frame dropping when screenshare_layers limits fps"
This reverts commit 28a06b16cc.

Reason for revert: Causes some unexpected perf changes.

Original change's description:
> Smoother frame dropping when screenshare_layers limits fps
> 
> Currently, when input fps is higher than the configured target fps in
> screenshare_layers, we drop frames with the help of a rate tracker using
> a one second sliding window. This is not optimal.
> For instance, given a 5fps limit and a 30fps capturer, the window will
> not be saturated until we have added the first 5 frames. Then we will
> drop all frames until the oldest one drops out, at which point we can
> immediately fill it's place. This results in quick 5 frame bursts every
> second.
> 
> In addition to rate tracker, also set a limit on minimum interval
> required between input frames, based on target frame rate.
> 
> Bug: webrtc:4172
> Change-Id: I49f0abf4d549673cc6b3fafe580b529ea3feaf57
> Reviewed-on: https://webrtc-review.googlesource.com/34380
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21325}

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

Change-Id: I7ca5b0c847310dbb11dce28773082eac946c0ba4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:4172
Reviewed-on: https://webrtc-review.googlesource.com/34780
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21354}
2017-12-19 11:21:11 +00:00
Erik Språng
28a06b16cc Smoother frame dropping when screenshare_layers limits fps
Currently, when input fps is higher than the configured target fps in
screenshare_layers, we drop frames with the help of a rate tracker using
a one second sliding window. This is not optimal.
For instance, given a 5fps limit and a 30fps capturer, the window will
not be saturated until we have added the first 5 frames. Then we will
drop all frames until the oldest one drops out, at which point we can
immediately fill it's place. This results in quick 5 frame bursts every
second.

In addition to rate tracker, also set a limit on minimum interval
required between input frames, based on target frame rate.

Bug: webrtc:4172
Change-Id: I49f0abf4d549673cc6b3fafe580b529ea3feaf57
Reviewed-on: https://webrtc-review.googlesource.com/34380
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21325}
2017-12-18 15:28:39 +00:00
Erik Språng
13044c1b53 Reduce time between sync frames for temporal layers vp8 screensharing.
This is expected to result in a slight loss of overall quality, but
should offset by quicker switching between temporal layers with flaky
connections.

Bug: webrtc:7694
Change-Id: Ib605802bb59f12773652324ac66cdf4774ae6bb6
Reviewed-on: https://webrtc-review.googlesource.com/6881
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20160}
2017-10-05 11:10:38 +00:00
Ilya Nikolaevskiy
586629155c Implement ScreenshareTemporalLayersChecker
Bug: none
Change-Id: Ic95156d0f47d186e2289264aa9a916511a8e4510
Reviewed-on: https://webrtc-review.googlesource.com/4960
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20143}
2017-10-04 14:18:04 +00:00
Ilya Nikolaevskiy
bf35298996 Implement temporal layers checkers for vp8
All frames are checked against hard-coded dependency graph 
using new helper class. It's invoked in RTC_DCHECK(). Only 
DefaultTemporalLayers are fully implemented in this CL, checker 
for ScreenshareLayers is not doing anything for now.

Bug: none
Change-Id: I3ec017176d8c25f7572c8f161e52f2ebfac8220f
Reviewed-on: https://webrtc-review.googlesource.com/3740
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20066}
2017-10-02 09:14:59 +00:00
Mirko Bonadei
92ea95e34a Fixing WebRTC after moving from src/webrtc to src/
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19846}
2017-09-15 05:02:56 +00:00