diff options
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/camera2/Parameters.cpp | 7 | ||||
-rw-r--r-- | services/camera/libcameraservice/camera2/Parameters.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/services/camera/libcameraservice/camera2/Parameters.cpp b/services/camera/libcameraservice/camera2/Parameters.cpp index 95e9d83..6383434 100644 --- a/services/camera/libcameraservice/camera2/Parameters.cpp +++ b/services/camera/libcameraservice/camera2/Parameters.cpp @@ -170,15 +170,16 @@ status_t Parameters::initialize(const CameraMetadata *info) { // PREVIEW_FRAME_RATE / SUPPORTED_PREVIEW_FRAME_RATES are deprecated, but // still have to do something sane for them + // NOTE: Not scaled like FPS range values are. params.set(CameraParameters::KEY_PREVIEW_FRAME_RATE, - previewFpsRange[0] * kFpsToApiScale); + previewFpsRange[0]); { String8 supportedPreviewFrameRates; for (size_t i=0; i < availableFpsRanges.count; i += 2) { if (i != 0) supportedPreviewFrameRates += ","; supportedPreviewFrameRates += String8::format("%d", - availableFpsRanges.data.i32[i] * kFpsToApiScale); + availableFpsRanges.data.i32[i]); } params.set(CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES, supportedPreviewFrameRates); @@ -946,7 +947,7 @@ status_t Parameters::set(const String8& params) { // Deprecated, only use if the preview fps range is unchanged this time. // The single-value FPS is the same as the minimum of the range. if (!fpsRangeChanged) { - validatedParams.previewFps = newParams.getPreviewFrameRate() / kFpsToApiScale; + validatedParams.previewFps = newParams.getPreviewFrameRate(); if (validatedParams.previewFps != previewFps) { camera_metadata_ro_entry_t availableFrameRates = staticInfo(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES); diff --git a/services/camera/libcameraservice/camera2/Parameters.h b/services/camera/libcameraservice/camera2/Parameters.h index 5dd3391..af23a4e 100644 --- a/services/camera/libcameraservice/camera2/Parameters.h +++ b/services/camera/libcameraservice/camera2/Parameters.h @@ -223,6 +223,8 @@ struct Parameters { // Map from camera orientation + facing to gralloc transform enum static int degToTransform(int degrees, bool mirror); + // API specifies FPS ranges are done in fixed point integer, with LSB = 0.001. + // Note that this doesn't apply to the (deprecated) single FPS value. static const int kFpsToApiScale = 1000; // Transform between (-1000,-1000)-(1000,1000) normalized coords from camera |