• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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_CAPTURE_SESSION_H
17 #define OHOS_CAMERA_CAPTURE_SESSION_H
18 
19 #include <atomic>
20 #include <cstdint>
21 #include <iostream>
22 #include <map>
23 #include <memory>
24 #include <mutex>
25 #include <set>
26 #include <sstream>
27 #include <stdint.h>
28 #include <string>
29 #include <unordered_map>
30 #include <vector>
31 
32 #include "camera_error_code.h"
33 #include "camera_photo_proxy.h"
34 #include "capture_scene_const.h"
35 #include "color_space_info_parse.h"
36 #include "features/moon_capture_boost_feature.h"
37 #include "hcapture_session_callback_stub.h"
38 #include "hcamera_service_callback_stub.h"
39 #include "icamera_util.h"
40 #include "icapture_session.h"
41 #include "icapture_session_callback.h"
42 #include "input/camera_death_recipient.h"
43 #include "input/capture_input.h"
44 #include "output/camera_output_capability.h"
45 #include "output/capture_output.h"
46 #include "refbase.h"
47 #include "effect_suggestion_info_parse.h"
48 #include "capture_scene_const.h"
49 #include "ability/camera_ability.h"
50 #include "ability/camera_ability_parse_util.h"
51 
52 namespace OHOS {
53 namespace CameraStandard {
54 enum FocusState {
55     FOCUS_STATE_SCAN = 0,
56     FOCUS_STATE_FOCUSED,
57     FOCUS_STATE_UNFOCUSED
58 };
59 
60 enum ExposureState {
61     EXPOSURE_STATE_SCAN = 0,
62     EXPOSURE_STATE_CONVERGED
63 };
64 
65 enum FilterType {
66     NONE = 0,
67     CLASSIC = 1,
68     DAWN = 2,
69     PURE = 3,
70     GREY = 4,
71     NATURAL = 5,
72     MORI = 6,
73     FAIR = 7,
74     PINK = 8,
75 };
76 
77 enum PreconfigType : int32_t {
78     PRECONFIG_720P = 0,
79     PRECONFIG_1080P = 1,
80     PRECONFIG_4K = 2,
81     PRECONFIG_HIGH_QUALITY = 3
82 };
83 
84 enum UsageType {
85     BOKEH = 0
86 };
87 
88 struct PreconfigProfiles {
89 public:
PreconfigProfilesPreconfigProfiles90     explicit PreconfigProfiles(ColorSpace colorSpace) : colorSpace(colorSpace) {}
91     Profile previewProfile;
92     Profile photoProfile;
93     VideoProfile videoProfile;
94     ColorSpace colorSpace;
95 
ToStringPreconfigProfiles96     std::string ToString()
97     {
98         std::ostringstream oss;
99         oss << "colorSpace:[" << to_string(colorSpace);
100         oss << "]\n";
101 
102         oss << "previewProfile:[";
103         oss << " format:" << to_string(previewProfile.format_);
104         oss << " size:" << to_string(previewProfile.size_.width) << "x" << to_string(previewProfile.size_.height);
105         oss << " fps:" << to_string(previewProfile.fps_.minFps) << "," << to_string(previewProfile.fps_.maxFps) << ","
106             << to_string(previewProfile.fps_.fixedFps);
107         oss << "]\n";
108 
109         oss << "photoProfile:[";
110         oss << " format:" << to_string(photoProfile.format_);
111         oss << " size:" << to_string(photoProfile.size_.width) << "x" << to_string(photoProfile.size_.height);
112         oss << " dynamic:" << to_string(photoProfile.sizeFollowSensorMax_) << "," << to_string(photoProfile.sizeRatio_);
113         oss << "]\n";
114 
115         oss << "videoProfile:[";
116         oss << " format:" << to_string(videoProfile.format_);
117         oss << " size:" << to_string(videoProfile.size_.width) << "x" << to_string(videoProfile.size_.height);
118         oss << " frameRates:";
119         for (auto& fps : videoProfile.framerates_) {
120             oss << to_string(fps) << " ";
121         }
122         oss << "]\n";
123         return oss.str();
124     }
125 };
126 
127 enum EffectSuggestionType {
128     EFFECT_SUGGESTION_NONE = 0,
129     EFFECT_SUGGESTION_PORTRAIT,
130     EFFECT_SUGGESTION_FOOD,
131     EFFECT_SUGGESTION_SKY,
132     EFFECT_SUGGESTION_SUNRISE_SUNSET
133 };
134 
135 typedef enum {
136     AWB_MODE_AUTO = 0,
137     AWB_MODE_CLOUDY_DAYLIGHT,
138     AWB_MODE_INCANDESCENT,
139     AWB_MODE_FLUORESCENT,
140     AWB_MODE_DAYLIGHT,
141     AWB_MODE_OFF,
142     AWB_MODE_LOCKED,
143     AWB_MODE_WARM_FLUORESCENT,
144     AWB_MODE_TWILIGHT,
145     AWB_MODE_SHADE,
146 } WhiteBalanceMode;
147 
148 enum LightPaintingType {
149     CAR = 0,
150     STAR,
151     WATER,
152     LIGHT
153 };
154 
155 typedef struct {
156     float x;
157     float y;
158 } Point;
159 
160 enum class FwkTripodStatus {
161     INVALID = 0,
162     ACTIVE,
163     ENTER,
164     EXITING
165 };
166 
167 typedef struct {
168     float zoomRatio;
169     int32_t equivalentFocalLength;
170 } ZoomPointInfo;
171 
172 template<class T>
173 struct RefBaseCompare {
174 public:
operatorRefBaseCompare175     bool operator()(const wptr<T>& firstPtr, const wptr<T>& secondPtr) const
176     {
177         return firstPtr.GetRefPtr() < secondPtr.GetRefPtr();
178     }
179 };
180 
181 class SessionCallback {
182 public:
183     SessionCallback() = default;
184     virtual ~SessionCallback() = default;
185     /**
186      * @brief Called when error occured during capture session callback.
187      *
188      * @param errorCode Indicates a {@link ErrorCode} which will give information for capture session callback error.
189      */
190     virtual void OnError(int32_t errorCode) = 0;
191 };
192 
193 class ExposureCallback {
194 public:
195     enum ExposureState {
196         SCAN = 0,
197         CONVERGED,
198     };
199     ExposureCallback() = default;
200     virtual ~ExposureCallback() = default;
201     virtual void OnExposureState(ExposureState state) = 0;
202 };
203 
204 class FocusCallback {
205 public:
206     enum FocusState {
207         SCAN = 0,
208         FOCUSED,
209         UNFOCUSED
210     };
211     FocusCallback() = default;
212     virtual ~FocusCallback() = default;
213     virtual void OnFocusState(FocusState state) = 0;
214     FocusState currentState;
215 };
216 
217 class MacroStatusCallback {
218 public:
219     enum MacroStatus { IDLE = 0, ACTIVE, UNKNOWN };
220     MacroStatusCallback() = default;
221     virtual ~MacroStatusCallback() = default;
222     virtual void OnMacroStatusChanged(MacroStatus status) = 0;
223     MacroStatus currentStatus = UNKNOWN;
224 };
225 
226 class MoonCaptureBoostStatusCallback {
227 public:
228     enum MoonCaptureBoostStatus { IDLE = 0, ACTIVE, UNKNOWN };
229     MoonCaptureBoostStatusCallback() = default;
230     virtual ~MoonCaptureBoostStatusCallback() = default;
231     virtual void OnMoonCaptureBoostStatusChanged(MoonCaptureBoostStatus status) = 0;
232     MoonCaptureBoostStatus currentStatus = UNKNOWN;
233 };
234 
235 class FeatureDetectionStatusCallback {
236 public:
237     enum FeatureDetectionStatus { IDLE = 0, ACTIVE, UNKNOWN };
238 
239     FeatureDetectionStatusCallback() = default;
240     virtual ~FeatureDetectionStatusCallback() = default;
241     virtual void OnFeatureDetectionStatusChanged(SceneFeature feature, FeatureDetectionStatus status) = 0;
242     virtual bool IsFeatureSubscribed(SceneFeature feature) = 0;
243 
UpdateStatus(SceneFeature feature,FeatureDetectionStatus status)244     inline bool UpdateStatus(SceneFeature feature, FeatureDetectionStatus status)
245     {
246         std::lock_guard<std::mutex> lock(featureStatusMapMutex_);
247         auto it = featureStatusMap_.find(feature);
248         if (it == featureStatusMap_.end()) {
249             featureStatusMap_[feature] = status;
250             return true;
251         } else if (it->second != status) {
252             it->second = status;
253             return true;
254         }
255         return false;
256     }
257 
SetFeatureStatus(int8_t featureStatus)258     inline void SetFeatureStatus(int8_t featureStatus)
259     {
260         featureStatus_ = featureStatus;
261     }
262 
GetFeatureStatus()263     inline int8_t GetFeatureStatus() const
264     {
265         return featureStatus_;
266     }
267 private:
268     std::atomic<int8_t> featureStatus_ = -1;
269     std::mutex featureStatusMapMutex_;
270     std::unordered_map<SceneFeature, FeatureDetectionStatus> featureStatusMap_;
271 };
272 
273 class CaptureSessionCallback : public HCaptureSessionCallbackStub {
274 public:
275     CaptureSession* captureSession_ = nullptr;
CaptureSessionCallback()276     CaptureSessionCallback() : captureSession_(nullptr) {}
277 
CaptureSessionCallback(CaptureSession * captureSession)278     explicit CaptureSessionCallback(CaptureSession* captureSession) : captureSession_(captureSession) {}
279 
~CaptureSessionCallback()280     ~CaptureSessionCallback()
281     {
282         captureSession_ = nullptr;
283     }
284 
285     int32_t OnError(int32_t errorCode) override;
286 };
287 
288 class SmoothZoomCallback {
289 public:
290     SmoothZoomCallback() = default;
291     virtual ~SmoothZoomCallback() = default;
292     virtual void OnSmoothZoom(int32_t duration) = 0;
293 };
294 
295 class AbilityCallback {
296 public:
297     AbilityCallback() = default;
298     virtual ~AbilityCallback() = default;
299     virtual void OnAbilityChange() = 0;
300 };
301 
302 struct ARStatusInfo {
303     std::vector<int32_t> laserData;
304     float lensFocusDistance;
305     int32_t sensorSensitivity;
306     uint32_t exposureDurationValue;
307     int64_t timestamp;
308 };
309 
310 class ARCallback {
311 public:
312     ARCallback() = default;
313     virtual ~ARCallback() = default;
314     virtual void OnResult(const ARStatusInfo &arStatusInfo) const = 0;
315 };
316 
317 class EffectSuggestionCallback {
318 public:
319     EffectSuggestionCallback() = default;
320     virtual ~EffectSuggestionCallback() = default;
321     virtual void OnEffectSuggestionChange(EffectSuggestionType effectSuggestionType) = 0;
322     bool isFirstReport = true;
323     EffectSuggestionType currentType = EffectSuggestionType::EFFECT_SUGGESTION_NONE;
324 };
325 
326 struct LcdFlashStatusInfo {
327     bool isLcdFlashNeeded;
328     int32_t lcdCompensation;
329 };
330 
331 class LcdFlashStatusCallback {
332 public:
333     LcdFlashStatusCallback() = default;
334     virtual ~LcdFlashStatusCallback() = default;
335     virtual void OnLcdFlashStatusChanged(LcdFlashStatusInfo lcdFlashStatusInfo) = 0;
SetLcdFlashStatusInfo(const LcdFlashStatusInfo lcdFlashStatusInfo)336     void SetLcdFlashStatusInfo(const LcdFlashStatusInfo lcdFlashStatusInfo)
337     {
338         std::lock_guard<std::mutex> lock(mutex_);
339         lcdFlashStatusInfo_ = lcdFlashStatusInfo;
340     }
GetLcdFlashStatusInfo()341     LcdFlashStatusInfo GetLcdFlashStatusInfo()
342     {
343         std::lock_guard<std::mutex> lock(mutex_);
344         return lcdFlashStatusInfo_;
345     }
346 
347 private:
348     LcdFlashStatusInfo lcdFlashStatusInfo_ = { .isLcdFlashNeeded = true, .lcdCompensation = -1 };
349     std::mutex mutex_;
350 };
351 
352 class AutoDeviceSwitchCallback {
353 public:
354     AutoDeviceSwitchCallback() = default;
355     virtual ~AutoDeviceSwitchCallback() = default;
356     virtual void OnAutoDeviceSwitchStatusChange(bool isDeviceSwitched, bool isDeviceCapabilityChanged) const = 0 ;
357 };
358 
359 class FoldCallback : public HFoldServiceCallbackStub {
360 public:
FoldCallback(wptr<CaptureSession> captureSession)361     explicit FoldCallback(wptr<CaptureSession> captureSession) : captureSession_(captureSession) {}
362     int32_t OnFoldStatusChanged(const FoldStatus status) override;
363 
364 private:
365     wptr<CaptureSession> captureSession_ = nullptr;
366 };
367 
368 struct EffectSuggestionStatus {
369     EffectSuggestionType type;
370     bool status;
371 };
372 
FloatIsEqual(float x,float y)373 inline bool FloatIsEqual(float x, float y)
374 {
375     const float EPSILON = 0.000001;
376     return std::fabs(x - y) < EPSILON;
377 }
378 
ConfusingNumber(float data)379 inline float ConfusingNumber(float data)
380 {
381     const float factor = 20;
382     return data * factor;
383 }
384 
385 class CaptureSession : public RefBase {
386 public:
387     class CaptureSessionMetadataResultProcessor : public MetadataResultProcessor {
388     public:
CaptureSessionMetadataResultProcessor(wptr<CaptureSession> session)389         explicit CaptureSessionMetadataResultProcessor(wptr<CaptureSession> session) : session_(session) {}
390         void ProcessCallbacks(
391             const uint64_t timestamp, const std::shared_ptr<OHOS::Camera::CameraMetadata>& result) override;
392 
393     private:
394         wptr<CaptureSession> session_;
395     };
396 
397     explicit CaptureSession(sptr<ICaptureSession>& captureSession);
398     virtual ~CaptureSession();
399 
400     /**
401      * @brief Begin the capture session config.
402      */
403     int32_t BeginConfig();
404 
405     /**
406      * @brief Commit the capture session config.
407      */
408     virtual int32_t CommitConfig();
409 
410     /**
411      * @brief Determine if the given Input can be added to session.
412      *
413      * @param CaptureInput to be added to session.
414      */
415     virtual bool CanAddInput(sptr<CaptureInput>& input);
416 
417     /**
418      * @brief Add CaptureInput for the capture session.
419      *
420      * @param CaptureInput to be added to session.
421      */
422     int32_t AddInput(sptr<CaptureInput>& input);
423 
424     /**
425      * @brief Determine if the given Ouput can be added to session.
426      *
427      * @param CaptureOutput to be added to session.
428      */
429     virtual bool CanAddOutput(sptr<CaptureOutput>& output);
430 
431     /**
432      * @brief Add CaptureOutput for the capture session.
433      *
434      * @param CaptureOutput to be added to session.
435      */
436     virtual int32_t AddOutput(sptr<CaptureOutput> &output);
437 
438     /**
439      * @brief Remove CaptureInput for the capture session.
440      *
441      * @param CaptureInput to be removed from session.
442      */
443     int32_t RemoveInput(sptr<CaptureInput>& input);
444 
445     /**
446      * @brief Remove CaptureOutput for the capture session.
447      *
448      * @param CaptureOutput to be removed from session.
449      */
450     int32_t RemoveOutput(sptr<CaptureOutput>& output);
451 
452     /**
453      * @brief Starts session and preview.
454      */
455     int32_t Start();
456 
457     /**
458      * @brief Stop session and preview..
459      */
460     int32_t Stop();
461 
462     /**
463      * @brief Set the session callback for the capture session.
464      *
465      * @param SessionCallback pointer to be triggered.
466      */
467     void SetCallback(std::shared_ptr<SessionCallback> callback);
468 
469     /**
470      * @brief Set the moving photo callback.
471      *
472      * @param photoProxy Requested for the pointer where moving photo callback is present.
473      * @param uri get uri for medialibary.
474      * @param cameraShotType get cameraShotType for medialibary.
475      */
476 
477     void CreateMediaLibrary(sptr<CameraPhotoProxy> photoProxy, std::string &uri, int32_t &cameraShotType,
478                             std::string &burstKey, int64_t timestamp);
479 
480     void CreateMediaLibrary(std::unique_ptr<Media::Picture> picture, sptr<CameraPhotoProxy> photoProxy,
481         std::string &uri, int32_t &cameraShotType, std::string &burstKey, int64_t timestamp);
482 
483     /**
484      * @brief Get the application callback information.
485      *
486      * @return Returns the pointer to SessionCallback set by application.
487      */
488     std::shared_ptr<SessionCallback> GetApplicationCallback();
489 
490     /**
491      * @brief Get the ExposureCallback.
492      *
493      * @return Returns the pointer to ExposureCallback.
494      */
495     std::shared_ptr<ExposureCallback> GetExposureCallback();
496 
497     /**
498      * @brief Get the FocusCallback.
499      *
500      * @return Returns the pointer to FocusCallback.
501      */
502     std::shared_ptr<FocusCallback> GetFocusCallback();
503 
504     /**
505      * @brief Get the MacroStatusCallback.
506      *
507      * @return Returns the pointer to MacroStatusCallback.
508      */
509     std::shared_ptr<MacroStatusCallback> GetMacroStatusCallback();
510 
511     /**
512      * @brief Get the MoonCaptureBoostStatusCallback.
513      *
514      * @return Returns the pointer to MoonCaptureBoostStatusCallback.
515      */
516     std::shared_ptr<MoonCaptureBoostStatusCallback> GetMoonCaptureBoostStatusCallback();
517 
518     /**
519      * @brief Get the FeatureDetectionStatusCallback.
520      *
521      * @return Returns the pointer to FeatureDetectionStatusCallback.
522      */
523     std::shared_ptr<FeatureDetectionStatusCallback> GetFeatureDetectionStatusCallback();
524 
525     /**
526      * @brief Get the SmoothZoomCallback.
527      *
528      * @return Returns the pointer to SmoothZoomCallback.
529      */
530     std::shared_ptr<SmoothZoomCallback> GetSmoothZoomCallback();
531 
532     /**
533      * @brief Releases CaptureSession instance.
534      * @return Returns errCode.
535      */
536     int32_t Release();
537 
538     /**
539      * @brief create new device control setting.
540      */
541     void LockForControl();
542 
543     /**
544      * @brief submit device control setting.
545      *
546      * @return Returns CAMERA_OK is success.
547      */
548     int32_t UnlockForControl();
549 
550     /**
551      * @brief Get the supported video sabilization modes.
552      *
553      * @return Returns vector of CameraVideoStabilizationMode supported stabilization modes.
554      */
555     std::vector<VideoStabilizationMode> GetSupportedStabilizationMode();
556 
557     /**
558      * @brief Get the supported video sabilization modes.
559      * @param vector of CameraVideoStabilizationMode supported stabilization modes.
560      * @return Returns errCode.
561      */
562     int32_t GetSupportedStabilizationMode(std::vector<VideoStabilizationMode>& modes);
563 
564     /**
565      * @brief Query whether given stabilization mode supported.
566      *
567      * @param VideoStabilizationMode stabilization mode to query.
568      * @return True is supported false otherwise.
569      */
570     bool IsVideoStabilizationModeSupported(VideoStabilizationMode stabilizationMode);
571 
572     /**
573      * @brief Query whether given stabilization mode supported.
574      *
575      * @param VideoStabilizationMode stabilization mode to query.
576      * @param bool True is supported false otherwise.
577      * @return errCode.
578      */
579     int32_t IsVideoStabilizationModeSupported(VideoStabilizationMode stabilizationMode, bool& isSupported);
580 
581     /**
582      * @brief Get the current Video Stabilizaion mode.
583      *
584      * @return Returns current Video Stabilizaion mode.
585      */
586     VideoStabilizationMode GetActiveVideoStabilizationMode();
587 
588     /**
589      * @brief Get the current Video Stabilizaion mode.
590      * @param current Video Stabilizaion mode.
591      * @return errCode
592      */
593     int32_t GetActiveVideoStabilizationMode(VideoStabilizationMode& mode);
594 
595     /**
596      * @brief Set the Video Stabilizaion mode.
597      * @param VideoStabilizationMode stabilization mode to set.
598      * @return errCode
599      */
600     int32_t SetVideoStabilizationMode(VideoStabilizationMode stabilizationMode);
601 
602     /**
603      * @brief Get the supported exposure modes.
604      *
605      * @return Returns vector of ExposureMode supported exposure modes.
606      */
607     std::vector<ExposureMode> GetSupportedExposureModes();
608 
609     /**
610      * @brief Get the supported exposure modes.
611      * @param vector of ExposureMode supported exposure modes.
612      * @return errCode.
613      */
614     int32_t GetSupportedExposureModes(std::vector<ExposureMode>& exposureModes);
615 
616     /**
617      * @brief Query whether given exposure mode supported.
618      *
619      * @param ExposureMode exposure mode to query.
620      * @return True is supported false otherwise.
621      */
622     bool IsExposureModeSupported(ExposureMode exposureMode);
623 
624     /**
625      * @brief Query whether given exposure mode supported.
626      *
627      * @param ExposureMode exposure mode to query.
628      * @param bool True is supported false otherwise.
629      * @return errCode.
630      */
631     int32_t IsExposureModeSupported(ExposureMode exposureMode, bool& isSupported);
632 
633     /**
634      * @brief Set exposure mode.
635      * @param ExposureMode exposure mode to be set.
636      * @return errCode
637      */
638     int32_t SetExposureMode(ExposureMode exposureMode);
639 
640     /**
641      * @brief Get the current exposure mode.
642      *
643      * @return Returns current exposure mode.
644      */
645     ExposureMode GetExposureMode();
646 
647     /**
648      * @brief Get the current exposure mode.
649      * @param ExposureMode current exposure mode.
650      * @return errCode.
651      */
652     int32_t GetExposureMode(ExposureMode& exposureMode);
653 
654     /**
655      * @brief Set the centre point of exposure area.
656      * @param Point which specifies the area to expose.
657      * @return errCode
658      */
659     int32_t SetMeteringPoint(Point exposurePoint);
660 
661     /**
662      * @brief Get centre point of exposure area.
663      *
664      * @return Returns current exposure point.
665      */
666     Point GetMeteringPoint();
667 
668     /**
669      * @brief Get centre point of exposure area.
670      * @param Point current exposure point.
671      * @return errCode
672      */
673     int32_t GetMeteringPoint(Point& exposurePoint);
674 
675     /**
676      * @brief Get exposure compensation range.
677      *
678      * @return Returns supported exposure compensation range.
679      */
680     std::vector<float> GetExposureBiasRange();
681 
682     /**
683      * @brief Get exposure compensation range.
684      * @param vector of exposure bias range.
685      * @return errCode.
686      */
687     int32_t GetExposureBiasRange(std::vector<float>& exposureBiasRange);
688 
689     /**
690      * @brief Set exposure compensation value.
691      * @param exposure compensation value to be set.
692      * @return errCode.
693      */
694     int32_t SetExposureBias(float exposureBias);
695 
696     /**
697      * @brief Get exposure compensation value.
698      *
699      * @return Returns current exposure compensation value.
700      */
701     float GetExposureValue();
702 
703     /**
704      * @brief Get exposure compensation value.
705      * @param exposure current exposure compensation value .
706      * @return Returns errCode.
707      */
708     int32_t GetExposureValue(float& exposure);
709 
710     /**
711      * @brief Set the exposure callback.
712      * which will be called when there is exposure state change.
713      *
714      * @param The ExposureCallback pointer.
715      */
716     void SetExposureCallback(std::shared_ptr<ExposureCallback> exposureCallback);
717 
718     /**
719      * @brief This function is called when there is exposure state change
720      * and process the exposure state callback.
721      *
722      * @param result metadata got from callback from service layer.
723      */
724     void ProcessAutoExposureUpdates(const std::shared_ptr<OHOS::Camera::CameraMetadata>& result);
725 
726     /**
727      * @brief Get the supported Focus modes.
728      *
729      * @return Returns vector of FocusMode supported exposure modes.
730      */
731     std::vector<FocusMode> GetSupportedFocusModes();
732 
733     /**
734      * @brief Get the supported Focus modes.
735      * @param vector of FocusMode supported.
736      * @return Returns errCode.
737      */
738     int32_t GetSupportedFocusModes(std::vector<FocusMode>& modes);
739 
740     /**
741      * @brief Query whether given focus mode supported.
742      *
743      * @param camera_focus_mode_enum_t focus mode to query.
744      * @return True is supported false otherwise.
745      */
746     bool IsFocusModeSupported(FocusMode focusMode);
747 
748     /**
749      * @brief Query whether given focus mode supported.
750      *
751      * @param camera_focus_mode_enum_t focus mode to query.
752      * @param bool True is supported false otherwise.
753      * @return Returns errCode.
754      */
755     int32_t IsFocusModeSupported(FocusMode focusMode, bool& isSupported);
756 
757     /**
758      * @brief Set Focus mode.
759      *
760      * @param FocusMode focus mode to be set.
761      * @return Returns errCode.
762      */
763     int32_t SetFocusMode(FocusMode focusMode);
764 
765     /**
766      * @brief Get the current focus mode.
767      *
768      * @return Returns current focus mode.
769      */
770     FocusMode GetFocusMode();
771 
772     /**
773      * @brief Get the current focus mode.
774      * @param FocusMode current focus mode.
775      * @return Returns errCode.
776      */
777     int32_t GetFocusMode(FocusMode& focusMode);
778 
779     /**
780      * @brief Set the focus callback.
781      * which will be called when there is focus state change.
782      *
783      * @param The ExposureCallback pointer.
784      */
785     void SetFocusCallback(std::shared_ptr<FocusCallback> focusCallback);
786 
787     /**
788      * @brief This function is called when there is focus state change
789      * and process the focus state callback.
790      *
791      * @param result metadata got from callback from service layer.
792      */
793     void ProcessAutoFocusUpdates(const std::shared_ptr<OHOS::Camera::CameraMetadata>& result);
794 
795     /**
796      * @brief Set the Focus area.
797      *
798      * @param Point which specifies the area to focus.
799      * @return Returns errCode.
800      */
801     int32_t SetFocusPoint(Point focusPoint);
802 
803     /**
804      * @brief Get centre point of focus area.
805      *
806      * @return Returns current focus point.
807      */
808     Point GetFocusPoint();
809 
810     /**
811      * @brief Get centre point of focus area.
812      * @param Point current focus point.
813      * @return Returns errCode.
814      */
815     int32_t GetFocusPoint(Point& focusPoint);
816 
817     /**
818      * @brief Get focal length.
819      *
820      * @return Returns focal length value.
821      */
822     float GetFocalLength();
823 
824     /**
825      * @brief Get focal length.
826      * @param focalLength current focal length compensation value .
827      * @return Returns errCode.
828      */
829     int32_t GetFocalLength(float& focalLength);
830 
831     /**
832      * @brief Get the vector of focus range types.
833      * @param types vector of focus range types.
834      * @return Returns errCode.
835      */
836     int32_t GetSupportedFocusRangeTypes(std::vector<FocusRangeType>& types);
837 
838     /**
839      * @brief Query whether given focus range type supported.
840      * @param focusRangeType focus range type to query.
841      * @param isSupported True is supported false otherwise.
842      * @return Returns errCode.
843      */
844     int32_t IsFocusRangeTypeSupported(FocusRangeType focusRangeType, bool& isSupported);
845 
846     /**
847      * @brief Get focus range type.
848      * @param focusRangeType focus range type.
849      * @return Returns errCode.
850      */
851     int32_t GetFocusRange(FocusRangeType& focusRangeType);
852 
853     /**
854      * @brief Set focus range type.
855      * @param focusRangeType focus range type to be set.
856      * @return Returns errCode.
857      */
858     int32_t SetFocusRange(FocusRangeType focusRangeType);
859 
860     /**
861      * @brief Get the vector of focus driven types.
862      * @param types vector of focus driven types.
863      * @return Returns errCode.
864      */
865     int32_t GetSupportedFocusDrivenTypes(std::vector<FocusDrivenType>& types);
866 
867     /**
868      * @brief Query whether given focus driven type supported.
869      * @param focusDrivenType focus driven type to query.
870      * @param isSupported True is supported false otherwise.
871      * @return Returns errCode.
872      */
873     int32_t IsFocusDrivenTypeSupported(FocusDrivenType focusDrivenType, bool& isSupported);
874 
875     /**
876      * @brief Get focus driven type.
877      * @param focusDrivenType focus driven type.
878      * @return Returns errCode.
879      */
880     int32_t GetFocusDriven(FocusDrivenType& focusDrivenType);
881 
882     /**
883      * @brief Set focus driven type.
884      * @param focusDrivenType focus driven type to be set.
885      * @return Returns errCode.
886      */
887     int32_t SetFocusDriven(FocusDrivenType focusDrivenType);
888 
889     /**
890      * @brief Get the vector of color reservation types.
891      * @param types vector of color reservation types.
892      * @return Returns errCode.
893      */
894     int32_t GetSupportedColorReservationTypes(std::vector<ColorReservationType>& types);
895 
896     /**
897      * @brief Get color reservation type.
898      * @param colorReservationType color reservation type.
899      * @return Returns errCode.
900      */
901     int32_t GetColorReservation(ColorReservationType& colorReservationType);
902 
903     /**
904      * @brief Set color reservation type.
905      * @param colorReservationType color reservation type to be set.
906      * @return Returns errCode.
907      */
908     int32_t SetColorReservation(ColorReservationType colorReservationType);
909 
910     /**
911     * @brief Set the smooth zoom callback.
912     * which will be called when there is smooth zoom change.
913     *
914     * @param The SmoothZoomCallback pointer.
915     */
916     void SetSmoothZoomCallback(std::shared_ptr<SmoothZoomCallback> smoothZoomCallback);
917 
918     /**
919      * @brief Get the supported Focus modes.
920      *
921      * @return Returns vector of camera_focus_mode_enum_t supported exposure modes.
922      */
923     std::vector<FlashMode> GetSupportedFlashModes();
924 
925     /**
926      * @brief Get the supported Focus modes.
927      * @param vector of camera_focus_mode_enum_t supported exposure modes.
928      * @return Returns errCode.
929      */
930     virtual int32_t GetSupportedFlashModes(std::vector<FlashMode>& flashModes);
931 
932     /**
933      * @brief Check whether camera has flash.
934      */
935     bool HasFlash();
936 
937     /**
938      * @brief Check whether camera has flash.
939      * @param bool True is has flash false otherwise.
940      * @return Returns errCode.
941      */
942     int32_t HasFlash(bool& hasFlash);
943 
944     /**
945      * @brief Query whether given flash mode supported.
946      *
947      * @param camera_flash_mode_enum_t flash mode to query.
948      * @return True if supported false otherwise.
949      */
950     bool IsFlashModeSupported(FlashMode flashMode);
951 
952     /**
953      * @brief Query whether given flash mode supported.
954      *
955      * @param camera_flash_mode_enum_t flash mode to query.
956      * @param bool True if supported false otherwise.
957      * @return errCode.
958      */
959     int32_t IsFlashModeSupported(FlashMode flashMode, bool& isSupported);
960 
961     /**
962      * @brief Get the current flash mode.
963      *
964      * @return Returns current flash mode.
965      */
966     FlashMode GetFlashMode();
967 
968     /**
969      * @brief Get the current flash mode.
970      * @param current flash mode.
971      * @return Returns errCode.
972      */
973     virtual int32_t GetFlashMode(FlashMode& flashMode);
974 
975     /**
976      * @brief Set flash mode.
977      *
978      * @param camera_flash_mode_enum_t flash mode to be set.
979      * @return Returns errCode.
980      */
981     virtual int32_t SetFlashMode(FlashMode flashMode);
982 
983     /**
984      * @brief Get the supported Zoom Ratio range.
985      *
986      * @return Returns vector<float> of supported Zoom ratio range.
987      */
988     std::vector<float> GetZoomRatioRange();
989 
990     /**
991      * @brief Get the supported Zoom Ratio range.
992      *
993      * @param vector<float> of supported Zoom ratio range.
994      * @return Returns errCode.
995      */
996     int32_t GetZoomRatioRange(std::vector<float>& zoomRatioRange);
997 
998     /**
999      * @brief Get the current Zoom Ratio.
1000      *
1001      * @return Returns current Zoom Ratio.
1002      */
1003     float GetZoomRatio();
1004 
1005     /**
1006      * @brief Get the current Zoom Ratio.
1007      * @param zoomRatio current Zoom Ratio.
1008      * @return Returns errCode.
1009      */
1010     int32_t GetZoomRatio(float& zoomRatio);
1011 
1012     /**
1013      * @brief Set Zoom ratio.
1014      *
1015      * @param Zoom ratio to be set.
1016      * @return Returns errCode.
1017      */
1018     int32_t SetZoomRatio(float zoomRatio);
1019 
1020     /**
1021      * @brief Prepare Zoom change.
1022      *
1023      * @return Returns errCode.
1024      */
1025     int32_t PrepareZoom();
1026 
1027     /**
1028      * @brief UnPrepare Zoom hange.
1029      *
1030      * @return Returns errCode.
1031      */
1032     int32_t UnPrepareZoom();
1033 
1034     /**
1035      * @brief Set Smooth Zoom.
1036      *
1037      * @param Target smooth zoom ratio.
1038      * @param Smooth zoom type.
1039      * @return Returns errCode.
1040      */
1041     int32_t SetSmoothZoom(float targetZoomRatio, uint32_t smoothZoomType);
1042 
1043     /**
1044      * @brief Get the supported Zoom point info.
1045      *
1046      * @param vector<ZoomPointInfo> of supported ZoomPointInfo.
1047      * @return Returns errCode.
1048      */
1049     int32_t GetZoomPointInfos(std::vector<ZoomPointInfo>& zoomPointInfoList);
1050 
1051     /**
1052      * @brief Set Metadata Object types.
1053      *
1054      * @param set of camera_face_detect_mode_t types.
1055      */
1056     void SetCaptureMetadataObjectTypes(std::set<camera_face_detect_mode_t> metadataObjectTypes);
1057 
1058     /**
1059      * @brief Get the supported filters.
1060      *
1061      * @return Returns the array of filter.
1062      */
1063     std::vector<FilterType> GetSupportedFilters();
1064 
1065     /**
1066      * @brief Verify ability for supported meta.
1067      *
1068      * @return Returns errorcode.
1069      */
1070     int32_t VerifyAbility(uint32_t ability);
1071 
1072     /**
1073      * @brief Get the current filter.
1074      *
1075      * @return Returns the array of filter.
1076      */
1077     FilterType GetFilter();
1078 
1079     /**
1080      * @brief Set the filter.
1081      */
1082     void SetFilter(FilterType filter);
1083 
1084     /**
1085      * @brief Get the supported beauty type.
1086      *
1087      * @return Returns the array of beautytype.
1088      */
1089     std::vector<BeautyType> GetSupportedBeautyTypes();
1090 
1091     /**
1092      * @brief Get the supported beauty range.
1093      *
1094      * @return Returns the array of beauty range.
1095      */
1096     std::vector<int32_t> GetSupportedBeautyRange(BeautyType type);
1097 
1098     /**
1099      * @brief Set the beauty.
1100      */
1101     void SetBeauty(BeautyType type, int value);
1102 
1103     /**
1104      * @brief according type to get the strength.
1105      */
1106     int32_t GetBeauty(BeautyType type);
1107 
1108     /**
1109      * @brief Gets supported portrait theme type.
1110      * @param vector of PortraitThemeType supported portraitTheme type.
1111      * @return Returns errCode.
1112      */
1113     int32_t GetSupportedPortraitThemeTypes(std::vector<PortraitThemeType>& types);
1114 
1115     /**
1116      * @brief Checks whether portrait theme is supported.
1117      * @param isSupported True if supported false otherwise.
1118      * @return Returns errCode.
1119      */
1120     int32_t IsPortraitThemeSupported(bool &isSupported);
1121 
1122     /**
1123      * @brief Checks whether portrait theme is supported.
1124      *
1125      * @return True if supported false otherwise.
1126      */
1127     bool IsPortraitThemeSupported();
1128 
1129     /**
1130      * @brief Sets a portrait theme type for a camera device.
1131      * @param type PortraitTheme type to be sety.
1132      * @return Returns errCode.
1133      */
1134     int32_t SetPortraitThemeType(PortraitThemeType type);
1135 
1136     /**
1137      * @brief Gets supported rotations.
1138      * @param vector of supported rotations.
1139      * @return Returns errCode.
1140      */
1141     int32_t GetSupportedVideoRotations(std::vector<int32_t>& supportedRotation);
1142 
1143     /**
1144      * @brief Checks whether rotation is supported.
1145      * @param isSupported True if supported false otherwise.
1146      * @return Returns errCode.
1147      */
1148     int32_t IsVideoRotationSupported(bool &isSupported);
1149 
1150     /**
1151      * @brief Checks whether rotation is supported.
1152      *
1153      * @return True if supported false otherwise.
1154      */
1155     bool IsVideoRotationSupported();
1156 
1157     /**
1158      * @brief Sets a rotation type for a camera device.
1159      * @param rotation Potation to be sety.
1160      * @return Returns errCode.
1161      */
1162     int32_t SetVideoRotation(int32_t rotation);
1163 
1164     /**
1165      * @brief Get the supported color spaces.
1166      *
1167      * @return Returns supported color spaces.
1168      */
1169     std::vector<ColorSpace> GetSupportedColorSpaces();
1170 
1171     /**
1172      * @brief Get current color space.
1173      *
1174      * @return Returns current color space.
1175      */
1176     int32_t GetActiveColorSpace(ColorSpace& colorSpace);
1177 
1178     /**
1179      * @brief Set the color space.
1180      */
1181     int32_t SetColorSpace(ColorSpace colorSpace);
1182 
1183     /**
1184      * @brief Get the supported color effect.
1185      *
1186      * @return Returns supported color effects.
1187      */
1188     std::vector<ColorEffect> GetSupportedColorEffects();
1189 
1190     /**
1191      * @brief Get the current color effect.
1192      *
1193      * @return Returns current color effect.
1194      */
1195     ColorEffect GetColorEffect();
1196 
1197     /**
1198      * @brief Set the color effect.
1199      */
1200     void SetColorEffect(ColorEffect colorEffect);
1201 
1202 // Focus Distance
1203     /**
1204      * @brief Get the current FocusDistance.
1205      * @param distance current Focus Distance.
1206      * @return Returns errCode.
1207      */
1208     int32_t GetFocusDistance(float& distance);
1209 
1210     /**
1211      * @brief Set Focus istance.
1212      *
1213      * @param distance to be set.
1214      * @return Returns errCode.
1215      */
1216     int32_t SetFocusDistance(float distance);
1217 
1218     /**
1219      * @brief Get the current FocusDistance.
1220      * @param distance current Focus Distance.
1221      * @return Returns errCode.
1222      */
1223     float GetMinimumFocusDistance();
1224 
1225     /**
1226      * @brief Check current status is support macro or not.
1227      */
1228     bool IsMacroSupported();
1229 
1230     /**
1231      * @brief Enable macro lens.
1232      */
1233     int32_t EnableMacro(bool isEnable);
1234 
1235     /**
1236      * @brief Check current status is support depth fusion or not.
1237      */
1238     bool IsDepthFusionSupported();
1239 
1240     /**
1241      * @brief Get the depth fusion supported Zoom Ratio range,
1242      *
1243      * @return Returns vector<float> of depth fusion supported Zoom ratio range.
1244      */
1245     std::vector<float> GetDepthFusionThreshold();
1246 
1247     /**
1248      * @brief Get the depth fusion supported Zoom ratio range.
1249      *
1250      * @param vector<float> of depth fusion supported Zoom ratio range.
1251      * @return Returns errCode.
1252      */
1253     int32_t GetDepthFusionThreshold(std::vector<float>& depthFusionThreshold);
1254 
1255     /**
1256     * @brief Check curernt status is enabled depth fusion.
1257     */
1258     bool IsDepthFusionEnabled();
1259 
1260     /**
1261      * @brief Enable depth fusion.
1262      */
1263     int32_t EnableDepthFusion(bool isEnable);
1264 
1265     /**
1266     * @brief Check current status is support motion photo.
1267     */
1268     bool IsMovingPhotoSupported();
1269 
1270     /**
1271      * @brief Enable motion photo.
1272      */
1273     int32_t EnableMovingPhoto(bool isEnable);
1274 
1275     /**
1276      * @brief Enable moving photo mirror.
1277      */
1278     int32_t EnableMovingPhotoMirror(bool isMirror, bool isConfig);
1279 
1280     /**
1281      * @brief Check current status is support moon capture boost or not.
1282      */
1283     bool IsMoonCaptureBoostSupported();
1284 
1285     /**
1286      * @brief Enable or disable moon capture boost ability.
1287      */
1288     int32_t EnableMoonCaptureBoost(bool isEnable);
1289 
1290     /**
1291      * @brief Check current status is support target feature or not.
1292      */
1293     bool IsFeatureSupported(SceneFeature feature);
1294 
1295     /**
1296      * @brief Enable or disable target feature ability.
1297      */
1298     int32_t EnableFeature(SceneFeature feature, bool isEnable);
1299 
1300     /**
1301      * @brief Set the macro status callback.
1302      * which will be called when there is macro state change.
1303      *
1304      * @param The MacroStatusCallback pointer.
1305      */
1306     void SetMacroStatusCallback(std::shared_ptr<MacroStatusCallback> callback);
1307 
1308     /**
1309      * @brief Set the moon detect status callback.
1310      * which will be called when there is moon detect state change.
1311      *
1312      * @param The MoonCaptureBoostStatusCallback pointer.
1313      */
1314     void SetMoonCaptureBoostStatusCallback(std::shared_ptr<MoonCaptureBoostStatusCallback> callback);
1315 
1316     /**
1317      * @brief Set the feature detection status callback.
1318      * which will be called when there is feature detection state change.
1319      *
1320      * @param The FeatureDetectionStatusCallback pointer.
1321      */
1322     void SetFeatureDetectionStatusCallback(std::shared_ptr<FeatureDetectionStatusCallback> callback);
1323 
1324     void SetEffectSuggestionCallback(std::shared_ptr<EffectSuggestionCallback> effectSuggestionCallback);
1325 
1326     /**
1327      * @brief This function is called when there is macro status change
1328      * and process the macro status callback.
1329      *
1330      * @param result Metadata got from callback from service layer.
1331      */
1332     void ProcessMacroStatusChange(const std::shared_ptr<OHOS::Camera::CameraMetadata>& result);
1333 
1334     /**
1335      * @brief This function is called when there is moon detect status change
1336      * and process the moon detect status callback.
1337      *
1338      * @param result Metadata got from callback from service layer.
1339      */
1340     void ProcessMoonCaptureBoostStatusChange(const std::shared_ptr<OHOS::Camera::CameraMetadata>& result);
1341 
1342     /**
1343      * @brief This function is called when there is low light detect status change
1344      * and process the low light detect status callback.
1345      *
1346      * @param result Metadata got from callback from service layer.
1347      */
1348     void ProcessLowLightBoostStatusChange(const std::shared_ptr<OHOS::Camera::CameraMetadata>& result);
1349 
1350     /**
1351      * @brief Check current status is support moon capture boost or not.
1352      */
1353     bool IsLowLightBoostSupported();
1354 
1355     /**
1356      * @brief Enable or disable moon capture boost ability.
1357      */
1358     int32_t EnableLowLightBoost(bool isEnable);
1359 
1360     /**
1361      * @brief Enable or disable moon capture boost ability.
1362      */
1363     int32_t EnableLowLightDetection(bool isEnable);
1364 
1365     /**
1366      * @brief Verify that the output configuration is legitimate.
1367      *
1368      * @param outputProfile The target profile.
1369      * @param outputType The type of output profile.
1370      *
1371      * @return True if the profile is supported, false otherwise.
1372      */
1373     bool ValidateOutputProfile(Profile& outputProfile, CaptureOutputType outputType);
1374 
1375     /**
1376      * @brief Check the preconfig type is supported or not.
1377      *
1378      * @param preconfigType The target preconfig type.
1379      * @param preconfigRatio The target ratio enum
1380      *
1381      * @return True if the preconfig type is supported, false otherwise.
1382      */
1383     virtual bool CanPreconfig(PreconfigType preconfigType, ProfileSizeRatio preconfigRatio);
1384 
1385     /**
1386      * @brief Set the preconfig type.
1387      *
1388      * @param preconfigType The target preconfig type.
1389      * @param preconfigRatio The target ratio enum
1390      *
1391      * @return Camera error code.
1392      */
1393     virtual int32_t Preconfig(PreconfigType preconfigType, ProfileSizeRatio preconfigRatio);
1394 
1395     /**
1396      * @brief Get whether or not commit config.
1397      *
1398      * @return Returns whether or not commit config.
1399      */
1400     bool IsSessionCommited();
1401     bool SetBeautyValue(BeautyType beautyType, int32_t value);
1402     /**
1403      * @brief Get whether or not commit config.
1404      *
1405      * @return Returns whether or not commit config.
1406      */
1407     bool IsSessionConfiged();
1408 
1409     /**
1410      * @brief Get whether or not start session.
1411      *
1412      * @return Returns whether or not start session.
1413      */
1414     bool IsSessionStarted();
1415 
1416     /**
1417      * @brief Set FrameRate Range.
1418      *
1419      * @return Returns whether or not commit config.
1420      */
1421     int32_t SetFrameRateRange(const std::vector<int32_t>& frameRateRange);
1422 
1423     /**
1424     * @brief Set camera sensor sensitivity.
1425     * @param sensitivity sensitivity value to be set.
1426     * @return errCode.
1427     */
1428     int32_t SetSensorSensitivity(uint32_t sensitivity);
1429 
1430     /**
1431     * @brief Get camera sensor sensitivity.
1432     * @param sensitivity current sensitivity value.
1433     * @return Returns errCode.
1434     */
1435     int32_t GetSensorSensitivityRange(std::vector<int32_t> &sensitivityRange);
1436 
1437     /**
1438     * @brief Get exposure time range.
1439     * @param vector of exposure time range.
1440     * @return errCode.
1441     */
1442     int32_t GetSensorExposureTimeRange(std::vector<uint32_t> &sensorExposureTimeRange);
1443 
1444     /**
1445     * @brief Set exposure time value.
1446     * @param exposure compensation value to be set.
1447     * @return errCode.
1448     */
1449     int32_t SetSensorExposureTime(uint32_t sensorExposureTime);
1450 
1451     /**
1452     * @brief Get exposure time value.
1453     * @param exposure current exposure time value .
1454     * @return Returns errCode.
1455     */
1456     int32_t GetSensorExposureTime(uint32_t &sensorExposureTime);
1457 
1458     /**
1459     * @brief Get sensor module type
1460     * @param moduleType sensor module type.
1461     * @return Returns errCode.
1462     */
1463     int32_t GetModuleType(uint32_t &moduleType);
1464 
1465     /**
1466      * @brief Set ar mode.
1467      * @param isEnable switch to control ar mode.
1468      * @return errCode
1469      */
1470     int32_t SetARMode(bool isEnable);
1471 
1472     /**
1473      * @brief Set the ar callback.
1474      * which will be called when there is ar info update.
1475      *
1476      * @param arCallback ARCallback pointer.
1477      */
1478     void SetARCallback(std::shared_ptr<ARCallback> arCallback);
1479 
1480     /**
1481      * @brief Get the ARCallback.
1482      *
1483      * @return Returns the pointer to ARCallback.
1484      */
1485     std::shared_ptr<ARCallback> GetARCallback();
1486 
1487     /**
1488      * @brief Get Session Functions.
1489      *
1490      * @param previewProfiles to be searched.
1491      * @param photoProfiles to be searched.
1492      * @param videoProfiles to be searched.
1493      */
1494     std::vector<sptr<CameraAbility>> GetSessionFunctions(std::vector<Profile>& previewProfiles,
1495                                                          std::vector<Profile>& photoProfiles,
1496                                                          std::vector<VideoProfile>& videoProfiles,
1497                                                          bool isForApp = true);
1498 
1499     /**
1500      * @brief Get Session Conflict Functions.
1501      *
1502      */
1503     std::vector<sptr<CameraAbility>> GetSessionConflictFunctions();
1504 
1505     /**
1506      * @brief Get CameraOutput Capabilities.
1507      *
1508      */
1509     std::vector<sptr<CameraOutputCapability>> GetCameraOutputCapabilities(sptr<CameraDevice> &camera);
1510 
1511     /**
1512      * @brief CreateCameraAbilityContainer.
1513      *
1514      */
1515     void CreateCameraAbilityContainer();
1516 
1517     /**
1518      * @brief Get whether effectSuggestion Supported.
1519      *
1520      * @return True if supported false otherwise.
1521      */
1522     bool IsEffectSuggestionSupported();
1523 
1524     /**
1525      * @brief Enable EffectSuggestion.
1526      * @param isEnable switch to control Effect Suggestion.
1527      * @return errCode
1528      */
1529     int32_t EnableEffectSuggestion(bool isEnable);
1530 
1531     /**
1532      * @brief Get supported EffectSuggestionInfo.
1533      * @return EffectSuggestionInfo parsed from tag
1534      */
1535     EffectSuggestionInfo GetSupportedEffectSuggestionInfo();
1536 
1537     /**
1538      * @brief Get supported effectSuggestionType.
1539      * @return EffectSuggestionTypeList which current mode supported.
1540      */
1541     std::vector<EffectSuggestionType> GetSupportedEffectSuggestionType();
1542 
1543     /**
1544      * @brief Batch set effect suggestion status.
1545      * @param effectSuggestionStatusList effect suggestion status list to be set.
1546      * @return errCode
1547      */
1548     int32_t SetEffectSuggestionStatus(std::vector<EffectSuggestionStatus> effectSuggestionStatusList);
1549 
1550     /**
1551      * @brief Set ar mode.
1552      * @param effectSuggestionType switch to control effect suggestion.
1553      * @param isEnable switch to control effect suggestion status.
1554      * @return errCode
1555      */
1556     int32_t UpdateEffectSuggestion(EffectSuggestionType effectSuggestionType, bool isEnable);
1557 
1558     /**
1559      * @brief This function is called when there is effect suggestion type change
1560      * and process the effect suggestion callback.
1561      *
1562      * @param result metadata got from callback from service layer.
1563      */
1564     void ProcessEffectSuggestionTypeUpdates(const std::shared_ptr<OHOS::Camera::CameraMetadata> &result);
1565 
1566     /**
1567      * @brief Get the supported portrait effects.
1568      *
1569      * @return Returns the array of portraiteffect.
1570      */
1571     std::vector<PortraitEffect> GetSupportedPortraitEffects();
1572 
1573     /**
1574      * @brief Get the supported virtual apertures.
1575      * @param apertures returns the array of virtual aperture.
1576      * @return Error code.
1577      */
1578     int32_t GetSupportedVirtualApertures(std::vector<float>& apertures);
1579 
1580     /**
1581      * @brief Get the virtual aperture.
1582      * @param aperture returns the current virtual aperture.
1583      * @return Error code.
1584      */
1585     int32_t GetVirtualAperture(float& aperture);
1586 
1587     /**
1588      * @brief Set the virtual aperture.
1589      * @param virtualAperture set virtual aperture value.
1590      * @return Error code.
1591      */
1592     int32_t SetVirtualAperture(const float virtualAperture);
1593 
1594     /**
1595      * @brief Get the supported physical apertures.
1596      * @param apertures returns the array of physical aperture.
1597      * @return Error code.
1598      */
1599     int32_t GetSupportedPhysicalApertures(std::vector<std::vector<float>>& apertures);
1600 
1601     /**
1602      * @brief Get the physical aperture.
1603      * @param aperture returns current physical aperture.
1604      * @return Error code.
1605      */
1606     int32_t GetPhysicalAperture(float& aperture);
1607 
1608     /**
1609      * @brief Set the physical aperture.
1610      * @param physicalAperture set physical aperture value.
1611      * @return Error code.
1612      */
1613     int32_t SetPhysicalAperture(float physicalAperture);
1614 
1615     /**
1616      * @brief Set quality prioritization.
1617      *
1618      * @param QualityPrioritization quality prioritization to be set.
1619      * @return Return errCode.
1620      */
1621     int32_t SetQualityPrioritization(QualityPrioritization qualityPrioritization);
1622 
1623     void SetMode(SceneMode modeName);
1624     SceneMode GetMode();
1625     SceneFeaturesMode GetFeaturesMode();
1626     std::vector<SceneFeaturesMode> GetSubFeatureMods();
1627     bool IsSetEnableMacro();
1628     sptr<CaptureOutput> GetMetaOutput();
1629     void ProcessSnapshotDurationUpdates(const uint64_t timestamp,
1630                                     const std::shared_ptr<OHOS::Camera::CameraMetadata> &result);
1631 
1632     virtual std::shared_ptr<OHOS::Camera::CameraMetadata> GetMetadata();
1633 
1634     void ExecuteAbilityChangeCallback();
1635     void SetAbilityCallback(std::shared_ptr<AbilityCallback> abilityCallback);
1636     void ProcessAREngineUpdates(const uint64_t timestamp,
1637                                     const std::shared_ptr<OHOS::Camera::CameraMetadata> &result);
1638 
1639     void EnableDeferredType(DeferredDeliveryImageType deferredType, bool isEnableByUser);
1640     void EnableAutoDeferredVideoEnhancement(bool isEnableByUser);
1641     void SetUserId();
1642     bool IsMovingPhotoEnabled();
1643     bool IsImageDeferred();
1644     bool IsVideoDeferred();
1645     virtual bool CanSetFrameRateRange(int32_t minFps, int32_t maxFps, CaptureOutput* curOutput);
1646     bool CanSetFrameRateRangeForOutput(int32_t minFps, int32_t maxFps, CaptureOutput* curOutput);
1647 
1648     int32_t EnableAutoHighQualityPhoto(bool enabled);
1649     int32_t EnableAutoCloudImageEnhancement(bool enabled);
1650     int32_t AddSecureOutput(sptr<CaptureOutput> &output);
1651 
1652     // White Balance
1653     /**
1654     * @brief Get Metering mode.
1655      * @param vector of Metering Mode.
1656      * @return errCode.
1657      */
1658     int32_t GetSupportedWhiteBalanceModes(std::vector<WhiteBalanceMode>& modes);
1659 
1660     /**
1661      * @brief Query whether given white-balance mode supported.
1662      *
1663      * @param camera_focus_mode_enum_t white-balance mode to query.
1664      * @param bool True if supported false otherwise.
1665      * @return errCode.
1666      */
1667     int32_t IsWhiteBalanceModeSupported(WhiteBalanceMode mode, bool &isSupported);
1668 
1669     /**
1670      * @brief Set WhiteBalanceMode.
1671      * @param mode WhiteBalanceMode to be set.
1672      * @return errCode.
1673      */
1674     int32_t SetWhiteBalanceMode(WhiteBalanceMode mode);
1675 
1676     /**
1677      * @brief Get WhiteBalanceMode.
1678      * @param mode current WhiteBalanceMode .
1679      * @return Returns errCode.
1680      */
1681     int32_t GetWhiteBalanceMode(WhiteBalanceMode& mode);
1682 
1683     /**
1684      * @brief Get ManualWhiteBalance Range.
1685      * @param whiteBalanceRange supported Manual WhiteBalance range .
1686      * @return Returns errCode.
1687      */
1688     int32_t GetManualWhiteBalanceRange(std::vector<int32_t> &whiteBalanceRange);
1689 
1690     /**
1691      * @brief Is Manual WhiteBalance Supported.
1692      * @param isSupported is Support Manual White Balance .
1693      * @return Returns errCode.
1694      */
1695     int32_t IsManualWhiteBalanceSupported(bool &isSupported);
1696 
1697     /**
1698      * @brief Set Manual WhiteBalance.
1699      * @param wbValue WhiteBalance value to be set.
1700      * @return Returns errCode.
1701      */
1702     int32_t SetManualWhiteBalance(int32_t wbValue);
1703 
1704     /**
1705      * @brief Get ManualWhiteBalance.
1706      * @param wbValue WhiteBalance value to be get.
1707      * @return Returns errCode.
1708      */
1709     int32_t GetManualWhiteBalance(int32_t &wbValue);
1710 
GetMetadataResultProcessor()1711     inline std::shared_ptr<MetadataResultProcessor> GetMetadataResultProcessor()
1712     {
1713         return metadataResultProcessor_;
1714     }
1715 
GetInputDevice()1716     inline sptr<CaptureInput> GetInputDevice()
1717     {
1718         std::lock_guard<std::mutex> lock(inputDeviceMutex_);
1719         return innerInputDevice_;
1720     }
1721 
1722     int32_t SetPreviewRotation(std::string &deviceClass);
1723 
GetCaptureSession()1724     inline sptr<ICaptureSession> GetCaptureSession()
1725     {
1726         std::lock_guard<std::mutex> lock(captureSessionMutex_);
1727         return innerCaptureSession_;
1728     }
1729 
1730     /**
1731      * @brief Checks if the LCD flash feature is supported.
1732      *
1733      * This function determines whether the current system or device supports the LCD flash feature.
1734      * It returns `true` if the feature is supported; otherwise, it returns `false`.
1735      *
1736      * @return `true` if the LCD flash feature is supported; `false` otherwise.
1737      */
1738     bool IsLcdFlashSupported();
1739 
1740     /**
1741      * @brief Enables or disables the LCD flash feature.
1742      *
1743      * This function enables or disables the LCD flash feature based on the provided `isEnable` flag.
1744      *
1745      * @param isEnable A boolean flag indicating whether to enable (`true`) or disable (`false`) the LCD flash feature.
1746      *
1747      * @return Returns an `int32_t` value indicating the result of the operation.
1748      *         Typically, a return value of 0 indicates success, while a non-zero value indicates an error.
1749      */
1750     int32_t EnableLcdFlash(bool isEnable);
1751 
1752     /**
1753      * @brief Enables or disables LCD flash detection.
1754      *
1755      * This function enables or disables the detection of the LCD flash feature based on the provided `isEnable` flag.
1756      *
1757      * @param isEnable A boolean flag indicating whether to enable (`true`) or disable (`false`) LCD flash detection.
1758      *
1759      * @return Returns an `int32_t` value indicating the outcome of the operation.
1760      *         A return value of 0 typically signifies success, while a non-zero value indicates an error.
1761      */
1762     int32_t EnableLcdFlashDetection(bool isEnable);
1763 
1764     void ProcessLcdFlashStatusUpdates(const std::shared_ptr<OHOS::Camera::CameraMetadata> &result);
1765 
1766     /**
1767      * @brief Sets the callback for LCD flash status updates.
1768      *
1769      * This function assigns a callback to be invoked whenever there is a change in the LCD flash status.
1770      * The callback is passed as a shared pointer, allowing for shared ownership and automatic memory management.
1771      *
1772      * @param lcdFlashStatusCallback A shared pointer to an LcdFlashStatusCallback object. This callback will
1773      *        be called to handle updates related to the LCD flash status. If the callback is already set,
1774      *        it will be overwritten with the new one.
1775      */
1776     void SetLcdFlashStatusCallback(std::shared_ptr<LcdFlashStatusCallback> lcdFlashStatusCallback);
1777 
1778     /**
1779      * @brief Retrieves the current LCD flash status callback.
1780      *
1781      * This function returns a shared pointer to the `LcdFlashStatusCallback` object that is used for receiving
1782      * notifications or callbacks related to the LCD flash status.
1783      *
1784      * @return A `std::shared_ptr<LcdFlashStatusCallback>` pointing to the current LCD flash status callback.
1785      *         If no callback is set, it may return a `nullptr`.
1786      */
1787     std::shared_ptr<LcdFlashStatusCallback> GetLcdFlashStatusCallback();
1788     void EnableFaceDetection(bool enable);
1789     /**
1790      * @brief Checks if tripod detection is supported.
1791      *
1792      * This function determines whether the current system or device supports tripod detection functionality.
1793      * It returns `true` if the feature is supported, otherwise `false`.
1794      *
1795      * @return `true` if tripod detection is supported; `false` otherwise.
1796      */
1797     bool IsTripodDetectionSupported();
1798 
1799     /**
1800      * @brief Enables or disables tripod stabilization.
1801      *
1802      * This function enables or disables the tripod stabilization feature based on the provided `enabled` flag.
1803      *
1804      * @param enabled A boolean flag that indicates whether to enable or disable tripod stabilization.
1805      *
1806      * @return Returns an `int32_t` value indicating the success or failure of the operation.
1807      *         Typically, a return value of 0 indicates success, while a non-zero value indicates an error.
1808      */
1809     int32_t EnableTripodStabilization(bool enabled);
1810 
1811     /**
1812      * @brief Enables or disables tripod detection.
1813      *
1814      * This function enables or disables the tripod detection feature based on the provided `enabled` flag.
1815      *
1816      * @param enabled A boolean flag that specifies whether to enable or disable tripod detection.
1817      *
1818      * @return Returns an `int32_t` value indicating the outcome of the operation.
1819      *         A return value of 0 typically indicates success, while a non-zero value indicates an error.
1820      */
1821     int32_t EnableTripodDetection(bool enabled);
1822 
1823     void ProcessTripodStatusChange(const std::shared_ptr<OHOS::Camera::CameraMetadata>& result);
1824 
1825     int32_t EnableRawDelivery(bool enabled);
1826 
1827     /**
1828      * @brief Checks if the automatic switchover device is supported.
1829      *
1830      * @return true if supported; false otherwise.
1831      */
1832     bool IsAutoDeviceSwitchSupported();
1833 
1834     /**
1835      * @brief Enables or disables the automatic switchover device.
1836      *
1837      * @param isEnable True to enable, false to disable.
1838      * @return 0 on success, or a negative error code on failure.
1839      */
1840     int32_t EnableAutoDeviceSwitch(bool isEnable);
1841 
1842     /**
1843      * @brief Switches the current device to a different one.
1844      *
1845      * @return true if the switch was successful; false if it failed or is not supported.
1846      */
1847     bool SwitchDevice();
1848 
1849     /**
1850      * @brief Enables or disables the automatic switchover device.
1851      *
1852      * @param isEnable True to enable, false to disable.
1853      */
1854     void SetIsAutoSwitchDeviceStatus(bool isEnable);
1855 
1856     /**
1857      * @brief Checks if the automatic switchover device is enabled.
1858      *
1859      * @return True if enabled, false otherwise.
1860      */
1861     bool GetIsAutoSwitchDeviceStatus();
1862 
1863     /**
1864      * @brief Sets the callback for automatic device switching.
1865      *
1866      * @param autoDeviceSwitchCallback A shared pointer to the callback.
1867      */
1868     void SetAutoDeviceSwitchCallback(shared_ptr<AutoDeviceSwitchCallback> autoDeviceSwitchCallback);
1869 
1870     /**
1871      * @brief Gets the current automatic device switch callback.
1872      *
1873      * @return A shared pointer to the callback, or nullptr if not set.
1874      */
1875     shared_ptr<AutoDeviceSwitchCallback> GetAutoDeviceSwitchCallback();
1876 
SetDeviceCapabilityChangeStatus(bool isDeviceCapabilityChanged)1877     inline void SetDeviceCapabilityChangeStatus(bool isDeviceCapabilityChanged)
1878     {
1879         isDeviceCapabilityChanged_ = isDeviceCapabilityChanged;
1880     }
1881 
GetDeviceCapabilityChangeStatus()1882     inline bool GetDeviceCapabilityChangeStatus()
1883     {
1884         return isDeviceCapabilityChanged_;
1885     }
1886 
1887     /**
1888      * @brief Adds a function to the mapping with the specified control tag.
1889      *
1890      * This function is used to register a callback that will be executed
1891      * when the automatic switchover device is enabled. The control target
1892      * must be set prior to switching the device. After the device is switched,
1893      * the target needs to be reset to HAL.
1894      *
1895      * @note This functionality is applicable only for SceneMode::CAPTURE
1896      *       and SceneMode::VIDEO modes.
1897      *
1898      * @param ctrlTag The control tag associated with the function.
1899      * @param func The function to be added to the map, which will be called
1900      *             when the corresponding control tag is triggered.
1901      */
1902     void AddFunctionToMap(std::string ctrlTag, std::function<void()> func);
1903     void ExecuteAllFunctionsInMap();
1904 
1905     /**
1906      * @brief Set usage for the capture session.
1907      * @param usage - The capture session usage.
1908      * @param enabled - Enable usage for session if TRUE.
1909      */
1910     void SetUsage(UsageType usageType, bool enabled);
1911 
1912 protected:
1913 
1914     static const std::unordered_map<camera_awb_mode_t, WhiteBalanceMode> metaWhiteBalanceModeMap_;
1915     static const std::unordered_map<WhiteBalanceMode, camera_awb_mode_t> fwkWhiteBalanceModeMap_;
1916 
1917     static const std::unordered_map<LightPaintingType, CameraLightPaintingType> fwkLightPaintingTypeMap_;
1918     static const std::unordered_map<CameraLightPaintingType, LightPaintingType> metaLightPaintingTypeMap_;
1919     static const std::unordered_map<TripodStatus, FwkTripodStatus> metaTripodStatusMap_;
1920     std::shared_ptr<OHOS::Camera::CameraMetadata> changedMetadata_;
1921     Profile photoProfile_;
1922     Profile previewProfile_;
1923     std::map<BeautyType, std::vector<int32_t>> beautyTypeAndRanges_;
1924     std::map<BeautyType, int32_t> beautyTypeAndLevels_;
1925     std::shared_ptr<MetadataResultProcessor> metadataResultProcessor_ = nullptr;
1926     bool isImageDeferred_ = false;
1927     std::atomic<bool> isRawImageDelivery_ { false };
1928     bool isVideoDeferred_ = false;
1929     std::atomic<bool> isMovingPhotoEnabled_ { false };
1930 
1931     std::shared_ptr<AbilityCallback> abilityCallback_;
1932     std::atomic<uint32_t> exposureDurationValue_ = 0;
1933 
1934     float apertureValue_ = 0.0;
1935 
ClearPreconfigProfiles()1936     inline void ClearPreconfigProfiles()
1937     {
1938         std::lock_guard<std::mutex> lock(preconfigProfilesMutex_);
1939         preconfigProfiles_ = nullptr;
1940     }
1941 
SetPreconfigProfiles(std::shared_ptr<PreconfigProfiles> preconfigProfiles)1942     inline void SetPreconfigProfiles(std::shared_ptr<PreconfigProfiles> preconfigProfiles)
1943     {
1944         std::lock_guard<std::mutex> lock(preconfigProfilesMutex_);
1945         preconfigProfiles_ = preconfigProfiles;
1946     }
1947 
GetPreconfigProfiles()1948     inline std::shared_ptr<PreconfigProfiles> GetPreconfigProfiles()
1949     {
1950         std::lock_guard<std::mutex> lock(preconfigProfilesMutex_);
1951         return preconfigProfiles_;
1952     }
1953 
SetInputDevice(sptr<CaptureInput> inputDevice)1954     inline void SetInputDevice(sptr<CaptureInput> inputDevice)
1955     {
1956         std::lock_guard<std::mutex> lock(inputDeviceMutex_);
1957         innerInputDevice_ = inputDevice;
1958     }
1959 
GetCameraAbilityContainer()1960     inline sptr<CameraAbilityContainer> GetCameraAbilityContainer()
1961     {
1962         std::lock_guard<std::mutex> lock(abilityContainerMutex_);
1963         return cameraAbilityContainer_;
1964     }
1965 
SetCaptureSession(sptr<ICaptureSession> captureSession)1966     inline void SetCaptureSession(sptr<ICaptureSession> captureSession)
1967     {
1968         std::lock_guard<std::mutex> lock(captureSessionMutex_);
1969         innerCaptureSession_ = captureSession;
1970     }
1971 
1972     virtual std::shared_ptr<PreconfigProfiles> GeneratePreconfigProfiles(
1973         PreconfigType preconfigType, ProfileSizeRatio preconfigRatio);
1974 
1975 private:
1976     std::mutex switchDeviceMutex_;
1977     std::mutex functionMapMutex_;
1978     std::mutex changeMetaMutex_;
1979     std::mutex sessionCallbackMutex_;
1980     std::mutex captureSessionMutex_;
1981     sptr<ICaptureSession> innerCaptureSession_ = nullptr;
1982     std::shared_ptr<SessionCallback> appCallback_;
1983     sptr<ICaptureSessionCallback> captureSessionCallback_;
1984     std::shared_ptr<ExposureCallback> exposureCallback_;
1985     std::shared_ptr<FocusCallback> focusCallback_;
1986     std::shared_ptr<MacroStatusCallback> macroStatusCallback_;
1987     std::shared_ptr<MoonCaptureBoostStatusCallback> moonCaptureBoostStatusCallback_;
1988     std::shared_ptr<FeatureDetectionStatusCallback> featureDetectionStatusCallback_;
1989     std::shared_ptr<SmoothZoomCallback> smoothZoomCallback_;
1990     std::shared_ptr<ARCallback> arCallback_;
1991     std::shared_ptr<EffectSuggestionCallback> effectSuggestionCallback_;
1992     std::shared_ptr<LcdFlashStatusCallback> lcdFlashStatusCallback_;
1993     std::shared_ptr<AutoDeviceSwitchCallback> autoDeviceSwitchCallback_;
1994     sptr<IFoldServiceCallback> foldStatusCallback_ = nullptr;
1995     std::vector<int32_t> skinSmoothBeautyRange_;
1996     std::vector<int32_t> faceSlendorBeautyRange_;
1997     std::vector<int32_t> skinToneBeautyRange_;
1998     std::mutex captureOutputSetsMutex_;
1999     std::set<wptr<CaptureOutput>, RefBaseCompare<CaptureOutput>> captureOutputSets_;
2000 
2001     std::mutex inputDeviceMutex_;
2002     sptr<CaptureInput> innerInputDevice_ = nullptr;
2003     volatile bool isSetMacroEnable_ = false;
2004     volatile bool isDepthFusionEnable_ = false;
2005     volatile bool isSetMoonCaptureBoostEnable_ = false;
2006     volatile bool isSetTripodDetectionEnable_ = false;
2007     volatile bool isSetSecureOutput_ = false;
2008     std::atomic<bool> isSetLowLightBoostEnable_ = false;
2009     static const std::unordered_map<camera_focus_state_t, FocusCallback::FocusState> metaFocusStateMap_;
2010     static const std::unordered_map<camera_exposure_state_t, ExposureCallback::ExposureState> metaExposureStateMap_;
2011 
2012     static const std::unordered_map<camera_filter_type_t, FilterType> metaFilterTypeMap_;
2013     static const std::unordered_map<FilterType, camera_filter_type_t> fwkFilterTypeMap_;
2014     static const std::unordered_map<BeautyType, camera_device_metadata_tag_t> fwkBeautyControlMap_;
2015     static const std::unordered_map<camera_device_metadata_tag_t, BeautyType> metaBeautyControlMap_;
2016     static const std::unordered_map<CameraEffectSuggestionType, EffectSuggestionType> metaEffectSuggestionTypeMap_;
2017     static const std::unordered_map<EffectSuggestionType, CameraEffectSuggestionType> fwkEffectSuggestionTypeMap_;
2018 
2019     sptr<CaptureOutput> metaOutput_ = nullptr;
2020     sptr<CaptureOutput> photoOutput_;
2021     std::atomic<int32_t> prevDuration_ = 0;
2022     sptr<CameraDeathRecipient> deathRecipient_ = nullptr;
2023     bool isColorSpaceSetted_ = false;
2024     atomic<bool> isDeferTypeSetted_ = false;
2025     atomic<bool> isAutoSwitchDevice_ = false;
2026     atomic<bool> isDeviceCapabilityChanged_ = false;
2027     atomic<bool> canAddFuncToMap_ = true;
2028 
2029     // Only for the SceneMode::CAPTURE and SceneMode::VIDEO mode
2030     map<std::string, std::function<void()>> functionMap;
2031 
2032     std::mutex preconfigProfilesMutex_;
2033     std::shared_ptr<PreconfigProfiles> preconfigProfiles_ = nullptr;
2034 
2035     // private tag
2036     uint32_t HAL_CUSTOM_AR_MODE = 0;
2037     uint32_t HAL_CUSTOM_LASER_DATA = 0;
2038     uint32_t HAL_CUSTOM_SENSOR_MODULE_TYPE = 0;
2039     uint32_t HAL_CUSTOM_LENS_FOCUS_DISTANCE = 0;
2040     uint32_t HAL_CUSTOM_SENSOR_SENSITIVITY = 0;
2041 
2042     std::mutex abilityContainerMutex_;
2043     sptr<CameraAbilityContainer> cameraAbilityContainer_ = nullptr;
2044     atomic<bool> supportSpecSearch_ = false;
2045     void CheckSpecSearch();
2046     void PopulateProfileLists(std::vector<Profile>& photoProfileList,
2047                               std::vector<Profile>& previewProfileList,
2048                               std::vector<VideoProfile>& videoProfileList);
2049     void PopulateSpecIdMaps(sptr<CameraDevice> device, int32_t modeName,
2050                             std::map<int32_t, std::vector<Profile>>& specIdPreviewMap,
2051                             std::map<int32_t, std::vector<Profile>>& specIdPhotoMap,
2052                             std::map<int32_t, std::vector<VideoProfile>>& specIdVideoMap);
2053     // Make sure you know what you are doing, you'd better to use {GetMode()} function instead of this variable.
2054     SceneMode currentMode_ = SceneMode::NORMAL;
2055     SceneMode guessMode_ = SceneMode::NORMAL;
2056     std::mutex moonCaptureBoostFeatureMutex_;
2057     std::shared_ptr<MoonCaptureBoostFeature> moonCaptureBoostFeature_ = nullptr;
2058     float focusDistance_ = 0.0;
2059     std::shared_ptr<MoonCaptureBoostFeature> GetMoonCaptureBoostFeature();
2060     void SetGuessMode(SceneMode mode);
2061     int32_t UpdateSetting(std::shared_ptr<OHOS::Camera::CameraMetadata> changedMetadata);
2062     Point CoordinateTransform(Point point);
2063     int32_t CalculateExposureValue(float exposureValue);
2064     Point VerifyFocusCorrectness(Point point);
2065     int32_t ConfigureOutput(sptr<CaptureOutput>& output);
2066     int32_t ConfigurePreviewOutput(sptr<CaptureOutput>& output);
2067     int32_t ConfigurePhotoOutput(sptr<CaptureOutput>& output);
2068     int32_t ConfigureVideoOutput(sptr<CaptureOutput>& output);
2069     std::shared_ptr<Profile> GetMaxSizePhotoProfile(ProfileSizeRatio sizeRatio);
2070     std::shared_ptr<Profile> GetPreconfigPreviewProfile();
2071     std::shared_ptr<Profile> GetPreconfigPhotoProfile();
2072     std::shared_ptr<VideoProfile> GetPreconfigVideoProfile();
2073     void CameraServerDied(pid_t pid);
2074     void InsertOutputIntoSet(sptr<CaptureOutput>& output);
2075     void RemoveOutputFromSet(sptr<CaptureOutput>& output);
2076     void OnSettingUpdated(std::shared_ptr<OHOS::Camera::CameraMetadata> changedMetadata);
2077     void OnResultReceived(std::shared_ptr<OHOS::Camera::CameraMetadata> changedMetadata);
2078     ColorSpaceInfo GetSupportedColorSpaceInfo();
2079     bool IsModeWithVideoStream();
2080     void SetDefaultColorSpace();
2081     void UpdateDeviceDeferredability();
2082     void ProcessProfilesAbilityId(const SceneMode supportModes);
2083     int32_t ProcessCaptureColorSpace(ColorSpaceInfo colorSpaceInfo, ColorSpace& fwkCaptureColorSpace);
2084     void ProcessFocusDistanceUpdates(const std::shared_ptr<OHOS::Camera::CameraMetadata>& result);
2085     void FindTagId();
2086     bool CheckFrameRateRangeWithCurrentFps(int32_t curMinFps, int32_t curMaxFps, int32_t minFps, int32_t maxFps);
2087     void SessionRemoveDeathRecipient();
2088     int32_t AdaptOutputVideoHighFrameRate(sptr<CaptureOutput>& output, sptr<ICaptureSession>& captureSession);
2089     CameraPosition GetUsedAsPosition();
2090     sptr<CameraDevice> FindFrontCamera();
2091     void StartVideoOutput();
2092     bool StopVideoOutput();
2093     void CreateAndSetFoldServiceCallback();
2094     int32_t IsColorReservationTypeSupported(ColorReservationType colorReservationType, bool& isSupported);
2095 };
2096 } // namespace CameraStandard
2097 } // namespace OHOS
2098 #endif // OHOS_CAMERA_CAPTURE_SESSION_H
2099