-
Notifications
You must be signed in to change notification settings - Fork 325
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
Improving the camera app #188
Comments
Hi, any improvements are very welcome, and the camera script could indeed need some improvements. If you open a PR with suggestions for changes then we can help test, review and propose additional improvements on top of it, thanks! |
Probably passing additional config options would be doable, but camera and other APIs needs a complete rewrite and need to use a foreground service to actually work in newer android versions (especially if started from background), which are planned for future. Video API to be added would also require a service to maintain state. https://developer.android.com/about/versions/11/privacy/foreground-services |
But in the link you provided it says you can't use the camera if started by a foreground service started in the background. |
If you normally start the app that starts the foreground service, then you can use that service to record while app is in background. There is no way around that on android |
Yes, I am aware of that restriction where android kills it if the job is not done fast. I encountered that problem with a timelapse app I wrote, where the alarm receiver would be killed by Android before finishing the job (it needed some seconds because it did other things as well). That problem can be fixed with root though (there is a command to increase that limit for all processes). |
Lot of things can be done with root, but since app is primarily meant for non-rooted users, the design needs to be fixed. The whole app and package scripts need a rewrite actually for many many issues, will be done eventually in future, there are some blockers actually before work can be started, some libraries need to be implemented for the API management so that they can be used for both termux-app and termux-api. |
I haven't checked everything, and I am not an Android developer (just doing this as a hobby) but I thought the reason termux moved to f-droid was because some things can't be done the google way. From my observations, Google (and in some cases the phone makers too) like to make things more and more restrictive. My Oppo phone for example sometimes likes to kill whatever Termux runs, complaining about security issues and the like. Even with the background limit disabled. |
Background process limit in developer options is unrelated and so is broadcast receiver runtime. Many vendors have aggressive killers for app and child processes, some can be disabled, especially with root. You may wanna read:
Google PlayStore doesn't allow apps to have lot of dangerous permissions and their review process is random, F-Droid doesn't have that issue, especially with Termux being open source. |
So after the new magic is done to make Termux compatible with newer Android versions, will it still be possible to start Termux, start sshd, then take pictures with the phone with the screen off? |
I think should be possible, will see. |
Well anyway, so far I added support for ISO, Exposure, Focus. Today I will also add support for disabling image processing (NR and sharpening). I will also add support for WB and for choosing the preview time (500 ms seems a bit excessive in most cases). Now, I am not a Java programmer (I am a low level guy, C, Assembly and the like) so I have a question: I added a bunch of public static variables in the CameraPhotoAPI class. The alternative is to pass them in function parameters, but there are two functions and it will get ugly with so many variables. Is it OK to keep them public static, or do you want me to do it some other way? |
If variables are not going to be used by other classes, then use |
Ok, so I implemented quite a few things, but I plan to do more. Should I clean up the code and submit a patch? Or should I implemented everything I want to, and then make a patch? Some things will take a while to do. |
Whatever works for you. Note that currently I don't have time to review as other work is going on, so merging will take time depending on how big your changes are and when I get time. |
Ok, I created PR, I hope I did it right: termux/termux-api#694 |
I really like the camera command line program, I've been looking for something like this for a long while.
However, the options are very limited, and it also has a small bug, where the max resolution stops at 12 MP rather than 27 MP which is what my phone camera outputs.
I fixed that bug, and started to implement other features, like being able to change the focus distance, iso, exposure, etc. Is there any interest for this code, and would you like it merged with the termux-camera app? If so I can submit a patch soon-ish.
Unfortunately, I am not good at sh scripting, so I can't modify the script that calls the API to add extra options (I am directly invoking the API from command line, and it's a bit ugly). I could use a bit of help on how to pass extra optional arguments.
The text was updated successfully, but these errors were encountered: