Commit graph

51 commits

Author SHA1 Message Date
Niels Möller
105711e9ad Move rtc::make_ref_counted to api/
Bug: webrtc:12701
Change-Id: If49095b101c1a1763c2a44a0284c0d670cce953f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265390
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37219}
2022-06-15 09:47:38 +00:00
Niels Möller
c7b690272d Update modules/ to not use implicit conversion from scoped_refptr<T> to T*.
Bug: webrtc:13464
Change-Id: I3906e91906edbf80d558e5c367d6b9429497c021
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259762
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36606}
2022-04-21 14:23:24 +00:00
Ali Tofigh
1e157a9596 Remove more top-level const from parameters in function declarations
This CL removes even more top-level const from parameters in function
declarations. This change is safe because top-level const in function
declarations (not function definitions) are ignored by the compiler
and so change is just a no-op cleanup.

Bug: webrtc:13610
Change-Id: Icf6868c27b1fdb9d9915b3a7020eb34bdcf07a09
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249989
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35866}
2022-02-01 09:15:50 +00:00
Mirko Bonadei
9937c32371 Roll chromium_revision 1ce7d592c3..fe555f2e69 (944520:945923)
This CL also adds COM_DECLSPEC_NOTHROW where needed since Windows
is compiled with -std=c++17.

Change log: 1ce7d592c3..fe555f2e69
Full diff: 1ce7d592c3..fe555f2e69

Changed dependencies
* src/base: a0e30222a6..c8a98d6969
* src/build: 749ecdaeea..245517235e
* src/buildtools/linux64: git_revision:4aa9bdfa05b688c58d3d7d3e496f3f18cbb3d89e..git_revision:b79031308cc878488202beb99883ec1f2efd9a6d
* src/buildtools/mac: git_revision:4aa9bdfa05b688c58d3d7d3e496f3f18cbb3d89e..git_revision:b79031308cc878488202beb99883ec1f2efd9a6d
* src/buildtools/third_party/libc++abi/trunk: e504863f9e..665b74f7d1
* src/buildtools/third_party/libunwind/trunk: 038090f742..c936d73ff7
* src/buildtools/win: git_revision:4aa9bdfa05b688c58d3d7d3e496f3f18cbb3d89e..git_revision:b79031308cc878488202beb99883ec1f2efd9a6d
* src/ios: d9a982f504..bc9340854d
* src/testing: 4e888a310b..6410d12020
* src/third_party: 7d86ceacba..51b895633d
* src/third_party/androidx: ftwyhL300WgpRNfRASqCL9olp8f0SJTlzIAgKWR_lwUC..qVa1DxDFLR8hbH6wr8ziYpbEPLeUQNDBDCtZaWb0As8C
* src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/4b9301e9c5..75423c310e
* src/third_party/depot_tools: a29f589a15..2ffa1bde79
* src/third_party/freetype/src: 3cabd142ce..cff026d415
* src/third_party/googletest/src: 3e0e32ba30..e2f3978937
* src/third_party/libjpeg_turbo: 49836d72bd..02959c3ee1
* src/third_party/libvpx/source/libvpx: ec80f88c5d..13f984c216
* src/third_party/perfetto: d5cb19a57d..889d9a924c
* src/third_party/r8: nqWomZTwNDoogX26WeCSoFGg6aQN1FrwzoU4hCS0duEC..CokGsfuGfcV-GjGwN98h28Phet4ai_xhPGZkGCqotWMC
* src/tools: 0e9c2f5abf..7c7f2ccfb1
* src/tools/luci-go: git_revision:2dfe2f218f0395673f336d17b841edf629907ae3..git_revision:81cc063690e374fdad0215a7565a0951e7db8a07
* src/tools/luci-go: git_revision:2dfe2f218f0395673f336d17b841edf629907ae3..git_revision:81cc063690e374fdad0215a7565a0951e7db8a07
DEPS diff: 1ce7d592c3..fe555f2e69/DEPS

No update to Clang.

BUG=None

Change-Id: I9f889473ef8a9453b1c9828d0b2d4be2d3a4e2c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239355
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35433}
2021-11-29 16:23:30 +00:00
Sergey Silkin
4de99443dd Delete memory allocated by GetStreamCaps
Bug: webrtc:13260
Change-Id: I18c23e2c3aad7c711c33c8cc381d46275473b4a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237344
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35369}
2021-11-17 15:06:31 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Mirko Bonadei
ff8caf1d56 Fix -Wunused-but-set-variable.
This is part of a set of CLs to fix the Chromium roll.

Bug: None
Change-Id: I3b00a4051b4219f8338986ebc4c69fa8318920de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236681
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35286}
2021-10-31 13:18:48 +00:00
Mirko Bonadei
3cff171333 Fix -Wunused-but-set-variable.
Bug: None
Change-Id: Idc55e5d4ef522349f0d76f10dd2738408ab994e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236586
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35282}
2021-10-29 11:02:00 +00:00
Artem Titov
954c1d1a0c Use backticks not vertical bars to denote variables in comments for /modules/video_capture
Bug: webrtc:12338
Change-Id: I262ead2039022d4a8135d506dc6c43857b9bfa04
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227099
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34682}
2021-08-09 15:20:43 +00:00
Mirko Bonadei
190244bb59 Remove all #include <assert.h>/<cassert> and usage in Obj-C code.
This CL completes the removal of assert() and relative headers from
the codebase (excluded
//examples/objc/AppRTCMobile/third_party/SocketRocket which is in a
third_party sub-directory).

Bug: webrtc:6779
Change-Id: I93ed57168d2c0e011626873d66529488c5f484f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225546
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34528}
2021-07-22 14:00:26 +00:00
Mirko Bonadei
25ab3228f3 Replace assert() with RTC_DCHECK().
CL partially auto-generated with:

git grep -l "\bassert(" | grep "\.[c|h]" | \
  xargs sed -i 's/\bassert(/RTC_DCHECK(/g'

And with:

git grep -l "RTC_DCHECK(false)" |  \
  xargs sed -i 's/RTC_DCHECK(false)/RTC_NOTREACHED()/g'

With some manual changes to include "rtc_base/checks.h" where
needed.

A follow-up CL will remove assert() from Obj-C code as well
and remove the #include of <assert.h>.

The choice to replace with RTC_DCHECK is because assert()
is because RTC_DCHECK has similar behavior as assert()
based on NDEBUG.

This CL also contains manual changes to switch from
basic RTC_DCHECK to other (preferred) versions like
RTC_DCHECK_GT (and similar).

Bug: webrtc:6779
Change-Id: I00bed8886e03d685a2f42324e34aef2c9b7a63b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224846
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34442}
2021-07-09 07:49:43 +00:00
Johannes Kron
7c719b0db1 Fixes off-by-one error in video capture module
Fixed: webrtc:11290
Change-Id: I471b409c27d6ee577a0ed84e3a09d31fbbc16fcd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222609
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34333}
2021-06-18 14:07:28 +00:00
Tommi
87f7090fd9 Replace more instances of rtc::RefCountedObject with make_ref_counted.
This is essentially replacing `new rtc::RefCountedObject` with
`rtc::make_ref_counted` in many files. In a couple of places I
made minor tweaks to make things compile such as adding parenthesis
when they were missing.

Bug: webrtc:12701
Change-Id: I3828dbf3ee0eb0232f3a47067474484ac2f4aed2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215973
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33852}
2021-04-27 17:01:59 +00:00
Artem Titov
d15a575ec3 Use SequenceChecker from public API
Bug: webrtc:12419
Change-Id: I00cca16a0ec70246156ba00b97aa7ae5ccbf5364
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205323
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33220}
2021-02-10 15:04:55 +00:00
Artem Titov
c8421c4c3e Replace rtc::ThreadChecker with webrtc::SequenceChecker
Bug: webrtc:12419
Change-Id: I825c014cc1c4b1dcba5ef300409d44859e971144
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205002
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33136}
2021-02-02 14:56:27 +00:00
Mirko Bonadei
3b68aa346a Move some RTC_LOG to RTC_DLOG.
Some locations in the WebRTC codebase RTC_LOG the value of the
__FUNCTION__ macro which probably is useful in debug mode. Moving
these instances to RTC_DLOG saves ~10 KiB on arm64.

Bug: webrtc:11986
Change-Id: I5d81cc459d2850657a712b9aed80c187edf49a3a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203981
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33086}
2021-01-28 10:05:00 +00:00
Niels Möller
5b5de21acc Replace RWLockWrapper --> Mutex in DeviceInfoImpl
Reader-writer locks helps performance only when there are many
concurrent readers, and I would expect that isn't the case for this
class. Using a plain mutex reduces complexity.

Bug: webrtc:12102
Change-Id: I07c315bcbfc38f1d8befe5395c9ece54c673aeb7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190722
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32547}
2020-11-04 10:20:10 +00:00
Markus Handell
4379a7db1f Reland "Migrate modules/desktop_capture and modules/video_capture to webrtc::Mutex."
This is a reland of 44dd3d7435

Original change's description:
> Migrate modules/desktop_capture and modules/video_capture to webrtc::Mutex.
> 
> Bug: webrtc:11567
> Change-Id: I7bfca17f91bf44151148f863480ce77804d53a04
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178805
> Commit-Queue: Markus Handell <handellm@webrtc.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31681}

Bug: webrtc:11567
Change-Id: I03a32cb7194cffb9e678355c4af4d370b39384b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179093
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31716}
2020-07-13 12:22:08 +00:00
Markus Handell
1added5666 Revert "Migrate modules/desktop_capture and modules/video_capture to webrtc::Mutex."
This reverts commit 44dd3d7435.

Reason for revert: crbug.com/1104081

Original change's description:
> Migrate modules/desktop_capture and modules/video_capture to webrtc::Mutex.
> 
> Bug: webrtc:11567
> Change-Id: I7bfca17f91bf44151148f863480ce77804d53a04
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178805
> Commit-Queue: Markus Handell <handellm@webrtc.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31681}

TBR=tommi@webrtc.org,handellm@webrtc.org

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

Bug: webrtc:11567
Change-Id: I4ee39947ba206522bce611341caef84ddb538068
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179080
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31702}
2020-07-10 13:43:22 +00:00
Markus Handell
44dd3d7435 Migrate modules/desktop_capture and modules/video_capture to webrtc::Mutex.
Bug: webrtc:11567
Change-Id: I7bfca17f91bf44151148f863480ce77804d53a04
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178805
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31681}
2020-07-08 20:35:04 +00:00
Jonas Olsson
b2b2031457 Concatenate string literals at compile time.
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format

After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.

This primary benefit of this change is a small reduction in binary size.

Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30251}
2020-01-14 14:47:48 +00:00
Jerome Humbert
39bab5afb5 Add missing assert.h for win no-test build
Add some missing `#include <assert.h>` for Windows build when compiling
without RTC tests (rtc_include_tests = false) with the MSVC compiler
(is_clang=false, use_lld=false).

Bug: None
Change-Id: Ie9861100efeae87f4c4e29303d62293ad541125a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158533
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29811}
2019-11-17 07:52:32 +00:00
Tim Haloun
059daa48a9 Don't leak device moniker when BindToStorage fails.
Bug: b/143372501
Change-Id: Ib60efc830de057c7edafa81b77b696b785fb78e7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159661
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29774}
2019-11-12 15:37:41 +00:00
Danil Chapovalov
b9f69028a0 Store logging streams in a manually linked list instead of std::list
LogMessage::streams_ is a global and thus should have trivial destructor

Bug: None
Change-Id: Ie6a8029602f50b2bc5bab546ffc0365ef0954024
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157042
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29552}
2019-10-21 09:02:52 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Niels Möller
8581877121 Delete interface class VideoCaptureExternal
Also delete corresponding and unused create method
VideoCaptureFactory::Create(VideoCaptureExternal...),
the code under modules/video_capture/external, and the
build target modules/video_capture:video_capture.

Bug: None
Change-Id: I5ec6139e9ecf460f93ede847868f7f80dbc019f5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131385
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27506}
2019-04-09 08:18:20 +00:00
Sebastian Jansson
c01367db40 Deprecating ThreadChecker specific interface.
All changes outside thread_checker.h are by:
s/CalledOnValidThread/IsCurrent/
s/DetachFromThread/Detach/

