1 /*
2  * Copyright (C) 2023 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 CELLULAR_CALL_CONTROL_IMS_VIDEO_CALL_H
17 #define CELLULAR_CALL_CONTROL_IMS_VIDEO_CALL_H
18 
19 #include "call_manager_errors.h"
20 #include "cellular_call_data_struct.h"
21 #include "ims_call_types.h"
22 #include "module_service_utils.h"
23 #include "singleton.h"
24 #include "surface.h"
25 #include "telephony_log_wrapper.h"
26 
27 namespace OHOS {
28 namespace Telephony {
29 class ImsVideoCallControl : public std::enable_shared_from_this<ImsVideoCallControl> {
30     DECLARE_DELAYED_SINGLETON(ImsVideoCallControl);
31 
32 public:
33     /**
34      * ControlCamera
35      *
36      * @param slotId[in], The slot id
37      * @param callIndex Indicates the call index number.
38      * @param cameraId
39      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
40      */
41     int32_t ControlCamera(int32_t slotId, int32_t callIndex, const std::string &cameraId);
42 
43     /**
44      * SetPreviewWindow
45      *
46      * @param slotId[in], The slot id
47      * @param callIndex Indicates the call index number.
48      * @param surfaceID Surface id of window object
49      * @param surface The surface object of window
50      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
51      */
52     int32_t SetPreviewWindow(int32_t slotId, int32_t callIndex, const std::string &surfaceID, sptr<Surface> surface);
53 
54     /**
55      * SetDisplayWindow
56      *
57      * @param slotId[in], The slot id
58      * @param callIndex Indicates the call index number.
59      * @param surfaceID Surface id of window object
60      * @param surface The surface object of window
61      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
62      */
63     int32_t SetDisplayWindow(int32_t slotId, int32_t callIndex, const std::string &surfaceID, sptr<Surface> surface);
64 
65     /**
66      * SetCameraZoom
67      *
68      * @param zoomRatio
69      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
70      */
71     int32_t SetCameraZoom(float zoomRatio);
72 
73     /**
74      * SetPausePicture
75      *
76      * @param slotId[in], The slot id
77      * @param callIndex Indicates the call index number.
78      * @param path
79      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
80      */
81     int32_t SetPausePicture(int32_t slotId, int32_t callIndex, const std::string &path);
82 
83     /**
84      * SetDeviceDirection
85      *
86      * @param slotId[in], The slot id
87      * @param callIndex Indicates the call index number.
88      * @param rotation
89      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
90      */
91     int32_t SetDeviceDirection(int32_t slotId, int32_t callIndex, int32_t rotation);
92 
93     /**
94      * IMS Send Update Call Media Mode Request
95      *
96      * @param CellularCallInfo
97      * @param ImsCallMode
98      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
99      */
100     int32_t SendUpdateCallMediaModeRequest(const CellularCallInfo &callInfo, ImsCallMode mode);
101 
102     /**
103      * IMS Send Update Call Media Mode Response
104      *
105      * @param CellularCallInfo
106      * @param ImsCallMode
107      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
108      */
109     int32_t SendUpdateCallMediaModeResponse(const CellularCallInfo &callInfo, ImsCallMode mode);
110 
111     /**
112      * Cancel Call Upgrade
113      *
114      * @param slotId the slot id
115      * @param callIndex the call index number.
116      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
117      */
118     int32_t CancelCallUpgrade(int32_t slotId, int32_t callIndex);
119 
120     /**
121      * Request Camera Capabilities
122      *
123      * @param slotId the slot id
124      * @param callIndex the call index number.
125      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
126      */
127     int32_t RequestCameraCapabilities(int32_t slotId, int32_t callIndex);
128 
129 private:
130     ImsCallType ConverToImsCallType(ImsCallMode mode);
131 
132 private:
133     ModuleServiceUtils moduleUtils_;
134 };
135 } // namespace Telephony
136 } // namespace OHOS
137 #endif // CELLULAR_CALL_CONTROL_IMS_H
138