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 #include "call_policy.h"
23 #include "call_state_listener_base.h"
24 #include "ims_call.h"
25 #include "surface.h"
26 
27 namespace OHOS {
28 namespace Telephony {
29 class VideoControlManager : public std::enable_shared_from_this<VideoControlManager> {
30     DECLARE_DELAYED_SINGLETON(VideoControlManager)
31 
32 public:
33     int32_t ControlCamera(int32_t callId, std::u16string &cameraId, int32_t callingUid, int32_t callingPid);
34     int32_t SetPreviewWindow(int32_t callId, std::string &surfaceId, sptr<Surface> surface);
35     int32_t SetDisplayWindow(int32_t callId, std::string &surfaceId, sptr<Surface> surface);
36     int32_t SetCameraZoom(float zoomRatio);
37     int32_t SetPausePicture(int32_t callId, std::u16string &path);
38     int32_t SetDeviceDirection(int32_t callId, int32_t rotation);
39     int32_t ReportImsCallModeInfo(CallMediaModeInfo &imsCallModeInfo);
40     int32_t UpdateImsCallMode(int32_t callId, ImsCallMode mode);
41     int32_t CancelCallUpgrade(int32_t callId);
42     int32_t RequestCameraCapabilities(int32_t callId);
43 
44 private:
45     int32_t OpenCamera(int32_t callId, std::u16string &cameraId, int32_t callingUid, int32_t callingPid);
46     int32_t CloseCamera(int32_t callId, std::u16string &cameraId, int32_t callingUid, int32_t callingPid);
47     bool CheckWindow(VideoWindow &window);
48     bool ContainCameraID(std::string id);
49     bool IsPngFile(std::string fileName);
50 
51 private:
52     bool isOpenCamera_;
53 };
54 } // namespace Telephony
55 } // namespace OHOS
56 #endif // TELEPHONY_VIDEO_MANAGER_H
57