Commit Graph

444 Commits

Author SHA1 Message Date
63173d5bef pipewire: handle deleting the capturer while a D-Bus call is in progress
If a D-Bus call is in progress when a BaseCapturerPipeWire is deleted, then
the user_data is invalid when the callback function is called. This results
in memory corruption.

To fix this, use a GCancellable. If it is canceled, the callback will be
called with a corresponding error. Detect this error and abort before
accessing the user_data.

Note: The first argument is the 'source_object'. For g_dbus_proxy_call()
this is the proxy object not the connection. This was not a problem before,
because it was not used.

Bug: None
Change-Id: I8d5e3fb5c49fcc9afd61cdb8e8249f78b9434faf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149817
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#29326}
2019-09-26 18:58:56 +00:00
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
0a7d5d8408 Set console window NOTOPMOST flag after WindowFinderTest.FindDrawerWindow on Windows
Otherwise it's inconvenient to run the test interactively, since
it leaves the interactive console window topmost preventing any other
window visibility even when the console window is deactivated.

Bug: webrtc:7950
Change-Id: I80a19509f1518550fe93b26feea9e8964b0e405d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150943
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Kimmo Kinnunen FI <kkinnunen@nvidia.com>
Cr-Commit-Position: refs/heads/master@{#29181}
2019-09-13 12:02:38 +00:00
ba5f8e94c8 Revert "Implemented screen enumeration and selection for desktop capture under X11 using the X Resize and Rotate entension version 1.5."
This reverts commit e7153012682ccd3d1eacc18f802cab7820e3bad3.

Reason for revert: Suspect of breaking build on linux_rel Chromium bot, preventing rolls into Chromium.

Sample log message:

FAILED: deb_chrome.deps 
python ../../chrome/installer/linux/debian/calculate_package_deps.py chrome ../../build/linux/debian_sid_amd64-sysroot x64 deb_chrome.deps --distro-check
Dependency libxrandr2 (>= 2:1.5.0) not satisfiable on distro Debian 8 (Jessie) caused by binary chrome
[71411/71430] LINK ./browser_tests
[71412/71430] LINK ./unit_tests
ninja: build stopped: subcommand failed.

Sample failed roll: https://chromium-review.googlesource.com/c/chromium/src/+/1788844

Original change's description:
> Implemented screen enumeration and selection for desktop capture under X11 using the X Resize and Rotate entension version 1.5.
> 
> Bug: chromium:396091
> Change-Id: Ia1b36c771632c536bb8d15322461b479fabc409e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148768
> Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#29083}

TBR=zijiehe@chromium.org,tommi@webrtc.org,julien.isorce@chromium.org,sergeyu@chromium.org,trevor.axiom@gmail.com,jonringle@gmail.com

Change-Id: I4a07213951a14eae524427c0a92d0cad72ade84c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:396091
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151761
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29088}
2019-09-06 05:36:23 +00:00
e715301268 Implemented screen enumeration and selection for desktop capture under X11 using the X Resize and Rotate entension version 1.5.
Bug: chromium:396091
Change-Id: Ia1b36c771632c536bb8d15322461b479fabc409e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148768
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#29083}
2019-09-05 21:19:41 +00:00
5e8ddc360b Reland "Delete mac_utils.h and mac_utils.cc"
This is a reland of ada8e17125d2124f5bcdc1558182ce95d6311d93

Original change's description:
> Delete mac_utils.h and mac_utils.cc
>
> They defined two functions: ToUtf16 and ToUtf8. The former was unused,
> and the latter is moved to
> modules/desktop_capture/mac/window_list_utils.cc, the only user.
>
> Tbr: sergeyu@chromium.org
> Bug: None
> Change-Id: Ib8a513da42e43ba8d41a2de4c1645b3f48448dc9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148531
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sergey Ulanov <sergeyu@google.com>
> Cr-Commit-Position: refs/heads/master@{#28913}

Tbr: kthelgason@webrtc.org
Bug: None
Change-Id: Icda3a2d6e98cfcaf8618035c248104c234e809ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150109
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28979}
2019-08-28 09:30:32 +00:00
a2dae38ee7 Revert "Reland "Delete mac_utils.h and mac_utils.cc""
This reverts commit df578330b8a0b1a003a37ca34253e7344caf17f4.

Reason for revert: Still results in link errors for chromium on mac.

Original change's description:
> Reland "Delete mac_utils.h and mac_utils.cc"
> 
> This is a reland of ada8e17125d2124f5bcdc1558182ce95d6311d93
> 
> Chromium link error should be fixed with
> https://chromium-review.googlesource.com/c/chromium/src/+/1762071
> 
> Original change's description:
> > Delete mac_utils.h and mac_utils.cc
> >
> > They defined two functions: ToUtf16 and ToUtf8. The former was unused,
> > and the latter is moved to
> > modules/desktop_capture/mac/window_list_utils.cc, the only user.
> >
> > Tbr: sergeyu@chromium.org
> > Bug: None
> > Change-Id: Ib8a513da42e43ba8d41a2de4c1645b3f48448dc9
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148531
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> > Reviewed-by: Sergey Ulanov <sergeyu@google.com>
> > Cr-Commit-Position: refs/heads/master@{#28913}
> 
> Tbr: kthelgason@webrtc.org
> Bug: None
> Change-Id: If6d186d565c73e36ddb81b3ff05f6de6c9201326
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149831
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28934}

