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

Add Impeller migration step for camera plugin authors #11008

Merged
merged 22 commits into from
Aug 20, 2024

Conversation

camsim99
Copy link
Contributor

@camsim99 camsim99 commented Aug 6, 2024

Description of what this PR is changing or adding, and why:
Adds a note to the Impeller Android plugins migration to clarify that plugin authors that create a camera preview may additionally need to correct the rotation of the preview due to rotation information of produced Surfaces being lost.

Issues fixed by this PR (if any):
N/A

PRs or commits this PR depends on (if any):
Should land after flutter/packages#6856 as this is mentioned as an example.

cc @navaronbracke

Presubmit checklist

  • This PR is marked as draft with an explanation if not meant to land until a future stable release.
  • This PR doesn’t contain automatically generated corrections (Grammarly or similar).
  • This PR follows the Google Developer Documentation Style Guidelines — for example, it doesn’t use i.e. or e.g., and it avoids I and we (first person).
  • This PR uses semantic line breaks of 80 characters or fewer.

@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Aug 6, 2024

Visit the preview URL for this PR (updated for commit c9bde67):

https://flutter-docs-prod--pr11008-impeller-packages-xp5p23dn.web.app

@camsim99 camsim99 marked this pull request as ready for review August 6, 2024 18:00
@camsim99 camsim99 requested a review from matanlurey August 6, 2024 18:01
to the equation:

```plaintext
rotation = (sensorOrientationDegrees - deviceOrientationDegrees * sign + 360) % 360
Copy link
Contributor

@navaronbracke navaronbracke Aug 6, 2024

Choose a reason for hiding this comment

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

Should we provide more context on how to retrieve sensorOrientationDegrees and deviceOrientationDegrees
directly in this document? (instead of pointing people to a GitHub PR)

We provide code samples for other things in this migration guide (see line 59 in this file), so can we do the same for this addition as well? I don't feel strongly about this, but maybe not everyone writing plugins / reading this doc is okay with going through a potentially long Github PR to find what they need, to migrate.

I would definitely keep the PR link, though, so people have a completed migration to look at as well.

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 added some links for further clarification because I agree that the PR isn't enough. We also had to make some Flutter camera plugin-specific fixes in it, so I don't want the focus to be there.

I think I'll leave it here unless others feel strongly because I think camera plugin authors are familiar with the APIs and could make the migration with this information.

@camsim99 camsim99 requested a review from navaronbracke August 12, 2024 17:32
@camsim99
Copy link
Contributor Author

@parlough Does this need another review from the devrel team or can this be merged?

Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

Hi, @camsim99! There are a few tech writery things I'd like to see fixed. (Writing in present tense, not using "may" which is specified in our writer's guide, linking to the main API site now that the API is live.

Also, there appears to be a link definition that isn't used in the text. Once this little things are cleared up, we can land!

@@ -117,6 +147,11 @@ Relevant PRs:
[`createSurfaceTexture`]: {{site.api}}/javadoc/io/flutter/view/TextureRegistry.html#createSurfaceTexture()
[`getSurface()`]: {{site.api}}/javadoc/io/flutter/view/TextureRegistry.SurfaceProducer.html#getSurface()
[`setCallback`]: https://main-api.flutter.dev/javadoc/io/flutter/view/TextureRegistry.SurfaceProducer.html#setCallback(io.flutter.view.TextureRegistry.SurfaceProducer.Callback)
[`CameraCharacteristics.SENSOR_ORIENTATION`]: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SENSOR_ORIENTATION
[this logic in our camera plugin]: https://github.com/flutter/packages/blob/d9a6de802e1fa74b377721929bfa6de5716ce6d9/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/DeviceOrientationManager.java#L127
Copy link
Contributor

Choose a reason for hiding this comment

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

@camsim99, "this logic in our camera plugin" text doesn't seem to appear in the PR. At least I couldn't find it. If not, can we delete this definition? Or make this a valid link. thx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! Let me remove this.

@camsim99 camsim99 requested a review from a team as a code owner August 20, 2024 18:24
@camsim99 camsim99 requested a review from sfshaza2 August 20, 2024 18:26
Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

lgtm

@sfshaza2 sfshaza2 merged commit a99e785 into flutter:main Aug 20, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants