Skip to content

Commit 3ea3c6a

Browse files
Revert "[camera_android_camerax] Force new Surface for each SurfaceRequest" (#9500)
Reverts #9360 It uses an API that's not available on `stable`, breaking compilation of the plugin on `stable`.
1 parent 5963ecd commit 3ea3c6a

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

packages/camera/camera_android_camerax/CHANGELOG.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
## 0.6.19
2-
3-
* Ensures that a new surface is provided every time that one is requested to render the camera preview
4-
to fix pausing and resuming the preview.
5-
61
## 0.6.18+3
72

83
* Fixes incorrect camera preview mirroring for front cameras of devices using the Impeller backend.

packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewProxyApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void onSurfaceCleanup() {
121121
// Provide surface.
122122
surfaceProducer.setSize(
123123
request.getResolution().getWidth(), request.getResolution().getHeight());
124-
Surface flutterSurface = surfaceProducer.getForcedNewSurface();
124+
Surface flutterSurface = surfaceProducer.getSurface();
125125
request.provideSurface(
126126
flutterSurface,
127127
Executors.newSingleThreadExecutor(),

packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/PreviewTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ TextureRegistry getTextureRegistry() {
103103
ArgumentCaptor.forClass(TextureRegistry.SurfaceProducer.Callback.class);
104104

105105
when(mockSurfaceRequest.getResolution()).thenReturn(new Size(5, 6));
106-
when(mockSurfaceProducer.getForcedNewSurface()).thenReturn(mock(Surface.class));
106+
when(mockSurfaceProducer.getSurface()).thenReturn(mock(Surface.class));
107107

108108
final Preview.SurfaceProvider previewSurfaceProvider =
109109
api.createSurfaceProvider(mockSurfaceProducer, mockSystemServicesManager);
@@ -155,7 +155,7 @@ TextureRegistry getTextureRegistry() {
155155

156156
when(mockSurfaceRequest.getResolution())
157157
.thenReturn(new Size(resolutionWidth, resolutionHeight));
158-
when(mockSurfaceProducer.getForcedNewSurface()).thenReturn(mockSurface);
158+
when(mockSurfaceProducer.getSurface()).thenReturn(mockSurface);
159159

160160
final ArgumentCaptor<Surface> surfaceCaptor = ArgumentCaptor.forClass(Surface.class);
161161
final ArgumentCaptor<Consumer<SurfaceRequest.Result>> consumerCaptor =

packages/camera/camera_android_camerax/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: camera_android_camerax
22
description: Android implementation of the camera plugin using the CameraX library.
33
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
5-
version: 0.6.19
5+
version: 0.6.18+3
66

77
environment:
88
sdk: ^3.7.0

0 commit comments

Comments
 (0)