diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index 559a5f51220eb451fee371e6e33388da36cef2de..6a61205b5bb5528c80536c976f13b10110780e80 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -353,8 +353,8 @@ typedef enum camera_device_metadata_tag { /** * ohos.ability.tripodDetection [static, int32[], public] * - * camera device property, report current camera whether support tripod detection by mode - * (i.e. int32[]: [mode, OHOS_CAMERA_NOT_SUPPORTED/OHOS_CAMERA_SUPPORTED, mode ...] ...) + * camera device property, report current camera what mode support tripod detection + * (i.e. int32[]: [mode, mode ...] ...) */ OHOS_ABILITY_TRIPOD_DETECTION, /** @@ -637,6 +637,13 @@ typedef enum camera_device_metadata_tag { * (i.e. int32[] ...) */ OHOS_STATISTICS_DETECT_BAR_CODE_INFOS, + /** + * ohos.statistics.baseFaceInfo [static, int32[], public] + * + * camera device property, query current camera detect base face information + * (i.e. int32[] ...) + */ + OHOS_STATISTICS_DETECT_BASE_FACE_INFO, /** * ohos.camera.statisticsEnd * @@ -2411,7 +2418,7 @@ enum CameraLightPaintingType { OHOS_CAMERA_LIGHT_PAINTING_LIGHT, }; -//OHOS_CONTRAL_TIME_LAPSE_TRYAE_STATE +//OHOS_CONTROL_TIME_LAPSE_TRYAE_STATE enum TimeLapseRecordState { TIME_LAPSE_IDLE = 0, TIME_LAPSE_RECORDING = 1, @@ -2433,6 +2440,7 @@ enum StatisticsDetectType { OHOS_CAMERA_DOG_BODY_DETECT = 5, OHOS_CAMERA_SALIENT_DETECT = 6, OHOS_CAMERA_BAR_CODE_DETECT = 7, + OHOS_CAMERA_BASE_FACE_DETECT = 8, }; // OHOS_STATUS_TRIPOD_DETECTION_STATUS @@ -2468,4 +2476,11 @@ enum DeviceProtectionStatus { OHOS_DEVICE_FALL_PROTECTION = 3, }; +enum StatisticsDetectEmotion { + OHOS_EMOTION_NEUTRAL = 0, + OHOS_EMOTION_SADNESS = 1, + OHOS_EMOTION_SMILE = 2, + OHOS_EMOTION_SURPRISE = 3, +}; + #endif diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 58526b4ffe1bcd66bdf854699cceb5ba52266d93..44e81c8ce49ab2f7e3284795eca5dc546a02ded2 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -184,6 +184,8 @@ static item_info_t g_ohosCameraStatistics[OHOS_CAMERA_STATISTICS_END - OHOS_CAME OHOS_CAMERA_STATISTICS_START] = {"detectSalientInfos", META_TYPE_INT32, -1}, [OHOS_STATISTICS_DETECT_BAR_CODE_INFOS - OHOS_CAMERA_STATISTICS_START] = {"detectBarCodeInfos", META_TYPE_INT32, -1}, + [OHOS_STATISTICS_DETECT_BASE_FACE_INFO - + OHOS_CAMERA_STATISTICS_START] = {"baseFaceInfo", META_TYPE_INT32, -1}, }; static item_info_t g_ohosCameraControl[OHOS_DEVICE_CONTROL_END - OHOS_DEVICE_CONTROL_START] = { diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index 41095acdd401ea9f5cbc0286005688072555b922..94faa1a0b3a7dda76502af337b9aafb0ec5ddde5 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -108,6 +108,7 @@ const std::vector g_metadataTags = { OHOS_STATISTICS_DETECT_DOG_BODY_INFOS, OHOS_STATISTICS_DETECT_SALIENT_INFOS, OHOS_STATISTICS_DETECT_BAR_CODE_INFOS, + OHOS_STATISTICS_DETECT_BASE_FACE_INFO, OHOS_CONTROL_AE_ANTIBANDING_MODE, OHOS_CONTROL_AE_EXPOSURE_COMPENSATION, diff --git a/camera/v1_3/BUILD.gn b/camera/v1_3/BUILD.gn index fe2f1ad4edaf4260c2e2b67a3bea45f18ac027f8..2423a4c84e49728bbb0f3c213cf5c9ee44476199 100644 --- a/camera/v1_3/BUILD.gn +++ b/camera/v1_3/BUILD.gn @@ -27,6 +27,7 @@ if (defined(ohos_lite)) { "ICameraHost.idl", "IImageProcessCallback.idl", "IImageProcessService.idl", + "IStreamOperator.idl", "IStreamOperatorCallback.idl", "IVideoProcessCallback.idl", "IVideoProcessService.idl", diff --git a/camera/v1_3/ICameraDevice.idl b/camera/v1_3/ICameraDevice.idl index fe92417d1a8462caa992e4800ba515808bedce93..39ac48e2a9c13cc78919af0fda8405c7a86d391e 100644 --- a/camera/v1_3/ICameraDevice.idl +++ b/camera/v1_3/ICameraDevice.idl @@ -26,7 +26,7 @@ package ohos.hdi.camera.v1_3; import ohos.hdi.camera.v1_2.ICameraDevice; import ohos.hdi.camera.v1_3.IStreamOperatorCallback; -import ohos.hdi.camera.v1_2.IStreamOperator; +import ohos.hdi.camera.v1_3.IStreamOperator; interface ICameraDevice extends ohos.hdi.camera.v1_2.ICameraDevice { /** diff --git a/camera/v1_3/IStreamOperator.idl b/camera/v1_3/IStreamOperator.idl new file mode 100644 index 0000000000000000000000000000000000000000..17b2e00032dc04b62f92e39e552ed12e590652e4 --- /dev/null +++ b/camera/v1_3/IStreamOperator.idl @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file istream_operator.h + * + * @brief Declares APIs for stream operations. + * + * @since 5.0 + * @version 1.3 + */ + +package ohos.hdi.camera.v1_3; + +import ohos.hdi.camera.v1_2.IStreamOperator; + +interface IStreamOperator extends ohos.hdi.camera.v1_2.IStreamOperator { + + /** + * @brief Enables metadata reporting and other information. + * + * Only metadata that is enabled can be reported by using {@link OnResult}. + * + * @param results Indicates the metadata and other information for which reporting are to be enabled. + * @param streamId Indicates the ID of the stream to enable metadata reporting. + * + * @return Returns NO_ERROR if the operation is successful; returns an error code defined + * in {@link CamRetCode} otherwise. + * + * @since 5.0 + * @version 1.0 + */ + EnableResult([in] int streamId, [in] unsigned char[] results); + + /** + * @brief Disable metadata reporting and other information. + * + * After metadata reporting is disabled, the metadata is not reported by calling {@link OnResult}. + * To enable metadata reporting, you must call {@link EnableResult}. + * + * @param results Indicates the metadata and other information for which reporting are to be disabled. + * @param streamId Indicates the ID of the stream to disable metadata reporting. + * + * @return Returns NO_ERROR if the operation is successful; returns an error code defined + * in {@link CamRetCode} otherwise. + * + * @since 5.0 + * @version 1.0 + */ + DisableResult([in] int streamId, [in] unsigned char[] results); +} \ No newline at end of file diff --git a/camera/v1_3/IStreamOperatorCallback.idl b/camera/v1_3/IStreamOperatorCallback.idl index 35993c76ab5d911f9daeb58689b6ee10c1c53b73..0bb3ebddd676579ddb9261df80ec60c3ab1ed76a 100644 --- a/camera/v1_3/IStreamOperatorCallback.idl +++ b/camera/v1_3/IStreamOperatorCallback.idl @@ -61,4 +61,18 @@ import ohos.hdi.camera.v1_3.Types; * @version 1.0 */ OnCaptureEndedExt([in] int captureId, [in] struct CaptureEndedInfoExt[] infos); + + /** + * @brief Called to report metadata and other information related to the stream. + * For details about the reporting mode, see {@link SetResultMode}. + * + * @param streamId Indicates the ID of the stream related to metadata is reported. + * @param result Indicates the metadata and other information reported. + * The reported metadata and other information are specified by {@link EnableResult}. + * You can call {@link DisableResult} to disable metadata and other information reporting. + * + * @since 5.0 + * @version 1.0 + */ + OnResult([in] int streamId, [in] unsigned char[] result); } \ No newline at end of file