TBR=zijiehe@chromium.org,nisse@webrtc.org,kthelgason@webrtc.org,sergeyu@chromium.org

Change-Id: I295cd23e63e17186f4c3c857ac0242467b7a68bf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150107
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28937}
2019-08-22 09:58:31 +00:00
df578330b8 Reland "Delete mac_utils.h and mac_utils.cc"
This is a reland of ada8e17125d2124f5bcdc1558182ce95d6311d93

Chromium link error should be fixed with
https://chromium-review.googlesource.com/c/chromium/src/+/1762071

Original change's description:
> Delete mac_utils.h and mac_utils.cc
>
> They defined two functions: ToUtf16 and ToUtf8. The former was unused,
> and the latter is moved to
> modules/desktop_capture/mac/window_list_utils.cc, the only user.
>
> Tbr: sergeyu@chromium.org
> Bug: None
> Change-Id: Ib8a513da42e43ba8d41a2de4c1645b3f48448dc9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148531
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sergey Ulanov <sergeyu@google.com>
> Cr-Commit-Position: refs/heads/master@{#28913}

Tbr: kthelgason@webrtc.org
Bug: None
Change-Id: If6d186d565c73e36ddb81b3ff05f6de6c9201326
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149831
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28934}
2019-08-22 08:30:57 +00:00
e8ef87bdad Include menus & dialogs in frames captured by WindowCapturerWin
This change adds logic to WindowCapturerWin to capture overlapping
owned/pop-up windows (e.g. menus, dialogs, tooltips). This makes window
capture behavior more consistent regardless of whether
CroppingWindowCapturerWin is used & its conditions for using crop-from-
screen capture are met (in ShouldUseScreenCapturer). (I.e. regardless
of OS version, window shape / translucency, occlusion by another
potentially top-most window, or whether the capturing app has opted in
to using the cropping capturer).

Owned/pop-up windows associated with the selected window are enumerated
then captured individually, with their contents composited into the
final frame.

This change also:
- Crops out the top window border (which exposed a bit of the background
  when using the cropping capturer, and resulted in an inconsistent
  appearance compared to the side & bottom borders being cropped out).

Bug: chromium:980864
Change-Id: I81c504848a0c0e6bf122aeff437b400e44944718
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148302
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#28922}
2019-08-21 07:55:07 +00:00
e21f3f574b Revert "Delete mac_utils.h and mac_utils.cc"
This reverts commit ada8e17125d2124f5bcdc1558182ce95d6311d93.

Reason for revert: Breaks chromium, due to undeclared dependency on SystemConfiguration.framework

Original change's description:
> Delete mac_utils.h and mac_utils.cc
> 
> They defined two functions: ToUtf16 and ToUtf8. The former was unused,
> and the latter is moved to
> modules/desktop_capture/mac/window_list_utils.cc, the only user.
> 
> Tbr: sergeyu@chromium.org
> Bug: None
> Change-Id: Ib8a513da42e43ba8d41a2de4c1645b3f48448dc9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148531
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sergey Ulanov <sergeyu@google.com>
> Cr-Commit-Position: refs/heads/master@{#28913}

TBR=zijiehe@chromium.org,nisse@webrtc.org,kthelgason@webrtc.org,sergeyu@google.com,sergeyu@chromium.org

Change-Id: I9d6a2f63b3acde0eefab92d034529b800d6adcab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149811
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28915}
2019-08-20 09:58:37 +00:00
ada8e17125 Delete mac_utils.h and mac_utils.cc
They defined two functions: ToUtf16 and ToUtf8. The former was unused,
and the latter is moved to
modules/desktop_capture/mac/window_list_utils.cc, the only user.

Tbr: sergeyu@chromium.org
Bug: None
Change-Id: Ib8a513da42e43ba8d41a2de4c1645b3f48448dc9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148531
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sergey Ulanov <sergeyu@google.com>
Cr-Commit-Position: refs/heads/master@{#28913}
2019-08-20 08:52:28 +00:00
1544915bb4 Avoid capturing extraneous windows in CroppingWindowCapturerWin
This change reduces cases where capturing a window with the cropping
capturer captures unrelated windows from the same process. For instance:
- Capturing an Explorer window could include portions of taskbar UI,
  e.g. when an auto-hide taskbar or window preview thumbnails are shown
  overtop.
- Capturing a window from a process with multiple windows could include
  menus/tooltips from another window.

Instead of capturing any window with an empty/matching title created by
the same process, the cropping capturer will capture any window created
by the same thread. While not foolproof, this heuristic seems to capture
menus/tooltips from the window of interest while excluding those from
other top-level windows in practice (assuming those were created by a
separate thread / independent message pump).

Bug: webrtc:10856
Change-Id: I2072c79da9e0158475b442a43b5b96d6ad307bc2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148641
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#28824}
2019-08-10 03:40:17 +00:00
e08ca23ec9 Include overlapping dialogs when capturing a window via screen cropping
This change includes windows owned by the primary captured window in the
captured frames if these conditions are met:
1) The owned window (e.g. dialog) overlaps the primary window (in whole
or part)
2) The primary window is otherwise eligible for the crop-from-screen
path (CroppingWindowCapturer is being used, and other conditions in
ShouldUseScreenCapturer are met)

