Skip to content

[camera] Reland implementations of flip/change camera while recording #3272

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

Conversation

BradenBagby
Copy link
Contributor

this PR recreates the PR here flutter/plugins#7185 that was the second PR for the federated plugin out of 3 that will be needed.

The first was merged here: flutter/plugins#7011

The 3rd PR exists here flutter/plugins#6478 (comment) and will need to be updated as well

Copy link
Contributor

@hellohuanlin hellohuanlin left a comment

Choose a reason for hiding this comment

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

Re-stamp the iOS part from the previous PR.

@BradenBagby
Copy link
Contributor Author

@bparrishMines and @stuartmorgan Here is the migrated PR that was merged and then reverted containing the fixes for the old Android devices

@stuartmorgan-g
Copy link
Contributor

Capturing from the other issue for ease of reviewing: this is a reland with changes of a previously reviewed/landed/reverted PR. The diffs relative to the original reverted PR are at https://github.com/flutter/plugins/pull/7185/files/69a8c567d474c0a24ee1a7c21e6c06cb61ccd837..6fc7df4c89f435b4e890bd39f49dd9f46e1cf04d

@camsim99 Could you take a look at the diffs since you reviewed the original PR?

@stuartmorgan-g
Copy link
Contributor

Also, should remember this time to have one of us push a commit here to trigger the FTL tests in presubmit.

@stuartmorgan-g stuartmorgan-g changed the title [camera] Recreating PR switch while recording [camera] Reland implementations of flip/change camera while recording Feb 23, 2023
@stuartmorgan-g
Copy link
Contributor

Or I can just do it myself right now so we don't forget :)

@BradenBagby
Copy link
Contributor Author

Same failure for starqlteue-26-en-portrait. Im not sure why because eglSwapBuffers() is supposed to be available for >= 26, and in my separate tests it worked on >= 26. Possibly device specific? I will look more into checking availability of eglSwapBuffers manually instead of just checking Android version. I will have to make the tests pass with either successful flip, or failure/error on flip but no crash since this is likely device specific

Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

Reviewed the changes, just left two nits!

@camsim99
Copy link
Contributor

@BradenBagby On the failure, I'm not sure what it is offhand, but looks like you may need to bump the example app compileSdkVersion to 33 https://cirrus-ci.com/task/4622324217937920?logs=firebase_test_lab#L274.

@BradenBagby
Copy link
Contributor Author

BradenBagby commented Feb 28, 2023

@BradenBagby On the failure, I'm not sure what it is offhand, but looks like you may need to bump the example app compileSdkVersion to 33 https://cirrus-ci.com/task/4622324217937920?logs=firebase_test_lab#L274.

That is due to device_info_plus package. Its a dev dependency I added for Android integration tests. We need to check SDK version to expect failures for devices < 26.

Would you recommend using the old/discontinued device_info package so that warning does not appear? Device_info_plus seems to work I have tested it on sdk 25, 26, and 33 in TestLab. Im thinking the part of the package we are using is supported and we can ignore the warning, but I will change it if needed.

@stuartmorgan-g
Copy link
Contributor

Third-party package dependencies are a liability for us in the longer term, so we avoid them unless there's really no other option.

In this case, since the SDK switch logic being tested is on the native side, we should just test that on the native side. On the Dart side you can have the code allow for either outcome (without switching) with a comment explaining and pointing to the relevant native test.

@BradenBagby BradenBagby removed the request for review from tarrinneal February 28, 2023 18:15
@stuartmorgan-g
Copy link
Contributor

Resolved conflicts so that the full Android tests will re-run in CI.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 7, 2023
@auto-submit auto-submit bot merged commit d311478 into flutter:main Mar 7, 2023
@BradenBagby
Copy link
Contributor Author

BradenBagby commented Mar 7, 2023

@stuartmorgan Tests failed on TestLab. Which I had ran myself on my personal TestLab on the same device and had them succeed. Sorry but will need revert again and Ill run through everything again. Maybe I re-broke it

@stuartmorgan-g
Copy link
Contributor

Ah, it's flaky, which is why it passed presubmit this time.

It's a different failure though, so hopefully that's progress?

java.lang.IllegalStateException: CameraDevice was already closed
     FATAL EXCEPTION: CameraBackground
Process: io.flutter.plugins.cameraexample, PID: 3460
java.lang.IllegalStateException: CameraDevice was already closed
	at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2192)
	at android.hardware.camera2.impl.CameraDeviceImpl.createCaptureRequest(CameraDeviceImpl.java:692)
	at io.flutter.plugins.camera.Camera$DefaultCameraDeviceWrapper.createCaptureRequest(Camera.java:165)
	at io.flutter.plugins.camera.Camera.createCaptureSession(Camera.java:401)
	at io.flutter.plugins.camera.Camera.createCaptureSession(Camera.java:391)
	at io.flutter.plugins.camera.Camera.startPreviewWithVideoRendererStream(Camera.java:1122)
	at io.flutter.plugins.camera.Camera.startPreview(Camera.java:1084)
	at io.flutter.plugins.camera.Camera$1.onOpened(Camera.java:323)
	at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:139)
	at android.os.Handler.handleCallback(Handler.java:789)
	at android.os.Handler.dispatchMessage(Handler.java:98)
	at android.os.Looper.loop(Looper.java:164)
	at android.os.HandlerThread.run(HandlerThread.java:65)

stuartmorgan-g added a commit to stuartmorgan-g/packages that referenced this pull request Mar 7, 2023
@stuartmorgan-g
Copy link
Contributor

#3405 will revert Android. I left the iOS part since there's no reason to keep reverting and re-landing that.

stuartmorgan-g added a commit that referenced this pull request Mar 7, 2023
Reverts the Android part of #3272 (commit d311478), which introduced significant crash flake in the tests.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 8, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 8, 2023
BradenBagby added a commit to BradenBagby/packages that referenced this pull request Mar 13, 2023
@BradenBagby
Copy link
Contributor Author

@stuartmorgan Are you able to send me or make public the logcat.txt from the failing test here: https://console.developers.google.com/storage/browser/flutter_cirrus_testlab/plugins_android_test/camera_android/5094810416054272/92dcbd69-1247-4c79-8ee6-865a4935458c/example/0/

I cannot reproduce this crash on testlab, it passes every time on the same device. Im using the plugin tools firebase-test-lab command and running it on my personal testlab. Trying to get some good logs so I can see whats going on

@stuartmorgan-g
Copy link
Contributor

Unfortunately I don't think there's any way for me to change visibility (we're working on resolving the general access issue here), but here's the specific file: https://drive.google.com/file/d/1lwaHd8CpmS7GV_TdnUno9n-qwmsQ4Sjo/view?usp=share_link

nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
…flutter#3272)

[camera] Reland implementations of flip/change camera while recording
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
Reverts the Android part of flutter#3272 (commit d311478), which introduced significant crash flake in the tests.
auto-submit bot pushed a commit that referenced this pull request Jan 19, 2024
…5930)

`DEVELOPMENT_TEAM` should not be set in the example Xcode app.  Introduced extraneously in #3272
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-android platform-ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants