• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-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 OHOS_AVSESSION_DESCRIPTOR_H
17 #define OHOS_AVSESSION_DESCRIPTOR_H
18 
19 #include "parcel.h"
20 #include "element_name.h"
21 
22 namespace OHOS::AVSession {
23 struct DeviceInfo {
24     bool WriteToParcel(Parcel& out) const;
25     bool ReadFromParcel(Parcel& in);
26 
27     int32_t castCategory_;
28     std::string deviceId_;
29     std::string deviceName_;
30     std::string networkId_;
31     std::string ipAddress_;
32     std::string manufacturer_;
33     std::string modelName_;
34     int32_t deviceType_;
35     int32_t providerId_;
36     int32_t supportedProtocols_ = 0;
37     int32_t authenticationStatus_ = 0;
38     std::vector<std::string> supportedDrmCapabilities_;
39     bool isLegacy_ = false;
40     int32_t mediumTypes_ = 2;
41 };
42 
43 struct OutputDeviceInfo {
44     bool WriteToParcel(Parcel& out) const;
45     bool ReadFromParcel(Parcel& in);
46 
47     std::vector<DeviceInfo> deviceInfos_;
48 };
49 
50 struct AVHistoryDescriptor {
51     bool WriteToParcel(Parcel& out) const;
52     bool ReadFromParcel(Parcel& in);
53 
54     std::string sessionId_;
55     std::string bundleName_;
56     std::string abilityName_;
57 };
58 
59 struct AVSessionDescriptor {
60     bool WriteToParcel(Parcel& out) const;
61     bool CheckBeforReadFromParcel(Parcel& in);
62     bool CheckBeforReadFromParcel(Parcel& in, DeviceInfo& deviceInfo);
63     bool ReadFromParcel(Parcel& in);
64 
65     std::string sessionId_;
66     int32_t sessionType_ {};
67     std::string sessionTag_;
68     AppExecFwk::ElementName elementName_;
69     pid_t pid_ {};
70     pid_t uid_ {};
71     bool isActive_ {};
72     bool isTopSession_ {};
73     bool isThirdPartyApp_ {};
74     OutputDeviceInfo outputDeviceInfo_;
75 
76     int32_t userId_;
77 };
78 
79 struct AVSessionBasicInfo {
80     std::string deviceName_;
81     std::string networkId_;
82     std::string vendorId_;
83     std::string deviceType_;
84     std::string systemVersion_;
85     int32_t sessionVersion_ {};
86     std::vector<int32_t> reserve_;
87     std::vector<int32_t> feature_;
88     std::vector<int32_t> metaDataCap_;
89     std::vector<int32_t> playBackStateCap_;
90     std::vector<int32_t> controlCommandCap_;
91     std::vector<int32_t> extendCapability_;
92     int32_t systemTime_ {};
93     std::vector<int32_t> extend_;
94 };
95 
96 enum CastDisplayState {
97     STATE_OFF = 1,
98     STATE_ON,
99 };
100 
101 enum DeviceLogEventCode {
102     DEVICE_LOG_FULL = 1,
103     DEVICE_LOG_EXCEPTION = 2,
104 };
105 
106 struct CastDisplayInfo {
107     CastDisplayState displayState;
108     uint64_t displayId;
109     std::string name;
110     int32_t width;
111     int32_t height;
112 };
113 } // namespace OHOS::AVSession
114 #endif // OHOS_AVSESSION_DESCRIPTOR_H