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 DevSurfaceItem { 70 bool deleting = false; 71 72 uint32_t agentId = INVALID_ID; 73 uint32_t contextId = INVALID_ID; 74 75 std::string deviceId; 76 77 SceneType sceneType; 78 sptr<Surface> surfacePtr; 79 }; 80 81 } // namespace Sharing 82 } // namespace OHOS 83 #endif 84