Bug: webrtc:9883
Change-Id: Idbb1086bff0817db58e770116acf4c9d60fae8b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131023
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27494}
2019-04-08 16:58:07 +00:00
Niels Möller
61e2753500 Delete placeholder code for Windows Media Foundation capturer.
Any new capture implementation for windows should use VideoSourceInterface,
like current capturers for android, mac and ios.

Bug: None
Change-Id: I0dffa9fde5ba069aab6273bfef826d17f03877d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131337
Commit-Queue: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27483}
2019-04-08 12:19:48 +00:00
Noah Richards
a64f397397 Use the preferred capture format on windows.
The existing windows dshow capture code was ignoring the requested
capture format when enumerating preferred formats. This CL changes
the behavior to move the requested format to the start of the
preferred list. This should fix an issue causing MJPEG to be not
selected on certain devices because other formats were preferred,
resulting in reduced framerates for HD capture (USB 2.0 throughput
isn't high enough to support capturing 30fps 720p I420 data, and many
cameras, even internal, are on the USB 2.0 bus).

Note that Chromium has yet a different implementation, which is if
MJPEG is selected, it claims to *only* support MJPEG and no other
formats. This solution seems more correct; if, for some reason,
MJPEG was listed as supported but isn't asked of the pin, this
code will still produce some output, just possibly at a lower framerate
or resolution.

Bug: None
Change-Id: Id86f345936f6f32e08beec02925e41056c87a544
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130843
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27412}
2019-04-02 11:33:17 +00:00
Tommi
30e60d6fd9 Remove dependency on DirectShow baseclasses (streams.h from the winsdk_samples directory).
This required a fairly extensive overhaul:

* Removed locks from the implementation.
  The filter/pin architecture does use multiple threads,
  but the state is controlled on one and synchronization
  is done via flags that don't require locking.
  Note though that the baseclasses used a lot of locking, it's unclear why,
  but perhaps there are things I'm not aware of. The locking was not done
  consistently though, which doesn't seem to have been a problem.
* Change the code to not mix AddRef/Release and use of explicit 'delete'.
* Removed implementations of interfaces we don't need/use.
* Similarly some methods now return E_NOTIMPL.
* Added some utilities to make use of COM interfaces and concepts, easier.

BUG=webrtc:10374
TBR=mbonadei@webrtc.org

Change-Id: Iaedb1157d37ef5d5c75f727dba3d7de75ce22cd8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125086
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Christian Fremerey <chfremer@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27072}
2019-03-12 11:52:20 +00:00
Tommi
8f385e39fa Remove dependency on DECLARE_IUNKNOWN macro on Windows.
Bug: webrtc:10355
Change-Id: I8baea58a3523ed812a3a760ccde123d8405040df
Reviewed-on: https://webrtc-review.googlesource.com/c/124982
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26893}
2019-02-28 10:59:27 +00:00
Mirko Bonadei
28221dee85 Fix more -Wextra-semi.
Chromium has enabled -Wextra-semi on Android, iOS and Windwos builds:
https://chromium-review.googlesource.com/c/1489138
https://chromium-review.googlesource.com/c/1489180
https://chromium-review.googlesource.com/c/1489102

This CL fixes some minor problems in WebRTC and it is a follow-up of
https://webrtc-review.googlesource.com/c/src/+/123560 and
https://webrtc-review.googlesource.com/c/124440.

Bug: webrtc:10355, chromium:926235
Change-Id: Ie9e49077a72c783c3e0fbc21bbe237d7338407e4
Reviewed-on: https://webrtc-review.googlesource.com/c/124680
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26873}
2019-02-27 11:36:23 +00:00
Dan Minor
e22498cc3e Compare GetStreamCaps against S_OK
GetStreamCaps can return S_FALSE, which is not caught by FAILED().
Instead it is necessary to compare for equality with S_OK.

Bug: webrtc:10267
Change-Id: I4113ef5544f830f5cb5f09f143dff43129993d3d
Reviewed-on: https://webrtc-review.googlesource.com/c/120644
Commit-Queue: Dan Minor <dminor@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26539}
2019-02-04 20:18:30 +00:00
Mirko Bonadei
d970807e0c Remove rtc_base/scoped_ref_ptr.h.
The type rtc::scoped_refptr<T> is now part of api/. Please include it from
api/scoped_refptr.h.

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

