Commit graph

279 commits

Author SHA1 Message Date
Sebastian Jansson
572c60f44d Injecting Clock into video senders.
Bug: webrtc:10365
Change-Id: I1dc42345a95929970d4f390e04eff56ca0c6d60b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125190
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26959}
2019-03-04 21:55:02 +00:00
Sebastian Jansson
74682c1191 Inject TaskQueueFactory to video streams.
Bug: webrtc:10365
Change-Id: Ib655d8eac4467926bcb86cf2cb3728eabf5342d8
Reviewed-on: https://webrtc-review.googlesource.com/c/125089
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26921}
2019-03-01 11:35:39 +00:00
Erik Språng
b7cb7b5e94 Remove VCMEncoderDataBase and put remaining code into VideoStreamEncoder
This is a reland of
https://webrtc-review.googlesource.com/c/src/+/123920
Patch set 1 is identical to the previous CL, additional patch sets fix
the bug that was introduced and adds test coverage.

Since this "data base" only holds a single encoder instance it just
serves to confuse object ownership. Removing it and giving ownership
of generic encoder instance to VideoStreamEncoder.

This CL also removes VideoSender interface from video_coding_impl.h,
which is mostly a leftover from
https://webrtc-review.googlesource.com/c/src/+/123540

Bug: webrtc:10164
Change-Id: Ieaf23457d69af0d6356b70461112892b14760b19
Reviewed-on: https://webrtc-review.googlesource.com/c/124488
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26857}
2019-02-26 16:19:54 +00:00
Sami Kalliomäki
5cbc528c03 Revert "Remove VCMEncoderDataBase and put remaining code into VideoStreamEncoder"
This reverts commit 715c4765b1.

Reason for revert: Breaks WebRTC roll to Chromium.
https://chromium-review.googlesource.com/c/chromium/src/+/1484629

# Fatal error in: ../../third_party/webrtc/modules/rtp_rtcp/source/rtp_sender.cc, line 796
# last system error: 0
# Check failed: diff_ms >= static_cast<int64_t>(0) (-307 vs. 0)
#

Original change's description:
> Remove VCMEncoderDataBase and put remaining code into VideoStreamEncoder
>
> Since this "data base" only holds a single encoder instance it just
> serves to confuse object ownership. Removing it and giving ownership
> of generic encoder instance to VideoStreamEncoder.
>
> This CL also removes VideoSender interface from video_coding_impl.h,
> which is mostly a leftover from
> https://webrtc-review.googlesource.com/c/src/+/123540
>
> Bug: webrtc:10164
> Change-Id: I9b7fec940dbcbccf3aa1278c2555da3bd5169ae1
> Reviewed-on: https://webrtc-review.googlesource.com/c/123920
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26835}

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

Change-Id: I5432878c4c2e497cd848c4ce1b190e0307df03ca
Bug: webrtc:10164
Reviewed-on: https://webrtc-review.googlesource.com/c/124402
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26841}
2019-02-25 16:31:15 +00:00
Erik Språng
715c4765b1 Remove VCMEncoderDataBase and put remaining code into VideoStreamEncoder
Since this "data base" only holds a single encoder instance it just
serves to confuse object ownership. Removing it and giving ownership
of generic encoder instance to VideoStreamEncoder.

This CL also removes VideoSender interface from video_coding_impl.h,
which is mostly a leftover from
https://webrtc-review.googlesource.com/c/src/+/123540

Bug: webrtc:10164
Change-Id: I9b7fec940dbcbccf3aa1278c2555da3bd5169ae1
Reviewed-on: https://webrtc-review.googlesource.com/c/123920
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26835}
2019-02-25 11:03:51 +00:00
Erik Språng
d7329ca570 Remove VideoSender and fold code into VideoStreamEncoder
This CL moves the functionality in VideoSender into VideoStreamEncoder
and simplifies the code where possible, given what we know of the
encoder state and that we now run on the encoder queue.

The intent here is to make it easier to remove the next parts, the
encoder database and generic encoder wrapper.

Bug: webrtc:10164
Change-Id: I8c108ccbe5db97cd9fd1e84228134709af845ea3
Reviewed-on: https://webrtc-review.googlesource.com/c/123540
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@{#26813}
2019-02-22 10:29:46 +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
a8d48ab87b Fix incorrect FPS measure when frame dropper kicks in
Bug: webrtc:10302
Change-Id: I4f8df7d41d8750e0810c2300fcd90b3eff7fb56d
Reviewed-on: https://webrtc-review.googlesource.com/c/121954
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26610}
2019-02-08 13:50:10 +00:00
Erik Språng
7ca375c8ca Implement encoder overshoot detector and rate adjuster.
The overshoot detector uses a simple pacer model to determine an
estimate of how much the encoder is overusing the target bitrate.
This utilization factor can then be adjuster for when configuring the
actual target bitrate.

Spatial layers (simulcast streams) are adjusted separately.
Temporal layers are measured separately, but are combined into a single
utilization factor per spatial layer.

Bug: webrtc:10155
Change-Id: I8ea58dc6c4871e880553d7c22202f11cb2feb216
Reviewed-on: https://webrtc-review.googlesource.com/c/114886
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26573}
2019-02-06 15:54:11 +00:00
Rasmus Brandt
c402dbe2b0 Account for simulcast hysteresis in padding rate calculation.
Bug: webrtc:10271
Change-Id: If0b0eb7d94fb1c892880ff4745f34c43fcdeee54
Reviewed-on: https://webrtc-review.googlesource.com/c/120661
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26527}
2019-02-04 10:49:04 +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
Mirta Dvornicic
ccc1b57e32 Poll is_hardware_accelerated from VideoEncoder instead of VideoEncoderFactory.
Currently, CPU overuse settings for HW encoders are sometimes being used
even though the actual encoder is a SW encoder, e.g. in case of SW fallback
when the encoder is initialized. Polling is_hardware_accelerated after the
encoder has been created and initialized will improve choosing the correct
CPU overuse settings.

Bug: webrtc:10065
Change-Id: Ic6bd67630a040b5a121c13fa63dd074006973929
Reviewed-on: https://webrtc-review.googlesource.com/c/116688
Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26266}
2019-01-15 14:12:12 +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
Niels Möller
6bb5ab9740 Reland "Refactor and remove media_optimization::MediaOptimization."
This reverts commit 6613f8e98a.

Reason for revert: This change seemed innocent after all, so undoing speculative revert.

