1 /* 2 * Copyright (c) 2023 Shenzhen Kaihong Digital Industry Development 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_SHARING_WFD_DEF_H 17 #define OHOS_SHARING_WFD_DEF_H 18 19 #include "common/const_def.h" 20 #include "common/event_comm.h" 21 #include "wfd_msg.h" 22 23 namespace OHOS { 24 namespace Sharing { 25 26 constexpr uint32_t SURFACE_MAX_NUMBER = 5; 27 constexpr uint32_t ACCESS_DEV_MAX_NUMBER = 4; 28 constexpr uint32_t FOREGROUND_SURFACE_MAX_NUMBER = 2; 29 30 enum WfdErrorCode {}; 31 32 enum ConnectionState { CONNECTED, DISCONNECTED, INIT, READY, PLAYING }; 33 34 struct SinkConfig { 35 uint32_t surfaceMaximum = 0; 36 uint32_t accessDevMaximum = 0; 37 uint32_t foregroundMaximum = 0; 38 }; 39 40 struct SourceConfig { 41 uint32_t accessDevMaximum = 0; 42 uint32_t foregroundMaximum = 0; 43 uint32_t surfaceMaximum = 0; 44 }; 45 46 struct ConnectionInfo { 47 bool isRunning = false; 48 49 int32_t ctrlPort = 0; 50 uint32_t agentId = INVALID_ID; 51 uint32_t contextId = INVALID_ID; 52 53 uint64_t surfaceId = 0; 54 55 std::string ip; 56 std::string mac; 57 std::string deviceName; 58 std::string primaryDeviceType; 59 std::string secondaryDeviceType; 60 61 ConnectionState state; 62 CodecId audioCodecId = CodecId::CODEC_AAC; 63 CodecId videoCodecId = CodecId::CODEC_H264; 64 65 AudioFormat audioFormatId = AudioFormat::AUDIO_48000_16_2; 66 VideoFormat videoFormatId = VideoFormat::VIDEO_1920X1080_30; 67 }; 68 69 struct WfdParamsInfo { 70 std::string contentProtection = "none"; 71 std::string uibcCapability = "none"; 72 std::string connectorType = "05"; 73 std::string microsofRtcpCapability = "none"; 74 std::string idrRequestCapablity = "support"; 75 std::string displayEdid = std::string("0002 00FFFFFFFFFFFF0022F6300000000000FF1D0103807844780ACF74A3574CB02") + 76 std::string("309484C21080081C0814081800101010101010101010108E80030F2705A80B0588A0") + 77 std::string("0C48E2100001E023A801871382D40582C4500C48E2100001E000000FC00485541574") + 78 std::string("54920494E430A2020000000FD003B461F8C3C000A20202020202001BB02036FF25B0") + 79 std::string("58403011213141607901F20225D5F6061626465665E63020611152F0907071507505") + 80 std::string("707003D07C067070383010000E200FF6E030C001000B83C2000800102030467D") + 81 std::string("85DC401788003EB0146D000260B11D578547BE61146D0007080E305FF01E50F0") + 82 std::string("0801900E3060D010000000000000000000000000000000034"); 83 std::string hweVersion = "none"; 84 std::string hweVenderId = "none"; 85 std::string hweProductId = "none"; 86 std::string hweVtp = "none"; 87 std::string hweHevcFormats = "none"; 88 std::string hweVideo60FPS = "none"; 89 std::string hweAvSyncSink = "none"; 90 }; 91 92 struct DevSurfaceItem { 93 bool deleting = false; 94 95 uint32_t agentId = INVALID_ID; 96 uint32_t contextId = INVALID_ID; 97 98 std::string deviceId; 99 100 SceneType sceneType; 101 sptr<Surface> surfacePtr; 102 }; 103 104 } // namespace Sharing 105 } // namespace OHOS 106 #endif 107