Thanks to the CL https://webrtc-review.googlesource.com/c/src/+/83822
there is now no need to destroy the stream asynchronously.
But the CL above introduced a leak, the streams were stopped but
not destroyed. This CL essentially fixes the leak, it is now safe
to destroy the stream right after being stopped as everything happen
in the same capture thread.
Bug: chromium:851883
Change-Id: I4bf7409246f3957d90040d0d8cf09e98f28d6559
Reviewed-on: https://webrtc-review.googlesource.com/96621
Reviewed-by: Brave Yao <braveyao@webrtc.org>
Reviewed-by: Zijie He <zijiehe@chromium.org>
Commit-Queue: Brave Yao <braveyao@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24519}
This cl is to move the RegisterRefreshAndMoveHandlers to be done on
capture thread, and reverse some execution order of releasing processing,
also remove a lock since the handler is on capturing thread too.
As we doubt the existing sequence may be the cause of a crash due to
race conditions at end of capture.
Bug: chromium:851883
Change-Id: I2254a69815144415424a77b4c82f150cfc369585
Reviewed-on: https://webrtc-review.googlesource.com/83822
Commit-Queue: Brave Yao <braveyao@webrtc.org>
Reviewed-by: Zijie He <zijiehe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#23647}
The issue is visible when reconfiguring the screen arrangement while
sharing the displays. Can sometimes be seen right after starting the
screen sharing.
Indeed CaptureFrame can be called at any time so TakeLatestFrameForDisplay
should always return a valid frame and the call should not empty the
internal container.
Also add missing teardown in the provider on failure case.
Bug: webrtc:8652
Change-Id: Ice151c1da92b9ad2b86ca9368d30d9d21114e53e
Reviewed-on: https://webrtc-review.googlesource.com/69420
Commit-Queue: Zijie He <zijiehe@chromium.org>
Reviewed-by: Zijie He <zijiehe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#22846}
The given IOSurfaceRef was ignored until now. Wrap it into the new
DesktopFrameIOSurface. The new DesktopFrameProvider object is there
to manage them as it has to be done per display id.
From initial measurement this speed-up the frame capture by 2.
Disabled by default for now but it can be enabled by calling
options.set_use_iosurface. This CL will allow to do some advanced
tests.
Bug: webrtc:8652
Change-Id: Ia9ac0b69b30098774941cb378804b45cb1710119
Reviewed-on: https://webrtc-review.googlesource.com/33014
Commit-Queue: Zijie He <zijiehe@chromium.org>
Reviewed-by: Zijie He <zijiehe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#22801}