Commit graph

60 commits

Author SHA1 Message Date
Elad Alon
8f01c4e1b6 Define FecControllerOverride and plumb it down to VideoEncoder
The purpose of this interface is to allow VideoEncoder to override
the bandwidth allocation set by FecController in RtpVideoSender.

This CL defines the interface and sends it down to VideoSender.
Two upcoming CLs will:
1. Make LibvpxVp8Encoder pass it on to the (injectable)
   FrameBufferController, where it might be put to good use.
2. Modify RtpVideoSender to respond to the message sent to it
   via this API.

TBR=kwiberg@webrtc.org

Bug: webrtc:10769
Change-Id: I2ef82f0ddcde7fd078e32d8aabf6efe43e0f7f8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143962
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28416}
2019-06-28 15:57:22 +00:00
Johnny Lee
c53850675b Enable H.264 temporal scalability in simulcast.
Bug: webrtc:10651
Change-Id: I58372186930ce33e925f85edb0f308657dbfe273
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/142840
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28381}
2019-06-26 09:21:32 +00:00
Elad Alon
370f93a34a Reland "Inform VideoEncoder of negotiated capabilities"
This is a reland of 11dfff0878

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

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

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

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

Reason for revert: Downstream import failure.

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

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

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

Bug: webrtc:10720
Change-Id: Ib992af0272bbb16ae16ef7e69491f365702d179e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140884
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28224}
2019-06-11 11:32:13 +00:00
Ilya Nikolaevskiy
4fc0855a39 Cleanup video frame metadata copying
In several places VideoFrame::Builder is used to create a new VideoFrame
when intent is to change only one or two fields of a const VideoFrame&.

This approach is bad because each and every metadata field have to be
added to all the places.

Instead, this CL adds missing setters and refactors the code to use
full copy of a VideoFrame and update required fields only.

Along the way few actual bugs are fixed, e.g. when ColorSpace isn't copied
when frame rotation or buffer is cropped or converted.

Bug: webrtc:10460
Change-Id: I2895a473ca938b150eed2916c689060bdf58cb25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140102
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28170}
2019-06-05 15:05:57 +00:00
Erik Språng
16cb8f5d74 Reland "Replace usage of old SetRates/SetRateAllocation methods"
This is a reland of 7ac0d5f348

Original change's description:
> Replace usage of old SetRates/SetRateAllocation methods
>
> This rather large CL replaces all relevant usage of the old
> VideoEncoder::SetRates()/SetRateAllocation() methods in WebRTC.
> API is unchanged to allow downstream projects to update without
> breakage.
>
> Bug: webrtc:10481
> Change-Id: Iab8f292ce6be6c3f5056a239d26361962b14bb38
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131949
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27554}

TBR=brandtr@webrtc.org,sakal@webrtc.org,perkj@webrtc.org

Bug: webrtc:10481
Change-Id: I2978d5c527a18e885b7845c4e53a2424e8ad5b4b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132551
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27593}
2019-04-12 13:37:32 +00:00
Minyue Li
7ddef1af88 Revert "Replace usage of old SetRates/SetRateAllocation methods"
This reverts commit 7ac0d5f348.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Replace usage of old SetRates/SetRateAllocation methods
> 
> This rather large CL replaces all relevant usage of the old
> VideoEncoder::SetRates()/SetRateAllocation() methods in WebRTC.
> API is unchanged to allow downstream projects to update without
> breakage.
> 
> Bug: webrtc:10481
> Change-Id: Iab8f292ce6be6c3f5056a239d26361962b14bb38
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131949
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27554}

TBR=brandtr@webrtc.org,sakal@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,perkj@webrtc.org

Change-Id: I576760b584e3f258013b0279c0c173c895bbb37e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10481
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132561
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27559}
2019-04-11 10:50:29 +00:00
Erik Språng
7ac0d5f348 Replace usage of old SetRates/SetRateAllocation methods
This rather large CL replaces all relevant usage of the old
VideoEncoder::SetRates()/SetRateAllocation() methods in WebRTC.
API is unchanged to allow downstream projects to update without
breakage.

Bug: webrtc:10481
Change-Id: Iab8f292ce6be6c3f5056a239d26361962b14bb38
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131949
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27554}
2019-04-11 07:46:09 +00:00
Sebastian Jansson
b55015e4e1 Replacing SequencedTaskChecker with SequenceChecker.
Bug: webrtc:9883
Change-Id: I5e3189da2a46e6f4ed1a3c5a5dfd2f7d75a16b5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130961
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27518}
2019-04-09 12:28:04 +00:00
Niels Möller
8f7ce222e7 Make VideoFrameType an enum class, and move to separate file and target
Bug: webrtc:5876, webrtc:6883
Change-Id: I1435cfa9e8e54c4ba2978261048ff3fbb993ce0e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126225
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27239}
2019-03-22 12:44:51 +00:00
Niels Möller
87e2d785a0 Prepare for splitting FrameType into AudioFrameType and VideoFrameType
This cl deprecates the FrameType enum, and adds aliases AudioFrameType
and VideoFrameType.

After downstream usage is updated, the enums will be separated
and be moved out of common_types.h.

Bug: webrtc:6883
Change-Id: I2aaf660169da45f22574b4cbb16aea8522cc07a6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/123184
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27011}
2019-03-07 10:12:57 +00:00
Niels Möller
c8d2e73ed0 Delete CodecSpecificInfo argument from VideoEncoder::Encode
Bug: webrtc:10379
Change-Id: If9f92eb1e5891df284881082c53f0b1db1c26a38
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125900
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26992}
2019-03-06 14:01:31 +00:00
Ilya Nikolaevskiy
71aee3a116 Reland "Propagate VideoFrame::UpdateRect to encoder"
Reland with fixes for failing chromium tests.

Propagate VideoFrame::UpdateRect to encoder

Accumulate it in all places where frames can be dropped before they reach the encoder.

Reset UpdateRect in VideoBroadcaster if frame the previous frame is dropped.
No accumulation is done here since it's supposed to be a brief occasion then configuration have changed.

Original Reviewed-on: https://webrtc-review.googlesource.com/c/123102

Bug: webrtc:10310
Change-Id: I18be73f47f227d6392bf9cb220b549ced225714f
Reviewed-on: https://webrtc-review.googlesource.com/c/123230
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26738}
2019-02-18 13:44:14 +00:00
Mirko Bonadei
429b67db1f Revert "Propagate VideoFrame::UpdateRect to encoder"
This reverts commit efa72a1312.

Reason for revert: It seems to break come chromium.webrtc.fyi bots:

They are all release.

https://ci.chromium.org/p/chromium/builders/luci.chromium.webrtc.fyi/WebRTC%20Chromium%20FYI%20Linux%20Tester/2167
https://ci.chromium.org/p/chromium/builders/luci.chromium.webrtc.fyi/WebRTC%20Chromium%20FYI%20Mac%20Tester/1833
https://ci.chromium.org/p/chromium/builders/luci.chromium.webrtc.fyi/WebRTC%20Chromium%20FYI%20Win10%20Tester/1835

Original change's description:
> Propagate VideoFrame::UpdateRect to encoder
> 
> Accumulate it in all places where frames can be dropped before they reach
> the encoder.
> 
> Reset UpdateRect in VideoBroadcaster if frame the previous frame is dropped.
> No accumulation is done here since it's supposed to be a brief occusion then
> configuration have changed.
> 
> Bug: webrtc:10310
> Change-Id: I2813ecd009eb730bd99ffa0a02f979091b56bf80
> Reviewed-on: https://webrtc-review.googlesource.com/c/123102
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26711}

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

