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 #include "rtp_factory.h"
17 #include "rtp_pack_impl.h"
18 #include "rtp_unpack_impl.h"
19
20 namespace OHOS {
21 namespace Sharing {
CreateRtpPack(uint32_t ssrc,size_t mtuSize,uint32_t sampleRate,uint8_t pt,RtpPayloadStream ps,uint32_t audioChannels)22 RtpPack::Ptr RtpFactory::CreateRtpPack(uint32_t ssrc, size_t mtuSize, uint32_t sampleRate, uint8_t pt,
23 RtpPayloadStream ps, uint32_t audioChannels)
24 {
25 return std::make_shared<RtpPackImpl>(ssrc, mtuSize, sampleRate, pt, ps, audioChannels);
26 }
27
CreateRtpUnpack()28 RtpUnpack::Ptr RtpFactory::CreateRtpUnpack()
29 {
30 return std::make_shared<RtpUnpackImpl>();
31 }
32
CreateRtpUnpack(const RtpPlaylodParam & rpp)33 RtpUnpack::Ptr RtpFactory::CreateRtpUnpack(const RtpPlaylodParam &rpp)
34 {
35 return std::make_shared<RtpUnpackImpl>(rpp);
36 }
37 } // namespace Sharing
38 } // namespace OHOS