Skip to content

Conversation

@RobertOdrowaz
Copy link
Contributor

Migrates camera implementation as part of flutter/flutter#119109

This PR migrates the 7th chunk of FLTCam class to Swift:

  • captureToFile
  • getTemporaryFilePath

We can also finally switch to Swift interface for dispatch queue specific because all usages are now in Swift.

Pre-Review Checklist

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

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

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

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request migrates captureToFile and getTemporaryFilePath to Swift and updates the dispatch queue handling to use modern Swift APIs. I've provided suggestions to improve the robustness of the new Swift code by avoiding potential runtime issues related to force-indexing and force-casting.

@RobertOdrowaz RobertOdrowaz force-pushed the feature/camera-implementation-swift-migration-part10 branch from e47c2b5 to f472203 Compare July 23, 2025 10:42
@RobertOdrowaz RobertOdrowaz force-pushed the feature/camera-implementation-swift-migration-part10 branch from f472203 to 50f66ca Compare July 25, 2025 07:37
@RobertOdrowaz
Copy link
Contributor Author

FYI I've added a commit that removes the ObjC implementation of getTemporaryFilePath. I've made the method private before, but forgot to remove the implementation

@RobertOdrowaz RobertOdrowaz added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 29, 2025
@auto-submit auto-submit bot merged commit 699fb4d into flutter:main Jul 29, 2025
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 29, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jul 29, 2025
flutter/packages@6b2e34e...ed235d1

2025-07-29 [email protected] Roll Flutter from
cfbaa18 to 46b097a (12 revisions) (flutter/packages#9695)
2025-07-29 [email protected] [camera_avfoundation]
Implementation swift migration - part 10 (flutter/packages#9664)
2025-07-29 [email protected]
[interactive_media_ads] Adds remaining methods for internal wrapper of
the native `AdsRequest` (flutter/packages#9663)
2025-07-28 [email protected]
[camera_android_camerax] Delete unused file (flutter/packages#9634)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
…er#9664)

Migrates camera implementation as part of flutter/flutter#119109

This PR migrates the 7th chunk of `FLTCam` class to Swift:
* `captureToFile`
* `getTemporaryFilePath`

We can also finally switch to Swift interface for dispatch queue specific because all usages are now in Swift.

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^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.
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
flutter/packages@6b2e34e...ed235d1

2025-07-29 [email protected] Roll Flutter from
cfbaa18 to 46b097a (12 revisions) (flutter/packages#9695)
2025-07-29 [email protected] [camera_avfoundation]
Implementation swift migration - part 10 (flutter/packages#9664)
2025-07-29 [email protected]
[interactive_media_ads] Adds remaining methods for internal wrapper of
the native `AdsRequest` (flutter/packages#9663)
2025-07-28 [email protected]
[camera_android_camerax] Delete unused file (flutter/packages#9634)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
flutter/packages@6b2e34e...ed235d1

2025-07-29 [email protected] Roll Flutter from
cfbaa18 to 46b097a (12 revisions) (flutter/packages#9695)
2025-07-29 [email protected] [camera_avfoundation]
Implementation swift migration - part 10 (flutter/packages#9664)
2025-07-29 [email protected]
[interactive_media_ads] Adds remaining methods for internal wrapper of
the native `AdsRequest` (flutter/packages#9663)
2025-07-28 [email protected]
[camera_android_camerax] Delete unused file (flutter/packages#9634)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
flutter/packages@6b2e34e...ed235d1

2025-07-29 [email protected] Roll Flutter from
cfbaa18 to 46b097a (12 revisions) (flutter/packages#9695)
2025-07-29 [email protected] [camera_avfoundation]
Implementation swift migration - part 10 (flutter/packages#9664)
2025-07-29 [email protected]
[interactive_media_ads] Adds remaining methods for internal wrapper of
the native `AdsRequest` (flutter/packages#9663)
2025-07-28 [email protected]
[camera_android_camerax] Delete unused file (flutter/packages#9634)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
flutter/packages@6b2e34e...ed235d1

2025-07-29 [email protected] Roll Flutter from
cfbaa18 to 46b097a (12 revisions) (flutter/packages#9695)
2025-07-29 [email protected] [camera_avfoundation]
Implementation swift migration - part 10 (flutter/packages#9664)
2025-07-29 [email protected]
[interactive_media_ads] Adds remaining methods for internal wrapper of
the native `AdsRequest` (flutter/packages#9663)
2025-07-28 [email protected]
[camera_android_camerax] Delete unused file (flutter/packages#9634)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: camera platform-ios platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants