From d3d5327be479d25b0e77559cae1f0889df616238 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 5 Aug 2024 10:22:24 -0700 Subject: [PATCH 01/18] draft --- .../breaking-changes/android-surface-plugins.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 90810d8cede..419ae1c0386 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -75,6 +75,20 @@ surfaceProducer.setCallback( A full example of using this new API can be found in [PR 6989][] for the `video_player_android` plugin. +## Note on camera previews + +If your plugin implements a camera preview, your migration may also require fixing the rotation of that preview. This is because `Surface`s produced by the `SurfaceProducer` may not contain the transformation information that Android libraries need to correctly rotate the preview. + +In order to correct the rotation, you will need to manually correct the preview by rotating it with respect to the camera sensor orientation and the device orientation according to the equation: + +``` +rotation = (sensorOrientationDegrees - deviceOrientationDegrees * sign + 360) % 360 +``` + +where `sign` is 1 for front-facing cameras and -1 for back-facing cameras. + +For more information on this calculation see the [Android orientation calculation documentation][]. For an example of making this fix, see [the PR we used to fix `camera_android_camerax`][]. + ## Timeline Landed in version: TBD @@ -117,6 +131,8 @@ 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) +[Android orientation calculation documentation]: https://developer.android.com/media/camera/camera2/camera-preview#orientation_calculation +[the PR we used to fix `camera_android_camerax`]: https://github.com/flutter/packages/pull/6856 [Issue 139702]: {{site.repo.flutter}}/issues/139702 [Issue 145930]: {{site.repo.flutter}}/issues/145930 [PR 51061]: {{site.repo.engine}}/pull/51061 From 7acd6a75d5821ec8613413ca87579730dfb800d8 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 6 Aug 2024 10:48:35 -0700 Subject: [PATCH 02/18] reword + 80 chars --- .../breaking-changes/android-surface-plugins.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 419ae1c0386..5c7cdceccd2 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -77,9 +77,14 @@ A full example of using this new API can be found in [PR 6989][] for the ## Note on camera previews -If your plugin implements a camera preview, your migration may also require fixing the rotation of that preview. This is because `Surface`s produced by the `SurfaceProducer` may not contain the transformation information that Android libraries need to correctly rotate the preview. +If your plugin implements a camera preview, your migration may also require +fixing the rotation of that preview. This is because `Surface`s produced by the +`SurfaceProducer` may not contain the transformation information that Android +libraries need to correctly rotate the preview automatically. -In order to correct the rotation, you will need to manually correct the preview by rotating it with respect to the camera sensor orientation and the device orientation according to the equation: +In order to correct the rotation, you will need to rotate the preview with +respect to the camera sensor orientation and the device orientation according +to the equation: ``` rotation = (sensorOrientationDegrees - deviceOrientationDegrees * sign + 360) % 360 @@ -87,7 +92,9 @@ rotation = (sensorOrientationDegrees - deviceOrientationDegrees * sign + 360) % where `sign` is 1 for front-facing cameras and -1 for back-facing cameras. -For more information on this calculation see the [Android orientation calculation documentation][]. For an example of making this fix, see [the PR we used to fix `camera_android_camerax`][]. +For more information on this calculation see the +[Android orientation calculation documentation][]. For an example of making +this fix, see [the PR we used to fix `camera_android_camerax`][]. ## Timeline From 6ea31403870c35df7b2f8a02f4523f9946666fec Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 6 Aug 2024 10:51:31 -0700 Subject: [PATCH 03/18] add plaintext --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 5c7cdceccd2..f648042c9f4 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -86,7 +86,7 @@ In order to correct the rotation, you will need to rotate the preview with respect to the camera sensor orientation and the device orientation according to the equation: -``` +```plaintext rotation = (sensorOrientationDegrees - deviceOrientationDegrees * sign + 360) % 360 ``` From db7cd6b77ed173e622c19b4268a91ec04cc6549c Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 12 Aug 2024 10:04:56 -0700 Subject: [PATCH 04/18] Address review --- .../android-surface-plugins.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index a82ec5cde60..25ec5536ed0 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -90,10 +90,20 @@ to the equation: rotation = (sensorOrientationDegrees - deviceOrientationDegrees * sign + 360) % 360 ``` -where `sign` is 1 for front-facing cameras and -1 for back-facing cameras. +where `sign` is 1 for front-facing cameras and -1 for back-facing cameras. + +To calculate this rotation, +- Retrieve the sensor orientation degrees by retrieving the value of +[`CameraCharacteristics.SENSOR_ORIENTATION`][]. +- Calculate the device orientation degrees with +[this logic in our camera plugin][] that is dependent on the default capture +rotation and orientation of the device screen (how to retrieve these is also +shown). + +To apply this rotation, you may use a [`RotatedBox`][] widget. For more information on this calculation see the -[Android orientation calculation documentation][]. For an example of making +[Android orientation calculation documentation][]. For a full example of making this fix, see [the PR we used to fix `camera_android_camerax`][]. ## Timeline @@ -138,8 +148,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 +[`RotatedBox`]: https://api.flutter.dev/flutter/widgets/RotatedBox-class.html [Android orientation calculation documentation]: https://developer.android.com/media/camera/camera2/camera-preview#orientation_calculation -[the PR we used to fix `camera_android_camerax`]: https://github.com/flutter/packages/pull/6856 +[the PR we used to fix `camera_android_camerax`]: https://github.com/flutter/packages/pull/7044 [Issue 139702]: {{site.repo.flutter}}/issues/139702 [Issue 145930]: {{site.repo.flutter}}/issues/145930 [PR 51061]: {{site.repo.engine}}/pull/51061 From 9fee67b3a273560b395690085fba10797fe52428 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 12 Aug 2024 10:14:03 -0700 Subject: [PATCH 05/18] Change dev orientation instructions to point to official documentation --- .../release/breaking-changes/android-surface-plugins.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 25ec5536ed0..1f0f63af02e 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -95,10 +95,8 @@ where `sign` is 1 for front-facing cameras and -1 for back-facing cameras. To calculate this rotation, - Retrieve the sensor orientation degrees by retrieving the value of [`CameraCharacteristics.SENSOR_ORIENTATION`][]. -- Calculate the device orientation degrees with -[this logic in our camera plugin][] that is dependent on the default capture -rotation and orientation of the device screen (how to retrieve these is also -shown). +- Retrieve the device orientation degrees in one of the ways that the +[Android orientation calculation documentation][] details. To apply this rotation, you may use a [`RotatedBox`][] widget. From 056c5ecc9deb1fba49c43bfa94827c4041285eec Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 12 Aug 2024 10:18:59 -0700 Subject: [PATCH 06/18] Clarify device orientation degrees --- .../release/breaking-changes/android-surface-plugins.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 1f0f63af02e..6470823ba55 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -90,7 +90,8 @@ to the equation: rotation = (sensorOrientationDegrees - deviceOrientationDegrees * sign + 360) % 360 ``` -where `sign` is 1 for front-facing cameras and -1 for back-facing cameras. +where `deviceOrientationDegrees` is counterclockwise degrees and `sign` is 1 for +front-facing cameras and -1 for back-facing cameras. To calculate this rotation, - Retrieve the sensor orientation degrees by retrieving the value of From 11b707f694ee74655c86e06f3b0c591cc6f8054a Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:18:09 -0700 Subject: [PATCH 07/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 6470823ba55..1a0744fd3e2 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -77,7 +77,7 @@ A full example of using this new API can be found in [PR 6989][] for the ## Note on camera previews -If your plugin implements a camera preview, your migration may also require +If your plugin implements a camera preview, your migration might also require fixing the rotation of that preview. This is because `Surface`s produced by the `SurfaceProducer` may not contain the transformation information that Android libraries need to correctly rotate the preview automatically. From 99c5b223e7f44dd77b1d94b942728aec353e7902 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:18:22 -0700 Subject: [PATCH 08/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 1a0744fd3e2..e6ccecf5b39 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -82,7 +82,7 @@ fixing the rotation of that preview. This is because `Surface`s produced by the `SurfaceProducer` may not contain the transformation information that Android libraries need to correctly rotate the preview automatically. -In order to correct the rotation, you will need to rotate the preview with +In order to correct the rotation, you need to rotate the preview with respect to the camera sensor orientation and the device orientation according to the equation: From 7da2899b26fce6d3b5d9eddc1d974b1353d4de21 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:18:27 -0700 Subject: [PATCH 09/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index e6ccecf5b39..5941adb8e5c 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -99,7 +99,7 @@ To calculate this rotation, - Retrieve the device orientation degrees in one of the ways that the [Android orientation calculation documentation][] details. -To apply this rotation, you may use a [`RotatedBox`][] widget. +To apply this rotation, you can use a [`RotatedBox`][] widget. For more information on this calculation see the [Android orientation calculation documentation][]. For a full example of making From 45d947fc53ac87ff14322765299b60b3e29bd2ec Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:18:34 -0700 Subject: [PATCH 10/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 5941adb8e5c..aedc4267bef 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -101,7 +101,7 @@ To calculate this rotation, To apply this rotation, you can use a [`RotatedBox`][] widget. -For more information on this calculation see the +For more information on this calculation, check out the [Android orientation calculation documentation][]. For a full example of making this fix, see [the PR we used to fix `camera_android_camerax`][]. From adcf9ffd5efa6c86fde2d582454163a8e18ec96d Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:18:43 -0700 Subject: [PATCH 11/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index aedc4267bef..92a5b6ad4a1 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -103,7 +103,7 @@ To apply this rotation, you can use a [`RotatedBox`][] widget. For more information on this calculation, check out the [Android orientation calculation documentation][]. For a full example of making -this fix, see [the PR we used to fix `camera_android_camerax`][]. +this fix, check out [this `camera_android_camerax` PR][]. ## Timeline From fbf4da230f5ecfbb51a44cb6ced9627bd7ab17d5 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:18:52 -0700 Subject: [PATCH 12/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 92a5b6ad4a1..28dc0e55d8b 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -149,7 +149,7 @@ Relevant PRs: [`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 -[`RotatedBox`]: https://api.flutter.dev/flutter/widgets/RotatedBox-class.html +[`RotatedBox`]: {{site.api}}/flutter/widgets/RotatedBox-class.html [Android orientation calculation documentation]: https://developer.android.com/media/camera/camera2/camera-preview#orientation_calculation [the PR we used to fix `camera_android_camerax`]: https://github.com/flutter/packages/pull/7044 [Issue 139702]: {{site.repo.flutter}}/issues/139702 From 026353283629746312f8da26a7180de46514a980 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:18:59 -0700 Subject: [PATCH 13/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 28dc0e55d8b..63addcb926e 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -151,7 +151,7 @@ Relevant PRs: [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 [`RotatedBox`]: {{site.api}}/flutter/widgets/RotatedBox-class.html [Android orientation calculation documentation]: https://developer.android.com/media/camera/camera2/camera-preview#orientation_calculation -[the PR we used to fix `camera_android_camerax`]: https://github.com/flutter/packages/pull/7044 +[this`camera_android_camerax` PR]: {{site.repo.flutter}}/packages/pull/7044 [Issue 139702]: {{site.repo.flutter}}/issues/139702 [Issue 145930]: {{site.repo.flutter}}/issues/145930 [PR 51061]: {{site.repo.engine}}/pull/51061 From c9a14efdc727b9d53e7aeaa8e3c2c0d22181b146 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:19:06 -0700 Subject: [PATCH 14/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 63addcb926e..a08d96f8fe8 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -150,7 +150,7 @@ Relevant PRs: [`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 [`RotatedBox`]: {{site.api}}/flutter/widgets/RotatedBox-class.html -[Android orientation calculation documentation]: https://developer.android.com/media/camera/camera2/camera-preview#orientation_calculation +[Android orientation calculation documentation]: {{site.android-dev}}/media/camera/camera2/camera-preview#orientation_calculation [this`camera_android_camerax` PR]: {{site.repo.flutter}}/packages/pull/7044 [Issue 139702]: {{site.repo.flutter}}/issues/139702 [Issue 145930]: {{site.repo.flutter}}/issues/145930 From ef521f11bf53546442dacf8ff3cd5a6ba029b9d4 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:19:12 -0700 Subject: [PATCH 15/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index a08d96f8fe8..0d09a9d3c64 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -146,7 +146,7 @@ Relevant PRs: [`createSurfaceProducer`]: {{site.api}}/javadoc/io/flutter/view/TextureRegistry.html#createSurfaceProducer() [`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) +[`setCallback`]: {{site.api}}/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 [`RotatedBox`]: {{site.api}}/flutter/widgets/RotatedBox-class.html From 48cf2a22bc6a58905948c17e27203f8abe74c06b Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:19:31 -0700 Subject: [PATCH 16/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 0d09a9d3c64..b6bfb4750cf 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -79,7 +79,7 @@ A full example of using this new API can be found in [PR 6989][] for the If your plugin implements a camera preview, your migration might also require fixing the rotation of that preview. This is because `Surface`s produced by the -`SurfaceProducer` may not contain the transformation information that Android +`SurfaceProducer` might not contain the transformation information that Android libraries need to correctly rotate the preview automatically. In order to correct the rotation, you need to rotate the preview with From f5a9c2960afec68a93d7516d0ec757ae8eaeb532 Mon Sep 17 00:00:00 2001 From: Camille Simon <43054281+camsim99@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:19:40 -0700 Subject: [PATCH 17/18] Update src/content/release/breaking-changes/android-surface-plugins.md Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com> --- src/content/release/breaking-changes/android-surface-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index b6bfb4750cf..290da57f52b 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -147,7 +147,7 @@ Relevant PRs: [`createSurfaceTexture`]: {{site.api}}/javadoc/io/flutter/view/TextureRegistry.html#createSurfaceTexture() [`getSurface()`]: {{site.api}}/javadoc/io/flutter/view/TextureRegistry.SurfaceProducer.html#getSurface() [`setCallback`]: {{site.api}}/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 +[`CameraCharacteristics.SENSOR_ORIENTATION`]: {{site.android-dev}}/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 [`RotatedBox`]: {{site.api}}/flutter/widgets/RotatedBox-class.html [Android orientation calculation documentation]: {{site.android-dev}}/media/camera/camera2/camera-preview#orientation_calculation From 6a7522c36d9cbc721dd8017f7dc02a791e4b9ccf Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 20 Aug 2024 11:24:07 -0700 Subject: [PATCH 18/18] remove unused link --- src/content/release/breaking-changes/android-surface-plugins.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/content/release/breaking-changes/android-surface-plugins.md b/src/content/release/breaking-changes/android-surface-plugins.md index 6470823ba55..a506a30f59e 100644 --- a/src/content/release/breaking-changes/android-surface-plugins.md +++ b/src/content/release/breaking-changes/android-surface-plugins.md @@ -148,7 +148,6 @@ Relevant PRs: [`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 [`RotatedBox`]: https://api.flutter.dev/flutter/widgets/RotatedBox-class.html [Android orientation calculation documentation]: https://developer.android.com/media/camera/camera2/camera-preview#orientation_calculation [the PR we used to fix `camera_android_camerax`]: https://github.com/flutter/packages/pull/7044