Change-Id: If34b5440393fffba6c37cd80c02e2b419b7ec601
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10310
Reviewed-on: https://webrtc-review.googlesource.com/c/123224
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26719}
2019-02-15 21:00:17 +00:00
Ilya Nikolaevskiy
efa72a1312 Propagate VideoFrame::UpdateRect to encoder
Accumulate it in all places where frames can be dropped before they reach
the encoder.

Reset UpdateRect in VideoBroadcaster if frame the previous frame is dropped.
No accumulation is done here since it's supposed to be a brief occusion then
configuration have changed.

Bug: webrtc:10310
Change-Id: I2813ecd009eb730bd99ffa0a02f979091b56bf80
Reviewed-on: https://webrtc-review.googlesource.com/c/123102
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26711}
2019-02-15 15:42:34 +00:00
Erik Språng
7f24fb9c1e Add settings to turn off VP8 base layer qp limit
This quality boost means that we sometimes drop a _lot_ of frames in the
base layer. It also interacts poorly with the bitrate adjuster since
even if frames are dropped they are often over-sized.

The setting still leaves the current behavior as default, but can be
changed using the WebRTC-VideoRateControl field trial.

Bug: webrtc:10155
Change-Id: I1a92ec69bab61b5148fe9d8bc391ac5ee1019367
Reviewed-on: https://webrtc-review.googlesource.com/c/122840
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26659}
2019-02-13 11:54:19 +00:00
Mirko Bonadei
d970807e0c Remove rtc_base/scoped_ref_ptr.h.
The type rtc::scoped_refptr<T> is now part of api/. Please include it from
api/scoped_refptr.h.

More info: See: https://groups.google.com/forum/#!topic/discuss-webrtc/Mme2MSz4z4o.

Bug: webrtc:9887, webrtc:8205
No-Try: True
Change-Id: Ic6c7c81e226e59f12f7933e472f573ae097b55bf
Reviewed-on: https://webrtc-review.googlesource.com/c/119041
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26414}
2019-01-25 20:29:58 +00:00
Florent Castelli
1b761ca21a Remove simulcast constraints in SimulcastEncoderAdapter
The lowest and highest resolution layers are also identified instead
of assuming they are the first and last ones.

Bug: webrtc:10069
Change-Id: If9c76d647415c5065b79dc71850709db6bf16f61
Reviewed-on: https://webrtc-review.googlesource.com/c/114429
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26343}
2019-01-21 16:02:59 +00:00
Erik Språng
dbdd8395f7 Add ability for VideoEncoder to signal frame rate allocation.
This CL add new data to the VideoEncoder::EncoderInfo struct, indicating
how the encoder intends to allocate frames across spatial and temporal
layers.

This metadata will be used in upcoming CLs to control how the encoder's
rate controller performs.

Bug: webrtc:10155
Change-Id: Id56fae04bae5f230d1a985171097d7ca83a3be8a
Reviewed-on: https://webrtc-review.googlesource.com/c/117900
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26300}
2019-01-17 15:40:53 +00:00
Erik Språng
f93eda1705 Move some video codec constants to separate file.
kMaxSimulcastStreams, kMaxSpatialLayers and kMaxTemporalStreams don't
really beling on VideoBitrateAllocation.
common_types.h is going away and it feels dubious to requrie include
of the full VideoEncoder api to use them. Therefore moving them into a
seprate file/target.

Also includes some remaining cleanup of includes.

Bug: webrtc:9271
Change-Id: I7ded3d97a9a835ac756159700774445a2b93a697
Reviewed-on: https://webrtc-review.googlesource.com/c/117305
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26299}
2019-01-17 15:29:53 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Artem Titov
1ebfb6aac7 Introduce VideoFrame::id to keep track of frames inside application.
Also switch webrtc code from deprecated constructors to the builder API.

Change-Id: Ie325bf1e9b4ff1e413fef3431ced8ed9ff725107
Bug: webrtc:10138
Reviewed-on: https://webrtc-review.googlesource.com/c/114422
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26132}
2019-01-04 08:59:26 +00:00
Mirta Dvornicic
897a991618 Add metadata from VideoEncoderFactory::CodecInfo to VideoEncoder::EncoderInfo
This is the first step in moving the metadata and eventually replacing
VideoEncoderFactory::QueryVideoEncoder with VideoEncoder::GetEncoderInfo.