Bug: webrtc:9887, webrtc:8205
No-Try: True
Change-Id: Ic6c7c81e226e59f12f7933e472f573ae097b55bf
Reviewed-on: https://webrtc-review.googlesource.com/c/119041
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26414}
2019-01-25 20:29:58 +00:00
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
Andreas Pehrson
58df0ada6e Add guards to VideoCaptureDS::Init for when pins are null
GetInputPin() and GetOutputPin() do not guarantee returning non-null pins.
Should either of them return null during Init() we're better off returning an
error than allowing unsafe behavior further ahead.

Bug: webrtc:9941
Change-Id: I25858f0555334b4ef99801f83454931384695bf6
Reviewed-on: https://webrtc-review.googlesource.com/c/108603
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25475}
2018-11-01 17:11:26 +00:00
Mirko Bonadei
5aec1f68f1 Remove clang:find_bad_constructs suppression from modules/video_capture.
This CL removes //build/config/clang:find_bad_constructs from the
suppressed_configs list, which means that clang:find_bad_constructs
is now enabled on these translation units.

Bug: webrtc:9251, webrtc:163
Change-Id: I71350feb45c23d5a0e17e4828c514ce1c353f6a7
Reviewed-on: https://webrtc-review.googlesource.com/96700
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24524}
2018-09-03 07:33:11 +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
Karl Wiberg
434327376b Don't assume that RTC_LOG's << operator is std::ostream
Bug: webrtc:8982, webrtc:9185
Change-Id: I8a88c10725508f7ea8a7f46e8bcdac4afdb2c617
Reviewed-on: https://webrtc-review.googlesource.com/77681
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23359}
2018-05-23 10:07:20 +00:00
Mirko Bonadei
d7624f2d90 Removing clang-cl warning suppression flags in video_capture.
After landing https://webrtc-review.googlesource.com/76720 and
https://webrtc-review.googlesource.com/76722 it is possible to remove
clang-cl only warning suppression flags.

These were needed because winsdk_samples was included using include_dirs
(-I) instead of -imsvc (which is similar to -isystem in GCC and clang).

Bug: webrtc:9251
Change-Id: I2bc19f0ba552342c49a29c07e4fb84d439003dfb
Reviewed-on: https://webrtc-review.googlesource.com/76781
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23252}
2018-05-15 17:33:32 +00:00
Mirko Bonadei
c710ac142e Removing -Wno-comment.
Chromium is suppressing this warning only on GCC [1], so WebRTC should
not suppress it on clang and just rely on Chromium's defaults.

[1] - https://cs.chromium.org/chromium/src/build/config/compiler/BUILD.gn?l=1356&rcl=027d7fa1c191f60f754985b9c235597f8c9a2081

Bug: webrtc:9251
Change-Id: I9316cbdda4083da7d859ff0b9c60579546ddbfcb
Reviewed-on: https://webrtc-review.googlesource.com/75301
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23183}
2018-05-09 09:12:06 +00:00
Mirko Bonadei
d93d01ef63 Lowercase all Windows headers in modules/video_capture.
Bug: None
Change-Id: I962df0d74741d0982ea54e402285a40741a0e94e
Reviewed-on: https://webrtc-review.googlesource.com/67201
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22770}
2018-04-06 13:28:23 +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
Mirko Bonadei
72c4250cab Formatting some files with LOG macros usage.
In order to create a clean CL to switch to RTC_ prefixed LOG macros
this CL runs `git cl format --full` on the files with LOG macros in
the following directories:
- modules/audio_device
- modules/media_file
- modules/video_capture

This CL has been automatically generated with:

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
  for d in media_file video_capture audio_device; do
    cd modules/$d
    git grep -l $m | grep -E "\.(cc|h|m|mm)$" | xargs sed -i "1 s/$/ /"
    cd ../..
  done
done
git cl format --full

Bug: webrtc:8452
Change-Id: I2858b6928e6bd79957f2e5e0b07028eb68a304b2
Reviewed-on: https://webrtc-review.googlesource.com/21322
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20613}
2017-11-09 09:49:12 +00:00
Niels Möller
84255bbe3b Add explicit includes of refcountedobject.h where it is used.
This is in preparation for deleting the include in rtc_base/refcount.h,
but that change has to wait for some downstream applications to 
not rely in the indirect include.