In practice, this means that dialog windows / message boxes are captured
in many cases where they aren't today. This seems beneficial to some
scenarios (e.g. demonstrating / recording how to do something, or
requesting help with something, that involves dialogs).

This is a logical revert of a change for https://crbug.com/webrtc/8062 .
There's some commentary in the newer bug that attempts to make a case
for revisiting that change. (In summary: cases where a dialog would be
substantialy clipped / partial seem relatively uncommon and have
workarounds. Clipping may already occur for menus & tooltips. Clipping
seems less surprising than complete absence.)

Changing the GA_ROOT flag back to GA_ROOTOWNER is sufficient to restore
the older behavior. The removal of the EnumChildWindows call is just a
minor optimization (it was unnecessary/superfluous, since every child
window would match the GA_ROOT check; dialogs are owned root windows,
not child windows).

Removing condition (2) above (capturing dialogs & other related
overlapping windows when not using the crop-from-screen path) is tracked
by https://crbug.com/980864 .

Bug: webrtc:10767
Change-Id: If7b418365685a7b96dc93901ef9367844f9ee99e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147421
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#28711}
2019-07-30 23:54:50 +00:00
366ac4d84e Allow use of CroppingWindowCapturer via CreateWindowCapturer
Currently, apps using WebRTC for window capture only get the benefits of
using CroppingWindowCapturer on Windows (described below) after changing
calls to DesktopCapturer::CreateWindowCapturer to instead call
CroppingWindowCapturer::CreateCapturer. This change adds a new flag to
DesktopCaptureOptions to allow opting in to the faster capture-screen-
and-crop path via the older & more discoverable API.

Benefits of using CroppingWindowCapturer's capture-screen-and-crop path
when possible:
1) It's significantly faster, up to ~36ms/frame (~160x) faster than the
capture-window-contents path in my testing (more details are in the
bug). This difference increased with the recent fix for
https://crbug.com/webrtc/10734 .
2) It allows capture of menus & tooltips (plus dialogs if
https://crbug.com/webrtc/10767 is fixed), partially mitigating
https://crbug.com/980864 .

Downsides of using it:
1) It may inadvertently capture occluding windows that aren't detected
properly, e.g. some system UI: https://crbug.com/webrtc/10835 .
2) It may capture some neighboring regions when moving/resizing the
captured window.

The new flag is not enabled by default, so the default behavior is
unchanged. This could perhaps be revisited after addressing
https://crbug.com/webrtc/10835 .

Bug: webrtc:10825
Change-Id: Ib77e5facc7240c5df311fe1fe204d0d8ea22a96a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146823
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#28695}
2019-07-27 00:50:03 +00:00
fd6d8d7129 Make CroppingWindowCapturer respect detect_updated_region on Windows
This change makes CroppingWindowCapturer::CreateCapturer respect the
detect_updated_region flag if set in the options it's passed on Windows.
Frames captured by the created capturer will now make changes available
via DesktopFrame.updated_region().

Bug: webrtc:10833
Change-Id: Ib973bc58745ebf6e216a7b31f82abec3c6dc9556
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147002
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#28694}
2019-07-27 00:48:33 +00:00
f89110d679 Use PW_RENDERFULLCONTENT to capture occluded windows on Win8.1 and Win10
On Win8.1 and Win10 when the window is occluded the cropping capturer
falls back to the PrintWindow API. But without a special flag it
fails when trying to capture apps that are using DirectComposition.
So just pass this undocumented flag named PW_RENDERFULLCONTENT to fix
the fallback case of the cropping capturer.

Due to new app framing on Win8 and Win10 the shadow of the window
are captured as black like if for the maximize case on Win7. So
just use the utility function webrtc::GetCroppedWindowRect and
remove the local GetWindowDrawableRect helper. The former returns
the same result as the later on Win7 so no real change is made here,
just that we make the WindowCapturerWin compatible with newer Windows.

Bug: webrtc:10734
Change-Id: Idb793ca0691261042569c30410669c4a5ad0c8ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144960
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28570}
2019-07-15 18:58:26 +00:00
0d90a1d039 Do not use hungarian notation for DwmGetWindowAttribute's params
See comments from:
  https://webrtc-review.googlesource.com/c/src/+/143980

Bug: chromium:978885
Change-Id: I1b2ffe36b25fe23f3a91613b048c112f10aa1f54
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145062
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28522}
2019-07-10 10:48:07 +00:00
5e25facefd CroppingWindowCapturerWin: filter out cloaked window.
A cloaked window is composited but not visible to the user.
When Win10 feature 'Cortana' is enabled it creates a window
that is always invisible and its z-order is top most. Because
of that the cropping capturer detects occlusion everywhere
preventing it from capturing anything.

