diff --git a/multimedia/camera_framework/BUILD.gn b/multimedia/camera_framework/BUILD.gn index 15bad5192e03b8daedd11a4097829540b32027e5..5193d84e080d5a418fdeeb2b85ed7668ce47e195 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 a840a259ba8d250cf7c5b077f60b6bcc2e4b7696..ff28a21055b004964e6de663e55bc75dadc449a7 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 0000000000000000000000000000000000000000..d4691deae916bd4f6c6a4e168dd1a3eccaeb4475 --- /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