AMRAudioRTPSource Class Reference

#include <AMRAudioRTPSource.hh>


Static Public Member Functions

static AMRAudioSourcecreateNew (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)


Detailed Description

Definition at line 31 of file AMRAudioRTPSource.hh.


Member Function Documentation

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 113 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::createSourceObjects().

00122                                                      {
00123   // Perform sanity checks on the input parameters:
00124   if (robustSortingOrder) {
00125     env << "AMRAudioRTPSource::createNew(): 'Robust sorting order' was specified, but we don't yet support this!\n";
00126     return NULL;
00127   } else if (numChannels > MAX_NUM_CHANNELS) {
00128     env << "AMRAudioRTPSource::createNew(): The \"number of channels\" parameter ("
00129         << numChannels << ") is much too large!\n";
00130     return NULL;
00131   } else if (interleaving > MAX_INTERLEAVING_GROUP_SIZE) {
00132     env << "AMRAudioRTPSource::createNew(): The \"interleaving\" parameter ("
00133         << interleaving << ") is much too large!\n";
00134     return NULL;
00135   }
00136 
00137   // 'Bandwidth-efficient mode' precludes some other options:
00138   if (!isOctetAligned) {
00139     if (interleaving > 0 || robustSortingOrder || CRCsArePresent) {
00140       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";
00141       isOctetAligned = True;
00142     }
00143   }
00144 
00145   Boolean isInterleaved;
00146   unsigned maxInterleaveGroupSize; // in frames (not frame-blocks)
00147   if (interleaving > 0) {
00148     isInterleaved = True;
00149     maxInterleaveGroupSize = interleaving*numChannels;
00150   } else {
00151     isInterleaved = False;
00152     maxInterleaveGroupSize = numChannels;
00153   }
00154 
00155   RawAMRRTPSource* rawRTPSource;
00156   resultRTPSource = rawRTPSource
00157     = RawAMRRTPSource::createNew(env, RTPgs, rtpPayloadFormat,
00158                                  isWideband, isOctetAligned,
00159                                  isInterleaved, CRCsArePresent);
00160   if (resultRTPSource == NULL) return NULL;
00161 
00162   AMRDeinterleaver* deinterleaver
00163     = AMRDeinterleaver::createNew(env, isWideband, numChannels,
00164                                   maxInterleaveGroupSize, rawRTPSource);
00165   if (deinterleaver == NULL) {
00166     Medium::close(resultRTPSource);
00167     resultRTPSource = NULL;
00168   }
00169 
00170   return deinterleaver;
00171 }


The documentation for this class was generated from the following files:
Generated on Thu Feb 2 23:54:38 2012 for live by  doxygen 1.5.2