The solution is to ignore all cloaked windows like if
::IsWindowVisible would return false.

Bug: chromium:978885
Change-Id: Id5aa8dc81dcf4979ffb30dd808fa2a553934c6e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143980
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28510}
2019-07-08 19:28:42 +00:00
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
71809c67ce WindowCapturerWin: properly check return value of GetClassName
In debug mode I hit the assert so this function can return 0. So
just skip the window in that case like for other desktop elements

Bug: None
Change-Id: I92abf2a1f450b677632f5eb4332ca218cfd850ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143860
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28408}
2019-06-27 21:11:41 +00:00
240b893fd2 Reland "Link fewer X11-related libraries"
This is a reland of 829a5dce900b781376ea72ba5d869c5dbe58a82d
(unchanged)
Downstream is fixed in https://chromium-review.googlesource.com/1651786

Original change's description:
> Link fewer X11-related libraries
>
> Use an explicit list and don't add X11 dependency to rtc_base.
>
> Allow skipping code that depends on rarer extensions such as Xdamage, Xfixes.
>
> Bug: None
> Change-Id: Icb8d20a267358f5cd3f1ff2af31a669e0670d2f6
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140865
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28204}

Bug: None
Change-Id: I51c60f7713eb49889cebbca2242f33b81b0aef39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141301
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28218}
2019-06-11 07:34:49 +00:00
4606ded90c Revert "Link fewer X11-related libraries"
This reverts commit 829a5dce900b781376ea72ba5d869c5dbe58a82d.

Reason for revert: Suspect of breaking autoroll to chromium: https://crrev.com/c/1651414.

Original change's description:
> Link fewer X11-related libraries
> 
> Use an explicit list and don't add X11 dependency to rtc_base.
> 
> Allow skipping code that depends on rarer extensions such as Xdamage, Xfixes.
> 
> Bug: None
> Change-Id: Icb8d20a267358f5cd3f1ff2af31a669e0670d2f6
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140865
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28204}

TBR=zijiehe@chromium.org,mbonadei@webrtc.org,henrika@webrtc.org,oprypin@webrtc.org,guidou@webrtc.org

Change-Id: Ie106de700fc017dafa603d15eaec88c4790dacfb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141300
Reviewed-by: Marina Ciocea <marinaciocea@webrtc.org>
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28215}
2019-06-10 19:53:42 +00:00
829a5dce90 Link fewer X11-related libraries
Use an explicit list and don't add X11 dependency to rtc_base.

Allow skipping code that depends on rarer extensions such as Xdamage, Xfixes.

Bug: None
Change-Id: Icb8d20a267358f5cd3f1ff2af31a669e0670d2f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140865
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28204}
2019-06-10 08:44:17 +00:00
40244407e3 Lowercase windows includes in desktop_capture/.
Allows building on case-sensitive file systems.

BUG=None

Change-Id: I0ecd494a5ed6e6dc2658d3918f88fa8692a471cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138180
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28031}
2019-05-23 06:36:19 +00:00
da87648470 Check nullity of CGColorSpaceCopyICCProfile's return value
Happens when the window is minimized or during the laps of time it
goes to fullscreen, the CGImage size being 1x1.

Issue introduced when adding ICC profile support, see
https://webrtc-review.googlesource.com/c/src/+/133580

Bug: chromium:945468
Change-Id: I65e90eaaa8999578f6127c229376ead219d7a795
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133708
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Cr-Commit-Position: refs/heads/master@{#27832}
2019-05-03 02:33:29 +00:00
c1187ab34b Partially revert https://webrtc-review.googlesource.com/c/src/+/110461.
X11 returns the image data in a |long|, and CL [1] broke the captured
on 32-bit builds.

[1] - https://webrtc-review.googlesource.com/c/src/+/110461

Bug: chromium:954762
Change-Id: I2620e977ed0dd7ae355b9acd938cfcbeaaa9bfb3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134541
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Wez <wez@google.com>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#27807}
2019-04-29 18:26:49 +00:00
62acb5a8c0 Add ICC profile to DesktopFrame
And fill-in icc profile from the various window and screen capturers.
Done on WindowCapturerMac, ScreenCapturerMac, WindowCapturerX11
and ScreenCapturerX11. Follow-up CLs will do it on ScreenCapturerWinDirectx
and ScreenCapturerPipeWire.

Useful to build the gfx::ColorSpace in chromium, especially
from src/content/browser/media/capture/desktop_capture_device.cc.

We do not build the color space directly here to avoid duplicating
ui/gfx/icc_profile.h,cc code from chromium, which one implements
icc profile caching.

Bug: chromium:945468
Change-Id: Id6e3920233771e035f7578847406bf1f519dcd49
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133580
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#27697}
2019-04-19 22:57:09 +00:00
5665572f47 Avoid a frame copy in WindowCapturerMac
By wraping the cg_data instead of copying it. We had the infrastructure
for it since the work around iosurface, we were just not using it.

Also having a centralized DesktopFrameCGImage::CreateFromCGImage helper
will be useful to parse the ICC Profile at only one place.

Bug: chromium:945468
Change-Id: I69f179064fd9045d992a7baea35820c38e24dacc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133640
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#27696}
2019-04-19 05:05:50 +00:00
6a489f22c7 Fully qualify googletest symbols.
Semi-automatically created with:

git grep -l " testing::" | xargs sed -i "s/ testing::/ ::testing::/g"
git grep -l "(testing::" | xargs sed -i "s/(testing::/(::testing::/g"
git cl format

After this, two .cc files failed to compile and I have fixed them
manually.

Bug: webrtc:10523
Change-Id: I4741d3bcedc831b6c5fdc04485678617eb4ce031
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132018
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27526}
2019-04-09 17:18:20 +00:00
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
27d5ad074c Fix mouse not being shared with Handgouts on Win10
When setting display scale to 200%, the mouse was shared only
for the top left quarter.

