1 /* 2 * Copyright (c) 2020-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 /** 17 * @addtogroup MultiMedia_CameraConfig 18 * @{ 19 * 20 * @brief Defines the <b>CameraConfig</b> class for operations on camera configurations. 21 * 22 * @since 1.0 23 * @version 1.0 24 */ 25 26 /** 27 * @file camera_config.h 28 * 29 * @brief Declares functions in the <b>CameraConfig</b> class. 30 * 31 * 32 * @since 1.0 33 * @version 1.0 34 */ 35 36 #ifndef OHOS_CAMERA_CONFIG_H 37 #define OHOS_CAMERA_CONFIG_H 38 39 #include "event_handler.h" 40 #include "frame_state_callback.h" 41 42 namespace OHOS { 43 namespace Media { 44 /** 45 * 46 * @brief Provides functions to configure camera parameters. 47 * 48 * 49 * @since 1.0 50 * @version 1.0 51 */ 52 class CameraConfig { 53 public: 54 /** 55 * @brief A destructor used to delete the <b>CameraAbility</b> instance. 56 * 57 */ ~CameraConfig()58 virtual ~CameraConfig() {} 59 60 /** 61 * @brief Creates the <b>CameraConfig</b> instance of this singleton class to configure 62 * and read the required parameters. 63 * 64 * @return Returns the <b>CameraConfig</b> instance if created; returns <b>NULL</b> otherwise. 65 */ 66 static CameraConfig *CreateCameraConfig(); 67 68 /** 69 * @brief Sets a frame state callback to responds to state changes. 70 * 71 * @param callback Indicates the frame state callback. 72 * @param handler Indicates the event handler. 73 */ SetFrameStateCallback(FrameStateCallback * callback,EventHandler * handler)74 virtual void SetFrameStateCallback(FrameStateCallback *callback, EventHandler *handler) {} 75 76 /** 77 * @brief Obtains the <b>EventHandler</b> object. 78 * 79 * @return Returns the pointer to the <b>EventHandler</b> object if obtained; returns <b>NULL</b> otherwise. 80 */ GetEventHandler()81 virtual EventHandler *GetEventHandler() const 82 { 83 return nullptr; 84 } 85 86 /** 87 * @brief Obtains a <b>FrameStateCallback</b> object. 88 * 89 * @return Returns the pointer to the <b>FrameStateCallback</b> object if obtained; returns <b>NULL</b> otherwise. 90 */ GetFrameStateCb()91 virtual FrameStateCallback *GetFrameStateCb() const 92 { 93 return nullptr; 94 } 95 96 protected: 97 /** 98 * @brief A constructor used to create a <b>CameraConfig</b> instance. 99 * 100 */ CameraConfig()101 CameraConfig() {} 102 }; 103 } // namespace Media 104 } // namespace OHOS 105 #endif // OHOS_CAMERA_CONFIG_H 106