Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Fail camera capture if there is no media environment #24873

Conversation

youennf
Copy link
Contributor

@youennf youennf commented Feb 21, 2024

857b349

[iOS] Fail camera capture if there is no media environment
https://bugs.webkit.org/show_bug.cgi?id=269837
rdar://121770895

Reviewed by Eric Carlson.

Update UserMediaCaptureManagerProxy::startProducingData to fail capture early if there is the browser entitlement,
capture is for camera and there is no media environment.

We add an ASSERT to MockRealtimeVideoSource::startProducingData and logging in AVVideoCaptureSource::setupSession.

* Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::setCurrentMediaEnvironment):
* Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h:
* Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setupSession):
* Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::startProducingData):
* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:
* Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::startProducingData):
* Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
(WebKit::UserMediaCaptureManagerProxy::ConnectionProxy::setCurrentMediaEnvironment):
* Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/275169@main

4ea61cb

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2   πŸ§ͺ gtk-wk2
βœ… πŸ›  tv   πŸ§ͺ mac-AS-debug-wk2   πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@youennf youennf self-assigned this Feb 21, 2024
@youennf youennf added the WebRTC For bugs in WebRTC label Feb 21, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 21, 2024
Copy link
Contributor

@eric-carlson eric-carlson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: s/Updte/Update/ in the commit message

@youennf youennf force-pushed the eng/iOS-Fail-camera-capture-if-there-is-no-media-environment branch from c1716da to fabc035 Compare February 21, 2024 16:58
@youennf youennf marked this pull request as ready for review February 22, 2024 08:54
@youennf youennf requested a review from cdumez as a code owner February 22, 2024 08:54
@youennf youennf removed the merging-blocked Applied to prevent a change from being merged label Feb 22, 2024
@youennf youennf force-pushed the eng/iOS-Fail-camera-capture-if-there-is-no-media-environment branch from fabc035 to 4ea61cb Compare February 22, 2024 08:56
@youennf youennf added the merge-queue Applied to send a pull request to merge-queue label Feb 22, 2024
https://bugs.webkit.org/show_bug.cgi?id=269837
rdar://121770895

Reviewed by Eric Carlson.

Update UserMediaCaptureManagerProxy::startProducingData to fail capture early if there is the browser entitlement,
capture is for camera and there is no media environment.

We add an ASSERT to MockRealtimeVideoSource::startProducingData and logging in AVVideoCaptureSource::setupSession.

* Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::setCurrentMediaEnvironment):
* Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h:
* Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setupSession):
* Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::startProducingData):
* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:
* Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::startProducingData):
* Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
(WebKit::UserMediaCaptureManagerProxy::ConnectionProxy::setCurrentMediaEnvironment):
* Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/275169@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/iOS-Fail-camera-capture-if-there-is-no-media-environment branch from 4ea61cb to 857b349 Compare February 22, 2024 11:06
@webkit-commit-queue
Copy link
Collaborator

Committed 275169@main (857b349): https://commits.webkit.org/275169@main

Reviewed commits have been landed. Closing PR #24873 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 857b349 into WebKit:main Feb 22, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebRTC For bugs in WebRTC
Projects
None yet
5 participants