Regressed since https://chromium-review.googlesource.com/641075.
Indeed frame->rect() takes into account scale_factor while the
frame is constructed with a size that does not take this scale
factor into account.

Also make sure to do a float disivison in DesktopFrame::scale_factor()
so that it returns 1.5 instead of 1 when dpi is 144 (i.e. 150%).

Bug: chromium:948362
Change-Id: Ic10f44946c9f1b53181244a44a5b45109c259f9f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130371
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Cr-Commit-Position: refs/heads/master@{#27424}
2019-04-02 19:10:34 +00:00
66e7679fb8 Export symbols needed by the Chromium component build (part 8).
This CL uses RTC_EXPORT (defined in rtc_base/system/rtc_export.h)
to mark WebRTC symbols as visible from a shared library, this doesn't
mean these symbols are part of the public API (please continue to refer
to [1] for info about what is considered public WebRTC API).

[1] - https://webrtc.googlesource.com/src/+/HEAD/native-api.md

Bug: webrtc:9419
Change-Id: Ib2c29054b2ae008f5291bd3b762a504b18534326
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130513
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27410}
2019-04-02 10:13:36 +00:00
98e9f29ff0 Improve application window picker on Mac that was not listing all apps.
All application with empty title were not listed, for example Photos.
Fallback to owner name in that case while making sure to keep ignoring
the ghost window.
Most of the ghost windows can be filtered with IsWindowOnScreen
or IsWindowFullScreen except a few. For the remaining ghost we check
if there is no other window with the same pid.

Bug: chromium:516230
Test: Hangouts or Rumpus
Change-Id: Ibb9f98887e5aedf822fc0611836b1938b5056d43
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130360
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27401}
2019-04-01 17:00:41 +00:00
673f7e56e4 Do not assume /DUNICODE and /D_UNICODE.
As a library, WebRTC should not assume UNICODE and _UNICODE to be
defined globally.

This CL explicitly selects wide character functions and types in
order to build WebRTC with /UUNICODE and /U_UNICODE.

Bug: None
Change-Id: Ie4e2bcb4c5c34aee6f68dc7b5b54b76f088ee3e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128904
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Noah Richards <noahric@chromium.org>
Cr-Commit-Position: refs/heads/master@{#27313}
2019-03-27 14:18:41 +00:00
741daaf039 Move rtc::FunctionView to the public API
Bug: webrtc:10138
Change-Id: Icc25a2a277a9608701aaddd546882366739991ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127898
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27227}
2019-03-21 15:23:05 +00:00
94b57c044e Cleanup BUILD.gn files from imports like foo:foo
Repalce all occurrences of foo:foo in deps with just foo in BUILD.gn
files.

Done with Sublime regex replace.
Find: \b([-a-zA-Z0-9_]+):+\1\b
In: *.gn
Replace with: \1

Bug: None
Change-Id: I40aba1b14face687a595b852ffe443cb20197611
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127899
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27225}
2019-03-21 13:05:28 +00:00
22f9925b3e webrtc: Remove semicolons.
Bug: chromium:926235
Change-Id: I66c10ab3df38adf87152d1f18cc8162afedca7e4
Reviewed-on: https://webrtc-review.googlesource.com/c/123560
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26780}
2019-02-20 16:02:59 +00:00
4e7058e621 desktopCaptuer: exempt to overlapping between hidden taskbar and maximized target
On Windows 10, the hidden taskbar won't be totally hidden, but having a
2 pixel margin on the screen. While a maximized app window will use up
the full screen, there will be overlapping between a hidden taskbar and
a maximized app window, which will impact window capture to that
maximized window. If the target window doesn't support GDI methods well,
the capture may be black (i.e. Chrome) or still (i.e. Word).

Because there is no solid way to identify a hidden taskbar window, we
have to make an exemption to the overlapping to a maximized window is
2-pixel X screen-width/height, which is thin enough to be noticed in
the cropping result.

Bug: chromium:838062
Change-Id: I9e0fbdf43b4445ca9fbbf5ed43bb266ae726a5b8
Reviewed-on: https://webrtc-review.googlesource.com/c/123261
Commit-Queue: Brave Yao <braveyao@webrtc.org>
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#26755}
2019-02-19 21:03:10 +00:00
831bd96138 Remove unnecessary memset to DesktopFrame
With a recent change, the webrtc::DesktopFrame is created and
initialized with 0. So it's not necessary to call memset() to
the frame again any more.

