1 /*
2  * Copyright (c) 2023-2023 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 #ifndef OHOS_CAMERA_RESTORE_PARAM_H
17 #define OHOS_CAMERA_RESTORE_PARAM_H
18 
19 #include <iostream>
20 #include <refbase.h>
21 #include <sys/time.h>
22 
23 #include "camera/v1_2/types.h"
24 #include "camera_metadata_info.h"
25 #include "icamera_service.h"
26 
27 namespace OHOS {
28 namespace CameraStandard {
29 using namespace OHOS::HDI::Camera::V1_0;
30 using OHOS::HDI::Camera::V1_1::StreamInfo_V1_1;
31 class HCameraRestoreParam : virtual public RefBase {
32 public:
33     HCameraRestoreParam(std::string clientName, std::string cameraId, std::vector<StreamInfo_V1_1> streamInfos,
34         std::shared_ptr<OHOS::Camera::CameraMetadata> settings,
35         RestoreParamTypeOhos restoreParamType, int startActiveTime);
36     HCameraRestoreParam(std::string clientName, std::string cameraId);
37     ~HCameraRestoreParam();
38 
39     std::vector<StreamInfo_V1_1> GetStreamInfo();
40     std::shared_ptr<OHOS::Camera::CameraMetadata> GetSetting();
41     RestoreParamTypeOhos GetRestoreParamType();
42     timeval GetCloseCameraTime();
43     int GetStartActiveTime();
44     std::string GetClientName();
45     std::string GetCameraId();
46     int32_t GetCameraOpMode();
47 
48     void SetStreamInfo(std::vector<StreamInfo_V1_1> &streamInfos);
49     void SetSetting(std::shared_ptr<OHOS::Camera::CameraMetadata>& settings);
50     void SetRestoreParamType(RestoreParamTypeOhos restoreParamType);
51     void SetStartActiveTime(int activeTime);
52     void SetCloseCameraTime(timeval closeCameraTime);
53     void SetCameraOpMode(int32_t opMode);
54     int GetFlodStatus();
55     void SetFoldStatus(int foldStaus);
56 
57 private:
58     std::string mClientName;
59     std::string mCameraId;
60     std::vector<StreamInfo_V1_1> mStreamInfos;
61     std::shared_ptr<OHOS::Camera::CameraMetadata> mSettings;
62     timeval mCloseCameraTime;
63     RestoreParamTypeOhos mRestoreParamType;
64     int mStartActiveTime = 0;
65     int32_t mOpMode = 0;
66     int mFoldStatus = 0;
67 };
68 } // namespace CameraStandard
69 } // namespace OHOS
70 #endif // OHOS_CAMERA_H_STREAM_COMMON_H
71