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