See https://webrtc-review.googlesource.com/c/src/+/97184/

Bug: webrtc:9703
Change-Id: I27d096058ead075765f4c49bf60cb8d725da1afd
Reviewed-on: https://webrtc-review.googlesource.com/c/120700
Commit-Queue: Brave Yao <braveyao@webrtc.org>
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26504}
2019-02-01 01:21:48 +00:00
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
2bb29f018a Set callback_ member at start of desktop capturer Start()
Some callback wrappers set the callback_ member at the start, but
most set it after calling any owned implementation of Start().

Setting it after the call means that the callback_ is not set up
for any callbacks that happen during the call.

This cl fixes that by setting the callback_ member before any
calls are made in Start().

Bug: chromium:916961
Change-Id: Id26f8cc98377ef217f928095834162f5526c1fdf
Reviewed-on: https://webrtc-review.googlesource.com/c/117040
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Commit-Queue: Gary Kacmarcik <garykac@chromium.org>
Cr-Commit-Position: refs/heads/master@{#26231}
2019-01-11 21:16:22 +00:00
b46235c1cc desktopCapture: skip non-responsive windows in the picker
This is a following up cl to the fix of crbug.com/911110. On Windows,
if an App window is suspended, it will block some queries (which
causes Chromium freezing and is fixed in Chromium.) and won't be captured.
So there is no reason to list it in the window capture picker.

Notes: this cl can't fix the case that the select app window becomes
non-responsive just before capturing starts. Hope that an extreme corner
case that can be safely ingored.

Bug: chromium:911110
Change-Id: I0d14872ac699d559f40b3bff70f048efc67ca5d9
Reviewed-on: https://webrtc-review.googlesource.com/c/115441
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Brave Yao <braveyao@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26230}
2019-01-11 19:21:22 +00:00
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
762543fcab Reland "Default to dlopening the PipeWire."
This is a reland of 0cc42d47389c039c57e47d7ec0c76b97e2da2b0b

Original change's description:
> Reland "Default to dlopening the PipeWire."
>
> This is a reland of a099877d8946eb942046ca1295cc142e4fa7ea6f
>
> Original change's description:
> > Reland "Default to dlopening the PipeWire."
> >
> > This is a reland of a13be019017449c57f48203d0fb778f34f7553a7
> >
> > Original change's description:
> > > Default to dlopening the PipeWire.
> > >
> > > Reuse the existing infra from Chromium to do that. Additionally the
> > > target_gen_dir needs to the added to the include directories, otherwise
> > > the Chromium build will fail as it won't find the generated stubs. Also the
> > > pw_properties_new() was replaced with pw_properties_new_string() as it doesn't
> > > require a variadic parameter because the //tools/generate_stubs/generate_stubs.py
> > > doesn't work with them correctly. With all these changes in place the PipeWire
> > > support is enabled when compiling on Linux.
> > >
> > > Bug: chromium:682122
> > > Change-Id: I3bbc5efaecd9a08e20cbcf998b2cb534224eae7d
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/111081
> > > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > > Reviewed-by: Brave Yao <braveyao@webrtc.org>
> > > Commit-Queue: Tomáš Popela <tomas.popela@gmail.com>
> > > Cr-Commit-Position: refs/heads/master@{#25720}
> >
> > Bug: chromium:682122
> > Change-Id: I3cca3d4d961dc7a088346c8fd3c970d3dfde3b79
> > Reviewed-on: https://webrtc-review.googlesource.com/c/113040
> > Reviewed-by: Weiyong Yao <braveyao@chromium.org>
> > Reviewed-by: Brave Yao <braveyao@webrtc.org>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> > Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#25981}
>
> Bug: chromium:682122
> Change-Id: Ief26c93069f946f981340664a267fcb412229285
> Reviewed-on: https://webrtc-review.googlesource.com/c/114163
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Brave Yao <braveyao@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26004}

Bug: chromium:682122
Change-Id: I0a4ea7b39be5970f26df6dbc3e437dd63cdb8708
Reviewed-on: https://webrtc-review.googlesource.com/c/116280
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26154}
2019-01-08 08:09:42 +00:00
ef77ef3573 Revert "Desktop capturer: Add OnDisplayChanged callback"
This reverts commit d1208c26b1cdb536fdec942207033711101d5d26.

Reason for revert: This cl causes the crashing issue as in
chromium:916961 at starting desktop capture on Windows.

Original change's description:
> Desktop capturer: Add OnDisplayChanged callback
>
> This adds support for a new DesktopCapturer::Callback method
> OnDisplayChanged that is sent at the start of a desktop capture
> session and whenever the display geometry changes.
>
> This cl adds the basic structure to call this api at the start
> of the capture session. Currently Windows only.
>
> A follow-up cl will add support to call this whenever the display
> geometry changes.
>
> Bug: webrtc:10122, chromium:915411
> Change-Id: Ie7283be5992454180daab1a60f58a3b2efdfed56
> Reviewed-on: https://webrtc-review.googlesource.com/c/114020
> Commit-Queue: Gary Kacmarcik <garykac@chromium.org>
> Reviewed-by: Brave Yao <braveyao@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26053}

