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_RTP_FACTORY_H 17 #define OHOS_SHARING_RTP_FACTORY_H 18 19 #include "rtp_def.h" 20 #include "rtp_pack.h" 21 #include "rtp_unpack.h" 22 23 namespace OHOS { 24 namespace Sharing { 25 class RtpFactory { 26 public: 27 /** 28 * @brief Create RtpUnpack instance 29 */ 30 static RtpUnpack::Ptr CreateRtpUnpack(); 31 static RtpUnpack::Ptr CreateRtpUnpack(const RtpPlaylodParam &rpp); 32 33 /** 34 * @brief Create RptPack instance 35 * @param ssrc ssrc 36 * @param mtuSize mtu size 37 * @param sampleRate Video is 90000, audio is sample rate 38 * @param pt payload type 39 */ 40 static RtpPack::Ptr CreateRtpPack(uint32_t ssrc, size_t mtuSize, uint32_t sampleRate, uint8_t pt, 41 RtpPayloadStream ps, uint32_t audioChannels = 1); 42 43 private: 44 RtpFactory() = delete; 45 ~RtpFactory() = delete; 46 }; 47 } // namespace Sharing 48 } // namespace OHOS 49 #endif