-
-
Notifications
You must be signed in to change notification settings - Fork 941
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
Switch mode without restart #806
base: main
Are you sure you want to change the base?
Conversation
What happens if you basically remove all that you have done and simply change I think you would achieve the same benefit and it would work for both Camera1 and Camera2. |
The issue with your solution is that the capture size is recomputed, but the preview size is not recomputed. But the preview size depends on the capture size... (we want a preview size the same aspect ratio). Maybe there are more issues but this is the one that I can see right now. |
Thanks for your answers, but now in the library we always use previewSize only for Picture, in both mode. Why I need stop and start preview if my preview didn't change after switch mode? |
For example because someone might call: camera.setPictureSize(SizeSelectors.aspectRatio(16/9));
camera.setVideoSize(SizeSelectors.aspectRatio(4/3)); and we want the preview to be 16:9 in the first case and 4:3 in the second case. But in your solution the preview size wouldn't change. I understand that it doesn't matter in your app but I think it matters for the library. If you change restart() with restartBind() you should save some time in my opinion. setMode does not need the full restart indeed |
Yes, I understood you. I think we need more smarter logic in this place. We need look at preview size (ratio) on picture mode and video mode, and if they equal we can switch mode without restart preview and camera. What you think about this idea? I didn't want use |
…w when we switch mode
Hi, @natario1. |
Hi @natario1, |
Hi @natario1, |
Will be cool to have it, especially if you have UI for capturing video/picture like a messenger application. When you have a long tap on a button for recording video and click for the same button for taking pictures. |
Solution
I trying use all actions, which depend on Mode (photo/video), without restart camera (preview, engine), but only for Engine.Camera1. I added flag for this small improve.
@natario1 Maybe you know, which bad effects we will get with this solution.