TBR=jamiewalch@chromium.org,braveyao@webrtc.org,braveyao@chromium.org,garykac@chromium.org

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

Bug: webrtc:10122, chromium:915411, chromium:916961
Change-Id: Id0471e01bb90bb5accdf58262ae2b130cf343ecd
Reviewed-on: https://webrtc-review.googlesource.com/c/115433
Commit-Queue: Brave Yao <braveyao@webrtc.org>
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26095}
2018-12-22 00:10:40 +00:00
d1208c26b1 Desktop capturer: Add OnDisplayChanged callback
This adds support for a new DesktopCapturer::Callback method
OnDisplayChanged that is sent at the start of a desktop capture
session and whenever the display geometry changes.

This cl adds the basic structure to call this api at the start
of the capture session. Currently Windows only.

A follow-up cl will add support to call this whenever the display
geometry changes.

Bug: webrtc:10122, chromium:915411
Change-Id: Ie7283be5992454180daab1a60f58a3b2efdfed56
Reviewed-on: https://webrtc-review.googlesource.com/c/114020
Commit-Queue: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26053}
2018-12-18 21:56:48 +00:00
3073f3d148 Revert "Reland "Default to dlopening the PipeWire.""
This reverts commit 0cc42d47389c039c57e47d7ec0c76b97e2da2b0b.

Reason for revert: Sorry, broke WebRTC roll to Chromium again: https://chromium-review.googlesource.com/c/chromium/src/+/1377299. This time the define now set enabled code around the feature flag already landed and there were failures related to that. I suggest to revert that Chromium CL and re-land it after this CL has landed and been rolled into Chromium (if possible to do so).

Original change's description:
> Reland "Default to dlopening the PipeWire."
> 
> This is a reland of a099877d8946eb942046ca1295cc142e4fa7ea6f
> 
> Original change's description:
> > Reland "Default to dlopening the PipeWire."
> >
> > This is a reland of a13be019017449c57f48203d0fb778f34f7553a7
> >
> > Original change's description:
> > > Default to dlopening the PipeWire.
> > >
> > > Reuse the existing infra from Chromium to do that. Additionally the
> > > target_gen_dir needs to the added to the include directories, otherwise
> > > the Chromium build will fail as it won't find the generated stubs. Also the
> > > pw_properties_new() was replaced with pw_properties_new_string() as it doesn't
> > > require a variadic parameter because the //tools/generate_stubs/generate_stubs.py
> > > doesn't work with them correctly. With all these changes in place the PipeWire
> > > support is enabled when compiling on Linux.
> > >
> > > Bug: chromium:682122
> > > Change-Id: I3bbc5efaecd9a08e20cbcf998b2cb534224eae7d
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/111081
> > > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > > Reviewed-by: Brave Yao <braveyao@webrtc.org>
> > > Commit-Queue: Tomáš Popela <tomas.popela@gmail.com>
> > > Cr-Commit-Position: refs/heads/master@{#25720}
> >
> > Bug: chromium:682122
> > Change-Id: I3cca3d4d961dc7a088346c8fd3c970d3dfde3b79
> > Reviewed-on: https://webrtc-review.googlesource.com/c/113040
> > Reviewed-by: Weiyong Yao <braveyao@chromium.org>
> > Reviewed-by: Brave Yao <braveyao@webrtc.org>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> > Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#25981}
> 
> Bug: chromium:682122
> Change-Id: Ief26c93069f946f981340664a267fcb412229285
> Reviewed-on: https://webrtc-review.googlesource.com/c/114163
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Brave Yao <braveyao@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26004}

TBR=phoglund@webrtc.org,mbonadei@webrtc.org,oprypin@webrtc.org,braveyao@webrtc.org,braveyao@chromium.org,tomas.popela@gmail.com

Change-Id: I9ca52c61210e94182dd6b6a26a136c7f79a2dd0f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:682122
Reviewed-on: https://webrtc-review.googlesource.com/c/114427
Reviewed-by: Henrik Grunell <henrikg@webrtc.org>
Commit-Queue: Henrik Grunell <henrikg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26014}
2018-12-14 14:23:58 +00:00
0cc42d4738 Reland "Default to dlopening the PipeWire."
This is a reland of a099877d8946eb942046ca1295cc142e4fa7ea6f

