From 91cd5ee8020db1ccc524bd28f1dc07a030b608cf Mon Sep 17 00:00:00 2001 From: zhangchao Date: Wed, 15 May 2024 14:28:47 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20ad5b9dc=20from=20https://gitee.com/zc24?= =?UTF-8?q?68/interface=5Fsdk=5Fc/pulls/699=20=E6=96=B0=E5=A2=9Ecamera=5Fd?= =?UTF-8?q?evice.h=E5=A4=B4=E6=96=87=E4=BB=B6=EF=BC=8C=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E8=8E=B7=E5=8F=96orientation=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangchao --- multimedia/camera_framework/BUILD.gn | 2 + multimedia/camera_framework/camera.ndk.json | 4 ++ multimedia/camera_framework/camera_device.h | 67 +++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 multimedia/camera_framework/camera_device.h diff --git a/multimedia/camera_framework/BUILD.gn b/multimedia/camera_framework/BUILD.gn index 15bad5192e0..5193d84e080 100644 --- a/multimedia/camera_framework/BUILD.gn +++ b/multimedia/camera_framework/BUILD.gn @@ -18,6 +18,7 @@ ohos_ndk_headers("camera_ndk_header") { dest_dir = "$ndk_headers_out_dir/ohcamera" sources = [ "./camera.h", + "./camera_device.h", "./camera_input.h", "./camera_manager.h", "./capture_session.h", @@ -35,6 +36,7 @@ ohos_ndk_library("libohcamera") { system_capability = "SystemCapability.Multimedia.Camera.Core" system_capability_headers = [ "ohcamera/camera.h", + "ohcamera/camera_device.h", "ohcamera/camera_manager.h", "ohcamera/camera_input.h", "ohcamera/capture_session.h", diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index a840a259ba8..ff28a21055b 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -326,5 +326,9 @@ { "first_introduced": "11", "name": "OH_VideoOutput_Release" + }, + { + "first_introduced": "12", + "name": "OH_CameraDevice_GetCameraOrientation" } ] diff --git a/multimedia/camera_framework/camera_device.h b/multimedia/camera_framework/camera_device.h new file mode 100644 index 00000000000..d4691deae91 --- /dev/null +++ b/multimedia/camera_framework/camera_device.h @@ -0,0 +1,67 @@ +/* + * 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. + */ + +/** + * @addtogroup OH_Camera + * @{ + * + * @brief Provide the definition of the C interface for the camera module. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * + * @since 12 + * @version 1.0 + */ + +/** + * @file camera_device.h + * + * @brief Declare the camera device concepts. + * + * @library libohcamera.so + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 12 + * @version 1.0 + */ + +#ifndef NATIVE_INCLUDE_CAMERA_CAMERADEVICE_H +#define NATIVE_INCLUDE_CAMERA_CAMERADEVICE_H + +#include +#include +#include "camera.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Gets the sensor orientation attribute for a camera device. + * + * @param camera the {@link Camera_Device} which use to get attributes. + * @param orientation the sensor orientation attribute if the method call succeeds. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 12 + */ +Camera_ErrorCode OH_CameraDevice_GetCameraOrientation(Camera_Device* camera, uint32_t* orientation); + +#ifdef __cplusplus +} +#endif + +#endif // NATIVE_INCLUDE_CAMERA_CAMERADEVICE_H +/** @} */ \ No newline at end of file -- Gitee