When a display uses a scale factor (different than 1.0) the previous
cursor position is not properly cleared during a CRD connection on
ChromeOS (see b/235191365).
The issue was that the fix for crbug.com/1323241 does not take device
scaling into account, so that fix would incorrectly not mark the
previous location of the mouse cursor as modified.
Adding proper boundary checks is hard and risky though, as the way the
position of the mouse cursor is reported seems to be platform dependent
(ChromeOS vs Linux vs ...).
So because crbug.com/1323241 only solves a theoretical crash that is rarely if
ever hit in the field, I decided to for now undo the fix for crbug.com/1323241.
A proper boundary check can then later be introduced without any pressure from
a looming release
Bug: chromium:1323241
Bug: b/235191365
Fixed: b/235191365
Test: Manually deployed
Change-Id: Ib09b6cc5e396bd52538332edfc4395ed80c6786e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265391
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Joe Downing <joedow@google.com>
Commit-Queue: Jeroen Dhollander <jeroendh@google.com>
Cr-Commit-Position: refs/heads/main@{#37274}
This crash happened when:
* The cursor was located in the corner
* The screen was resized so that the cursor position is outside of the frame.
This caused us to add out-of-bound coordinates to the frame's updated_region, which caused crashes further down the pipeline.
Bug: chromium:1323241
Test: new unittest
Test: manually reproduced crash
Change-Id: Ie71db58c8a347f00af8a3803fcd55cdcad6eafac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261263
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Jeroen Dhollander <jeroendh@google.com>
Cr-Commit-Position: refs/heads/main@{#36809}
ChromeOS will use DPI (see crrev.com/c/3322917), but the
DesktopAndCursorComposer assumed pixels were used.
Test: Manually ensured it works
Bug: b/208370410
Change-Id: I5fee50d408fd204273946009e6653d4e60d1e458
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259502
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Jeroen Dhollander <jeroendh@google.com>
Cr-Commit-Position: refs/heads/main@{#36597}
Change adapts the `base_capturer_pipewire` so that a portal can be
injected in the capturer. This allows the remoting to inject its
own portal for the purpose of capturing desktop stream as long
as the injected portal provides implementation of the new interface
that is added as part of this change.
Additionally, a method has been exposed on the capturer to get
details about the portal session so that the remoting
implementation can use the same underlying session for controlling
inputs on the remote host.
Finally, desktop capturer interface is extended with a generic
method `GetMetadata` that is used to retrieve session related
information by CRD and relay it over to its input injector. Clients
provide override for the method and it eventually invokes the
underlying `GetSessionDetails` method on the portal instance.
Bug: chromium:1291247
Change-Id: I0dbd154eb16d4149f967c4a818eea51e7e6eb9a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257000
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Salman Malik <salmanmalik@google.com>
Cr-Commit-Position: refs/heads/main@{#36399}
This reverts commit e1223747c2.
Reason for revert: Breaks WebRTC roll into Chromium. E.g:
https://ci.chromium.org/ui/p/chromium/builders/try/cast_shell_linux/1166014/overview
Original change's description:
> wayland: Add a common interface for screencast and remote desktop portal
>
> Change adapts the `base_capturer_pipewire` so that a portal can be
> injected in the capturer. This allows the remoting to inject its
> own portal for the purpose of capturing desktop stream as long
> as the injected portal provides implementation of the new interface
> that is added as part of this change.
>
> Additionally, a method has been exposed on the capturer to get
> details about the portal session so that the remoting
> implementation can use the same underlying session for controlling
> inputs on the remote host.
>
> Finally, desktop capturer interface is extended with a generic
> method `GetMetadata` that is used to retrieve session related
> information by CRD and relay it over to its input injector. Clients
> provide override for the method and it eventually invokes the
> underlying `GetSessionDetails` method on the portal instance.
>
> Bug: chromium:1291247
> Change-Id: I81b7ce3b949d8be2e24e2d303d5fbc76a849209c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256400
> Reviewed-by: Alexander Cooper <alcooper@chromium.org>
> Commit-Queue: Salman Malik <salmanmalik@google.com>
> Cr-Commit-Position: refs/heads/main@{#36323}
Bug: chromium:1291247
Change-Id: I73fbb1b9a103d61fd8d7f04bb8452b3e29da9025
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256801
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36331}
Change adapts the `base_capturer_pipewire` so that a portal can be
injected in the capturer. This allows the remoting to inject its
own portal for the purpose of capturing desktop stream as long
as the injected portal provides implementation of the new interface
that is added as part of this change.
Additionally, a method has been exposed on the capturer to get
details about the portal session so that the remoting
implementation can use the same underlying session for controlling
inputs on the remote host.
Finally, desktop capturer interface is extended with a generic
method `GetMetadata` that is used to retrieve session related
information by CRD and relay it over to its input injector. Clients
provide override for the method and it eventually invokes the
underlying `GetSessionDetails` method on the portal instance.
Bug: chromium:1291247
Change-Id: I81b7ce3b949d8be2e24e2d303d5fbc76a849209c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256400
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Salman Malik <salmanmalik@google.com>
Cr-Commit-Position: refs/heads/main@{#36323}
This CL adds a new property to the DesktopFrame interface to indicate
that the capturer supports cursor capture and the frame may contain
an image of the cursor (if the cursor was over the window or screen
being captured). This allows the DesktopAndCursorComposer to avoid
compositing another image of the cursor on the frame.
This is preferred because natively capturing the cursor will likely
be more efficient, and for WGC the API to disable cursor capture
is only availabe on later versions of Win10, reducing the number
of users that could use it.
Bug: webrtc:12654
Change-Id: I992804ff2a65eb423fb8ecc66e066408dc05e849
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215341
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Austin Orion <auorion@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#33780}
DesktopCapturer includes a few methods that are not pure virtual because
they were added after implementions existed in Chromium. The intent was
to implement them in Chromium and then make them pure virtual, but that
never happened, which caused a bug when DesktopAndCursorComposer did not
delegate source-selection methods to the underlying capturer.
This CL adds the missing methods to a couple of simple pass-through
capturers; I will follow up with the necessary implementations for other
capturers once I've fixed the underlying remoting bug.
Change-Id: Icb3914a3cb3116878f57a9f685163c7670c1f89b
Bug: webrtc:11370
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168780
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#30550}
DesktopAndCursorComposer adds the cursor image to the desktop, but does
not change the updated_region, so it generally doesn't encode correctly
unless the mouse is moving over a region that is changing. This CL
extends the updated region to include the union of the old and new
cursor rects, with an optimization for the case where the cursor has
neither moved nor changed.
Bug: chromium:1043325
Change-Id: I52076c96528820833fda6aa95f5b1fbc0f613909
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166545
Reviewed-by: Sergey Ulanov <sergeyu@google.com>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#30374}
DesktopAndCursorComposer already handles a null MouseCursorMonitor. This
CL allows that code-path to be utilized by callers that already have a
MouseCursorMonitor, allowing its callbacks to be re-used by this class.
This is more efficient, and works around an apparent X Server deadlock
on Linux if multiple MouseCursorMonitors are simultaneously active.
The intended use-case for this is to allow the host-side cursor to be
composited into the desktop image if mouse-lock is active at the client.
Bug: chromium:1043325
Change-Id: I7e036850dd8c17fe55e57db252392062a847d10f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166581
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#30312}
The only callers or non-trivial implementations of this that I could
find are in remoting/ in Chromium, which I plan on fixing once this
gets rolled.
Bug: chromium:1043325
Change-Id: Id5a33fc09bb066f979876b2a7dcbc3dc5c2d3dd9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166560
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#30310}
With Retina monitor connected, OSX and Win10 work differently. OSX will
use logical pixel to cursor location and physical pixel to cursor image.
And Win10 will always use logical coordinate. So the processing in this
patchset should only be applied to OSX only.
Bug: chromium:909784
Change-Id: I038e7769d101fbc3efe08b4739204d523255b609
Reviewed-on: https://webrtc-review.googlesource.com/c/112523
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Brave Yao <braveyao@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25850}
This is a follow-up to
https://webrtc-review.googlesource.com/c/src/+/106280.
This time the whole code base is covered.
Some files may have not been fixed though, whenever the IWYU tool
was breaking the build.
Bug: webrtc:8311
Change-Id: I2c31f552a87e887d33931d46e87b6208b1e483ef
Reviewed-on: https://webrtc-review.googlesource.com/c/111965
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25830}
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}
This is a reland of 89653d5db4
Original change's description:
> [desktopCapture] Unify the position info in DIP coordinates on Mac.
>
> On OSX, the logical(DIP) and physical coordinates are used mixingly.
> For example, the captured image has its size in physical pixels(2x) and
> location in logical(DIP) pixels. Same to the cursor position. This
> causes trouble when we check the relative position of image and cursor
> when there are multiple monitors with different DIP setting connected.
>
> This cl proposed a solution to use DIP pixel for any location info,
> i.e. top-left of a frame and cursor position. Also propose a method to
> get the current scale factor of a window across multiple monitors. And
> save the current scale factor in DPI of the capture frame.
> Then we can check relative position of cursor and frame correctly
> in DIP pixel and compose them in physical pixel.
>
> Bug: webrtc:9178
> Change-Id: I3c076aeac2d6f2c1f63d000d7fff03500aa375ac
> Reviewed-on: https://webrtc-review.googlesource.com/71621
> Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
> Reviewed-by: Zijie He <zijiehe@chromium.org>
> Commit-Queue: Brave Yao <braveyao@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23263}
Bug: webrtc:9178
Change-Id: I97d9150f7b9a4ed6671733b75613ea9c315d5c1d
Reviewed-on: https://webrtc-review.googlesource.com/77481
Reviewed-by: Zijie He <zijiehe@chromium.org>
Commit-Queue: Brave Yao <braveyao@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23289}
This reverts commit 89653d5db4.
Reason for revert:
Tentatively revert since I believe this break remoting unittests on Asan/Tsan
https://chromium-review.googlesource.com/c/chromium/src/+/1063330https://chromium-swarm.appspot.com/task?id=3d8692bedcc85c10&refresh=10&show_raw=1
Original change's description:
> [desktopCapture] Unify the position info in DIP coordinates on Mac.
>
> On OSX, the logical(DIP) and physical coordinates are used mixingly.
> For example, the captured image has its size in physical pixels(2x) and
> location in logical(DIP) pixels. Same to the cursor position. This
> causes trouble when we check the relative position of image and cursor
> when there are multiple monitors with different DIP setting connected.
>
> This cl proposed a solution to use DIP pixel for any location info,
> i.e. top-left of a frame and cursor position. Also propose a method to
> get the current scale factor of a window across multiple monitors. And
> save the current scale factor in DPI of the capture frame.
> Then we can check relative position of cursor and frame correctly
> in DIP pixel and compose them in physical pixel.
>
> Bug: webrtc:9178
> Change-Id: I3c076aeac2d6f2c1f63d000d7fff03500aa375ac
> Reviewed-on: https://webrtc-review.googlesource.com/71621
> Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
> Reviewed-by: Zijie He <zijiehe@chromium.org>
> Commit-Queue: Brave Yao <braveyao@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23263}
TBR=zijiehe@chromium.org,jamiewalch@chromium.org,perkj@webrtc.org,braveyao@webrtc.org
Change-Id: Ica02365925623e21b256d20a21b5625e7ed6f49b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9178
Reviewed-on: https://webrtc-review.googlesource.com/77461
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23280}
On OSX, the logical(DIP) and physical coordinates are used mixingly.
For example, the captured image has its size in physical pixels(2x) and
location in logical(DIP) pixels. Same to the cursor position. This
causes trouble when we check the relative position of image and cursor
when there are multiple monitors with different DIP setting connected.
This cl proposed a solution to use DIP pixel for any location info,
i.e. top-left of a frame and cursor position. Also propose a method to
get the current scale factor of a window across multiple monitors. And
save the current scale factor in DPI of the capture frame.
Then we can check relative position of cursor and frame correctly
in DIP pixel and compose them in physical pixel.
Bug: webrtc:9178
Change-Id: I3c076aeac2d6f2c1f63d000d7fff03500aa375ac
Reviewed-on: https://webrtc-review.googlesource.com/71621
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Reviewed-by: Zijie He <zijiehe@chromium.org>
Commit-Queue: Brave Yao <braveyao@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23263}
After deploying the new DesktopAndCursorComposer ctor in chromium in cl
https://chromium-review.googlesource.com/c/chromium/src/+/980668
The old ctor and relative stuffs can be removed now.
Bug: webrtc:9072
Change-Id: Ibbf23a374883c096b13169bd5289a2d4ece539fa
Reviewed-on: https://webrtc-review.googlesource.com/65341
Commit-Queue: Brave Yao <braveyao@webrtc.org>
Reviewed-by: Zijie He <zijiehe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#22679}
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}
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/desktop_capture/desktop_and_cursor_composer.cc (Browse further)