diff --git a/camera/v1_4/BUILD.gn b/camera/v1_4/BUILD.gn index 42c1ae0d196292b61918688199eed43537a6819a..f7642f24aa194becc05f56a4879127df8fc12526 100644 --- a/camera/v1_4/BUILD.gn +++ b/camera/v1_4/BUILD.gn @@ -22,6 +22,10 @@ if (defined(ohos_lite)) { module_name = "camera_service" sources = [ + "ICameraDevice.idl", + "ICameraHost.idl", + "IStreamOperator.idl", + "IStreamOperatorCallback.idl", "IVideoProcessCallback.idl", "IVideoProcessService.idl", "Types.idl", diff --git a/camera/v1_4/ICameraDevice.idl b/camera/v1_4/ICameraDevice.idl new file mode 100644 index 0000000000000000000000000000000000000000..892bc93056130702e51b107478ce72ed6ed5837e --- /dev/null +++ b/camera/v1_4/ICameraDevice.idl @@ -0,0 +1,49 @@ +/* + * 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_device.h + * + * @brief Declares APIs for camera device operations. + * + * @since 5.0 + * @version 1.3 + */ + +package ohos.hdi.camera.v1_4; + +import ohos.hdi.camera.v1_3.ICameraDevice; +import ohos.hdi.camera.v1_4.IStreamOperatorCallback; +import ohos.hdi.camera.v1_4.IStreamOperator; + +interface ICameraDevice extends ohos.hdi.camera.v1_3.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 5.0 + * @version 1.3 + */ + GetStreamOperator_V1_4([in] IStreamOperatorCallback callbackObj, [out] IStreamOperator streamOperator); + +} diff --git a/camera/v1_4/ICameraHost.idl b/camera/v1_4/ICameraHost.idl new file mode 100644 index 0000000000000000000000000000000000000000..1df31a7a9a10f20c65893d1d1ebc59ea32f12b55 --- /dev/null +++ b/camera/v1_4/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 5.0 + * @version 1.3 + */ + +package ohos.hdi.camera.v1_4; + +import ohos.hdi.camera.v1_3.ICameraHost; +import ohos.hdi.camera.v1_4.ICameraDevice; +import ohos.hdi.camera.v1_0.ICameraDeviceCallback; +import ohos.hdi.camera.v1_4.Types; + +interface ICameraHost extends ohos.hdi.camera.v1_3.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 5.0 + * @version 1.3 + */ + OpenCamera_V1_4([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 5.0 + * @version 1.0 + */ + OpenSecureCamera_V1_4([in] String cameraId, [in] ICameraDeviceCallback callbackObj, [out] ICameraDevice device); +} diff --git a/camera/v1_4/IStreamOperator.idl b/camera/v1_4/IStreamOperator.idl new file mode 100644 index 0000000000000000000000000000000000000000..b1b865733c9857e159a1a680043a1a735a8bec14 --- /dev/null +++ b/camera/v1_4/IStreamOperator.idl @@ -0,0 +1,54 @@ +/* + * 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_4; + +import ohos.hdi.camera.v1_3.IStreamOperator; +import ohos.hdi.camera.v1_4.IStreamOperatorCallback; +import ohos.hdi.camera.v1_0.IOfflineStreamOperator; + +interface IStreamOperator extends ohos.hdi.camera.v1_3.IStreamOperator { + + /** + * @brief Converts a specific stream to an offline stream. + * + * Only photographing streams can be converted into offline streams,other streams are not supported. + * Due to the limited processing capability, some devices may spend a long period of time on + * algorithm processing during photographing, causing the capture requests to stack in the module. + * Converting to an offline stream enables the bottom-layer device to close and + * the offline stream to take over for subsequent processing. + * + * @param streamIds Indicates the IDs of the streams to be converted. + * @param callback Indicates the callback for conversion to offline streams. + * @param offlineOperator Indicates the offline stream after conversion. + * + * @return Returns NO_ERROR if the operation is successful; + * returns an error code defined in {@link CamRetCode} otherwise. + * + * @since 3.2 + * @version 1.0 + */ + ChangeToOfflineStream_V1_4([in] int[] streamIds, [in] IStreamOperatorCallback callbackObj, + [out] IOfflineStreamOperator offlineOperator); +} \ No newline at end of file diff --git a/camera/v1_4/IStreamOperatorCallback.idl b/camera/v1_4/IStreamOperatorCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..6cc4d2b9e48c6525809fe0eac6e0ebfa8cd2c17e --- /dev/null +++ b/camera/v1_4/IStreamOperatorCallback.idl @@ -0,0 +1,42 @@ +/* + * 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_callback.h + * + * @brief Declares callbacks related to {@link IStreamOperator}. The caller needs to implement these callbacks. + * + * @since 5.0 + * @version 1.3 + */ + +package ohos.hdi.camera.v1_4; + +import ohos.hdi.camera.v1_4.Types; +import ohos.hdi.camera.v1_3.IStreamOperatorCallback; + +[callback] interface IStreamOperatorCallback extends ohos.hdi.camera.v1_3.IStreamOperatorCallback { + /** + * @brief Called when the capture ends. + * + * @param captureId Indicates the ID of the capture request corresponding to the callback. + * @param infos Indicates information related to the capture when it ends. + * + * @since 5.0 + * @version 1.0 + */ + OnCaptureEndedExt_V1_4([in] int captureId, [in] struct CaptureEndedInfoExt_V1_4[] infos); + +} \ No newline at end of file diff --git a/camera/v1_4/Types.idl b/camera/v1_4/Types.idl index 383c305a5fe57854fd25424be4aefc39c8f106f8..365d4810f03e9a265ea74cf253b822399ed59e66 100644 --- a/camera/v1_4/Types.idl +++ b/camera/v1_4/Types.idl @@ -42,3 +42,15 @@ enum EncodeType : ohos.hdi.camera.v1_3.EncodeType { */ ENCODE_TYPE_DNG_XDRAW = 5, }; + +/** + * @brief Defines the CaptureEndedInfoExt, which is used by {@link IStreamOperatorCallback::OnCaptureEndedExt}. + * @since 5.0 + * @version 1.0 + */ +struct CaptureEndedInfoExt_V1_4 { + + struct CaptureEndedInfoExt captureEndedInfoExt; + MapDataSequenceable metadata_; +}; +