1 /** 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #include <RtpPayloadInfo.h> 18 RtpPayloadInfo()19RtpPayloadInfo::RtpPayloadInfo() : 20 m_uiSamplingRate(RTP_ZERO) 21 { 22 for (RtpDt_UInt32 i = 0; i < RTP_MAX_PAYLOAD_TYPE; i++) 23 m_uiPayloadType[i] = RTP_ZERO; 24 } 25 RtpPayloadInfo(IN RtpDt_UInt32 * uiPayloadType,IN RtpDt_UInt32 uiSamplingRate,IN RtpDt_UInt32 nNumOfPayloadParam)26RtpPayloadInfo::RtpPayloadInfo(IN RtpDt_UInt32* uiPayloadType, IN RtpDt_UInt32 uiSamplingRate, 27 IN RtpDt_UInt32 nNumOfPayloadParam) : 28 m_uiSamplingRate(uiSamplingRate) 29 { 30 for (RtpDt_UInt32 i = 0; i < nNumOfPayloadParam; i++) 31 m_uiPayloadType[i] = uiPayloadType[i]; 32 } 33 ~RtpPayloadInfo()34RtpPayloadInfo::~RtpPayloadInfo() {} 35 setRtpPayloadInfo(IN RtpPayloadInfo * pobjRlInfo)36RtpDt_Void RtpPayloadInfo::setRtpPayloadInfo(IN RtpPayloadInfo* pobjRlInfo) 37 { 38 for (RtpDt_UInt32 i = 0; i < RTP_MAX_PAYLOAD_TYPE; i++) 39 m_uiPayloadType[i] = pobjRlInfo->getPayloadType(i); 40 41 m_uiSamplingRate = pobjRlInfo->getSamplingRate(); 42 } 43 getPayloadType(IN RtpDt_UInt32 payloadIndex)44RtpDt_UInt32 RtpPayloadInfo::getPayloadType(IN RtpDt_UInt32 payloadIndex) 45 { 46 return m_uiPayloadType[payloadIndex]; 47 } 48 getSamplingRate()49RtpDt_UInt32 RtpPayloadInfo::getSamplingRate() 50 { 51 return m_uiSamplingRate; 52 } 53