#include <AMRAudioRTPSource.hh>
Static Public Member Functions | |
| static AMRAudioSource * | createNew (UsageEnvironment &env, Groupsock *RTPgs, RTPSource *&resultRTPSource, unsigned char rtpPayloadFormat, Boolean isWideband=False, unsigned numChannels=1, Boolean isOctetAligned=True, unsigned interleaving=0, Boolean robustSortingOrder=False, Boolean CRCsArePresent=False) |
Definition at line 31 of file AMRAudioRTPSource.hh.
| AMRAudioSource * AMRAudioRTPSource::createNew | ( | UsageEnvironment & | env, | |
| Groupsock * | RTPgs, | |||
| RTPSource *& | resultRTPSource, | |||
| unsigned char | rtpPayloadFormat, | |||
| Boolean | isWideband = False, |
|||
| unsigned | numChannels = 1, |
|||
| Boolean | isOctetAligned = True, |
|||
| unsigned | interleaving = 0, |
|||
| Boolean | robustSortingOrder = False, |
|||
| Boolean | CRCsArePresent = False | |||
| ) | [static] |
Definition at line 114 of file AMRAudioRTPSource.cpp.
References Medium::close(), AMRDeinterleaver::createNew(), RawAMRRTPSource::createNew(), env, False, MAX_INTERLEAVING_GROUP_SIZE, MAX_NUM_CHANNELS, NULL, and True.
Referenced by MediaSubsession::initiate().
00123 { 00124 // Perform sanity checks on the input parameters: 00125 if (robustSortingOrder) { 00126 env << "AMRAudioRTPSource::createNew(): 'Robust sorting order' was specified, but we don't yet support this!\n"; 00127 return NULL; 00128 } else if (numChannels > MAX_NUM_CHANNELS) { 00129 env << "AMRAudioRTPSource::createNew(): The \"number of channels\" parameter (" 00130 << numChannels << ") is much too large!\n"; 00131 return NULL; 00132 } else if (interleaving > MAX_INTERLEAVING_GROUP_SIZE) { 00133 env << "AMRAudioRTPSource::createNew(): The \"interleaving\" parameter (" 00134 << interleaving << ") is much too large!\n"; 00135 return NULL; 00136 } 00137 00138 // 'Bandwidth-efficient mode' precludes some other options: 00139 if (!isOctetAligned) { 00140 if (interleaving > 0 || robustSortingOrder || CRCsArePresent) { 00141 env << "AMRAudioRTPSource::createNew(): 'Bandwidth-efficient mode' was specified, along with interleaving, 'robust sorting order', and/or CRCs, so we assume 'octet-aligned mode' instead.\n"; 00142 isOctetAligned = True; 00143 } 00144 } 00145 00146 Boolean isInterleaved; 00147 unsigned maxInterleaveGroupSize; // in frames (not frame-blocks) 00148 if (interleaving > 0) { 00149 isInterleaved = True; 00150 maxInterleaveGroupSize = interleaving*numChannels; 00151 } else { 00152 isInterleaved = False; 00153 maxInterleaveGroupSize = numChannels; 00154 } 00155 00156 RawAMRRTPSource* rawRTPSource; 00157 resultRTPSource = rawRTPSource 00158 = RawAMRRTPSource::createNew(env, RTPgs, rtpPayloadFormat, 00159 isWideband, isOctetAligned, 00160 isInterleaved, CRCsArePresent); 00161 if (resultRTPSource == NULL) return NULL; 00162 00163 AMRDeinterleaver* deinterleaver 00164 = AMRDeinterleaver::createNew(env, isWideband, numChannels, 00165 maxInterleaveGroupSize, rawRTPSource); 00166 if (deinterleaver == NULL) { 00167 Medium::close(resultRTPSource); 00168 resultRTPSource = NULL; 00169 } 00170 00171 return deinterleaver; 00172 }
1.5.2