Original change's description:
> Revert "Refactor and remove media_optimization::MediaOptimization."
> 
> This reverts commit 07276e4f89.
> 
> Reason for revert: Speculative revert due to downstream crashes.
> 
> Original change's description:
> > Refactor and remove media_optimization::MediaOptimization.
> > 
> > This CL removes MediaOptmization and folds some of its functionality
> > into VideoStreamEncoder.
> > 
> > The FPS tracking is now handled by a RateStatistics instance. Frame
> > dropping is still handled by FrameDropper. Both of these now live
> > directly in VideoStreamEncoder.
> > There is no intended change in behavior from this CL, but due to a new
> > way of measuring frame rate, some minor perf changes can be expected.
> > 
> > A small change in behavior is that OnBitrateUpdated is now called
> > directly rather than on the next frame. Since both encoding frame and
> > setting rate allocations happen on the encoder worker thread, there's
> > really no reason to cache bitrates and wait until the next frame.
> > An edge case though is that if a new bitrate is set before the first
> > frame, we must remember that bitrate and then apply it after the video
> > bitrate allocator has been first created.
> > 
> > In addition to existing unit tests, manual tests have been used to
> > confirm that frame dropping works as expected with misbehaving encoders.
> > 
> > Bug: webrtc:10164
> > Change-Id: I7ee9c8d3c4f2bcf23c8c420310b05a4d35d94744
> > Reviewed-on: https://webrtc-review.googlesource.com/c/115620
> > Commit-Queue: Erik Språng <sprang@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#26147}
> 
> TBR=nisse@webrtc.org,sprang@webrtc.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: webrtc:10164
> Change-Id: Ie0dae19dd012bc09e793c9661a45823fd760c20c
> Reviewed-on: https://webrtc-review.googlesource.com/c/116780
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26191}

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

Change-Id: Ieda1fad301de002460bb0bf5a75267ea065176a8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10164
Reviewed-on: https://webrtc-review.googlesource.com/c/116960
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26213}
2019-01-11 10:46:33 +00:00
Niels Möller
6613f8e98a Revert "Refactor and remove media_optimization::MediaOptimization."
This reverts commit 07276e4f89.

Reason for revert: Speculative revert due to downstream crashes.

Original change's description:
> Refactor and remove media_optimization::MediaOptimization.
> 
> This CL removes MediaOptmization and folds some of its functionality
> into VideoStreamEncoder.
> 
> The FPS tracking is now handled by a RateStatistics instance. Frame
> dropping is still handled by FrameDropper. Both of these now live
> directly in VideoStreamEncoder.
> There is no intended change in behavior from this CL, but due to a new
> way of measuring frame rate, some minor perf changes can be expected.
> 
> A small change in behavior is that OnBitrateUpdated is now called
> directly rather than on the next frame. Since both encoding frame and
> setting rate allocations happen on the encoder worker thread, there's
> really no reason to cache bitrates and wait until the next frame.
> An edge case though is that if a new bitrate is set before the first
> frame, we must remember that bitrate and then apply it after the video
> bitrate allocator has been first created.
> 
> In addition to existing unit tests, manual tests have been used to
> confirm that frame dropping works as expected with misbehaving encoders.
> 
> Bug: webrtc:10164
> Change-Id: I7ee9c8d3c4f2bcf23c8c420310b05a4d35d94744
> Reviewed-on: https://webrtc-review.googlesource.com/c/115620
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26147}

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

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

Bug: webrtc:10164
Change-Id: Ie0dae19dd012bc09e793c9661a45823fd760c20c
Reviewed-on: https://webrtc-review.googlesource.com/c/116780
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26191}
2019-01-10 11:39:24 +00:00
Erik Språng
07276e4f89 Refactor and remove media_optimization::MediaOptimization.
This CL removes MediaOptmization and folds some of its functionality
into VideoStreamEncoder.

The FPS tracking is now handled by a RateStatistics instance. Frame
dropping is still handled by FrameDropper. Both of these now live
directly in VideoStreamEncoder.
There is no intended change in behavior from this CL, but due to a new
way of measuring frame rate, some minor perf changes can be expected.

A small change in behavior is that OnBitrateUpdated is now called
directly rather than on the next frame. Since both encoding frame and
setting rate allocations happen on the encoder worker thread, there's
really no reason to cache bitrates and wait until the next frame.
An edge case though is that if a new bitrate is set before the first
frame, we must remember that bitrate and then apply it after the video
bitrate allocator has been first created.

In addition to existing unit tests, manual tests have been used to
confirm that frame dropping works as expected with misbehaving encoders.

Bug: webrtc:10164
Change-Id: I7ee9c8d3c4f2bcf23c8c420310b05a4d35d94744
Reviewed-on: https://webrtc-review.googlesource.com/c/115620
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26147}
2019-01-07 14:58:23 +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
Niels Möller
412d185b4a Delete pre_encode_callback from VideoSendStream::Config
Bug: webrtc:9864
Change-Id: I7f0c897345c99765ea9de77bc70b43ba0e4af19b
Reviewed-on: https://webrtc-review.googlesource.com/c/115320
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26110}
2019-01-02 09:14:32 +00:00
Mirta Dvornicic
1ec2a16121 Revert "Replace VideoEncoderFactory::QueryVideoEncoder with VideoEncoder::GetEncoderInfo"
This reverts commit cdc5eb0de1.

Reason for revert: Causes wrong CPU adaptation to be used for some HW codecs since GetEncoderInfo() is polled before InitEncode().

Original change's description:
> Replace VideoEncoderFactory::QueryVideoEncoder with VideoEncoder::GetEncoderInfo
> 
> Make implementation of VideoEncoderFactory::QueryVideoEncoder optional
> until it is removed downstream and remove all implementations of it.
> 
> Bug: webrtc:10065
> Change-Id: Ibb1f9612234e536651ce53f05ee048a5d172a41f
> Reviewed-on: https://webrtc-review.googlesource.com/c/113065
> Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25924}

TBR=brandtr@webrtc.org,sakal@webrtc.org,kthelgason@webrtc.org,sprang@webrtc.org,srte@webrtc.org,perkj@webrtc.org,mirtad@webrtc.org

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

Bug: webrtc:10065
Change-Id: Idaa452e1d8c1c58cdb4ec69b88fce9042589cc3c
Reviewed-on: https://webrtc-review.googlesource.com/c/113800
Reviewed-by: Mirta Dvornicic <mirtad@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25943}
2018-12-10 10:36:00 +00:00
Mirta Dvornicic
cdc5eb0de1 Replace VideoEncoderFactory::QueryVideoEncoder with VideoEncoder::GetEncoderInfo
Make implementation of VideoEncoderFactory::QueryVideoEncoder optional
until it is removed downstream and remove all implementations of it.

Bug: webrtc:10065
Change-Id: Ibb1f9612234e536651ce53f05ee048a5d172a41f
Reviewed-on: https://webrtc-review.googlesource.com/c/113065
Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25924}
2018-12-06 15:24:45 +00:00
Jiawei Ou
c2ebe21ba9 Reland "Use the factory instead of using the builtin code path in VideoCodecInitializer"
Compared the original CL: https://webrtc-review.googlesource.com/c/src/+/94782

This new CL added backward compatible functions to WebRtcMediaEngineFactory so that internal projects will not be broken.

Because of that, now we can revert all the changes to SDK and PeerConnection and do it in following CLs. This makes this CL cleaner.

One temporary disadvantage of this is the media engine now need to take a dependency onto builtin video bitrate factory, but practically it just moved code around and should not result in a large binary size change. We can remove this dependency later if needed.

Bug: webrtc:9513
Change-Id: I38708762ff365e4ca05974b99fac71edc739a756
Reviewed-on: https://webrtc-review.googlesource.com/c/109040
Commit-Queue: Jiawei Ou <ouj@fb.com>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25574}
2018-11-08 19:10:47 +00:00
Niels Möller
c572ff3c71 Add default constructor for rtc::Event
Bug: webrtc:9962
Change-Id: Icaa91e657e6881fcb1553f354c07866109a0ea68
Reviewed-on: https://webrtc-review.googlesource.com/c/109500
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25535}
2018-11-07 08:57:50 +00:00
Erik Språng
aed3070ad4 Replace GetScalingSettings() with GetEnocderInfo() in TestEncoder
Bug: webrtc:9890
Change-Id: I00c0d95739fe1e90df464a6a7402410ee070f840
Reviewed-on: https://webrtc-review.googlesource.com/c/109028
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25500}
2018-11-05 13:58:14 +00:00
Qingsi Wang
59844ce57e Revert "Use the factory instead of using the builtin code path in VideoCodecInitializer."
This reverts commit be142178aa.

Reason for revert: breaking internal projects

Original change's description:
> Use the factory instead of using the builtin code path in `VideoCodecInitializer`.
> 
> Bug: webrtc:9513
> Change-Id: Ia299ae1044a3ff4c91e208200938cba540bdcea6
> Reviewed-on: https://webrtc-review.googlesource.com/c/94782
> Commit-Queue: Jiawei Ou <ouj@fb.com>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Anders Carlsson <andersc@webrtc.org>
> Reviewed-by: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: 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@{#25456}

TBR=brandtr@webrtc.org,magjed@webrtc.org,sakal@webrtc.org,nisse@webrtc.org,andersc@webrtc.org,tommi@webrtc.org,kthelgason@webrtc.org,sprang@webrtc.org,srte@webrtc.org,perkj@webrtc.org,tkchin@webrtc.org,shampson@webrtc.org,glaznev@webrtc.org,ouj@fb.com,qingsi@webrtc.org

Change-Id: I8040ccabe3ae6464d72c7696adb663c1dd275b63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9513
Reviewed-on: https://webrtc-review.googlesource.com/c/108980
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25459}
2018-11-01 04:46:02 +00:00
Jiawei Ou
be142178aa Use the factory instead of using the builtin code path in VideoCodecInitializer.
Bug: webrtc:9513
Change-Id: Ia299ae1044a3ff4c91e208200938cba540bdcea6
Reviewed-on: https://webrtc-review.googlesource.com/c/94782
Commit-Queue: Jiawei Ou <ouj@fb.com>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: 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@{#25456}
2018-10-31 22:47:02 +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
8abd56cfdf Split TemporalLayers and TemporalLayers checker, clean up header.
This CL is a step towards making the TemporalLayers landable in api/ :
* It splits TemporalLayers from TemporalLayersChecker
* It initially renames temporal_layer.h to vp8_temporal_layers.h and
  moved it into the include/ folder
* It removes the dependency on VideoCodec, which was essentially only
  used to determine if screenshare_layers or default_temporal_layers
  should be used, and the number of temporal temporal layers to use.

Subsequent CLs will make further cleanup before attempting a move to api

Bug: webrtc:9012
Change-Id: I87ea7aac66d39284eaebd86aa9d015aba2eaaaea
Reviewed-on: https://webrtc-review.googlesource.com/94156
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24920}
2018-10-02 07:52:02 +00:00
Niels Möller
cbcbc22568 Reland "Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config."
This is a reland of 529d0d9795

Original change's description:
> Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config.
> 
> Preparation for deleting EnableFrameRecordning, and also a step
> towards landing of the new VideoStreamDecoder.
> 
> Bug: webrtc:9106
> Change-Id: I50964ee458b08a702ec69b82a62e4995c57cee82
> Reviewed-on: https://webrtc-review.googlesource.com/97660
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Anders Carlsson <andersc@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24861}

Bug: webrtc:9106
Change-Id: I2eb894773b3f33ff6a980e8008e8248607e32668
Reviewed-on: https://webrtc-review.googlesource.com/102480
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24882}
2018-09-28 08:48:02 +00:00
Mirko Bonadei
17f4878419 Remove deprecated field_trial_default and metrics_default.
This CL removes some deprecated build targets (and their headers)
from system_wrappers:
- field_trial_api
- field_trial_default
- metrics_api
- metrics_default

It also refreshes all the dependencies on field_trial.h and metrics.h.

A nice side effect is that it is finally possible to remove 'nogncheck'
from the following files (when it was used with field_trial_default
and metrics_default):
- sdk/objc/api/peerconnection/RTCMetricsSampleInfo+Private.h
- sdk/android/src/jni/pc/peerconnectionfactory.cc
- sdk/objc/api/peerconnection/RTCFieldTrials.mm

Bug: webrtc:9631
Change-Id: Ib621f41ef8ad0aba4fe1c1d7e749c044afc956c3
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/100524
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24878}
2018-09-28 07:21:07 +00:00
Sebastian Jansson
377b26ec65 Revert "Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config."
This reverts commit efb94d57eb.

Reason for revert: Investigate and fix build errors.

Original change's description:
> Revert "Revert "Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config.""
>
> This reverts commit 7961dc2dbd.
>
> Reason for revert: WebRTC does not build
>
> Original change's description:
> > Revert "Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config."
> >
> > This reverts commit 529d0d9795.
> >
> > Reason for revert: Seems to break perf tests, likely some breakage in video_quality_tests decoder configuration.
> >
> > Original change's description:
> > > Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config.
> > >
> > > Preparation for deleting EnableFrameRecordning, and also a step
> > > towards landing of the new VideoStreamDecoder.
> > >
> > > Bug: webrtc:9106
> > > Change-Id: I50964ee458b08a702ec69b82a62e4995c57cee82
> > > Reviewed-on: https://webrtc-review.googlesource.com/97660
> > > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > > Reviewed-by: Anders Carlsson <andersc@webrtc.org>
> > > Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> > > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#24861}
> >
> > TBR=brandtr@webrtc.org,nisse@webrtc.org,andersc@webrtc.org,sprang@webrtc.org,philipel@webrtc.org,srte@webrtc.org
> >
> > Change-Id: Id34e4a3452a7dbc06167a4df5bb4c2825ebd7bd0
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: webrtc:9106
> > Reviewed-on: https://webrtc-review.googlesource.com/102421
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#24866}
>
> TBR=brandtr@webrtc.org,nisse@webrtc.org,andersc@webrtc.org,sprang@webrtc.org,philipel@webrtc.org,srte@webrtc.org
>
> Change-Id: I23a439e1ceef79109b1f966b80b2663203968269
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:9106
> Reviewed-on: https://webrtc-review.googlesource.com/102422
> Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24867}

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

Change-Id: I9dafbc070e7f39dcb0ddbd61cb620164258fe894
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9106
Reviewed-on: https://webrtc-review.googlesource.com/102460
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24872}
2018-09-27 16:04:50 +00:00
Oleh Prypin
efb94d57eb Revert "Revert "Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config.""
This reverts commit 7961dc2dbd.

Reason for revert: WebRTC does not build

Original change's description:
> Revert "Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config."
> 
> This reverts commit 529d0d9795.
> 
> Reason for revert: Seems to break perf tests, likely some breakage in video_quality_tests decoder configuration.
> 
> Original change's description:
> > Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config.
> > 
> > Preparation for deleting EnableFrameRecordning, and also a step
> > towards landing of the new VideoStreamDecoder.
> > 
> > Bug: webrtc:9106
> > Change-Id: I50964ee458b08a702ec69b82a62e4995c57cee82
> > Reviewed-on: https://webrtc-review.googlesource.com/97660
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Reviewed-by: Anders Carlsson <andersc@webrtc.org>
> > Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#24861}
> 
> TBR=brandtr@webrtc.org,nisse@webrtc.org,andersc@webrtc.org,sprang@webrtc.org,philipel@webrtc.org,srte@webrtc.org
> 
> Change-Id: Id34e4a3452a7dbc06167a4df5bb4c2825ebd7bd0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:9106
> Reviewed-on: https://webrtc-review.googlesource.com/102421
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24866}

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

Change-Id: I23a439e1ceef79109b1f966b80b2663203968269
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9106
Reviewed-on: https://webrtc-review.googlesource.com/102422
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24867}
2018-09-27 13:55:44 +00:00
Niels Moller
7961dc2dbd Revert "Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config."
This reverts commit 529d0d9795.

Reason for revert: Seems to break perf tests, likely some breakage in video_quality_tests decoder configuration.

Original change's description:
> Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config.
> 
> Preparation for deleting EnableFrameRecordning, and also a step
> towards landing of the new VideoStreamDecoder.
> 
> Bug: webrtc:9106
> Change-Id: I50964ee458b08a702ec69b82a62e4995c57cee82
> Reviewed-on: https://webrtc-review.googlesource.com/97660
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Anders Carlsson <andersc@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24861}

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

Change-Id: Id34e4a3452a7dbc06167a4df5bb4c2825ebd7bd0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9106
Reviewed-on: https://webrtc-review.googlesource.com/102421
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24866}
2018-09-27 13:24:13 +00:00
Niels Möller
529d0d9795 Replace VideoDecoder with VideoDecoderFactory in VideoReceiveStream config.
Preparation for deleting EnableFrameRecordning, and also a step
towards landing of the new VideoStreamDecoder.

Bug: webrtc:9106
Change-Id: I50964ee458b08a702ec69b82a62e4995c57cee82
Reviewed-on: https://webrtc-review.googlesource.com/97660
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24861}
2018-09-27 11:25:21 +00:00
Åsa Persson
8c1bf9595a Reland "Add initial support for RtpEncodingParameters max_framerate."
This reverts commit 948b7e3755.

Reason for revert: downstream project fixed.

Original change's description:
> Revert "Add initial support for RtpEncodingParameters max_framerate."
>
> This reverts commit ced5cfdb35.
>
> Reason for revert: Breaks downstream project.
>
> Original change's description:
> > Add initial support for RtpEncodingParameters max_framerate.
> >
> > Add support to set the framerate to the maximum of |max_framerate|.
> > Different framerates are currently not supported per stream for video.
> >
> > Bug: webrtc:9597
> > Change-Id: Ie326617b66bd97be387f809a7f82b97b8f3ff5fe
> > Reviewed-on: https://webrtc-review.googlesource.com/92392
> > Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > Commit-Queue: Åsa Persson <asapersson@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#24270}
>
> TBR=steveanton@webrtc.org,magjed@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org,srte@webrtc.org
>
> Change-Id: I508fe48e0c53996654f657357913ac307dc256bd
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:9597
> Reviewed-on: https://webrtc-review.googlesource.com/94060
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24277}

TBR=steveanton@webrtc.org,mbonadei@webrtc.org,magjed@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org,srte@webrtc.org

Bug: webrtc:9597
Change-Id: Ieed9d62787f3e9dcb439399bfe7529012292381e
Reviewed-on: https://webrtc-review.googlesource.com/100080
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24720}
2018-09-13 10:06:33 +00:00
Niels Möller
2377588c82 Add accessor methods for RTP timestamp of EncodedImage.
Intention is to make the member private, but downstream callers
must be updated to use the accessor methods first.

Bug: webrtc:9378
Change-Id: I3495bd8d545b7234fbea10abfd14f082caa420b6
Reviewed-on: https://webrtc-review.googlesource.com/82160
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24352}
2018-08-21 09:15:51 +00:00
Kári Tristan Helgason
639602ace3 Activate initial framedrop when first BW estimate arrives
Bug: webrtc:9176, webrtc:6086
Change-Id: I420f8a0c6191697f7b50aaf780cf90a4ea365739
Reviewed-on: https://webrtc-review.googlesource.com/79580
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24306}
2018-08-16 08:41:39 +00:00
Mirko Bonadei
948b7e3755 Revert "Add initial support for RtpEncodingParameters max_framerate."
This reverts commit ced5cfdb35.

Reason for revert: Breaks downstream project.

Original change's description:
> Add initial support for RtpEncodingParameters max_framerate.
> 
> Add support to set the framerate to the maximum of |max_framerate|.
> Different framerates are currently not supported per stream for video.
> 
> Bug: webrtc:9597
> Change-Id: Ie326617b66bd97be387f809a7f82b97b8f3ff5fe
> Reviewed-on: https://webrtc-review.googlesource.com/92392
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Commit-Queue: Åsa Persson <asapersson@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24270}

TBR=steveanton@webrtc.org,magjed@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org,srte@webrtc.org

Change-Id: I508fe48e0c53996654f657357913ac307dc256bd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9597
Reviewed-on: https://webrtc-review.googlesource.com/94060
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24277}
2018-08-14 07:25:23 +00:00
Åsa Persson
ced5cfdb35 Add initial support for RtpEncodingParameters max_framerate.
Add support to set the framerate to the maximum of |max_framerate|.
Different framerates are currently not supported per stream for video.

Bug: webrtc:9597
Change-Id: Ie326617b66bd97be387f809a7f82b97b8f3ff5fe
Reviewed-on: https://webrtc-review.googlesource.com/92392
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24270}
2018-08-13 09:59:04 +00:00
Niels Möller
213618e37e New api function CreateVideoStreamEncoder.
Bug: webrtc:8830
Change-Id: I01de86f601e48f76e6b41b4182ce006d397a190c
Reviewed-on: https://webrtc-review.googlesource.com/78260
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24079}
2018-07-24 09:14:26 +00:00
Stefan Holmer
dbdb3a0079 Refactoring PayloadRouter.
- Move PayloadRouter to RtpTransportControllerInterface.
- Move RetransmissionLimiter inside RtpTransportControllerSend from
  VideoSendStreamImpl.
- Move video RTP specifics into PayloadRouter, in particular ownership
  of the RTP modules.
- PayloadRouter now contains all video specific RTP code, and will be
  renamed in a follow-up to VideoRtpSender.
- Introduce VideoRtpSenderInterface.

Bug: webrtc:9517
Change-Id: I1c7b293fa6f9c320286c80533b3c584498034a38
Reviewed-on: https://webrtc-review.googlesource.com/88240
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24009}
2018-07-17 14:46:15 +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
Danil Chapovalov
b9b146c9fe Replace rtc::Optional with absl::optional in audio, call and video
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script with parameters 'audio call video':
#!/bin/bash
find $@ -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+

find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"(../)*api:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;

git cl format

Bug: webrtc:9078
Change-Id: I02c5db956846a88a268a300ba086703a02d62e36
Reviewed-on: https://webrtc-review.googlesource.com/83722
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23628}
2018-06-15 12:09:49 +00:00
Niels Möller
97e04884bd Delete unused stats for preferred_bitrate.
Bug: webrtc:8830
Change-Id: Iaa30488255f2e09e269274136d370740cd030902
Reviewed-on: https://webrtc-review.googlesource.com/78880
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23529}
2018-06-07 08:11:07 +00:00
Niels Möller
0327c2ddc1 Move VideoStreamEncoderInterface to api/.
Bug: webrtc:8830
Change-Id: I17908b4ef6a043acf22e2110b9672012d5fa7fc0
Reviewed-on: https://webrtc-review.googlesource.com/74481
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23334}
2018-05-21 19:50:37 +00:00
Taylor Brandstetter
49fcc10de6 Merge DegradationPreference enums.
This replaces webrtc::VideoSendStream::DegradationPreference with
webrtc::DegradationPreference, and adds "DISABLED".

It's still not wired up from RtpSenderInterface::SetParameters to the
underlying video engine; that would be the next step.

Bug: webrtc:8830
Change-Id: I582ffd04eaef33c73d9892e52e789804c933b864
Reviewed-on: https://webrtc-review.googlesource.com/77024
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23276}
2018-05-17 11:21:52 +00:00
Niels Möller
f133856dfa Delete nack_enabled flag in encoder configuration.
This is a followup to cl https://webrtc-review.googlesource.com/71380,
which reworked the way encoder resilience is done, and made the
nack_enabled flag unused.

Bug: webrtc:8830
Change-Id: I3de2508c97bc71e01c8f2232d16cd1f33e57fe4a
Reviewed-on: https://webrtc-review.googlesource.com/69986
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23080}
2018-05-02 16:05:27 +00:00
Niels Möller
65fb4049c1 Don't expose resilience mode in VP8 and VP9 configuration.
This deletes the resilienceOn flag in VideoCodecVP8 and VideoCodecVP9.
Instead, the implementations of VP8 and VP9 set resilience mode
internally, based on the configuration of temporal and spatial layers.

The nack_enabled argument to VideoCodecInitializer::SetupCodec becomes
unused with this cl. In a followup, it will be deleted, together with
the corresponding argument to VideoStreamEncoder methods.

An applications which really wants to configure resilience differently
can do that by injecting an EncoderFactory with encoders behaving
as desired.

Bug: webrtc:8830
Change-Id: I9990faf07d3e95c0fb4a56fcc9a56c2005b4a6fa
Reviewed-on: https://webrtc-review.googlesource.com/71380
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23025}
2018-04-25 13:54:33 +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
Niels Möller
e8a9c45cc1 Delete enum VP8ResilienceMode.
We only support on (formely kResilientStream) and off (formely
kResilienceOff). The third mode, kResilientFrames, was not
implemented.

Bug: None
Change-Id: Ida82f6a33eda9d943ea70bc8ae4e6bddb720b0e8
Reviewed-on: https://webrtc-review.googlesource.com/71481
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22984}
2018-04-23 15:10:26 +00:00
Niels Möller
4db138e889 Reland "Move creating encoder to VideoStreamEncoder."
This is a reland of fb82fcc7f9

Original change's description:
> Move creating encoder to VideoStreamEncoder.
>
> This used to be in WebRtcVideoChannel::WebRtcVideoSendStream.
> One implication is that encoder is not created until the first
> frame arrives, and some of the tests needed updates to emit a
> frame or two.
>
> Bug: webrtc:8830
> Change-Id: I78169b2bb4dfa4197b4b4229af9fd69d0f747835
> Reviewed-on: https://webrtc-review.googlesource.com/64885
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22905}

TBR=magjed@webrtc.org,kwiberg@webrtc.org

Bug: webrtc:8830
Change-Id: I9565095ea1880fb49d15111198c08b2fcb84f18c
Reviewed-on: https://webrtc-review.googlesource.com/70740
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22930}
2018-04-19 08:48:58 +00:00
Niels Moller
0d650b44ef Revert "Move creating encoder to VideoStreamEncoder."
This reverts commit fb82fcc7f9.

Reason for revert: Appears to break Chromium, see https://ci.chromium.org/buildbot/chromium.webrtc.fyi/Linux%20Tester/43756, where remoting_unittests failed.

