Commit graph

26 commits

Author SHA1 Message Date
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
0040b66ad3 Replace rtc::Optional with absl::optional
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script from modules with parameters
'pacing video_coding congestion_controller remote_bitrate_estimator':

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: I8ea501d7f1ee36e8d8cd3ed37e6b763c7fe29118
Reviewed-on: https://webrtc-review.googlesource.com/83900
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23640}
2018-06-18 10:24:48 +00:00
Ilya Nikolaevskiy
b6c462d4e4 Cleanup webrtc:: namespace from leaked TimingFrameFlags
Bug: webrtc:9351
Change-Id: Ifbc0a522bf13ab62a2e490b9f129eacfabe7796f
Reviewed-on: https://webrtc-review.googlesource.com/80961
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23520}
2018-06-05 13:52:04 +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
Ilya Nikolaevskiy
764aeb7758 Reland In GenericEncoder enable timing frames for encoders with internal source
The original cl broke some downstream project because some internal source
encoders do not call OnBitrateChanged on GenericEncoder.

Bug: webrtc:9058
Change-Id: I7841c65059fb4fc9e1ab9754bb1d232ce660a990
Reviewed-on: https://webrtc-review.googlesource.com/66342
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22733}
2018-04-04 13:38:10 +00:00
Ilya Nikolaevskiy
4157936823 Revert "In GenericEncoder enable timing frames for encoders with internal source"
This reverts commit e24c41ea45.

Reason for revert: Breaks downstream project.

Original change's description:
> In GenericEncoder enable timing frames for encoders with internal source
>
> Bug: webrtc:9058
> Change-Id: Iab75238cef9d8683d3f78b045d24dcca71427e14
> Reviewed-on: https://webrtc-review.googlesource.com/64446
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22640}

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


# Skipping CQ checks because MAC bots are out of commission right now.
No-Presubmit: True
No-Tree-Checks: True
No-Try: True

Bug: webrtc:9058
Change-Id: I1d6258066e81b37b05d0ad0ff41d792f93d17ad9
Reviewed-on: https://webrtc-review.googlesource.com/65660
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22691}
2018-03-30 14:56:38 +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
Ilya Nikolaevskiy
e24c41ea45 In GenericEncoder enable timing frames for encoders with internal source
Bug: webrtc:9058
Change-Id: Iab75238cef9d8683d3f78b045d24dcca71427e14
Reviewed-on: https://webrtc-review.googlesource.com/64446
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22640}
2018-03-28 08:40:06 +00:00
Niels Möller
2e1d784956 Delete the VideoCodec::plName string.
It holds the same information as codecType, but in different format.

Bug: webrtc:8830
Change-Id: Ia83e2dff4fd9a5ddb489501b7a1fe80759fa4218
Reviewed-on: https://webrtc-review.googlesource.com/56100
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22307}
2018-03-06 11:17:41 +00:00
Niels Möller
3f693b9e75 Delete unused method SetPeriodicKeyFrames.
Keyframe interval is configurable in codec settings, with no need for
a setter method to toggle it on or off.

Bug: webrtc:8830
Change-Id: Ic20d8829884ed22588f8f8c0cceddd76144a9858
Reviewed-on: https://webrtc-review.googlesource.com/56040
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22280}
2018-03-05 08:54:32 +00:00
Ying Wang
0dd1b0a4b2 Revert "Revert "Enables PeerConnectionFactory using external fec controller""
This reverts commit 00733015fa.

Reason for revert: The reason for a downstream test failure on the original commit and a workaround has been found. Solution is to keep a PeerConnectionFactory constructor implementation as the same as before.

