• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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  * Description: rtsp parameter class
15  * Author: dingkang
16  * Create: 2022-01-24
17  */
18 #ifndef LIBCASTENGINE_RTSP_PARAM_INFO_H
19 #define LIBCASTENGINE_RTSP_PARAM_INFO_H
20 
21 #include <set>
22 #include <string>
23 
24 #include "cast_engine_common.h"
25 
26 namespace OHOS {
27 namespace CastEngine {
28 namespace CastEngineService {
29 namespace CastSessionRtsp {
30 struct DeviceTypeParamInfo {
31     DeviceType localDeviceType;
32     SubDeviceType localDeviceSubtype;
33     DeviceType remoteDeviceType;
34     SubDeviceType remoteDeviceSubtype;
35 };
36 
37 struct RemoteControlParamInfo {
38     bool isSupportUibc{ false };
39     bool isSupportGeneric{ false };
40     bool isSupportHidc{ false };
41     bool isSupportVendor{ false };
42     std::vector<std::string> genericList;
43     std::vector<std::string> hidcList;
44     std::vector<std::string> vendorList;
45 };
46 
47 struct EncryptionParamInfo {
48     uint32_t dataChannelAlgId;
49     uint32_t controlChannelAlgId;
50 };
51 
52 // castSession transmit info
53 struct TransferParamInfo {
54     std::string appId;
55     std::string projectionMode;
56     uint32_t asymmetricSupport;
57     uint32_t maxResolutionSize;
58 };
59 
60 enum class VtpType {
61     VTP_NOT_SUPPORT_VIDEO,
62     VTP_SUPPORT_VIDEO,
63     VTP_SUPPORT_VIDEO_AUDIO
64 };
65 
66 enum class ProjectionMode {
67     MIRROR,
68     STREAM
69 };
70 
71 class ParamInfo {
72 public:
ParamInfo()73     ParamInfo() {};
74     ParamInfo(const ParamInfo &) = default;
75     ParamInfo &operator=(const ParamInfo &) = default;
~ParamInfo()76     ~ParamInfo() {};
77 
78     double GetVersion() const;
79     void SetVersion(double version);
80     const EncryptionParamInfo &GetEncryptionParamInfo();
81     void SetEncryptionParamInfo(EncryptionParamInfo &encryptionParam);
82     const DeviceTypeParamInfo &GetDeviceTypeParamInfo();
83     void SetDeviceTypeParamInfo(DeviceTypeParamInfo &deviceTypeParam);
84     const RemoteControlParamInfo &GetRemoteControlParamInfo();
85     void SetRemoteControlParamInfo(RemoteControlParamInfo &remoteControlParam);
86     const AudioProperty &GetAudioProperty() const;
87     void SetAudioProperty(AudioProperty &audioProperty);
88     const VideoProperty &GetVideoProperty() const;
89     void SetVideoProperty(VideoProperty &videoProperty);
90     const WindowProperty &GetWindowProperty();
91     void SetWindowProperty(WindowProperty &windowProperty);
92     const TransferParamInfo &GetTransferParamInfo();
93     void SetTransferParamInfo(TransferParamInfo &transferParam);
94     VtpType GetSupportVtpOpt() const;
95     void SetSupportVtpOpt(VtpType supportVtpOpt);
96     const std::set<int> &GetFeatureSet();
97     void SetFeatureSet(std::set<int> featureSet);
98     const std::string &GetPlayerControllerCapability();
99     void SetPlayerControllerCapability(const std::string &capability);
100     const std::string GetMediaCapability();
101     void SetMediaCapability(const std::string &capability);
102     ProjectionMode GetProjectionMode();
103     void SetProjectionMode(ProjectionMode projectionMode);
104 
105     // channel feature
106     static const int FEATURE_BASE = 0;
107     static const int FEATURE_TRIGGER_REQUEST_IDR_FRAME = FEATURE_BASE + 1;
108     static const int FEATURE_STOP_VTP = FEATURE_BASE + 101;
109     static const int FEATURE_KEEP_ALIVE = FEATURE_BASE + 102;
110     static const int FEATURE_SEND_EVENT_CHANGE = FEATURE_BASE + 103;
111 
112     // remote control feature
113     static const int FEATURE_FINE_STYLUS = FEATURE_BASE + 201;
114     static const int FEATURE_SOURCE_MOUSE = FEATURE_BASE + 202;
115     static const int FEATURE_SOURCE_MOUSE_HISTORY = FEATURE_BASE + 203;
116 
117 private:
118     double version_ = 1.0;
119     VtpType supportVtpOpt_{ VtpType::VTP_NOT_SUPPORT_VIDEO };
120     std::string playerControllerCapability_;
121     std::string mediaCapability_;
122     std::set<int> featureSet_;
123     AudioProperty audioProperty_{};
124     VideoProperty videoProperty_;
125     WindowProperty windowProperty_{};
126     DeviceTypeParamInfo deviceType_{};
127     EncryptionParamInfo encryptionParamInfo_{};
128     TransferParamInfo transferParamInfo_{};
129     RemoteControlParamInfo remoteControlParamInfo_{};
130     ProjectionMode projectionMode_{ ProjectionMode::MIRROR };
131 };
132 } // namespace CastSessionRtsp
133 } // namespace CastEngineService
134 } // namespace CastEngine
135 } // namespace OHOS
136 #endif // LIBCASTENGINE_RTSP_PARAM_INFO_H
137