Original change's description:
> Move creating encoder to VideoStreamEncoder.
> 
> This used to be in WebRtcVideoChannel::WebRtcVideoSendStream.
> One implication is that encoder is not created until the first
> frame arrives, and some of the tests needed updates to emit a
> frame or two.
> 
> Bug: webrtc:8830
> Change-Id: I78169b2bb4dfa4197b4b4229af9fd69d0f747835
> Reviewed-on: https://webrtc-review.googlesource.com/64885
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22905}

TBR=magjed@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org

Change-Id: I47ee3ac42e62472d825a08c98e28f9ae53ec9fff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8830
Reviewed-on: https://webrtc-review.googlesource.com/70600
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22914}
2018-04-18 07:17:16 +00:00
Niels Möller
fb82fcc7f9 Move creating encoder to VideoStreamEncoder.
This used to be in WebRtcVideoChannel::WebRtcVideoSendStream.
One implication is that encoder is not created until the first
frame arrives, and some of the tests needed updates to emit a
frame or two.

Bug: webrtc:8830
Change-Id: I78169b2bb4dfa4197b4b4229af9fd69d0f747835
Reviewed-on: https://webrtc-review.googlesource.com/64885
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22905}
2018-04-17 15:04:33 +00:00
Sebastian Jansson
a3177057c7 Reland "Storing frame if encoder is paused."
This is a reland of dcc7e88cc7

Original change's description:
> Storing frame if encoder is paused.
> 
> Adds a pending frame to VideoStreamEncoder that is used to store frames
> that are not sent because the encoder is paused. If the encoder is
> resumed within 200 ms, the pending frame will be encoded and sent. This
> ensures that resuming a stream instantly starts sending frames if it is
> possible.
> 
> This also protects against a race between submitting the first frame
> and enabling the encoder that caused flakiness in end to end tests
> when using the task queue based congestion controller.
> 
> Bug: webrtc:8415
> Change-Id: If4bd897187fbfdc4926855f39503230bdad4a93a
> Reviewed-on: https://webrtc-review.googlesource.com/67141
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22781}

Bug: webrtc:8415
Change-Id: I0ea7d4d679e7845907cfbe9a120f128ff2180e4b
Reviewed-on: https://webrtc-review.googlesource.com/68580
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22810}
2018-04-10 15:49:05 +00:00
Sergey Silkin
1ad210876f Revert "Storing frame if encoder is paused."
This reverts commit dcc7e88cc7.

Reason for revert: breaks downstream projects

Original change's description:
> Storing frame if encoder is paused.
> 
> Adds a pending frame to VideoStreamEncoder that is used to store frames
> that are not sent because the encoder is paused. If the encoder is
> resumed within 200 ms, the pending frame will be encoded and sent. This
> ensures that resuming a stream instantly starts sending frames if it is
> possible.
> 
> This also protects against a race between submitting the first frame
> and enabling the encoder that caused flakiness in end to end tests
> when using the task queue based congestion controller.
> 
> Bug: webrtc:8415
> Change-Id: If4bd897187fbfdc4926855f39503230bdad4a93a
> Reviewed-on: https://webrtc-review.googlesource.com/67141
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22781}

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

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

Bug: webrtc:8415
Change-Id: I4449eca65a64e2bc2fb25d866e5775e9a085cee9
Reviewed-on: https://webrtc-review.googlesource.com/68280
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22788}
2018-04-09 10:01:13 +00:00
Sebastian Jansson
dcc7e88cc7 Storing frame if encoder is paused.
Adds a pending frame to VideoStreamEncoder that is used to store frames
that are not sent because the encoder is paused. If the encoder is
resumed within 200 ms, the pending frame will be encoded and sent. This
ensures that resuming a stream instantly starts sending frames if it is
possible.

This also protects against a race between submitting the first frame
and enabling the encoder that caused flakiness in end to end tests
when using the task queue based congestion controller.

Bug: webrtc:8415
Change-Id: If4bd897187fbfdc4926855f39503230bdad4a93a
Reviewed-on: https://webrtc-review.googlesource.com/67141
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22781}
2018-04-07 14:21:27 +00:00
Niels Möller
d1f7eb6e83 Postpone setting of CpuOveruseOptions.
This will enable changing thresholds when switching between hardware
and software encoders. It is also a partial revert of
https://webrtc-review.googlesource.com/33340: construction of the
OveruseFrameDetector is still in VideoSendStream, but configuration is
moved back to VideoStreamEncoder.

Longer term, information about HW vs SW, or generally, about resources
consumed by the encoder, should be passed in the per-frame callbacks
to OveruseFrameDetector, and then the CpuOveruseOptions could move
back to construction time.

Bug: webrtc:8504, webrtc:8830
Change-Id: I44577519d4e05356730cac9bd9ae3c74bfc17ed7
Reviewed-on: https://webrtc-review.googlesource.com/65163
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22761}
2018-04-06 08:34:32 +00:00
Niels Möller
259a497632 Reland "Reland "Move rtp-specific config out of EncoderSettings.""
This reverts commit 6c2c13af06.

Reason for revert: Intend to investigate and fix perf problems.

Original change's description:
> Revert "Reland "Move rtp-specific config out of EncoderSettings.""
> 
> This reverts commit 04dd176862.
> 
> Reason for revert: Regression in ramp up perf tests.
> 
> Original change's description:
> > Reland "Move rtp-specific config out of EncoderSettings."
> >
> > This is a reland of bc900cb1d1
> >
> > Original change's description:
> > > Move rtp-specific config out of EncoderSettings.
> > >
> > > In VideoSendStream::Config, move payload_name and payload_type from
> > > EncoderSettings to Rtp.
> > >
> > > EncoderSettings now contains configuration for VideoStreamEncoder only,
> > > and should perhaps be renamed in a follow up cl. It's no longer
> > > passed as an argument to VideoCodecInitializer::SetupCodec.
> > >
> > > The latter then needs a different way to know the codec type,
> > > which is provided by a new codec_type member in VideoEncoderConfig.
> > >
> > > Bug: webrtc:8830
> > > Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> > > Reviewed-on: https://webrtc-review.googlesource.com/62062
> > > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#22532}
> >
> > Bug: webrtc:8830
> > Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
> > Reviewed-on: https://webrtc-review.googlesource.com/63721
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22595}
> 
> TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
> 
> Bug: webrtc:8830,chromium:827080
> Change-Id: Iaaf146de91ec5c0d741b8efdf143f7e173084fef
> Reviewed-on: https://webrtc-review.googlesource.com/65520
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22677}

TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org

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

Bug: webrtc:8830, chromium:827080
Change-Id: I9b62987bf5daced90dfeb3ebb6739c80117c487f
Reviewed-on: https://webrtc-review.googlesource.com/66862
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22751}
2018-04-05 14:30:09 +00:00
Niels Möller
6c2c13af06 Revert "Reland "Move rtp-specific config out of EncoderSettings.""
This reverts commit 04dd176862.

Reason for revert: Regression in ramp up perf tests.

Original change's description:
> Reland "Move rtp-specific config out of EncoderSettings."
>
> This is a reland of bc900cb1d1
>
> Original change's description:
> > Move rtp-specific config out of EncoderSettings.
> >
> > In VideoSendStream::Config, move payload_name and payload_type from
> > EncoderSettings to Rtp.
> >
> > EncoderSettings now contains configuration for VideoStreamEncoder only,
> > and should perhaps be renamed in a follow up cl. It's no longer
> > passed as an argument to VideoCodecInitializer::SetupCodec.
> >
> > The latter then needs a different way to know the codec type,
> > which is provided by a new codec_type member in VideoEncoderConfig.
> >
> > Bug: webrtc:8830
> > Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> > Reviewed-on: https://webrtc-review.googlesource.com/62062
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22532}
>
> Bug: webrtc:8830
> Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
> Reviewed-on: https://webrtc-review.googlesource.com/63721
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22595}

TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org

Bug: webrtc:8830,chromium:827080
Change-Id: Iaaf146de91ec5c0d741b8efdf143f7e173084fef
Reviewed-on: https://webrtc-review.googlesource.com/65520
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22677}
2018-03-29 11:45:18 +00:00
Sergey Silkin
86684960b3 Adding layering configurator and rate allocator for VP9 SVC.
The configurator decides number of spatial layers, their resolution
and bitrate thresholds based on given input resolution and maximum
number of spatial layers.

The allocator distributes available bitrate across spatial and
temporal layers. If there is not enough bitrate to provide acceptable
quality for all spatial layers allocator disables enhancement layers
one by one until the condition is met or number of layers is reduced
to one.

VP9 SVC related unit tests have been updated. Input resolution and
bitrate in these tests have been increased to the level enough to
provide desirable number of spatial layers.

Bug: webrtc:8518
Change-Id: I9df790920227c7f7dd4d42a50a856c22f0f4389b
Reviewed-on: https://webrtc-review.googlesource.com/60340
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22672}
2018-03-29 10:16:47 +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
Niels Möller
04dd176862 Reland "Move rtp-specific config out of EncoderSettings."
This is a reland of bc900cb1d1

Original change's description:
> Move rtp-specific config out of EncoderSettings.
> 
> In VideoSendStream::Config, move payload_name and payload_type from
> EncoderSettings to Rtp.
> 
> EncoderSettings now contains configuration for VideoStreamEncoder only,
> and should perhaps be renamed in a follow up cl. It's no longer
> passed as an argument to VideoCodecInitializer::SetupCodec.
> 
> The latter then needs a different way to know the codec type,
> which is provided by a new codec_type member in VideoEncoderConfig.
> 
> Bug: webrtc:8830
> Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> Reviewed-on: https://webrtc-review.googlesource.com/62062
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22532}

Bug: webrtc:8830
Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
Reviewed-on: https://webrtc-review.googlesource.com/63721
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22595}
2018-03-26 08:39:39 +00:00
Niels Moller
92be1caf4f Revert "Move rtp-specific config out of EncoderSettings."
This reverts commit bc900cb1d1.

Reason for revert: Broke downstream projects.

Original change's description:
> Move rtp-specific config out of EncoderSettings.
> 
> In VideoSendStream::Config, move payload_name and payload_type from
> EncoderSettings to Rtp.
> 
> EncoderSettings now contains configuration for VideoStreamEncoder only,
> and should perhaps be renamed in a follow up cl. It's no longer
> passed as an argument to VideoCodecInitializer::SetupCodec.
> 
> The latter then needs a different way to know the codec type,
> which is provided by a new codec_type member in VideoEncoderConfig.
> 
> Bug: webrtc:8830
> Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> Reviewed-on: https://webrtc-review.googlesource.com/62062
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22532}

TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org

Change-Id: I01f06c1fcf21eb2cd40dca7d4f268614200ee490
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8830
Reviewed-on: https://webrtc-review.googlesource.com/63720
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22537}
2018-03-21 13:53:49 +00:00
Niels Möller
bc900cb1d1 Move rtp-specific config out of EncoderSettings.
In VideoSendStream::Config, move payload_name and payload_type from
EncoderSettings to Rtp.

EncoderSettings now contains configuration for VideoStreamEncoder only,
and should perhaps be renamed in a follow up cl. It's no longer
passed as an argument to VideoCodecInitializer::SetupCodec.

The latter then needs a different way to know the codec type,
which is provided by a new codec_type member in VideoEncoderConfig.

Bug: webrtc:8830
Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
Reviewed-on: https://webrtc-review.googlesource.com/62062
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22532}
2018-03-21 12:55:08 +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
Sergey Silkin
a796a7ee85 Reland "Replaced temporal_layer_thresholds_bps[] field with num_temporal_layers."
This reverts commit e27e0aca94.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Replaced temporal_layer_thresholds_bps[] field with num_temporal_layers."
> 
> This reverts commit d2ed0a4c9e.
> 
> Reason for revert: Breaks downstream projects.
> 
> Original change's description:
> > Replaced temporal_layer_thresholds_bps[] field with num_temporal_layers.
> > 
> > temporal_layer_thresholds_bps served only one purpose: its size was used
> > to infer number of temporal layers. I replaced it with num_temporal_layers,
> > which does what is says.
> > 
> > The practical reason for this change is the need to have possibility to
> > distinguish between cases when VP9 SVC temporal layering was/not set
> > through field trial. That was not possible with
> > temporal_layer_thresholds_bps[] because empty vector means 1 temporal
> > layer.
> > 
> > Bug: webrtc:8518
> > Change-Id: I275ec3a8c74e8ba409eb049878199f132a20ec51
> > Reviewed-on: https://webrtc-review.googlesource.com/58084
> > Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22230}
> 
> TBR=sprang@webrtc.org,stefan@webrtc.org,ssilkin@webrtc.org
> 
> Change-Id: Ic2940f7f78a74312170940d51ad8967cde8ad42f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8518
> Reviewed-on: https://webrtc-review.googlesource.com/58902
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22234}

TBR=sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,ssilkin@webrtc.org