Original change's description:
> Reland "Default to dlopening the PipeWire."
>
> This is a reland of a13be019017449c57f48203d0fb778f34f7553a7
>
> Original change's description:
> > Default to dlopening the PipeWire.
> >
> > Reuse the existing infra from Chromium to do that. Additionally the
> > target_gen_dir needs to the added to the include directories, otherwise
> > the Chromium build will fail as it won't find the generated stubs. Also the
> > pw_properties_new() was replaced with pw_properties_new_string() as it doesn't
> > require a variadic parameter because the //tools/generate_stubs/generate_stubs.py
> > doesn't work with them correctly. With all these changes in place the PipeWire
> > support is enabled when compiling on Linux.
> >
> > Bug: chromium:682122
> > Change-Id: I3bbc5efaecd9a08e20cbcf998b2cb534224eae7d
> > Reviewed-on: https://webrtc-review.googlesource.com/c/111081
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Brave Yao <braveyao@webrtc.org>
> > Commit-Queue: Tomáš Popela <tomas.popela@gmail.com>
> > Cr-Commit-Position: refs/heads/master@{#25720}
>
> Bug: chromium:682122
> Change-Id: I3cca3d4d961dc7a088346c8fd3c970d3dfde3b79
> Reviewed-on: https://webrtc-review.googlesource.com/c/113040
> Reviewed-by: Weiyong Yao <braveyao@chromium.org>
> Reviewed-by: Brave Yao <braveyao@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25981}

Bug: chromium:682122
Change-Id: Ief26c93069f946f981340664a267fcb412229285
Reviewed-on: https://webrtc-review.googlesource.com/c/114163
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26004}
2018-12-13 19:45:59 +00:00
0697ce2a76 Revert "Reland "Default to dlopening the PipeWire.""
This reverts commit a099877d8946eb942046ca1295cc142e4fa7ea6f.

Reason for revert: Breaks WebRTC roll into Chromium. See https://chromium-review.googlesource.com/c/chromium/src/+/1373891:

In file included from ../../third_party/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc:11:
In file included from ../../third_party/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.h:16:
../../third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h:16:10: fatal error: 'pipewire/pipewire.h' file not found
#include <pipewire/pipewire.h>
         ^~~~~~~~~~~~~~~~~~~~~

Original change's description:
> Reland "Default to dlopening the PipeWire."
> 
> This is a reland of a13be019017449c57f48203d0fb778f34f7553a7
> 
> Original change's description:
> > Default to dlopening the PipeWire.
> >
> > Reuse the existing infra from Chromium to do that. Additionally the
> > target_gen_dir needs to the added to the include directories, otherwise
> > the Chromium build will fail as it won't find the generated stubs. Also the
> > pw_properties_new() was replaced with pw_properties_new_string() as it doesn't
> > require a variadic parameter because the //tools/generate_stubs/generate_stubs.py
> > doesn't work with them correctly. With all these changes in place the PipeWire
> > support is enabled when compiling on Linux.
> >
> > Bug: chromium:682122
> > Change-Id: I3bbc5efaecd9a08e20cbcf998b2cb534224eae7d
> > Reviewed-on: https://webrtc-review.googlesource.com/c/111081
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Brave Yao <braveyao@webrtc.org>
> > Commit-Queue: Tomáš Popela <tomas.popela@gmail.com>
> > Cr-Commit-Position: refs/heads/master@{#25720}
> 
> Bug: chromium:682122
> Change-Id: I3cca3d4d961dc7a088346c8fd3c970d3dfde3b79
> Reviewed-on: https://webrtc-review.googlesource.com/c/113040
> Reviewed-by: Weiyong Yao <braveyao@chromium.org>
> Reviewed-by: Brave Yao <braveyao@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
> Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25981}

TBR=phoglund@webrtc.org,mbonadei@webrtc.org,oprypin@webrtc.org,braveyao@webrtc.org,braveyao@chromium.org,tomas.popela@gmail.com

Change-Id: Icdb6a94c8825f13d75ddc12219e99cee8fef51a0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:682122
Reviewed-on: https://webrtc-review.googlesource.com/c/114162
Reviewed-by: Henrik Grunell <henrikg@webrtc.org>
Commit-Queue: Henrik Grunell <henrikg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25989}
2018-12-12 13:05:56 +00:00
a099877d89 Reland "Default to dlopening the PipeWire."
This is a reland of a13be019017449c57f48203d0fb778f34f7553a7

Original change's description:
> Default to dlopening the PipeWire.
>
> Reuse the existing infra from Chromium to do that. Additionally the
> target_gen_dir needs to the added to the include directories, otherwise
> the Chromium build will fail as it won't find the generated stubs. Also the
> pw_properties_new() was replaced with pw_properties_new_string() as it doesn't
> require a variadic parameter because the //tools/generate_stubs/generate_stubs.py
> doesn't work with them correctly. With all these changes in place the PipeWire
> support is enabled when compiling on Linux.
>
> Bug: chromium:682122
> Change-Id: I3bbc5efaecd9a08e20cbcf998b2cb534224eae7d
> Reviewed-on: https://webrtc-review.googlesource.com/c/111081
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Brave Yao <braveyao@webrtc.org>
> Commit-Queue: Tomáš Popela <tomas.popela@gmail.com>
> Cr-Commit-Position: refs/heads/master@{#25720}

Bug: chromium:682122
Change-Id: I3cca3d4d961dc7a088346c8fd3c970d3dfde3b79
Reviewed-on: https://webrtc-review.googlesource.com/c/113040
Reviewed-by: Weiyong Yao <braveyao@chromium.org>
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25981}
2018-12-12 08:22:57 +00:00