• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "rkispv6.h"
17 #include <vector>
18 
19 namespace OHOS::Camera {
IMPLEMENT_SENSOR(Rkispv6)20 IMPLEMENT_SENSOR(Rkispv6)
21 Rkispv6::Rkispv6() : ISensor("rkisp_v6") {}
22 
~Rkispv6()23 Rkispv6::~Rkispv6() {}
InitPhysicalSize(Camera::CameraMetadata & camera_meta_data)24 void Rkispv6::InitPhysicalSize(Camera::CameraMetadata& camera_meta_data)
25 {
26     ISensor::InitPhysicalSize(camera_meta_data);
27 }
InitAntiBandingModes(Camera::CameraMetadata & camera_meta_data)28 void Rkispv6::InitAntiBandingModes(Camera::CameraMetadata& camera_meta_data)
29 {
30     ISensor::InitAntiBandingModes(camera_meta_data);
31 }
InitAvailableModes(Camera::CameraMetadata & camera_meta_data)32 void Rkispv6::InitAvailableModes(Camera::CameraMetadata& camera_meta_data)
33 {
34     ISensor::InitAvailableModes(camera_meta_data);
35 }
InitFpsTarget(Camera::CameraMetadata & camera_meta_data)36 void Rkispv6::InitFpsTarget(Camera::CameraMetadata& camera_meta_data)
37 {
38     ISensor::InitFpsTarget(camera_meta_data);
39 }
InitCompensationRange(Camera::CameraMetadata & camera_meta_data)40 void Rkispv6::InitCompensationRange(Camera::CameraMetadata& camera_meta_data)
41 {
42     ISensor::InitCompensationRange(camera_meta_data);
43 }
44 
InitAwbModes(Camera::CameraMetadata & camera_meta_data)45 void Rkispv6::InitAwbModes(Camera::CameraMetadata& camera_meta_data)
46 {
47     ISensor::InitAwbModes(camera_meta_data);
48 }
49 
InitSensitivityRange(Camera::CameraMetadata & camera_meta_data)50 void Rkispv6::InitSensitivityRange(Camera::CameraMetadata& camera_meta_data)
51 {
52     ISensor::InitSensitivityRange(camera_meta_data);
53 }
54 
Init(Camera::CameraMetadata & camera_metaData)55 void Rkispv6::Init(Camera::CameraMetadata& camera_metaData)
56 {
57     InitPhysicalSize(camera_metaData);
58     InitAntiBandingModes(camera_metaData);
59     InitAvailableModes(camera_metaData);
60     InitFpsTarget(camera_metaData);
61     InitCompensationRange(camera_metaData);
62 
63     const camera_rational_t aeCompensationStep[] = {{0, 1}};
64     camera_metaData.addEntry(OHOS_CONTROL_AE_COMPENSATION_STEP, aeCompensationStep, 1);
65 
66     InitAwbModes(camera_metaData);
67     InitSensitivityRange(camera_metaData);
68 
69     uint8_t faceDetectMode = OHOS_CAMERA_FACE_DETECT_MODE_OFF;
70     camera_metaData.addEntry(OHOS_STATISTICS_FACE_DETECT_MODE, &faceDetectMode, 1);
71 }
72 } // namespace OHOS::Camera
73