Bug: webrtc:10065
Change-Id: If925b895718e1b1225d2cf49bede1adb3ff281b8
Reviewed-on: https://webrtc-review.googlesource.com/c/112285
Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25856}
2018-11-30 12:58:53 +00:00
Yves Gerey
3e70781361 [Cleanup] Add missing #include. Remove useless ones. IWYU part 2.
This is a follow-up to
https://webrtc-review.googlesource.com/c/src/+/106280.
This time the whole code base is covered.
Some files may have not been fixed though, whenever the IWYU tool
was breaking the build.

Bug: webrtc:8311
Change-Id: I2c31f552a87e887d33931d46e87b6208b1e483ef
Reviewed-on: https://webrtc-review.googlesource.com/c/111965
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25830}
2018-11-28 18:25:07 +00:00
Erik Språng
d3438aa1ed Add ability to specify if rate controller of video encoder is trusted.
If rate controller is trusted, we disable the frame dropper in the
media optimization module.

This is a re-land of
https://webrtc-review.googlesource.com/c/src/+/105020

Bug: webrtc:9890
Change-Id: I418e47a43a1a98cb2fd5295c03360b954f2288f2
Reviewed-on: https://webrtc-review.googlesource.com/c/109141
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25570}
2018-11-08 16:41:12 +00:00
Erik Språng
75de46a966 Update SimulcastEncoderAdapter merging of EncoderInfo
Determining the EncoderInfo meta data is now done during InitEncode().

This implementation assums that no dynamic wrappers are wrapped in this
simulcast encoder adapter. Ie, if supports_native_handle changes,
InitEncode() must be called again for it to be reported properly.

Bug: webrtc:9722
Change-Id: I7901effe11e89ac011659a4ea862ab2a42577eb5
Reviewed-on: https://webrtc-review.googlesource.com/c/109620
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25549}
2018-11-07 15:22:38 +00:00
philipel
ee49f7087f Remove VideoEncoder::SetChannelParameters.
The SetChannelParameters function was used when WebRTC supported decoding
with errors, which we no longer do.

This cleanup CL is related to the work tracked by 9946.

Bug: webrtc:9946
Change-Id: Id2d5ed23031388f890c42651bfbe5f79eda701e5
Reviewed-on: https://webrtc-review.googlesource.com/c/108861
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25505}
2018-11-05 17:37:07 +00:00
Erik Språng
9b5b070817 Use EncoderInfo in SimulcastEncoderAdapter
Remove use of deprecated methods.

Bug: webrtc:9890
Change-Id: I96cce2fc94cb4c4ac07ffc882f5d2b84e279e3b6
Reviewed-on: https://webrtc-review.googlesource.com/c/108123
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25474}
2018-11-01 16:05:57 +00:00
Erik Språng
e2fd86a79c Move encoder metadata into EncoderInfo struct.
This deprecates the following methods in VideoEncoder:
  virtual ScalingSettings GetScalingSettings() const;
  virtual bool SupportsNativeHandle() const;
  virtual const char* ImplementationName() const;

Though they are not marked RTC_DEPRECATED since we still want to call
them from within the default GetEncoderInfo() until downstream
projects have been updated.

Furthmore, implementation name is changed from const char* to
std:string, which prevents some lifetime issues with dynamic encoder
names, and CodecSpecificInfo.codec_name is removed in favor of getting
the implementation name via GetEncoderInfo().

This CL removes calls to these deprecated methods, follow-ups will also
remove implementations of the methods and replace them with new
GetEncoderInfo() substitutions.

