Commit ac56c26
committed
[macOS] camera OS indicator does not go away when stopping camera and screenshare
rdar://152962650
https://bugs.webkit.org/show_bug.cgi?id=297718
Reviewed by Eric Carlson.
We need to do two things:
- When capture starts, make sure the picker is active.
- When capture is muted, make sure the picker stays active as long as the muted source may be unmuted. This is to ensure that capturing applications that can fullscreen (like KeyNotes) is working appropriately
- When capture is ended, make sure the picker is inactive if there is no other source (started or muted).
To do so, we do the following:
- We move the setActive logic to WebDisplayMediaPromptHelper startObservingPicker/stopObservingPicker.
- We make sure that ScreenCaptureKitCaptureSource keeps its m_sessionSource alive when stopped. This prevents the picker to be set back to inactive too early.
- We continue to recreate m_sessionSource whenever starting to capture (initial start or unmute) to keep the existing code as is.
- We make sure that ScreenCaptureKitCaptureSource clears its m_sessionSource when ended.
Manually tested by muting/unmuting capture and capturing KeyNotes app/fullscreening it.
* Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm:
(WebCore::ScreenCaptureKitCaptureSource::stop):
(WebCore::ScreenCaptureKitCaptureSource::startContentStream):
* Source/WebCore/platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm:
(-[WebDisplayMediaPromptHelper startObservingPicker:]):
(-[WebDisplayMediaPromptHelper stopObservingPicker:]):
(WebCore::ScreenCaptureKitSharingSessionManager::cancelPicking):
(WebCore::ScreenCaptureKitSharingSessionManager::promptWithSCContentSharingPicker):
(-[WebDisplayMediaPromptHelper hasObservingSession]): Deleted.
Canonical link: https://commits.webkit.org/299161@main1 parent ceb7560 commit ac56c26
File tree
2 files changed
+9
-17
lines changed- Source/WebCore/platform/mediastream/mac
2 files changed
+9
-17
lines changedLines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
| 266 | + | |
266 | 267 | | |
267 | | - | |
268 | | - | |
269 | 268 | | |
270 | 269 | | |
271 | 270 | | |
| |||
400 | 399 | | |
401 | 400 | | |
402 | 401 | | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | 402 | | |
407 | 403 | | |
408 | 404 | | |
| |||
Lines changed: 7 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 99 | | |
106 | 100 | | |
107 | 101 | | |
| |||
178 | 172 | | |
179 | 173 | | |
180 | 174 | | |
| 175 | + | |
| 176 | + | |
181 | 177 | | |
182 | 178 | | |
183 | 179 | | |
| |||
187 | 183 | | |
188 | 184 | | |
189 | 185 | | |
| 186 | + | |
| 187 | + | |
190 | 188 | | |
191 | 189 | | |
192 | 190 | | |
| |||
256 | 254 | | |
257 | 255 | | |
258 | 256 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 257 | + | |
| 258 | + | |
263 | 259 | | |
| 260 | + | |
264 | 261 | | |
265 | 262 | | |
266 | 263 | | |
| |||
473 | 470 | | |
474 | 471 | | |
475 | 472 | | |
476 | | - | |
477 | 473 | | |
478 | 474 | | |
479 | 475 | | |
| |||
0 commit comments