From: Igor Murashkin Date: Wed, 28 Nov 2012 00:24:58 +0000 (-0800) Subject: hardware: samsung_slsi: libcamera2: fix metadata symbols X-Git-Tag: cm-10.2-M1^2~36 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fd1276b259b81ba698ae7ae9f641e80dc099ecdb;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git hardware: samsung_slsi: libcamera2: fix metadata symbols Change-Id: I2088c777fa0ac6841189d07c520b5607fc898021 --- diff --git a/libcamera2/ExynosCamera2.cpp b/libcamera2/ExynosCamera2.cpp index 100f0a8..960a5e2 100644 --- a/libcamera2/ExynosCamera2.cpp +++ b/libcamera2/ExynosCamera2.cpp @@ -88,7 +88,7 @@ const nsecs_t Sensor::kExposureTimeRange[2] = const nsecs_t Sensor::kFrameDurationRange[2] = {33331760L, 30000000000L}; // ~1/30 s - 30 sec -const uint8_t Sensor::kColorFilterArrangement = ANDROID_SENSOR_RGGB; +const uint8_t Sensor::kColorFilterArrangement = ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB; const uint32_t kAvailableFormats[5] = { HAL_PIXEL_FORMAT_RAW_SENSOR, @@ -149,38 +149,38 @@ const int32_t jpegResolutionS5K4E5[] = const uint8_t availableAfModesS5K4E5[] = { - ANDROID_CONTROL_AF_OFF, - ANDROID_CONTROL_AF_AUTO, - ANDROID_CONTROL_AF_MACRO, - ANDROID_CONTROL_AF_CONTINUOUS_PICTURE, - ANDROID_CONTROL_AF_CONTINUOUS_VIDEO + ANDROID_CONTROL_AF_MODE_OFF, + ANDROID_CONTROL_AF_MODE_AUTO, + ANDROID_CONTROL_AF_MODE_MACRO, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO }; const uint8_t sceneModeOverridesS5K4E5[] = { // ANDROID_CONTROL_SCENE_MODE_ACTION - ANDROID_CONTROL_AE_ON, - ANDROID_CONTROL_AWB_AUTO, - ANDROID_CONTROL_AF_CONTINUOUS_PICTURE, + ANDROID_CONTROL_AE_MODE_ON, + ANDROID_CONTROL_AWB_MODE_AUTO, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE, // ANDROID_CONTROL_SCENE_MODE_NIGHT - ANDROID_CONTROL_AE_ON, - ANDROID_CONTROL_AWB_AUTO, - ANDROID_CONTROL_AF_CONTINUOUS_PICTURE, + ANDROID_CONTROL_AE_MODE_ON, + ANDROID_CONTROL_AWB_MODE_AUTO, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE, // ANDROID_CONTROL_SCENE_MODE_SUNSET - ANDROID_CONTROL_AE_ON, - ANDROID_CONTROL_AWB_DAYLIGHT, - ANDROID_CONTROL_AF_CONTINUOUS_PICTURE, + ANDROID_CONTROL_AE_MODE_ON, + ANDROID_CONTROL_AWB_MODE_DAYLIGHT, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE, // ANDROID_CONTROL_SCENE_MODE_PARTY - ANDROID_CONTROL_AE_ON_AUTO_FLASH, - ANDROID_CONTROL_AWB_AUTO, - ANDROID_CONTROL_AF_CONTINUOUS_PICTURE + ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH, + ANDROID_CONTROL_AWB_MODE_AUTO, + ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE }; const uint8_t availableAeModesS5K4E5[] = { - ANDROID_CONTROL_AE_OFF, - ANDROID_CONTROL_AE_ON, - ANDROID_CONTROL_AE_ON_AUTO_FLASH + ANDROID_CONTROL_AE_MODE_OFF, + ANDROID_CONTROL_AE_MODE_ON, + ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH }; ExynosCamera2InfoS5K4E5::ExynosCamera2InfoS5K4E5() @@ -245,33 +245,33 @@ const int32_t jpegResolutionS5K6A3[] = const uint8_t availableAfModesS5K6A3[] = { - ANDROID_CONTROL_AF_OFF + ANDROID_CONTROL_AF_MODE_OFF }; const uint8_t sceneModeOverridesS5K6A3[] = { // ANDROID_CONTROL_SCENE_MODE_ACTION - ANDROID_CONTROL_AE_ON, - ANDROID_CONTROL_AWB_AUTO, - ANDROID_CONTROL_AF_OFF, + ANDROID_CONTROL_AE_MODE_ON, + ANDROID_CONTROL_AWB_MODE_AUTO, + ANDROID_CONTROL_AF_MODE_OFF, // ANDROID_CONTROL_SCENE_MODE_NIGHT - ANDROID_CONTROL_AE_ON, - ANDROID_CONTROL_AWB_AUTO, - ANDROID_CONTROL_AF_OFF, + ANDROID_CONTROL_AE_MODE_ON, + ANDROID_CONTROL_AWB_MODE_AUTO, + ANDROID_CONTROL_AF_MODE_OFF, // ANDROID_CONTROL_SCENE_MODE_SUNSET - ANDROID_CONTROL_AE_ON, - ANDROID_CONTROL_AWB_DAYLIGHT, - ANDROID_CONTROL_AF_OFF, + ANDROID_CONTROL_AE_MODE_ON, + ANDROID_CONTROL_AWB_MODE_DAYLIGHT, + ANDROID_CONTROL_AF_MODE_OFF, // ANDROID_CONTROL_SCENE_MODE_PARTY - ANDROID_CONTROL_AE_ON, - ANDROID_CONTROL_AWB_AUTO, - ANDROID_CONTROL_AF_OFF + ANDROID_CONTROL_AE_MODE_ON, + ANDROID_CONTROL_AWB_MODE_AUTO, + ANDROID_CONTROL_AF_MODE_OFF }; const uint8_t availableAeModesS5K6A3[] = { - ANDROID_CONTROL_AE_OFF, - ANDROID_CONTROL_AE_ON + ANDROID_CONTROL_AE_MODE_OFF, + ANDROID_CONTROL_AE_MODE_ON }; ExynosCamera2InfoS5K6A3::ExynosCamera2InfoS5K6A3() @@ -394,31 +394,31 @@ status_t ExynosCamera2::constructStaticInfo(camera_metadata_t **info, // android.lens - ADD_OR_SIZE(ANDROID_LENS_MINIMUM_FOCUS_DISTANCE, + ADD_OR_SIZE(ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE, &(m_curCameraInfo->minFocusDistance), 1); - ADD_OR_SIZE(ANDROID_LENS_HYPERFOCAL_DISTANCE, + ADD_OR_SIZE(ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE, &(m_curCameraInfo->minFocusDistance), 1); - ADD_OR_SIZE(ANDROID_LENS_AVAILABLE_FOCAL_LENGTHS, + ADD_OR_SIZE(ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS, &m_curCameraInfo->focalLength, 1); - ADD_OR_SIZE(ANDROID_LENS_AVAILABLE_APERTURES, + ADD_OR_SIZE(ANDROID_LENS_INFO_AVAILABLE_APERTURES, &m_curCameraInfo->aperture, 1); static const float filterDensity = 0; - ADD_OR_SIZE(ANDROID_LENS_AVAILABLE_FILTER_DENSITY, + ADD_OR_SIZE(ANDROID_LENS_INFO_AVAILABLE_FILTER_DENSITIES, &filterDensity, 1); static const uint8_t availableOpticalStabilization = - ANDROID_LENS_OPTICAL_STABILIZATION_OFF; - ADD_OR_SIZE(ANDROID_LENS_AVAILABLE_OPTICAL_STABILIZATION, + ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF; + ADD_OR_SIZE(ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION, &availableOpticalStabilization, 1); static const int32_t lensShadingMapSize[] = {1, 1}; - ADD_OR_SIZE(ANDROID_LENS_SHADING_MAP_SIZE, lensShadingMapSize, + ADD_OR_SIZE(ANDROID_LENS_INFO_SHADING_MAP_SIZE, lensShadingMapSize, sizeof(lensShadingMapSize)/sizeof(int32_t)); static const float lensShadingMap[3 * 1 * 1 ] = { 1.f, 1.f, 1.f }; - ADD_OR_SIZE(ANDROID_LENS_SHADING_MAP, lensShadingMap, + ADD_OR_SIZE(ANDROID_LENS_INFO_SHADING_MAP, lensShadingMap, sizeof(lensShadingMap)/sizeof(float)); int32_t lensFacing = cameraId ? @@ -426,31 +426,31 @@ status_t ExynosCamera2::constructStaticInfo(camera_metadata_t **info, ADD_OR_SIZE(ANDROID_LENS_FACING, &lensFacing, 1); // android.sensor - ADD_OR_SIZE(ANDROID_SENSOR_EXPOSURE_TIME_RANGE, + ADD_OR_SIZE(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE, Sensor::kExposureTimeRange, 2); - ADD_OR_SIZE(ANDROID_SENSOR_MAX_FRAME_DURATION, + ADD_OR_SIZE(ANDROID_SENSOR_INFO_MAX_FRAME_DURATION, &Sensor::kFrameDurationRange[1], 1); - ADD_OR_SIZE(ANDROID_SENSOR_AVAILABLE_SENSITIVITIES, + ADD_OR_SIZE(ANDROID_SENSOR_INFO_AVAILABLE_SENSITIVITIES, Sensor::kAvailableSensitivities, sizeof(Sensor::kAvailableSensitivities) /sizeof(uint32_t)); - ADD_OR_SIZE(ANDROID_SENSOR_COLOR_FILTER_ARRANGEMENT, + ADD_OR_SIZE(ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT, &Sensor::kColorFilterArrangement, 1); static const float sensorPhysicalSize[2] = {3.20f, 2.40f}; // mm - ADD_OR_SIZE(ANDROID_SENSOR_PHYSICAL_SIZE, + ADD_OR_SIZE(ANDROID_SENSOR_INFO_PHYSICAL_SIZE, sensorPhysicalSize, 2); int32_t pixelArraySize[2] = { m_curCameraInfo->sensorW, m_curCameraInfo->sensorH }; - ADD_OR_SIZE(ANDROID_SENSOR_PIXEL_ARRAY_SIZE, pixelArraySize, 2); - ADD_OR_SIZE(ANDROID_SENSOR_ACTIVE_ARRAY_SIZE, pixelArraySize,2); + ADD_OR_SIZE(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, pixelArraySize, 2); + ADD_OR_SIZE(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE, pixelArraySize,2); - ADD_OR_SIZE(ANDROID_SENSOR_WHITE_LEVEL, + ADD_OR_SIZE(ANDROID_SENSOR_INFO_WHITE_LEVEL, &Sensor::kMaxRawValue, 1); static const int32_t blackLevelPattern[4] = { @@ -468,10 +468,10 @@ status_t ExynosCamera2::constructStaticInfo(camera_metadata_t **info, flashAvailable = 1; else flashAvailable = 0; - ADD_OR_SIZE(ANDROID_FLASH_AVAILABLE, &flashAvailable, 1); + ADD_OR_SIZE(ANDROID_FLASH_INFO_AVAILABLE, &flashAvailable, 1); static const int64_t flashChargeDuration = 0; - ADD_OR_SIZE(ANDROID_FLASH_CHARGE_DURATION, &flashChargeDuration, 1); + ADD_OR_SIZE(ANDROID_FLASH_INFO_CHARGE_DURATION, &flashChargeDuration, 1); // android.tonemap @@ -511,7 +511,7 @@ status_t ExynosCamera2::constructStaticInfo(camera_metadata_t **info, sizeof(kAvailableJpegMinDurations)/sizeof(uint64_t)); static const float maxZoom = 4; - ADD_OR_SIZE(ANDROID_SCALER_AVAILABLE_MAX_ZOOM, &maxZoom, 1); + ADD_OR_SIZE(ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, &maxZoom, 1); // android.jpeg @@ -532,31 +532,31 @@ status_t ExynosCamera2::constructStaticInfo(camera_metadata_t **info, // android.stats static const uint8_t availableFaceDetectModes[] = { - ANDROID_STATS_FACE_DETECTION_OFF, - ANDROID_STATS_FACE_DETECTION_FULL + ANDROID_STATISTICS_FACE_DETECT_MODE_OFF, + ANDROID_STATISTICS_FACE_DETECT_MODE_FULL }; - ADD_OR_SIZE(ANDROID_STATS_AVAILABLE_FACE_DETECT_MODES, + ADD_OR_SIZE(ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES, availableFaceDetectModes, sizeof(availableFaceDetectModes)); m_curCameraInfo->maxFaceCount = CAMERA2_MAX_FACES; - ADD_OR_SIZE(ANDROID_STATS_MAX_FACE_COUNT, + ADD_OR_SIZE(ANDROID_STATISTICS_INFO_MAX_FACE_COUNT, &(m_curCameraInfo->maxFaceCount), 1); static const int32_t histogramSize = 64; - ADD_OR_SIZE(ANDROID_STATS_HISTOGRAM_BUCKET_COUNT, + ADD_OR_SIZE(ANDROID_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT, &histogramSize, 1); static const int32_t maxHistogramCount = 1000; - ADD_OR_SIZE(ANDROID_STATS_MAX_HISTOGRAM_COUNT, + ADD_OR_SIZE(ANDROID_STATISTICS_INFO_MAX_HISTOGRAM_COUNT, &maxHistogramCount, 1); static const int32_t sharpnessMapSize[2] = {64, 64}; - ADD_OR_SIZE(ANDROID_STATS_SHARPNESS_MAP_SIZE, + ADD_OR_SIZE(ANDROID_STATISTICS_INFO_SHARPNESS_MAP_SIZE, sharpnessMapSize, sizeof(sharpnessMapSize)/sizeof(int32_t)); static const int32_t maxSharpnessMapValue = 1000; - ADD_OR_SIZE(ANDROID_STATS_MAX_SHARPNESS_MAP_VALUE, + ADD_OR_SIZE(ANDROID_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE, &maxSharpnessMapValue, 1); // android.control @@ -571,7 +571,7 @@ status_t ExynosCamera2::constructStaticInfo(camera_metadata_t **info, availableSceneModes, sizeof(availableSceneModes)); static const uint8_t availableEffects[] = { - ANDROID_CONTROL_EFFECT_OFF + ANDROID_CONTROL_EFFECT_MODE_OFF }; ADD_OR_SIZE(ANDROID_CONTROL_AVAILABLE_EFFECTS, availableEffects, sizeof(availableEffects)); @@ -586,11 +586,11 @@ status_t ExynosCamera2::constructStaticInfo(camera_metadata_t **info, static const camera_metadata_rational exposureCompensationStep = { 1, 1 }; - ADD_OR_SIZE(ANDROID_CONTROL_AE_EXP_COMPENSATION_STEP, + ADD_OR_SIZE(ANDROID_CONTROL_AE_COMPENSATION_STEP, &exposureCompensationStep, 1); int32_t exposureCompensationRange[] = {-3, 3}; - ADD_OR_SIZE(ANDROID_CONTROL_AE_EXP_COMPENSATION_RANGE, + ADD_OR_SIZE(ANDROID_CONTROL_AE_COMPENSATION_RANGE, exposureCompensationRange, sizeof(exposureCompensationRange)/sizeof(int32_t)); @@ -602,19 +602,19 @@ status_t ExynosCamera2::constructStaticInfo(camera_metadata_t **info, sizeof(availableTargetFpsRanges)/sizeof(int32_t)); static const uint8_t availableAntibandingModes[] = { - ANDROID_CONTROL_AE_ANTIBANDING_OFF, - ANDROID_CONTROL_AE_ANTIBANDING_AUTO + ANDROID_CONTROL_AE_ANTIBANDING_MODE_OFF, + ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO }; ADD_OR_SIZE(ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES, availableAntibandingModes, sizeof(availableAntibandingModes)); static const uint8_t availableAwbModes[] = { - ANDROID_CONTROL_AWB_OFF, - ANDROID_CONTROL_AWB_AUTO, - ANDROID_CONTROL_AWB_INCANDESCENT, - ANDROID_CONTROL_AWB_FLUORESCENT, - ANDROID_CONTROL_AWB_DAYLIGHT, - ANDROID_CONTROL_AWB_CLOUDY_DAYLIGHT + ANDROID_CONTROL_AWB_MODE_OFF, + ANDROID_CONTROL_AWB_MODE_AUTO, + ANDROID_CONTROL_AWB_MODE_INCANDESCENT, + ANDROID_CONTROL_AWB_MODE_FLUORESCENT, + ANDROID_CONTROL_AWB_MODE_DAYLIGHT, + ANDROID_CONTROL_AWB_MODE_CLOUDY_DAYLIGHT }; ADD_OR_SIZE(ANDROID_CONTROL_AWB_AVAILABLE_MODES, availableAwbModes, sizeof(availableAwbModes)); @@ -623,8 +623,8 @@ status_t ExynosCamera2::constructStaticInfo(camera_metadata_t **info, m_curCameraInfo->availableAfModes, m_curCameraInfo->numAvailableAfModes); static const uint8_t availableVstabModes[] = { - ANDROID_CONTROL_VIDEO_STABILIZATION_OFF, - ANDROID_CONTROL_VIDEO_STABILIZATION_ON + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF, + ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_ON }; ADD_OR_SIZE(ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, availableVstabModes, sizeof(availableVstabModes)); @@ -681,7 +681,7 @@ status_t ExynosCamera2::constructDefaultRequest( /** android.request */ - static const uint8_t metadataMode = ANDROID_REQUEST_METADATA_NONE; + static const uint8_t metadataMode = ANDROID_REQUEST_METADATA_MODE_NONE; ADD_OR_SIZE(ANDROID_REQUEST_METADATA_MODE, &metadataMode, 1); static const int32_t id = 0; @@ -707,7 +707,7 @@ status_t ExynosCamera2::constructDefaultRequest( ADD_OR_SIZE(ANDROID_LENS_FILTER_DENSITY, &filterDensity, 1); static const uint8_t opticalStabilizationMode = - ANDROID_LENS_OPTICAL_STABILIZATION_OFF; + ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF; ADD_OR_SIZE(ANDROID_LENS_OPTICAL_STABILIZATION_MODE, &opticalStabilizationMode, 1); @@ -721,7 +721,7 @@ status_t ExynosCamera2::constructDefaultRequest( /** android.flash */ - static const uint8_t flashMode = ANDROID_FLASH_OFF; + static const uint8_t flashMode = ANDROID_FLASH_MODE_OFF; ADD_OR_SIZE(ANDROID_FLASH_MODE, &flashMode, 1); static const uint8_t flashPower = 10; @@ -739,89 +739,53 @@ status_t ExynosCamera2::constructDefaultRequest( uint8_t colorMode = 0; uint8_t tonemapMode = 0; uint8_t edgeMode = 0; - uint8_t vstabMode = 0; + uint8_t vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF; switch (request_template) { - case CAMERA2_TEMPLATE_PREVIEW: - hotPixelMode = ANDROID_PROCESSING_FAST; - demosaicMode = ANDROID_PROCESSING_FAST; - noiseMode = ANDROID_PROCESSING_FAST; - shadingMode = ANDROID_PROCESSING_FAST; - geometricMode = ANDROID_PROCESSING_FAST; - colorMode = ANDROID_PROCESSING_FAST; - tonemapMode = ANDROID_PROCESSING_FAST; - edgeMode = ANDROID_PROCESSING_FAST; - vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_OFF; - break; - case CAMERA2_TEMPLATE_STILL_CAPTURE: - hotPixelMode = ANDROID_PROCESSING_HIGH_QUALITY; - demosaicMode = ANDROID_PROCESSING_HIGH_QUALITY; - noiseMode = ANDROID_PROCESSING_HIGH_QUALITY; - shadingMode = ANDROID_PROCESSING_HIGH_QUALITY; - geometricMode = ANDROID_PROCESSING_HIGH_QUALITY; - colorMode = ANDROID_PROCESSING_HIGH_QUALITY; - tonemapMode = ANDROID_PROCESSING_HIGH_QUALITY; - edgeMode = ANDROID_PROCESSING_HIGH_QUALITY; - vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_OFF; - break; - case CAMERA2_TEMPLATE_VIDEO_RECORD: - hotPixelMode = ANDROID_PROCESSING_FAST; - demosaicMode = ANDROID_PROCESSING_FAST; - noiseMode = ANDROID_PROCESSING_FAST; - shadingMode = ANDROID_PROCESSING_FAST; - geometricMode = ANDROID_PROCESSING_FAST; - colorMode = ANDROID_PROCESSING_FAST; - tonemapMode = ANDROID_PROCESSING_FAST; - edgeMode = ANDROID_PROCESSING_FAST; - vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_ON; - break; case CAMERA2_TEMPLATE_VIDEO_SNAPSHOT: - hotPixelMode = ANDROID_PROCESSING_HIGH_QUALITY; - demosaicMode = ANDROID_PROCESSING_HIGH_QUALITY; - noiseMode = ANDROID_PROCESSING_HIGH_QUALITY; - shadingMode = ANDROID_PROCESSING_HIGH_QUALITY; - geometricMode = ANDROID_PROCESSING_HIGH_QUALITY; - colorMode = ANDROID_PROCESSING_HIGH_QUALITY; - tonemapMode = ANDROID_PROCESSING_HIGH_QUALITY; - edgeMode = ANDROID_PROCESSING_HIGH_QUALITY; - vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_ON; - break; + vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_ON; + // fall-through + case CAMERA2_TEMPLATE_STILL_CAPTURE: + // fall-through case CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG: - hotPixelMode = ANDROID_PROCESSING_HIGH_QUALITY; - demosaicMode = ANDROID_PROCESSING_HIGH_QUALITY; - noiseMode = ANDROID_PROCESSING_HIGH_QUALITY; - shadingMode = ANDROID_PROCESSING_HIGH_QUALITY; - geometricMode = ANDROID_PROCESSING_HIGH_QUALITY; - colorMode = ANDROID_PROCESSING_HIGH_QUALITY; - tonemapMode = ANDROID_PROCESSING_HIGH_QUALITY; - edgeMode = ANDROID_PROCESSING_HIGH_QUALITY; - vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_OFF; + hotPixelMode = ANDROID_HOT_PIXEL_MODE_HIGH_QUALITY; + demosaicMode = ANDROID_DEMOSAIC_MODE_HIGH_QUALITY; + noiseMode = ANDROID_NOISE_REDUCTION_MODE_HIGH_QUALITY; + shadingMode = ANDROID_SHADING_MODE_HIGH_QUALITY; + geometricMode = ANDROID_GEOMETRIC_MODE_HIGH_QUALITY; + colorMode = ANDROID_COLOR_CORRECTION_MODE_HIGH_QUALITY; + tonemapMode = ANDROID_TONEMAP_MODE_HIGH_QUALITY; + edgeMode = ANDROID_EDGE_MODE_HIGH_QUALITY; break; + case CAMERA2_TEMPLATE_VIDEO_RECORD: + vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_ON; + // fall-through + case CAMERA2_TEMPLATE_PREVIEW: + // fall-through default: - hotPixelMode = ANDROID_PROCESSING_FAST; - demosaicMode = ANDROID_PROCESSING_FAST; - noiseMode = ANDROID_PROCESSING_FAST; - shadingMode = ANDROID_PROCESSING_FAST; - geometricMode = ANDROID_PROCESSING_FAST; - colorMode = ANDROID_PROCESSING_FAST; - tonemapMode = ANDROID_PROCESSING_FAST; - edgeMode = ANDROID_PROCESSING_FAST; - vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_OFF; + hotPixelMode = ANDROID_HOT_PIXEL_MODE_FAST; + demosaicMode = ANDROID_DEMOSAIC_MODE_FAST; + noiseMode = ANDROID_NOISE_REDUCTION_MODE_FAST; + shadingMode = ANDROID_SHADING_MODE_FAST; + geometricMode = ANDROID_GEOMETRIC_MODE_FAST; + colorMode = ANDROID_COLOR_CORRECTION_MODE_FAST; + tonemapMode = ANDROID_TONEMAP_MODE_FAST; + edgeMode = ANDROID_EDGE_MODE_FAST; break; } ADD_OR_SIZE(ANDROID_HOT_PIXEL_MODE, &hotPixelMode, 1); ADD_OR_SIZE(ANDROID_DEMOSAIC_MODE, &demosaicMode, 1); - ADD_OR_SIZE(ANDROID_NOISE_MODE, &noiseMode, 1); + ADD_OR_SIZE(ANDROID_NOISE_REDUCTION_MODE, &noiseMode, 1); ADD_OR_SIZE(ANDROID_SHADING_MODE, &shadingMode, 1); ADD_OR_SIZE(ANDROID_GEOMETRIC_MODE, &geometricMode, 1); - ADD_OR_SIZE(ANDROID_COLOR_MODE, &colorMode, 1); + ADD_OR_SIZE(ANDROID_COLOR_CORRECTION_MODE, &colorMode, 1); ADD_OR_SIZE(ANDROID_TONEMAP_MODE, &tonemapMode, 1); ADD_OR_SIZE(ANDROID_EDGE_MODE, &edgeMode, 1); ADD_OR_SIZE(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, &vstabMode, 1); /** android.noise */ static const uint8_t noiseStrength = 5; - ADD_OR_SIZE(ANDROID_NOISE_STRENGTH, &noiseStrength, 1); + ADD_OR_SIZE(ANDROID_NOISE_REDUCTION_STRENGTH, &noiseStrength, 1); /** android.color */ static const float colorTransform[9] = { @@ -829,7 +793,7 @@ status_t ExynosCamera2::constructDefaultRequest( 0.f, 1.f, 0.f, 0.f, 0.f, 1.f }; - ADD_OR_SIZE(ANDROID_COLOR_TRANSFORM, colorTransform, 9); + ADD_OR_SIZE(ANDROID_COLOR_CORRECTION_TRANSFORM, colorTransform, 9); /** android.tonemap */ static const float tonemapCurve[4] = { @@ -878,14 +842,14 @@ status_t ExynosCamera2::constructDefaultRequest( /** android.stats */ - static const uint8_t faceDetectMode = ANDROID_STATS_FACE_DETECTION_FULL; - ADD_OR_SIZE(ANDROID_STATS_FACE_DETECT_MODE, &faceDetectMode, 1); + static const uint8_t faceDetectMode = ANDROID_STATISTICS_FACE_DETECT_MODE_FULL; + ADD_OR_SIZE(ANDROID_STATISTICS_FACE_DETECT_MODE, &faceDetectMode, 1); - static const uint8_t histogramMode = ANDROID_STATS_OFF; - ADD_OR_SIZE(ANDROID_STATS_HISTOGRAM_MODE, &histogramMode, 1); + static const uint8_t histogramMode = ANDROID_STATISTICS_HISTOGRAM_MODE_OFF; + ADD_OR_SIZE(ANDROID_STATISTICS_HISTOGRAM_MODE, &histogramMode, 1); - static const uint8_t sharpnessMapMode = ANDROID_STATS_OFF; - ADD_OR_SIZE(ANDROID_STATS_SHARPNESS_MAP_MODE, &sharpnessMapMode, 1); + static const uint8_t sharpnessMapMode = ANDROID_STATISTICS_HISTOGRAM_MODE_OFF; + ADD_OR_SIZE(ANDROID_STATISTICS_SHARPNESS_MAP_MODE, &sharpnessMapMode, 1); /** android.control */ @@ -893,36 +857,36 @@ status_t ExynosCamera2::constructDefaultRequest( uint8_t controlIntent = 0; switch (request_template) { case CAMERA2_TEMPLATE_PREVIEW: - controlIntent = ANDROID_CONTROL_INTENT_PREVIEW; + controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW; break; case CAMERA2_TEMPLATE_STILL_CAPTURE: - controlIntent = ANDROID_CONTROL_INTENT_STILL_CAPTURE; + controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE; break; case CAMERA2_TEMPLATE_VIDEO_RECORD: - controlIntent = ANDROID_CONTROL_INTENT_VIDEO_RECORD; + controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD; break; case CAMERA2_TEMPLATE_VIDEO_SNAPSHOT: - controlIntent = ANDROID_CONTROL_INTENT_VIDEO_SNAPSHOT; + controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT; break; case CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG: - controlIntent = ANDROID_CONTROL_INTENT_ZERO_SHUTTER_LAG; + controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG; break; default: - controlIntent = ANDROID_CONTROL_INTENT_CUSTOM; + controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_CUSTOM; break; } ADD_OR_SIZE(ANDROID_CONTROL_CAPTURE_INTENT, &controlIntent, 1); - static const uint8_t controlMode = ANDROID_CONTROL_AUTO; + static const uint8_t controlMode = ANDROID_CONTROL_MODE_AUTO; ADD_OR_SIZE(ANDROID_CONTROL_MODE, &controlMode, 1); - static const uint8_t effectMode = ANDROID_CONTROL_EFFECT_OFF; + static const uint8_t effectMode = ANDROID_CONTROL_EFFECT_MODE_OFF; ADD_OR_SIZE(ANDROID_CONTROL_EFFECT_MODE, &effectMode, 1); static const uint8_t sceneMode = ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED; ADD_OR_SIZE(ANDROID_CONTROL_SCENE_MODE, &sceneMode, 1); - static const uint8_t aeMode = ANDROID_CONTROL_AE_ON; + static const uint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON; ADD_OR_SIZE(ANDROID_CONTROL_AE_MODE, &aeMode, 1); int32_t controlRegions[5] = { @@ -931,7 +895,7 @@ status_t ExynosCamera2::constructDefaultRequest( ADD_OR_SIZE(ANDROID_CONTROL_AE_REGIONS, controlRegions, 5); static const int32_t aeExpCompensation = 0; - ADD_OR_SIZE(ANDROID_CONTROL_AE_EXP_COMPENSATION, &aeExpCompensation, 1); + ADD_OR_SIZE(ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, &aeExpCompensation, 1); static const int32_t aeTargetFpsRange[2] = { 15, 30 @@ -939,11 +903,11 @@ status_t ExynosCamera2::constructDefaultRequest( ADD_OR_SIZE(ANDROID_CONTROL_AE_TARGET_FPS_RANGE, aeTargetFpsRange, 2); static const uint8_t aeAntibandingMode = - ANDROID_CONTROL_AE_ANTIBANDING_AUTO; + ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO; ADD_OR_SIZE(ANDROID_CONTROL_AE_ANTIBANDING_MODE, &aeAntibandingMode, 1); static const uint8_t awbMode = - ANDROID_CONTROL_AWB_AUTO; + ANDROID_CONTROL_AWB_MODE_AUTO; ADD_OR_SIZE(ANDROID_CONTROL_AWB_MODE, &awbMode, 1); ADD_OR_SIZE(ANDROID_CONTROL_AWB_REGIONS, controlRegions, 5); @@ -951,22 +915,22 @@ status_t ExynosCamera2::constructDefaultRequest( uint8_t afMode = 0; switch (request_template) { case CAMERA2_TEMPLATE_PREVIEW: - afMode = ANDROID_CONTROL_AF_CONTINUOUS_PICTURE; + afMode = ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE; break; case CAMERA2_TEMPLATE_STILL_CAPTURE: - afMode = ANDROID_CONTROL_AF_CONTINUOUS_PICTURE; + afMode = ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE; break; case CAMERA2_TEMPLATE_VIDEO_RECORD: - afMode = ANDROID_CONTROL_AF_CONTINUOUS_VIDEO; + afMode = ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO; break; case CAMERA2_TEMPLATE_VIDEO_SNAPSHOT: - afMode = ANDROID_CONTROL_AF_CONTINUOUS_VIDEO; + afMode = ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO; break; case CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG: - afMode = ANDROID_CONTROL_AF_CONTINUOUS_PICTURE; + afMode = ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE; break; default: - afMode = ANDROID_CONTROL_AF_AUTO; + afMode = ANDROID_CONTROL_AF_MODE_AUTO; break; } ADD_OR_SIZE(ANDROID_CONTROL_AF_MODE, &afMode, 1); diff --git a/libcamera2/MetadataConverter.cpp b/libcamera2/MetadataConverter.cpp index d3dd2b3..a39be4e 100644 --- a/libcamera2/MetadataConverter.cpp +++ b/libcamera2/MetadataConverter.cpp @@ -230,7 +230,7 @@ status_t MetadataConverter::ToInternalShot(camera_metadata_t * request, struct c - case ANDROID_STATS_FACE_DETECT_MODE: + case ANDROID_STATISTICS_FACE_DETECT_MODE: if (NO_ERROR != CheckEntryTypeMismatch(&curr_entry, TYPE_BYTE, 1)) break; dst->ctl.stats.faceDetectMode = (enum facedetect_mode)(curr_entry.data.u8[0] + 1); @@ -271,7 +271,7 @@ status_t MetadataConverter::ToInternalShot(camera_metadata_t * request, struct c dst_ext->ae_lock = (enum ae_lockmode)(curr_entry.data.u8[0]); break; - case ANDROID_CONTROL_AE_EXP_COMPENSATION: + case ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION: if (NO_ERROR != CheckEntryTypeMismatch(&curr_entry, TYPE_INT32, 1)) break; dst->ctl.aa.aeExpCompensation = curr_entry.data.i32[0] + 5; @@ -570,17 +570,17 @@ status_t MetadataConverter::ToDynamicMetadata(struct camera2_shot_ext * metadata return NO_MEMORY; intData = metadata->ctl.aa.aeExpCompensation - 5; - if (0 != add_camera_metadata_entry(dst, ANDROID_CONTROL_AE_EXP_COMPENSATION, + if (0 != add_camera_metadata_entry(dst, ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, &intData, 1)) return NO_MEMORY; byteData = metadata->dm.stats.faceDetectMode - 1; - if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_FACE_DETECT_MODE, + if (0 != add_camera_metadata_entry(dst, ANDROID_STATISTICS_FACE_DETECT_MODE, &byteData, 1)) return NO_MEMORY; int maxFacecount = CAMERA2_MAX_FACES; - if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_MAX_FACE_COUNT, + if (0 != add_camera_metadata_entry(dst, ANDROID_STATISTICS_INFO_MAX_FACE_COUNT, &maxFacecount, 1)) return NO_MEMORY; @@ -601,19 +601,19 @@ status_t MetadataConverter::ToDynamicMetadata(struct camera2_shot_ext * metadata } if (tempFaceCount > 0) { - if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_FACE_RECTANGLES, + if (0 != add_camera_metadata_entry(dst, ANDROID_STATISTICS_FACE_RECTANGLES, &metaFaceRectangles, 4 * tempFaceCount)) return NO_MEMORY; - if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_FACE_LANDMARKS, + if (0 != add_camera_metadata_entry(dst, ANDROID_STATISTICS_FACE_LANDMARKS, &mataFaceLandmarks, 6 * tempFaceCount)) return NO_MEMORY; - if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_FACE_IDS, + if (0 != add_camera_metadata_entry(dst, ANDROID_STATISTICS_FACE_IDS, &mataFaceIds, tempFaceCount)) return NO_MEMORY; - if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_FACE_SCORES, + if (0 != add_camera_metadata_entry(dst, ANDROID_STATISTICS_FACE_SCORES, &metaFaceScores, tempFaceCount)) return NO_MEMORY; }