Partial reland of "Make rtc_base/refcount.h self contained, not including refcountedobject.h."

This is a reland of b7239a9dc8
Original change's description:
> Make rtc_base/refcount.h self contained, not including refcountedobject.h.
> 
> The refcount.h file doesn't depend on anything from
> refcountedobject.h. The motivation of this change to make it possible
> to add additional declarations to refcount.h, and include it from
> refcountedobject.h.
> 
> Bug: webrtc:8270
> Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
> Reviewed-on: https://webrtc-review.googlesource.com/5760
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20106}

Bug: webrtc:8270
Change-Id: I63a42712f6c1ec83823c629d1a954fd1a04d4a6c
Reviewed-on: https://webrtc-review.googlesource.com/7281
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20185}
2017-10-06 13:00:14 +00:00
Niels Moller
fb26f85b79 Revert "Reland "Make rtc_base/refcount.h self contained, not including refcountedobject.h.""
This reverts commit bf6937a8e9.

Reason for revert: Broke internal projects.

Original change's description:
> Reland "Make rtc_base/refcount.h self contained, not including refcountedobject.h."
> 
> This is a reland of b7239a9dc8
> Original change's description:
> > Make rtc_base/refcount.h self contained, not including refcountedobject.h.
> > 
> > The refcount.h file doesn't depend on anything from
> > refcountedobject.h. The motivation of this change to make it possible
> > to add additional declarations to refcount.h, and include it from
> > refcountedobject.h.
> > 
> > Bug: webrtc:8270
> > Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
> > Reviewed-on: https://webrtc-review.googlesource.com/5760
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#20106}
> 
> Bug: webrtc:8270
> Change-Id: I9738f6680ab52d0f43639a1a39175fdba5957681
> Reviewed-on: https://webrtc-review.googlesource.com/5840
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20180}

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

Change-Id: I342b241f5bb707b59ccf2d15a1a5befecb53a52e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8270
Reviewed-on: https://webrtc-review.googlesource.com/7280
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20181}
2017-10-06 11:05:55 +00:00
Niels Möller
bf6937a8e9 Reland "Make rtc_base/refcount.h self contained, not including refcountedobject.h."
This is a reland of b7239a9dc8
Original change's description:
> Make rtc_base/refcount.h self contained, not including refcountedobject.h.
> 
> The refcount.h file doesn't depend on anything from
> refcountedobject.h. The motivation of this change to make it possible
> to add additional declarations to refcount.h, and include it from
> refcountedobject.h.
> 
> Bug: webrtc:8270
> Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
> Reviewed-on: https://webrtc-review.googlesource.com/5760
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20106}

Bug: webrtc:8270
Change-Id: I9738f6680ab52d0f43639a1a39175fdba5957681
Reviewed-on: https://webrtc-review.googlesource.com/5840
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20180}
2017-10-06 10:20:48 +00:00
Niels Moller
d25fa78daf Revert "Make rtc_base/refcount.h self contained, not including refcountedobject.h."
This reverts commit b7239a9dc8.

Reason for revert: Broke chromium mac build, compilation failures on content/renderer/media/webrtc/webrtc_video_frame_adapter.h.

Original change's description:
> Make rtc_base/refcount.h self contained, not including refcountedobject.h.
> 
> The refcount.h file doesn't depend on anything from
> refcountedobject.h. The motivation of this change to make it possible
> to add additional declarations to refcount.h, and include it from
> refcountedobject.h.
> 
> Bug: webrtc:8270
> Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
> Reviewed-on: https://webrtc-review.googlesource.com/5760
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20106}

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

Change-Id: I7334597cc8979ba9cfaff526967084349ef27f3c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8270
Reviewed-on: https://webrtc-review.googlesource.com/5800
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20107}
2017-10-03 09:49:04 +00:00
Niels Möller
b7239a9dc8 Make rtc_base/refcount.h self contained, not including refcountedobject.h.
The refcount.h file doesn't depend on anything from
refcountedobject.h. The motivation of this change to make it possible
to add additional declarations to refcount.h, and include it from
refcountedobject.h.

Bug: webrtc:8270
Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
Reviewed-on: https://webrtc-review.googlesource.com/5760
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20106}
2017-10-03 09:37:30 +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