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 int32_t deviceType_; 31 std::string ipAddress_; 32 int32_t providerId_; 33 int32_t supportedProtocols_ = 3; 34 int32_t authenticationStatus_ = 0; 35 }; 36 37 struct OutputDeviceInfo { 38 bool WriteToParcel(Parcel& out) const; 39 bool ReadFromParcel(Parcel& in); 40 41 std::vector<DeviceInfo> deviceInfos_; 42 }; 43 44 struct AVHistoryDescriptor { 45 bool WriteToParcel(Parcel& out) const; 46 bool ReadFromParcel(Parcel& in); 47 48 std::string sessionId_; 49 std::string bundleName_; 50 std::string abilityName_; 51 }; 52 53 struct AVSessionDescriptor { 54 bool WriteToParcel(Parcel& out) const; 55 bool ReadFromParcel(Parcel& in); 56 57 std::string sessionId_; 58 int32_t sessionType_ {}; 59 std::string sessionTag_; 60 AppExecFwk::ElementName elementName_; 61 pid_t pid_ {}; 62 pid_t uid_ {}; 63 bool isActive_ {}; 64 bool isTopSession_ {}; 65 bool isThirdPartyApp_ {}; 66 OutputDeviceInfo outputDeviceInfo_; 67 }; 68 69 struct AVSessionBasicInfo { 70 std::string deviceName_; 71 std::string networkId_; 72 std::string vendorId_; 73 std::string deviceType_; 74 std::string systemVersion_; 75 int32_t sessionVersion_ {}; 76 std::vector<int32_t> reserve_; 77 std::vector<int32_t> feature_; 78 std::vector<int32_t> metaDataCap_; 79 std::vector<int32_t> playBackStateCap_; 80 std::vector<int32_t> controlCommandCap_; 81 std::vector<int32_t> extendCapability_; 82 int32_t systemTime_ {}; 83 std::vector<int32_t> extend_; 84 }; 85 } // namespace OHOS::AVSession 86 #endif // OHOS_AVSESSION_DESCRIPTOR_H