Skip to content

[camera_avfoundation] Implementation swift migration - part 2 #9007

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RobertOdrowaz
Copy link
Contributor

@RobertOdrowaz RobertOdrowaz commented Apr 5, 2025

Migrates camera implementation as part of flutter/flutter#119109

This PR migrates CameraPlugin class.

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@RobertOdrowaz RobertOdrowaz force-pushed the feature/camera-implementation-swift-migration-part2 branch 3 times, most recently from aa4269d to 8be6136 Compare April 16, 2025 10:43
permissionManager: FLTCameraPermissionManager(
permissionService: FLTDefaultPermissionService()),
deviceFactory: { name in
FLTDefaultCaptureDevice(device: AVCaptureDevice(uniqueID: name)!)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't like the null assertion here, but it is consistent with the ObjC implementation behavior, and I don't want to go into the error handling improvements rabbit hole during the migration

@RobertOdrowaz RobertOdrowaz marked this pull request as ready for review April 16, 2025 11:26
@@ -13,3 +13,7 @@ void FLTEnsureToRunOnMainQueue(dispatch_block_t block) {
block();
}
}

void FLTDispatchQueueSetSpecific(dispatch_queue_t queue, const void *key) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function is moved from QeueueTestUtils. We now need it in CameraPlugin to access the ObjC dispatch queue API from Swift. It will be completely removed once FLTCam is migrated

@RobertOdrowaz RobertOdrowaz force-pushed the feature/camera-implementation-swift-migration-part2 branch from 8be6136 to 859ad13 Compare April 16, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant