mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-28 07:44:06 +01:00
Camera (Android): tidy
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
// Records the largest size the camera can stream in the given pixel format. The stream configurations
|
// Records the largest size the camera can stream in the given pixel format. The stream configurations
|
||||||
// are a flat array of (format, width, height, isInput) quads; a negative format matches any of them.
|
// are a flat array of (format, width, height, isInput) quads; a negative format matches any of them.
|
||||||
static void ffCameraMaxStreamSize(const ACameraMetadata* metadata, int32_t format, uint32_t* width, uint32_t* height) {
|
static void getMaxStreamSize(const ACameraMetadata* metadata, int32_t format, uint32_t* width, uint32_t* height) {
|
||||||
ACameraMetadata_const_entry entry;
|
ACameraMetadata_const_entry entry;
|
||||||
if (ACameraMetadata_getConstEntry(metadata, ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, &entry) != ACAMERA_OK) {
|
if (ACameraMetadata_getConstEntry(metadata, ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, &entry) != ACAMERA_OK) {
|
||||||
return;
|
return;
|
||||||
@@ -94,11 +94,11 @@ const char* ffDetectCamera(FFlist* result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
camera->width = camera->height = 0;
|
camera->width = camera->height = 0;
|
||||||
ffCameraMaxStreamSize(metadata, FF_ANDROID_PIXEL_FORMAT_JPEG, &camera->width, &camera->height);
|
getMaxStreamSize(metadata, FF_ANDROID_PIXEL_FORMAT_JPEG, &camera->width, &camera->height);
|
||||||
if (camera->width == 0) {
|
if (camera->width == 0) {
|
||||||
// Not every camera HAL lists a JPEG format. The largest size of any output format is the
|
// Not every camera HAL lists a JPEG format. The largest size of any output format is the
|
||||||
// same resolution on those devices.
|
// same resolution on those devices.
|
||||||
ffCameraMaxStreamSize(metadata, -1, &camera->width, &camera->height);
|
getMaxStreamSize(metadata, -1, &camera->width, &camera->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
ACameraMetadata_free(metadata);
|
ACameraMetadata_free(metadata);
|
||||||
|
|||||||
Reference in New Issue
Block a user