Change-Id: I1900c6b845b9baa9430fb72c3f4e7f2a44b3a8b1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8518
Reviewed-on: https://webrtc-review.googlesource.com/59160
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22256}
2018-03-01 18:07:29 +00:00
Philip Eliasson
e27e0aca94 Revert "Replaced temporal_layer_thresholds_bps[] field with num_temporal_layers."
This reverts commit d2ed0a4c9e.

Reason for revert: Breaks downstream projects.

Original change's description:
> Replaced temporal_layer_thresholds_bps[] field with num_temporal_layers.
> 
> temporal_layer_thresholds_bps served only one purpose: its size was used
> to infer number of temporal layers. I replaced it with num_temporal_layers,
> which does what is says.
> 
> The practical reason for this change is the need to have possibility to
> distinguish between cases when VP9 SVC temporal layering was/not set
> through field trial. That was not possible with
> temporal_layer_thresholds_bps[] because empty vector means 1 temporal
> layer.
> 
> Bug: webrtc:8518
> Change-Id: I275ec3a8c74e8ba409eb049878199f132a20ec51
> Reviewed-on: https://webrtc-review.googlesource.com/58084
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22230}

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

Change-Id: Ic2940f7f78a74312170940d51ad8967cde8ad42f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8518
Reviewed-on: https://webrtc-review.googlesource.com/58902
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22234}
2018-02-28 16:01:32 +00:00
Sergey Silkin
d2ed0a4c9e Replaced temporal_layer_thresholds_bps[] field with num_temporal_layers.
temporal_layer_thresholds_bps served only one purpose: its size was used
to infer number of temporal layers. I replaced it with num_temporal_layers,
which does what is says.

The practical reason for this change is the need to have possibility to
distinguish between cases when VP9 SVC temporal layering was/not set
through field trial. That was not possible with
temporal_layer_thresholds_bps[] because empty vector means 1 temporal
layer.

Bug: webrtc:8518
Change-Id: I275ec3a8c74e8ba409eb049878199f132a20ec51
Reviewed-on: https://webrtc-review.googlesource.com/58084
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22230}
2018-02-28 14:46:03 +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
Niels Möller
73f29cbcc1 Move creation of OveruseFrameDetector to VideoSendStream.
Intended to make it easier to wire up cpu-adaptation experiments.
To setup the circular references between OveruseFrameDetector and
VideoStreamEncoder, let the AdaptationObserverInterface pointer be
an argument to StartCheckForOveruse.

Bug: webrtc:8504
Change-Id: Ifcf7655ec65e637819d77f507552cb22a6aa5f0f
Reviewed-on: https://webrtc-review.googlesource.com/33340
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22006}
2018-02-13 15:45:03 +00:00
Niels Möller
6539f69746 Add VideoSendStream::Config::EncoderSettings::experiment_cpu_load_estimator.
And wire it up to methods on RTCConfiguration, via MediaConfig::Video.

Bug: webrtc:8504
Change-Id: I30805ee20c11d1d2fe552eb81f16d514db0ba4a8
Reviewed-on: https://webrtc-review.googlesource.com/39786
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21670}
2018-01-18 10:42:07 +00:00
Jonathan Yu
bc771b7585 Remove limits on CPU adaptation.
In balanced adaptation mode, a 1280x720 feed would only ever be reduced in
resolution twice, and would never have its framerate reduced (due to an
interaction with MinFps()).

This change removes the hard limits entirely, instead relying only on
kMinFramerateFps and VideoEncoder::ScalingSettings::min_pixels_per_frame.

Deleted SinkWantsFromOveruseDetector test because it duplicates other tests.
Fixed DoesntAdaptDownPastMinFramerate; it wasn't testing what it claimed to
because it wasn't updating the fake clock correctly, meaning FPS was detected as
0, meaning framerate adaptation was never triggered.

Bug: webrtc:8068, b/38207842
Change-Id: If99d0e74c1334879c1b0c3117eb079f5f2139851
Reviewed-on: https://webrtc-review.googlesource.com/31644
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Jonathan Yu <yujo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#21312}
2017-12-15 22:32:27 +00:00
Niels Möller
6b642f730c Delete EncodedFrameObserver::OnEncodeTiming.
This callback was used only by the PrintSamplesToFile feature of
video_quality_test, which looks like it has been broken for some time
(due to mixup of capture time and ntp time).

Bug: webrtc:8504
Change-Id: I7d2b55405caeffda582ae0d6fb0e7dfdfce4c5a9
Reviewed-on: https://webrtc-review.googlesource.com/31420
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21211}
2017-12-11 16:41:46 +00:00
Niels Möller
7dc26b7b32 Revert "Refactor OverUseFrameDetector to use the timestamps attached to EncodedImage."
This reverts commit eee7cedf69.

Reason for revert: Intend to rework with a flag to select between old or new estimator, to be wired up as an origin-trial experiment. And old estimator deleted at a later point.

Original change's description:
> Refactor OverUseFrameDetector to use the timestamps attached to EncodedImage.
> 
> Bug: webrtc:8504
> Change-Id: I3f99c3c1e528f59b45724921a91f65b485f5b820
> Reviewed-on: https://webrtc-review.googlesource.com/23720
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20979}

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

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

Bug: webrtc:8504
Change-Id: Ieec4624e1d6dd8472b7e89c7bd19f425d9b54533
Reviewed-on: https://webrtc-review.googlesource.com/30180
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21115}
2017-12-06 10:32:12 +00:00
Åsa Persson
c74d8da339 Remove unused struct from ProtectionBitrateCalculator.
Remove unused forward declarations.

Bug: none
Change-Id: Ie6f656efa83c889103ace4c9245e2fe3d8f7a547
Reviewed-on: https://webrtc-review.googlesource.com/29060
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21111}
2017-12-06 08:39:12 +00:00
Niels Möller
eee7cedf69 Refactor OverUseFrameDetector to use the timestamps attached to EncodedImage.
Bug: webrtc:8504
Change-Id: I3f99c3c1e528f59b45724921a91f65b485f5b820
Reviewed-on: https://webrtc-review.googlesource.com/23720
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20979}
2017-12-01 15:13:26 +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
Mirko Bonadei
bb547203bf Moving src/webrtc into src/.
In order to eliminate the WebRTC Subtree mirror in Chromium, 
WebRTC is moving the content of the src/webrtc directory up
to the src/ directory.

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

Bug: chromium:611808
Change-Id: Iac59c5b51b950f174119565bac87955a7994bc38
Reviewed-on: https://webrtc-review.googlesource.com/1560
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19845}
2017-09-15 04:25:06 +00:00
Renamed from webrtc/video/video_stream_encoder_unittest.cc (Browse further)