Original change's description:
> Revert "Enables PeerConnectionFactory using external fec controller"
>
> This reverts commit 4f07bdb255.
>
> Reason for revert: Speculatively reverting, because downstream test is now hitting "PeerConnectionFactory.initialize was not called before creating a PeerConnectionFactory" error, even though it did call initialize. I don't see how any change in this CL could cause that, but it's the only CL on the blamelist, and it does modify PeerConnectionFactory.java
>
> Original change's description:
> > Enables PeerConnectionFactory using external fec controller
> >
> > Bug: webrtc:8799
> > Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
> > Reviewed-on: https://webrtc-review.googlesource.com/43961
> > Commit-Queue: Ying Wang <yinwa@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22038}
>
> TBR=sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org
>
> Change-Id: I95868c35d6f9973e0ebf563814cd71d0fcbd433d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8799
> Reviewed-on: https://webrtc-review.googlesource.com/54080
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22040}

TBR=deadbeef@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org

Bug: webrtc:8799
Change-Id: If9f3292bfcc739782967530c49f006d0abbc38a8
Reviewed-on: https://webrtc-review.googlesource.com/55400
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22100}
2018-02-20 12:41:55 +00:00
Taylor Brandstetter
00733015fa Revert "Enables PeerConnectionFactory using external fec controller"
This reverts commit 4f07bdb255.

Reason for revert: Speculatively reverting, because downstream test is now hitting "PeerConnectionFactory.initialize was not called before creating a PeerConnectionFactory" error, even though it did call initialize. I don't see how any change in this CL could cause that, but it's the only CL on the blamelist, and it does modify PeerConnectionFactory.java

Original change's description:
> Enables PeerConnectionFactory using external fec controller
> 
> Bug: webrtc:8799
> Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
> Reviewed-on: https://webrtc-review.googlesource.com/43961
> Commit-Queue: Ying Wang <yinwa@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22038}

TBR=sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org

Change-Id: I95868c35d6f9973e0ebf563814cd71d0fcbd433d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8799
Reviewed-on: https://webrtc-review.googlesource.com/54080
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22040}
2018-02-15 20:07:24 +00:00
Ying Wang
4f07bdb255 Enables PeerConnectionFactory using external fec controller
Bug: webrtc:8799
Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
Reviewed-on: https://webrtc-review.googlesource.com/43961
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22038}
2018-02-15 16:58:26 +00:00
Ilya Nikolaevskiy
269674f7ad Throttle GenericEncoder warning messages more.
Because they usually happen for all or for no frames in a stream.

Bug: chrome:801327
Change-Id: Ie09b93a0822e821076ff2743cf1223c29fcf44a6
Reviewed-on: https://webrtc-review.googlesource.com/39785
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21644}
2018-01-16 15:26:14 +00:00
Sebastian Jansson
cabe3838bb Moved ALR experiment settings to new experiments folder.
This replaces most of the existing dependencies on the application
limited region(ALR) detector. This is to achieve a greater separation of
concerns and will make further refactoring regarding the ALR Detector
less invasive on other parts of the code base.

Bug: webrtc:8415
Change-Id: I92912254c6d02285cce6a88f6789f0ac94794c88
Reviewed-on: https://webrtc-review.googlesource.com/37560
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21598}
2018-01-12 12:03:22 +00:00
Ilya Nikolaevskiy
76f2a85027 In generic encoder ensure capture timestamp is preserved.
Because some hardware encoders may not preserve capture timestamp, use
rtp timestamp as a key to capture time storage and restore corrupted
capture timestamps whenever possible.

Bug: webrtc:8497
Change-Id: Ib3449313c65e864a89cd645a3f5dec99aa9cf8e4
Reviewed-on: https://webrtc-review.googlesource.com/23620
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20732}
2017-11-17 16:06:17 +00:00
Ilya Nikolaevskiy
b9fb78f425 Cap amount of warning log messages in generic encoder
Bug: None
Change-Id: I4fe2f027eb92c59eb901c88bf244300252588c27
Reviewed-on: https://webrtc-review.googlesource.com/22921
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20674}
2017-11-14 16:53:36 +00:00
Mirko Bonadei
0ec39e2d0f Switching to RTC_ prefixed LOG macros.
Unprefixed LOG macros will be removed on 10/11/2017, this CL just
switch some LOG macros to RTC_LOG.

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

