-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[camera_avfoundation] Implementation swift migration - part 8 #9635
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
[camera_avfoundation] Implementation swift migration - part 8 #9635
Conversation
a49cb5f
to
2881a7a
Compare
We're trialing Gemini Code Assist for GitHub in this repo, and I'm going to run it here since this is an interesting category of PR that we don't have many examples of. We may well choose to ignore some of its feedback since the goal is not to change behavior, but I'm curious to see how it handles a Swift migration PR. |
/gemini review |
Hello stuartmorgan-g, Thank you for initiating this review and for providing the context of this being part of a larger Swift migration effort. I've thoroughly reviewed the changes in this pull request, focusing on correctness, maintainability, and adherence to the migration goals. Overall, the changes look solid and are a clear step forward in the Swift migration. The logic has been successfully translated from Objective-C to Swift, maintaining the existing functionality and introducing a more Swifty approach where appropriate. Here's a summary of my findings:
Minor Suggestion:
Overall, this is a well-structured and correct migration step. Great work, RobertOdrowaz! Let me know if you have any questions or would like me to elaborate on any points. |
There was a problem hiding this 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 several methods from Objective-C to Swift, including setVideoFormat
, stopVideoRecording
, stopImageStream
, stopping accelerometer updates, setDescriptionWhileRecording
, and createConnection
. The changes involve updating the DefaultCamera
class and modifying the FLTCam
class. The migration appears to be well-structured, with the use of temporary public properties to facilitate access during the transition. The code includes appropriate error handling and checks for various conditions, such as recording status and device capabilities. The changes also include updates to the CHANGELOG.md
file to reflect the migrated methods.
.../camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/DefaultCamera.swift
Outdated
Show resolved
Hide resolved
.../camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/DefaultCamera.swift
Show resolved
Hide resolved
Hm, that was much worse than the first Java change we tried it on. It'll be interesting to see if poor-quality suggestions for Swift is a pattern. |
Migrates camera implementation as part of flutter/flutter#119109
This PR migrates the 5th chunk of
FLTCam
class to Swift:setVideoFormat
stopVideoRecording
stopImageStream
deinit
)setDescriptionWhileRecording
createConnection
(adds Swift implementation, FLTCam still depends on private non-static implementation)NOTE:
setDescriptionWhileRecording
is migrated close to verbatim, the issue affecting it remains.Some properties of the
FLTCam
have to be temporarily made public so that they are accessible inDefaultCamera
.Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
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