From 973ec4f1e92f9eb7ff911dece94bac64a93d2cbc Mon Sep 17 00:00:00 2001 From: zhanghang133 Date: Fri, 19 Jul 2024 20:43:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=86=E6=AE=B5=E5=BC=8F?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=A4=84=E7=90=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhanghang133 --- camera/v1_3/BUILD.gn | 5 +- camera/v1_3/IVideoProcessCallback.idl | 63 ++++++++++++++ camera/v1_3/IVideoProcessService.idl | 44 ++++++++++ camera/v1_3/IVideoProcessSession.idl | 117 ++++++++++++++++++++++++++ camera/v1_3/Types.idl | 114 +++++++++++++++++++++++++ 5 files changed, 342 insertions(+), 1 deletion(-) create mode 100644 camera/v1_3/IVideoProcessCallback.idl create mode 100644 camera/v1_3/IVideoProcessService.idl create mode 100644 camera/v1_3/IVideoProcessSession.idl diff --git a/camera/v1_3/BUILD.gn b/camera/v1_3/BUILD.gn index 520e7510..16d70e86 100644 --- a/camera/v1_3/BUILD.gn +++ b/camera/v1_3/BUILD.gn @@ -9,7 +9,7 @@ # 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. +# limitations under the License. import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") if (defined(ohos_lite)) { @@ -26,6 +26,9 @@ if (defined(ohos_lite)) { "ICameraDevice.idl", "ICameraHost.idl", "IStreamOperatorCallback.idl", + "IVideoProcessCallback.idl", + "IVideoProcessService.idl", + "IVideoProcessSession.idl", "Types.idl", ] diff --git a/camera/v1_3/IVideoProcessCallback.idl b/camera/v1_3/IVideoProcessCallback.idl new file mode 100644 index 00000000..81ad1364 --- /dev/null +++ b/camera/v1_3/IVideoProcessCallback.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 ivideo_process_callback.h + * + * @brief Declares callbacks for video process. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.camera.v1_3; +import ohos.hdi.camera.v1_3.Types; +import ohos.hdi.camera.v1_2.Types; + +[callback] interface IVideoProcessCallback { + + /** + * @brief Called when the process status changed. + * For details about the reporting mode, see {@link SetResultMode}. + * + * @param status Indicates the new status of the Session. + * + * @since 5.0 + * @version 1.0 + */ + OnStatusChanged([in] enum SessionStatus status); + + /** + * @brief Called when the process done. + * For details about the reporting mode, see {@link SetResultMode}. + * + * @param videoId Indicates the video id. + * + * @since 5.0 + * @version 1.0 + */ + OnProcessDone([in] String videoId); + + /** + * @brief Called when an error occurs when processing the session. + * + * @param videoId Indicates the video id. + * @param ErrorCode Indicates the error code, see {@link ErrorCode}. + * + * @since 5.0 + * @version 1.0 + */ + OnError([in] String videoId, [in] enum ErrorCode errorCode); +} \ No newline at end of file diff --git a/camera/v1_3/IVideoProcessService.idl b/camera/v1_3/IVideoProcessService.idl new file mode 100644 index 00000000..875443ef --- /dev/null +++ b/camera/v1_3/IVideoProcessService.idl @@ -0,0 +1,44 @@ +/* + * 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 ivideo_process_session.h + * + * @brief Declares APIs for video process service. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.camera.v1_3; + +import ohos.hdi.camera.v1_3.IVideoProcessSession; +import ohos.hdi.camera.v1_3.IVideoProcessCallback; + +interface IVideoProcessService { + /** + * @brief Create video process session. + * + * @param userId Indicates user ID. + * @param videoProcessCallback Indicates the video process callback. For details, see {@link IVideoProcessCallback}. + * @param videoProcessSession Indicates the video process session. For details, see {@link IVideoProcessSession} + * + * @since 5.0 + * @version 1.0 + */ + CreateVideoProcessSession([in] int userId, + [in] IVideoProcessCallback videoProcessCallback, + [out] IVideoProcessSession videoProcessSession); +} \ No newline at end of file diff --git a/camera/v1_3/IVideoProcessSession.idl b/camera/v1_3/IVideoProcessSession.idl new file mode 100644 index 00000000..ad495c51 --- /dev/null +++ b/camera/v1_3/IVideoProcessSession.idl @@ -0,0 +1,117 @@ +/* + * 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 ivideo_process_session.h + * + * @brief Declares APIs for video process session. + * + * @since 5.0 + * @version 1.0 + */ + +package ohos.hdi.camera.v1_3; + +import ohos.hdi.camera.v1_3.Types; + +interface IVideoProcessSession { + + /** + * @brief Get the IDs of the pending video which are unprocessed. + * + * @param videoIds Indicates the IDs of the pending videos. + * + * @since 5.0 + * @version 1.0 + */ + GetPendingVideos([out] List videoIds); + + /** + * @brief pending the prepare video. + * + * @param the id of the pending video. + * @param fd Indicates pending video file. + * @param streamDescs Indicates straem information. + * + * @since 5.0 + * @version 1.0 + */ + Prepare([in] String videoId, [in]FileDescriptor fd, [out] SteramDescription []streamDescs); + + /** + * @brief Process the specific video by video ID. + * + * @param videoId Indicates video id. + * @param timestamp Indicates need process video frame time. + * + * @since 5.0 + * @version 1.0 + */ + ProcessVideo([in] String videoId, [in] unsigned long timestamp); + + /** + * @brief Creates streams. + * + * @param streamInfos Indicates the list of stream information, which is defined by {@link StreamInfo}. + * + * @return Returns NO_ERROR if the operation is successful; + * returns an error code defined in {@link CamRetCode} otherwise. + * + * @since 5.0 + * @version 1.0 + */ + CreateStreams([in] struct StreamInfo_V1_1[] streamInfos); + + /** + * @brief Configures a stream. + * + * This function must be called after {@link CreateStreams}. + * + * @param mode Indicates the operation mode of the stream. For details, see {@link OperationMode_V1_1}. + * @param modeSetting Indicates the stream configuration parameters, including the frame rate and zoom information. + * @return Returns NO_ERROR if the operation is successful; + * returns an error code defined in {@link CamRetCode} otherwise. + * + * @since 5.0 + * @version 1.0 + */ + CommitStreams([in] unsigned char[] modeSetting); + + /** + * @brief Remove the specific video by video ID. + * + * @param videoId Indicates video ID. + * + * @since 5.0 + * @version 1.0 + */ + RemoveVideo([in] String videoId); + + /** + * @brief Interrupt the process session. + * + * @since 5.0 + * @version 1.0 + */ + Interrupt(); + + /** + * @brief Reset the process session. + * + * @since 5.0 + * @version 1.0 + */ + Reset(); +} \ No newline at end of file diff --git a/camera/v1_3/Types.idl b/camera/v1_3/Types.idl index 202e21fc..09369abc 100644 --- a/camera/v1_3/Types.idl +++ b/camera/v1_3/Types.idl @@ -120,6 +120,13 @@ enum OperationMode : ohos.hdi.camera.v1_2.OperationMode_V1_2 { * @version 1.0 */ APERTURE_VIDEO = 20, + + /** + * flourscence photo mode, which dedicated to flourscence photo mode + * @since 5.0 + * @version 1.0 + */ + FLOURSCENCE_PHOTO = 21, }; /** @@ -148,6 +155,11 @@ enum ExtendedStreamInfoType : ohos.hdi.camera.v1_2.ExtendedStreamInfoType_V1_2 { * Extended stream information of secure. */ EXTENDED_STREAM_INFO_SECURE = 5, + + /** + * Extended stream information of maker. + */ + EXTENDED_STREAM_INFO_MAKER_INFO = 5, }; /** @@ -232,4 +244,106 @@ struct CameraDeviceResourceCost { * @brief Cameradevices ID that can not open while current camera device is on. */ String[] conflictingDevices_; +}; + +/** + * @brief Enumerates camera media stream type. + * @since 5.0 + * @version 1.0 + */ +enum MediaStreamType { + /** + * video media stream + * @since 5.0 + * @version 1.0 + */ + MEDIA_STREAM_TYPE_VIDEO = 0, + /** + * metadata media stream + * @since 5.0 + * @version 1.0 + */ + MEDIA_STREAM_TYPE_METADATA = 1, + /** + * maker media stream + * @since 5.0 + * @version 1.0 + */ + MEDIA_STREAM_TYPE_MAKER = 2, +}; + +/** + * @brief Defines the SteramDescription, which is used by {@link IVideoProcessSession::Prepare}. + * @since 5.0 + * @version 1.0 + */ +struct SteramDescription { + /** + * stream id + * @since 5.0 + * @version 1.0 + */ + int streamId; + /** + * media stream type + * @since 5.0 + * @version 1.0 + */ + enmm MediaStreamType type; + /** + * pixel format + * @since 5.0 + * @version 1.0 + */ + int pixelFormat; + /** + * image width + * @since 5.0 + * @version 1.0 + */ + int width; + /** + * image height + * @since 5.0 + * @version 1.0 + */ + int height; + /** + * image color space + * @since 5.0 + * @version 1.0 + */ + int dataspace; +}; + +/** + * @brief Defines the CaptureEndedInfoExt, which is used by {@link IStreamOperatorCallback::OnCaptureEndedExt}. + * @since 5.0 + * @version 1.0 + */ +struct CaptureEndedInfoExt { + /** + * stream id + * @since 5.0 + * @version 1.0 + */ + int streamId_; + /** + * frame count + * @since 5.0 + * @version 1.0 + */ + int frameCount_; + /** + * whether deffered video enhancement available + * @since 5.0 + * @version 1.0 + */ + boolean isDeferredVideoEnhancementAvailable_; + /** + * video id + * @since 5.0 + * @version 1.0 + */ + String videoId_; }; \ No newline at end of file -- Gitee