Bug: webrtc:8452
Change-Id: I3828c145897818ded56d342eba5f7496431715a4
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/22083
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20633}
2017-11-10 15:39:46 +00:00
Ilya Nikolaevskiy
e0da9eab5f Don't count frames passed to VP8 BWE disabled streams as being encoded
This excludes these frames from being counted as dropped by encoder.
Also fix bitrate projected distribution for vp9 svc for outliers
detection.

Bug: webrtc:8497
Change-Id: Id37487456170c61e2323a660668f0c319ea5831d
Reviewed-on: https://webrtc-review.googlesource.com/21223
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20632}
2017-11-10 15:11:25 +00:00
Niels Möller
c241af9cca Add timing info to all encoded frames.
Even if we're not going to transmit any timing info over the wire.

Bug: webrtc:8504
Change-Id: Id54192a10e6b2a6a2cb57a2ff6b28fc0d16e471d
Reviewed-on: https://webrtc-review.googlesource.com/21160
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20628}
2017-11-10 12:15:35 +00:00
Mirko Bonadei
675513b96a Stop using LOG macros in favor of RTC_ prefixed macros.
This CL has been generated with the following script:

for m in PLOG \
  LOG_TAG \
  LOG_GLEM \
  LOG_GLE_EX \
  LOG_GLE \
  LAST_SYSTEM_ERROR \
  LOG_ERRNO_EX \
  LOG_ERRNO \
  LOG_ERR_EX \
  LOG_ERR \
  LOG_V \
  LOG_F \
  LOG_T_F \
  LOG_E \
  LOG_T \
  LOG_CHECK_LEVEL_V \
  LOG_CHECK_LEVEL \
  LOG
do
  git grep -l $m | xargs sed -i "s,\b$m\b,RTC_$m,g"
done
git checkout rtc_base/logging.h
git cl format

Bug: webrtc:8452
Change-Id: I1a53ef3e0a5ef6e244e62b2e012b864914784600
Reviewed-on: https://webrtc-review.googlesource.com/21325
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20617}
2017-11-09 11:56:32 +00:00
Ilya Nikolaevskiy
d79314f9f9 Reland "Add fine grained dropped video frames counters on sending side"
Add fine grained dropped video frames counters on sending side

4 new counters added to SendStatisticsProxy and reported to UMA and logs.

Bug: webrtc:8355
Change-Id: I1f9bdfea9cbf17cf38b3cb2f55d406ffdb06614f
Reviewed-on: https://webrtc-review.googlesource.com/14580
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20421}
2017-10-25 09:32:15 +00:00
Ilya Nikolaevskiy
1c1a6815ae Revert "Add fine grained dropped video frames counters on sending side"
This reverts commit 4b1a363e4c.

Reason for revert: Breaks dependent android projects.

Original change's description:
> Add fine grained dropped video frames counters on sending side
> 
> 4 new counters added to SendStatisticsProxy and reported to UMA and logs.
> 
> Bug: webrtc:8355
> Change-Id: Idf9b8dfc295c92821e058a97cb3894dc6a446082
> Reviewed-on: https://webrtc-review.googlesource.com/12260
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20347}

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

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

Bug: webrtc:8355
Change-Id: I59b02f4eb77abad7ff1fbcbfa61844918c95d723
Reviewed-on: https://webrtc-review.googlesource.com/14500
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20378}
2017-10-21 09:23:54 +00:00
Ilya Nikolaevskiy
4b1a363e4c Add fine grained dropped video frames counters on sending side
4 new counters added to SendStatisticsProxy and reported to UMA and logs.

Bug: webrtc:8355
Change-Id: Idf9b8dfc295c92821e058a97cb3894dc6a446082
Reviewed-on: https://webrtc-review.googlesource.com/12260
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20347}
2017-10-19 10:37:12 +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/modules/video_coding/generic_encoder.cc (Browse further)