1 /* 2 * Copyright (c) 2020 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 #ifndef CAMERA_SERVER_H 16 #define CAMERA_SERVER_H 17 18 #include "camera_service.h" 19 #include "liteipc_adapter.h" 20 #include "serializer.h" 21 #include "camera_ability.h" 22 23 namespace OHOS { 24 namespace Media { 25 class CameraServer { 26 public: 27 static CameraServer *GetInstance(); ~CameraServer()28 ~CameraServer() {} 29 30 static void CameraServerRequestHandle(int funcId, void *origin, IpcIo *req, IpcIo *reply); 31 void InitCameraServer(); 32 void GetCameraAbility(IpcIo *req, IpcIo *reply); 33 void GetCameraInfo(IpcIo *req, IpcIo *reply); 34 void GetCameraIdList(IpcIo *req, IpcIo *reply); 35 void CreateCamera(IpcIo *req, IpcIo *reply); 36 void CloseCamera(IpcIo *req, IpcIo *reply); 37 void SetCameraConfig(IpcIo *req, IpcIo *reply); 38 void SetFrameConfig(IpcIo *req, IpcIo *reply); 39 void TriggerLoopingCapture(IpcIo *req, IpcIo *reply); 40 void StopLoopingCapture(IpcIo *req, IpcIo *reply); 41 void TriggerSingleCapture(IpcIo *req, IpcIo *reply); 42 void SetCameraCallback(IpcIo *req, IpcIo *reply); 43 void OnTriggerSingleCaptureFinished(int32_t ret); 44 void OnTriggerLoopingCaptureFinished(int32_t ret, int32_t streamId); 45 void OnCameraStatusChange(int32_t ret, SvcIdentity *sid); 46 void OnCameraConfigured(int32_t ret); 47 void GetCameraModeNum(IpcIo *req, IpcIo *reply); 48 void SetCameraMode(IpcIo *req, IpcIo *reply); 49 private: CameraServer()50 CameraServer() 51 { 52 sid_.cookie = 0; 53 } 54 SvcIdentity sid_; 55 }; 56 } // namespace Media 57 } // namespace OHOS 58 #endif // CAMERA_SERVER_H 59