1 /* 2 * Copyright (C) 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 #ifndef TELEPHONY_VIDEO_MANAGER_H 17 #define TELEPHONY_VIDEO_MANAGER_H 18 19 #include "singleton.h" 20 21 #include "call_manager_inner_type.h" 22 23 #include "call_state_listener_base.h" 24 25 namespace OHOS { 26 namespace Telephony { 27 class VideoControlManager : public std::enable_shared_from_this<VideoControlManager> { 28 DECLARE_DELAYED_SINGLETON(VideoControlManager) 29 public: 30 int32_t ControlCamera(std::u16string cameraId, int32_t callingUid, int32_t callingPid); 31 int32_t SetPreviewWindow(VideoWindow &window); 32 int32_t SetDisplayWindow(VideoWindow &window); 33 int32_t SetCameraZoom(float zoomRatio); 34 int32_t SetPausePicture(std::u16string path); 35 int32_t SetDeviceDirection(int32_t rotation); 36 37 private: 38 int32_t OpenCamera(std::u16string cameraId, int32_t callingUid, int32_t callingPid); 39 int32_t CloseCamera(std::u16string cameraId, int32_t callingUid, int32_t callingPid); 40 bool CheckWindow(VideoWindow &window); 41 bool ContainCameraID(std::string id); 42 bool IsPngFile(std::string fileName); 43 bool isOpenCamera_; 44 }; 45 } // namespace Telephony 46 } // namespace OHOS 47 #endif // TELEPHONY_VIDEO_MANAGER_H 48