Bug: webrtc:9890
Change-Id: I6fd6e531480c0b952f53dbd5105e0b0adc3e3b0c
Reviewed-on: https://webrtc-review.googlesource.com/c/106905
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25351}
2018-10-25 08:51:53 +00:00
Jonathan Yu
9a5da497b5 Split out a separate target for SimulcastEncoderAdapter
This will allow downstream projects to use it to construct their own
injected codecs without pulling in dependencies on the software codecs.

Bug: webrtc:7925
Change-Id: If8628fedd18e57a51a8b6e5baf4f63a686bf52e8
Reviewed-on: https://webrtc-review.googlesource.com/c/107027
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Jonathan Yu <yujo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#25297}
2018-10-22 22:36:59 +00:00
Oleh Prypin
a1d9ca47f9 Revert "Add ability to specify if rate controller of video encoder is trusted."
This reverts commit 3e335d1423.

Reason for revert: breaks downstream project

Original change's description:
> Add ability to specify if rate controller of video encoder is trusted.
>
> If rate controller is trusted, we disable the frame dropper in the
> media optimization module.
>
> Bug: webrtc:9722
> Change-Id: I821f21fd74a400ee9d5aa3f6b42d4e569033acbe
> Reviewed-on: https://webrtc-review.googlesource.com/c/105020
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25107}

TBR=brandtr@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,perkj@webrtc.org

Change-Id: Ifdb0aae684894854a184ec1e7423a7c62e7ba237
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9722
Reviewed-on: https://webrtc-review.googlesource.com/c/105360
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25117}
2018-10-11 15:37:40 +00:00
Erik Språng
3e335d1423 Add ability to specify if rate controller of video encoder is trusted.
If rate controller is trusted, we disable the frame dropper in the
media optimization module.

Bug: webrtc:9722
Change-Id: I821f21fd74a400ee9d5aa3f6b42d4e569033acbe
Reviewed-on: https://webrtc-review.googlesource.com/c/105020
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25107}
2018-10-11 09:07:34 +00:00
Erik Språng
7d687b13ed SimulcastEncoderAdapter, don't start streams without enough bitrate
Currently a bug in InitEncode() sets all stream initially to active.
This CL actually bases the active-flag on available start bitrate.

Bug: webrtc:9747
Change-Id: If197b0c69376d96c717f2a391fba8108895018f3
Reviewed-on: https://webrtc-review.googlesource.com/99960
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24711}
2018-09-12 16:34:45 +00:00
Niels Möller
d3b8c63b58 Reland "Add spatial index to EncodedImage."
This is a reland of da0898dfae

Original change's description:
> Add spatial index to EncodedImage.
>
> Replaces the VP8 simulcast index and VP9 spatial index formely part of
> CodecSpecificInfo.
>
> Bug: webrtc:9378
> Change-Id: I80eafd63fbdee0a25864338196a690628b4bd3d2
> Reviewed-on: https://webrtc-review.googlesource.com/83161
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24485}

Tbr: magjed@webrtc.org
Bug: webrtc:9378
Change-Id: Iff20b656581ef63317e073833d1a326f7118fdfd
Reviewed-on: https://webrtc-review.googlesource.com/96780
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24507}
2018-08-31 07:35:52 +00:00
Niels Moller
5a998d7246 Revert "Add spatial index to EncodedImage."
This reverts commit da0898dfae.

Reason for revert: Broke downstream tests.

Original change's description:
> Add spatial index to EncodedImage.
> 
> Replaces the VP8 simulcast index and VP9 spatial index formely part of
> CodecSpecificInfo.
> 
> Bug: webrtc:9378
> Change-Id: I80eafd63fbdee0a25864338196a690628b4bd3d2
> Reviewed-on: https://webrtc-review.googlesource.com/83161
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24485}

TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,philipel@webrtc.org,srte@webrtc.org

Change-Id: Idb4fb9d72e5574d7353c631cb404a1311f3fd148
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9378
Reviewed-on: https://webrtc-review.googlesource.com/96664
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24486}
2018-08-29 14:36:05 +00:00
Niels Möller
da0898dfae Add spatial index to EncodedImage.
Replaces the VP8 simulcast index and VP9 spatial index formely part of
CodecSpecificInfo.

