diff --git a/camera/metadata/include/camera_device_ability_items.h b/camera/metadata/include/camera_device_ability_items.h index d27c0c6525d6c1a43f118ce047564ddef5598ba3..9c4bfbbb76d33dd224fba868713a94ffec9ef1a7 100644 --- a/camera/metadata/include/camera_device_ability_items.h +++ b/camera/metadata/include/camera_device_ability_items.h @@ -1620,6 +1620,20 @@ typedef enum camera_device_metadata_tag { * (i.e. uint8: 0-false/1-true ...) */ OHOS_ABILITY_ROTATION_IN_IPS_SUPPORTED, + /* + * ohos.ability.bandwidthCompressionAvailable [static, byte[], public] + * + * camera stream property, report camera support band width compression available + * (i.e. byte[] ...) + */ + OHOS_ABILITY_BANDWIDTH_COMPRESSION_AVAILABLE, + /** + * ohos.control.bandwidthCompressionAvailable [static, byte[], public] + * + * camera stream property, set camera support band width compression + * (i.e. byte[] ...) + */ + OHOS_CONTROL_BANDWIDTH_COMPRESSION, /** * ohos.ability.prerecord [static, int32[], public] * diff --git a/camera/metadata/include/camera_metadata_item_info.h b/camera/metadata/include/camera_metadata_item_info.h index 2e0ebc78f2ee5c4ffaed3acbb5aea73f15d666ae..68e49f270118d25ded8589e46fdb69da6b4aa1d3 100644 --- a/camera/metadata/include/camera_metadata_item_info.h +++ b/camera/metadata/include/camera_metadata_item_info.h @@ -399,6 +399,10 @@ static item_info_t g_ohosStreamAbility[OHOS_STREAM_ABILITY_END - OHOS_STREAM_ABI OHOS_STREAM_ABILITY_START] = {"offlineControlValue", META_TYPE_BYTE, -1}, [OHOS_ABILITY_ROTATION_IN_IPS_SUPPORTED - OHOS_STREAM_ABILITY_START] = {"rotationInIpsSupported", META_TYPE_BYTE, 1}, + [OHOS_ABILITY_BANDWIDTH_COMPRESSION_AVAILABLE - + OHOS_STREAM_ABILITY_START] = {"bandwidthCompressionAvailable", META_TYPE_BYTE, -1}, + [OHOS_CONTROL_BANDWIDTH_COMPRESSION - + OHOS_STREAM_ABILITY_START] = {"bandwidthCompressionControlValue", META_TYPE_BYTE, -1}, }; static item_info_t g_ohosStreamControl[OHOS_STREAM_CONTROL_END - OHOS_STREAM_CONTROL_START] = { diff --git a/camera/metadata/src/camera_metadata_info.cpp b/camera/metadata/src/camera_metadata_info.cpp index f02d4651e5aebd6be2f569c5a62b34775248f283..4cd66321ba0370e60529e298ba3cabf4fa7b34bb 100644 --- a/camera/metadata/src/camera_metadata_info.cpp +++ b/camera/metadata/src/camera_metadata_info.cpp @@ -252,6 +252,8 @@ const std::vector g_metadataTags = { OHOS_ABILITY_CHANGETO_OFFLINE_STREAM_OPEATOR, OHOS_CONTROL_CHANGETO_OFFLINE_STREAM_OPEATOR, OHOS_ABILITY_ROTATION_IN_IPS_SUPPORTED, + OHOS_ABILITY_BANDWIDTH_COMPRESSION_AVAILABLE, + OHOS_CONTROL_BANDWIDTH_COMPRESSION, OHOS_JPEG_GPS_COORDINATES, OHOS_JPEG_GPS_PROCESSING_METHOD, diff --git a/camera/v1_5/BUILD.gn b/camera/v1_5/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..67a03bf113270fb6e64ad313e952a1ab59bd4efd --- /dev/null +++ b/camera/v1_5/BUILD.gn @@ -0,0 +1,54 @@ +# Copyright (c) 2025 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. + +import("//build/config/components/hdi/hdi.gni") +if (defined(ohos_lite)) { + group("libcamera_proxy_1.5") { + deps = [] + public_configs = [] + } +} else { + hdi("camera") { + module_name = "camera_service" + + sources = [ + "ICameraDevice.idl", + "ICameraHost.idl", + "IStreamOperator.idl", + "Types.idl", + ] + + stub_deps = [ + "../sequenceable/buffer_handle:libbuffer_handle_sequenceable_1.0", + "../sequenceable/buffer_producer:libbuffer_producer_sequenceable_1.0", + "../sequenceable/map_data:libmap_data_sequenceable_1.0", + "../v1_3:libcamera_stub_1.3", + "../v1_4:libcamera_stub_1.4", + ] + proxy_deps = [ + "../sequenceable/buffer_handle:libbuffer_handle_sequenceable_1.0", + "../sequenceable/buffer_producer:libbuffer_producer_sequenceable_1.0", + "../sequenceable/map_data:libmap_data_sequenceable_1.0", + "../v1_3:libcamera_proxy_1.3", + "../v1_4:libcamera_proxy_1.4", + ] + sequenceable_ext_deps = [ + "graphic_surface:buffer_handle", + "graphic_surface:surface", + ] + + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_camera" + } +} diff --git a/camera/v1_5/ICameraDevice.idl b/camera/v1_5/ICameraDevice.idl new file mode 100644 index 0000000000000000000000000000000000000000..d33e0003dbd1a53bfa67e7dd8a1f5a4c3a77dc00 --- /dev/null +++ b/camera/v1_5/ICameraDevice.idl @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2025 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 icamera_device.h + * + * @brief Declares APIs for camera device operations. + * + * @since 6.0 + * @version 1.5 + */ + +package ohos.hdi.camera.v1_5; + +import ohos.hdi.camera.v1_4.IStreamOperatorCallback; +import ohos.hdi.camera.v1_5.IStreamOperator; +import ohos.hdi.camera.v1_4.ICameraDevice; + +interface ICameraDevice extends ohos.hdi.camera.v1_4.ICameraDevice { + /** + * @brief Obtains the stream operation handle. + * + * @param callback Indicates a stream callback. For details, see {@link IStreamOperatorCallback}. + * {@link OnCaptureStarted} and {@link OnCaptureEnded} are used to report the start and end of capture, + * and {@link OnCaptureError} is used to report a capture error. + * + * @param streamOperator Indicates the stream operation handle. + * + * @return Returns NO_ERROR if the operation is successful; returns an error code defined + * in {@link CamRetCode} otherwise. + * + * @since 6.0 + * @version 1.5 + */ + GetStreamOperator_V1_5([in] IStreamOperatorCallback callbackObj, [out] IStreamOperator streamOperator); + +} \ No newline at end of file diff --git a/camera/v1_5/ICameraHost.idl b/camera/v1_5/ICameraHost.idl new file mode 100644 index 0000000000000000000000000000000000000000..c364e04244f5af1a31328cc255d9e14b5469046f --- /dev/null +++ b/camera/v1_5/ICameraHost.idl @@ -0,0 +1,68 @@ +/* + * 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 icamera_host.h + * + * @brief Management class of the camera service that provides Hardware Driver Interfaces (HDIs) for the upper layer. + * + * @since 6.0 + * @version 1.5 + */ + +package ohos.hdi.camera.v1_5; + +import ohos.hdi.camera.v1_4.ICameraHost; +import ohos.hdi.camera.v1_5.ICameraDevice; +import ohos.hdi.camera.v1_0.ICameraDeviceCallback; +import ohos.hdi.camera.v1_5.Types; + +interface ICameraHost extends ohos.hdi.camera.v1_4.ICameraHost { + /** + * @brief Opens a camera device. + * + * By calling this function, you can obtain the ICameraDevice instance and operate the + * specific camera device mapping to the instance. + * + * @param cameraId Indicates the ID of the camera device, which can be obtained by calling {@link GetCameraIds}. + * @param callback Indicates the callback related to the camera. For details, see {@link ICameraDeviceCallback}. + * @param device Indicates the ICameraDevice instance corresponding to the ID of the camera device. + * + * @return Returns NO_ERROR if the operation is successful; returns an error code defined + * in {@link CamRetCode} otherwise. + * + * @since 6.0 + * @version 1.5 + */ + OpenCamera_V1_5([in] String cameraId, [in] ICameraDeviceCallback callbackObj, [out] ICameraDevice device); + + /** + * @brief Opens a camera device in secure mode. + * + * By calling this function, you can obtain the ICameraDevice instance and operate the + * specific camera device mapping to the instance. + * + * @param cameraId Indicates the ID of the camera device, which can be obtained by calling {@link GetCameraIds}. + * @param callback Indicates the callback related to the camera. For details, see {@link ICameraDeviceCallback}. + * @param device Indicates the ICameraDevice instance corresponding to the ID of the camera device. + * + * @return Returns NO_ERROR if the operation is successful; returns an error code defined + * in {@link CamRetCode} otherwise. + * + * @since 6.0 + * @version 1.5 + */ + OpenSecureCamera_V1_5([in] String cameraId, [in] ICameraDeviceCallback callbackObj, [out] ICameraDevice device); +} \ No newline at end of file diff --git a/camera/v1_5/IStreamOperator.idl b/camera/v1_5/IStreamOperator.idl new file mode 100644 index 0000000000000000000000000000000000000000..7ee3d4db49efc492e438c0745f8123a469b96efc --- /dev/null +++ b/camera/v1_5/IStreamOperator.idl @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2025 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 6.0 + * @version 1.5 + */ + +package ohos.hdi.camera.v1_5; + +import ohos.hdi.camera.v1_4.IStreamOperator; +import ohos.hdi.camera.v1_5.Types; + +interface IStreamOperator extends ohos.hdi.camera.v1_4.IStreamOperator { + /** + * @brief Creates streams. + * + * Before calling this function, you must use {@link IsStreamsSupported} to check whether the hardware + * abstraction layer (HAL) supports the streams to create. + * + * @param streamInfos Indicates the list of stream information, which is defined by {@link StreamInfo}. + * The passed stream information may be changed. Therefore, you can run {@link GetStreamAttributes} to + * obtain the latest stream attributes after the stream is created. + * + * @return Returns NO_ERROR if the operation is successful; + * returns an error code defined in {@link CamRetCode} otherwise. + * + * @since 6.0 + * @version 1.5 + */ + CreateStreams_V1_5([in] struct StreamInfo_V1_5[] streamInfos); +} diff --git a/camera/v1_5/Types.idl b/camera/v1_5/Types.idl new file mode 100644 index 0000000000000000000000000000000000000000..31c7d3c4c3415a8c69707e25457529ce31f476e2 --- /dev/null +++ b/camera/v1_5/Types.idl @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2025 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 Types.h + * + * @brief Declares data types + * used by the Hardware Driver Interfaces (HDIs) of this module. + * + * @since 6.0 + * @version 1.5 + */ + +package ohos.hdi.camera.v1_5; + +import ohos.hdi.camera.v1_1.Types; +import ohos.hdi.camera.v1_0.Types; + +/** + * @brief Defines the stream information, which is used to pass configuration parameters during stream creation. + */ +struct StreamInfo_V1_5 { + /** + * The last version of stream info + */ + struct StreamInfo v1_0; + + /** + * Optional extended stream informations. + */ + struct ExtendedStreamInfo[] extendedStreamInfos; + + /** + * Indicates the configuration parameters. + */ + unsigned char[] settings; +}; \ No newline at end of file