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

_cameraController intializer takePicture #66

Closed
wants to merge 1 commit into from
Closed

_cameraController intializer takePicture #66

wants to merge 1 commit into from

Conversation

imasif
Copy link

@imasif imasif commented Jul 17, 2019

fixed camera initialization await before takePicture method being called, other wise the following exception was thrown:
Exception has occurred. CameraException (CameraException(error, CaptureRequest contains unconfigured Input/Output Surface!))

Fixes for issue: #62

fixed camera initialization await before takePicture method being called, other wise the following exception was thrown:
`Exception has occurred. CameraException (CameraException(error, CaptureRequest contains unconfigured Input/Output Surface!))`

Fixes for issue: #62
Copy link

@bmabir17 bmabir17 left a comment

Choose a reason for hiding this comment

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

I also faced the similar issue #62 . This solution has worked for me.

@Kleak
Copy link
Contributor

Kleak commented Jul 17, 2019

Does it fix your issues ?
That seems pretty strange since _cameraController.initialize() is called in the start function so as soon as you see the stream on image it should not be necessary to add this call.

@jaumard
Copy link
Collaborator

jaumard commented Jul 19, 2019

I agree with @Kleak, this mean that you're calling takePicture too soon, can you confirm this just by waiting that the camera is Streaming images and then call takePicture ? It should worked normally

@imasif
Copy link
Author

imasif commented Jul 20, 2019

Without waiting to initilialize the takePicture method doesnt work

@imasif
Copy link
Author

imasif commented Jul 29, 2019

I tried this without using the initializer:

await _scanKey.currentState.stop();
        new Timer(const Duration(seconds: 5), ()async{
          await _scanKey.currentState.takePicture(path);
          await _scanKey.currentState.start();
        });

the floowing error is thrown:
E/MethodChannel#plugins.flutter.io/camera(30245): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#plugins.flutter.io/camera(30245): at android.os.MessageQueue.next(MessageQueue.java:326) E/MethodChannel#plugins.flutter.io/camera(30245): at android.os.Looper.loop(Looper.java:165) E/MethodChannel#plugins.flutter.io/camera(30245): at android.app.ActivityThread.main(ActivityThread.java:6806) E/MethodChannel#plugins.flutter.io/camera(30245): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#plugins.flutter.io/camera(30245): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) E/MethodChannel#plugins.flutter.io/camera(30245): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

@jaumard
Copy link
Collaborator

jaumard commented Jul 29, 2019

One question, why do you call stop ?? should work without stoping the camera ^^

@imasif
Copy link
Author

imasif commented Jul 29, 2019

@jaumard can you provide some code working example? I've tried without stop and start, but when I call: await _scanKey.currentState.takePicture(path); it always returns

Exception has occurred. CameraException (CameraException(error, CaptureRequest contains unconfigured Input/Output Surface!))

@jaumard
Copy link
Collaborator

jaumard commented Feb 12, 2020

I'm closing this one, it's taking care by #97 by exposing directly the camera controller so you have full control if you want/need
Thanks !

@jaumard jaumard closed this Feb 12, 2020
@imasif
Copy link
Author

imasif commented Jun 16, 2020

Thanks ! :)

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.

None yet

4 participants