Bug: webrtc:9378
Change-Id: I80eafd63fbdee0a25864338196a690628b4bd3d2
Reviewed-on: https://webrtc-review.googlesource.com/83161
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24485}
2018-08-29 13:50:17 +00:00
Ilya Nikolaevskiy
c30a13147c Add experiment for boosted qp at lowest stream for screenshare
Bug: webrtc:9659
Change-Id: I2320afc393d6a78ae03a4f447f0e3333dd5748c4
Reviewed-on: https://webrtc-review.googlesource.com/95943
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24441}
2018-08-27 10:04:50 +00:00
Erik Språng
8d2995b865 SimulcastEncoderAdapter should not update maxQp for screencast
Bug: webrtc:9608
Change-Id: I70f10c77df6579a24678842a9d9e7a2a528b0c40
Reviewed-on: https://webrtc-review.googlesource.com/93287
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24241}
2018-08-09 10:21:14 +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
Niels Möller
e3cf3d0496 Use enum class for VideoCodecMode and VideoCodecComplexity.
Bug: webrtc:7660
Change-Id: I6a8ef01f8abcc25c8efaf0af387408343a7c8ba3
Reviewed-on: https://webrtc-review.googlesource.com/81240
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23595}
2018-06-13 12:26:09 +00:00
Ilya Nikolaevskiy
97b4ee5b4c Wire up VAAPI VP8 experimental support in WebRTC.
Experiment flag added to PeerConnectionInterface::RtcConfiguration and
propagated down to VideoStreamEncoder.

Artificial Sdp parameter is added to the sdp format if the flag is set.

Additionally, sdp format is propagated in vp8 simulcast adapters.

Bug: chromium:794608
Change-Id: I2dec54d19ae7bfbd5f2777ec682da5a84194da94
Reviewed-on: https://webrtc-review.googlesource.com/78500
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23412}
2018-05-28 12:30:19 +00:00
Erik Språng
7fd0a28bdf Directly include VideoBitrateAllocation in media/ targets
Bug: webrtc:9271
Change-Id: I11a79c350a9de6edee203c9711ca97e266049f32
Reviewed-on: https://webrtc-review.googlesource.com/76943
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23368}
2018-05-23 13:56:40 +00:00
Erik Språng
566124a6df Move BitrateAllocation to api/ and rename it VideoBitrateAllocation
Since the webrtc_common build target does not have visibility set, we
cannot easily use BitrateAllocation in other parts of Chromium.
This is currently blocking parts of chromium:794608, and I know of other
usage outside webrtc already, so moving it to api/ should be warranted.

Also, since there's some naming confusion and this class is video
specific rename it VideoBitrateAllocation. This also fits with the
standard interface for producing these: VideoBitrateAllocator.

Bug: chromium:794608
Change-Id: I4c0fae40f9365e860c605a76a4f67ecc9b9cf9fe
Reviewed-on: https://webrtc-review.googlesource.com/70783
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22986}
2018-04-23 15:31:27 +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
cc681ccf6b Split vp8_impl into webm_vp8_encoder and webm_vp8_decoder
This work is in preparation for refactoring the TemporalLayers api.

Bug: webrtc:9012
Change-Id: I01908ee034fb79996e687ff72d10178acf102321
Reviewed-on: https://webrtc-review.googlesource.com/61781
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22445}
2018-03-15 11:57:07 +00:00
Niels Möller
225c787c6e Move default thresholds from QualityScaler to encoders.
Overriding implementations of VideoEncoder::GetScalingSettings that
want to enable quality scaling must now provide the thresholds.

Bug: webrtc:8830
Change-Id: I75c47cb56ac1b9cf77401684980b3167e485f51c
Reviewed-on: https://webrtc-review.googlesource.com/46622
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22172}
2018-02-23 13:12:36 +00:00