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_MEDIA_CHANNEL_DEF_H 17 #define OHOS_SHARING_MEDIA_CHANNEL_DEF_H 18 #include "common/const_def.h" 19 #include "utils/data_buffer.h" 20 21 namespace OHOS { 22 namespace Sharing { 23 24 enum TransportType { UDP_CLIENT, UDP_SERVER, TCP_CLIENT, TCP_SERVER }; 25 26 constexpr size_t MAX_BUFFER_CAPACITY = 800; 27 constexpr size_t BUFFER_CAPACITY_INCREMENT = 50; 28 29 enum ProsumerNotifyStatus { 30 PROSUMER_NOTIFY_INIT_SUCCESS, 31 PROSUMER_NOTIFY_START_SUCCESS, 32 PROSUMER_NOTIFY_STOP_SUCCESS, 33 PROSUMER_NOTIFY_PAUSE_SUCCESS, 34 PROSUMER_NOTIFY_RESUME_SUCCESS, 35 PROSUMER_NOTIFY_DESTROY_SUCCESS, 36 PROSUMER_NOTIFY_ERROR, 37 PROSUMER_NOTIFY_PRIVATE_EVENT, 38 }; 39 40 enum ProsumerOptRunningStatus { 41 PROSUMER_INIT, 42 PROSUMER_START, 43 PROSUMER_PAUSE, 44 PROSUMER_RESUME, 45 PROSUMER_STOP, 46 PROSUMER_DESTROY 47 }; 48 49 enum PlayConntrollerNotifyStatus { 50 CONNTROLLER_NOTIFY_ACCELERATION, 51 CONNTROLLER_NOTIFY_KEYMOD_START, 52 CONNTROLLER_NOTIFY_KEYMOD_STOP, 53 CONNTROLLER_NOTIFY_DECODER_DIED, 54 }; 55 56 struct MediaData { 57 using Ptr = std::shared_ptr<MediaData>; 58 59 bool isRaw; 60 bool keyFrame; 61 uint32_t ssrc; 62 uint64_t pts; 63 MediaType mediaType; 64 CodecId codecId; 65 AudioFormat format; 66 DataBuffer::Ptr buff; 67 }; 68 69 } // namespace Sharing 70 } // namespace OHOS 71 #endif