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

android 8.1 (XA2) compatibility + zoom implementation #115

Open
wants to merge 3 commits into
base: camera2
Choose a base branch
from

Conversation

thigg
Copy link

@thigg thigg commented Oct 15, 2023

wip

droidmediacamera2.cpp Outdated Show resolved Hide resolved
droidmediacamera2.cpp Outdated Show resolved Hide resolved
droidmediacamera2.cpp Outdated Show resolved Hide resolved
droidmediacamera2.cpp Outdated Show resolved Hide resolved
droidmediacamera2.cpp Outdated Show resolved Hide resolved
#if ANDROID_MAJOR >= 9
case ACAMERA_CONTROL_ZOOM_RATIO_RANGE:
params += "max-zoom="+std::to_string(entry.data.f[1])+";";
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we return max-zoom also for older devices?

Copy link
Author

Choose a reason for hiding this comment

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

I think the parameter means the max zoom of optical zooms. This does not really make sense if zoom is only done by cropping the image

Minimum and maximum zoom ratios supported by this camera device.
https://developer.android.google.cn/ndk/reference/group/camera#group___camera_1gga49cf3e5a3deefe079ad036a8fac14627af00bd3268478899b538e6ae1323720fc

@thigg
Copy link
Author

thigg commented Oct 25, 2023

I will continue as soon as I find time. If anyone else wants to change something on this branch, feel free to do so/create a new pr if you are faster than i am

@thigg thigg force-pushed the camera2 branch 2 times, most recently from 7038d50 to 651bbd2 Compare December 9, 2023 12:26
@@ -1352,7 +1359,11 @@ int param_key_string_to_enum(const char *key)
!strcmp(key, android::CameraParameters::KEY_METERING_AREAS) ?
ACAMERA_CONTROL_AE_REGIONS :
!strcmp(key, android::CameraParameters::KEY_ZOOM) ?
ACAMERA_CONTROL_ZOOM_RATIO :
#if ANDORID_MAJOR >= 9

Choose a reason for hiding this comment

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

typo

@@ -19,13 +19,13 @@
#include "droidmediacamera.h"

#include <camera/CameraParameters.h>
#include <camera/NdkCaptureRequest.h>

Choose a reason for hiding this comment

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

I think these were sorted alphabetically before

Copy link
Contributor

Choose a reason for hiding this comment

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

There is an issue with includes in Android versions < 10. In my wip branch I have a comment like this before this include "// This needs to be first because of broken includes in Android < 10"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants