|
reSIProcate/stack
9694
|
parameters for a specific codec are stored in this class. More...
#include <SdpContents.hxx>

Public Types | |
| typedef HashMap< int, Codec > | CodecMap |
Public Member Functions | |
| Codec () | |
| Codec (const Data &name, unsigned long rate, const Data ¶meters=Data::Empty, const Data &encodingParameters=Data::Empty) | |
| full constructor for a Codec. | |
| Codec (const Data &name, int payloadType, int rate=8000) | |
| constructor for a Codec | |
| Codec (const Codec &rhs) | |
| Codec & | operator= (const Codec &codec) |
| void | parse (ParseBuffer &pb, const SdpContents::Session::Medium &medium, int payLoadType) |
| void | assignFormatParameters (const SdpContents::Session::Medium &medium) |
| const Data & | getName () const |
| returns the name of the codec. | |
| int | getRate () const |
| returns the name of the codec. | |
| int | payloadType () const |
| returns the RTP payload type associated with this codec. | |
| int & | payloadType () |
| returns the RTP payload type associated with this codec. | |
| const Data & | parameters () const |
| returns the parameters associated with this codec | |
| Data & | parameters () |
| returns the parameters associated with this codec | |
| const Data & | encodingParameters () const |
| returns the encoding parameters associated with this codec | |
| Data & | encodingParameters () |
| returns the encoding parameters associated with this codec | |
Static Public Member Functions | |
| static CodecMap & | getStaticCodecs () |
Static Public Attributes | |
| static const Codec | ULaw_8000 |
| static const Codec | ALaw_8000 |
| static const Codec | G729_8000 |
| static const Codec | G723_8000 |
| static const Codec | GSM_8000 |
| static const Codec | TelephoneEvent |
| static const Codec | FrfDialedDigit |
| static const Codec | CN |
Private Attributes | |
| Data | mName |
| unsigned long | mRate |
| int | mPayloadType |
| Data | mParameters |
| Data | mEncodingParameters |
Static Private Attributes | |
| static std::auto_ptr< CodecMap > | sStaticCodecs |
| static bool | sStaticCodecsCreated = false |
Friends | |
| bool | operator== (const Codec &, const Codec &) |
| EncodeStream & | operator<< (EncodeStream &, const Codec &) |
parameters for a specific codec are stored in this class.
Definition at line 69 of file SdpContents.hxx.
| typedef HashMap<int, Codec> resip::SdpContents::Session::Codec::CodecMap |
Definition at line 149 of file SdpContents.hxx.
| resip::SdpContents::Session::Codec::Codec | ( | ) | [inline] |
Definition at line 72 of file SdpContents.hxx.
Referenced by getStaticCodecs().
: mName(), mRate(0), mPayloadType(-1) {}
| Codec::Codec | ( | const Data & | name, |
| unsigned long | rate, | ||
| const Data & | parameters = Data::Empty, |
||
| const Data & | encodingParameters = Data::Empty |
||
| ) |
full constructor for a Codec.
This constructor allows a rate and optional parameters to be specified.
| name | a string identifying the codec |
| rate | number of samples/sec |
| parameters | optional list of parameters for the codec |
| encodingParameters | optional encoding parameters for the codec |
Definition at line 1725 of file SdpContents.cxx.
: mName(name), mRate(rate), mPayloadType(-1), mParameters(parameters), mEncodingParameters(encodingParameters) { }
| Codec::Codec | ( | const Data & | name, |
| int | payloadType, | ||
| int | rate = 8000 |
||
| ) |
constructor for a Codec
This constructor allows for payload type and rate parameters to be specified.
| name | a string identifying the codec |
| payloadType | RTP payload type to associate with this codec |
| rate | sample rate of this codec |
Definition at line 1746 of file SdpContents.cxx.
: mName(name), mRate(rate), mPayloadType(payloadType) { }
| Codec::Codec | ( | const Codec & | rhs | ) |
Definition at line 1737 of file SdpContents.cxx.
: mName(rhs.mName), mRate(rhs.mRate), mPayloadType(rhs.mPayloadType), mParameters(rhs.mParameters), mEncodingParameters(rhs.mEncodingParameters) { }
| void Codec::assignFormatParameters | ( | const SdpContents::Session::Medium & | medium | ) |
Definition at line 1793 of file SdpContents.cxx.
References resip::Data::data(), resip::SdpContents::Session::Medium::exists(), fmtp, resip::SdpContents::Session::Medium::getValues(), InfoLog, resip::ParseBuffer::integer(), mParameters, and mPayloadType.
Referenced by resip::SdpContents::Session::Medium::codecs(), and parse().
{
// get parameters if they exist
if (medium.exists(fmtp))
{
for (list<Data>::const_iterator i = medium.getValues(fmtp).begin();
i != medium.getValues(fmtp).end(); ++i)
{
try
{
ParseBuffer pb(i->data(), i->size());
int payload = pb.integer();
if (payload == mPayloadType)
{
const char* anchor = pb.skipWhitespace();
pb.skipToEnd();
mParameters = pb.data(anchor);
break;
}
}
catch (ParseException &pe)
{
InfoLog(<<"Caught exception when parsing a=fmtp: "<< pe);
}
}
}
}

| const Data& resip::SdpContents::Session::Codec::encodingParameters | ( | ) | const [inline] |
returns the encoding parameters associated with this codec
Definition at line 134 of file SdpContents.hxx.
References mEncodingParameters.
{return mEncodingParameters;}
| Data& resip::SdpContents::Session::Codec::encodingParameters | ( | ) | [inline] |
returns the encoding parameters associated with this codec
Definition at line 138 of file SdpContents.hxx.
References mEncodingParameters.
{return mEncodingParameters;}
| const Data & Codec::getName | ( | ) | const |
returns the name of the codec.
Definition at line 1822 of file SdpContents.cxx.
References mName.
Referenced by resip::SdpContents::Session::Medium::findTelephoneEventPayloadType().
{
return mName;
}
| int Codec::getRate | ( | ) | const |
returns the name of the codec.
Definition at line 1828 of file SdpContents.cxx.
References mRate.
{
return mRate;
}
| Codec::CodecMap & Codec::getStaticCodecs | ( | ) | [static] |
Definition at line 1833 of file SdpContents.cxx.
References Codec(), sStaticCodecs, and sStaticCodecsCreated.
Referenced by resip::SdpContents::Session::Medium::codecs().
{
if (! sStaticCodecsCreated)
{
//
// Build map of static codecs as defined in RFC 3551
//
sStaticCodecs = std::auto_ptr<CodecMap>(new CodecMap);
// Audio codecs
sStaticCodecs->insert(make_pair(0,Codec("PCMU",0,8000)));
sStaticCodecs->insert(make_pair(3,Codec("GSM",3,8000)));
sStaticCodecs->insert(make_pair(4,Codec("G723",4,8000)));
sStaticCodecs->insert(make_pair(5,Codec("DVI4",5,8000)));
sStaticCodecs->insert(make_pair(6,Codec("DVI4",6,16000)));
sStaticCodecs->insert(make_pair(7,Codec("LPC",7,8000)));
sStaticCodecs->insert(make_pair(8,Codec("PCMA",8,8000)));
sStaticCodecs->insert(make_pair(9,Codec("G722",9,8000)));
sStaticCodecs->insert(make_pair(10,Codec("L16-2",10,44100)));
sStaticCodecs->insert(make_pair(11,Codec("L16-1",11,44100)));
sStaticCodecs->insert(make_pair(12,Codec("QCELP",12,8000)));
sStaticCodecs->insert(make_pair(13,Codec("CN",13,8000)));
sStaticCodecs->insert(make_pair(14,Codec("MPA",14,90000)));
sStaticCodecs->insert(make_pair(15,Codec("G728",15,8000)));
sStaticCodecs->insert(make_pair(16,Codec("DVI4",16,11025)));
sStaticCodecs->insert(make_pair(17,Codec("DVI4",17,22050)));
sStaticCodecs->insert(make_pair(18,Codec("G729",18,8000)));
// Video or audio/video codecs
sStaticCodecs->insert(make_pair(25,Codec("CelB",25,90000)));
sStaticCodecs->insert(make_pair(26,Codec("JPEG",26,90000)));
sStaticCodecs->insert(make_pair(28,Codec("nv",28,90000)));
sStaticCodecs->insert(make_pair(31,Codec("H261",31,90000)));
sStaticCodecs->insert(make_pair(32,Codec("MPV",32,90000)));
sStaticCodecs->insert(make_pair(33,Codec("MP2T",33,90000)));
sStaticCodecs->insert(make_pair(34,Codec("H263",34,90000)));
sStaticCodecsCreated = true;
}
return *(sStaticCodecs.get());
}

Definition at line 1754 of file SdpContents.cxx.
References mEncodingParameters, mName, mParameters, mPayloadType, and mRate.
{
if (this != &rhs)
{
mName = rhs.mName;
mRate = rhs.mRate;
mPayloadType = rhs.mPayloadType;
mParameters = rhs.mParameters;
mEncodingParameters = rhs.mEncodingParameters;
}
return *this;
}
| const Data& resip::SdpContents::Session::Codec::parameters | ( | ) | const [inline] |
returns the parameters associated with this codec
Definition at line 125 of file SdpContents.hxx.
References mParameters.
{return mParameters;}
| Data& resip::SdpContents::Session::Codec::parameters | ( | ) | [inline] |
returns the parameters associated with this codec
Definition at line 129 of file SdpContents.hxx.
References mParameters.
{return mParameters;}
| void Codec::parse | ( | ParseBuffer & | pb, |
| const SdpContents::Session::Medium & | medium, | ||
| int | payLoadType | ||
| ) |
Definition at line 1768 of file SdpContents.cxx.
References assignFormatParameters(), resip::ParseBuffer::data(), resip::ParseBuffer::eof(), resip::ParseBuffer::integer(), mEncodingParameters, mName, mPayloadType, mRate, payloadType(), resip::ParseBuffer::position(), resip::ParseBuffer::skipChar(), resip::ParseBuffer::skipToChar(), resip::ParseBuffer::skipToEnd(), resip::ParseBuffer::skipWhitespace(), and resip::Symbols::SLASH.
{
const char* anchor = pb.skipWhitespace();
pb.skipToChar(Symbols::SLASH[0]);
mName = pb.data(anchor);
if(!pb.eof())
{
pb.skipChar(Symbols::SLASH[0]);
mRate = pb.integer();
pb.skipToChar(Symbols::SLASH[0]);
}
if(!pb.eof() && *pb.position() == Symbols::SLASH[0])
{
anchor = pb.skipChar(Symbols::SLASH[0]);
pb.skipToEnd();
mEncodingParameters = pb.data(anchor);
}
mPayloadType = payloadType;
assignFormatParameters(medium);
}

| int resip::SdpContents::Session::Codec::payloadType | ( | ) | const [inline] |
returns the RTP payload type associated with this codec.
Definition at line 116 of file SdpContents.hxx.
References mPayloadType.
Referenced by parse().
{return mPayloadType;}
| int& resip::SdpContents::Session::Codec::payloadType | ( | ) | [inline] |
returns the RTP payload type associated with this codec.
Definition at line 120 of file SdpContents.hxx.
References mPayloadType.
{return mPayloadType;}
| EncodeStream& operator<< | ( | EncodeStream & | , |
| const Codec & | |||
| ) | [friend] |
const Codec Codec::ALaw_8000 [static] |
Definition at line 141 of file SdpContents.hxx.
Definition at line 147 of file SdpContents.hxx.
const Codec Codec::FrfDialedDigit [static] |
Definition at line 146 of file SdpContents.hxx.
const Codec Codec::G723_8000 [static] |
Definition at line 143 of file SdpContents.hxx.
const Codec Codec::G729_8000 [static] |
Definition at line 142 of file SdpContents.hxx.
const Codec Codec::GSM_8000 [static] |
Definition at line 144 of file SdpContents.hxx.
Definition at line 161 of file SdpContents.hxx.
Referenced by encodingParameters(), operator=(), and parse().
Definition at line 157 of file SdpContents.hxx.
Referenced by getName(), operator=(), and parse().
Definition at line 160 of file SdpContents.hxx.
Referenced by assignFormatParameters(), operator=(), and parameters().
int resip::SdpContents::Session::Codec::mPayloadType [private] |
Definition at line 159 of file SdpContents.hxx.
Referenced by assignFormatParameters(), operator=(), parse(), and payloadType().
unsigned long resip::SdpContents::Session::Codec::mRate [private] |
Definition at line 158 of file SdpContents.hxx.
Referenced by getRate(), operator=(), and parse().
std::auto_ptr< Codec::CodecMap > Codec::sStaticCodecs [static, private] |
Definition at line 163 of file SdpContents.hxx.
Referenced by getStaticCodecs().
bool Codec::sStaticCodecsCreated = false [static, private] |
Definition at line 164 of file SdpContents.hxx.
Referenced by getStaticCodecs().
const Codec Codec::TelephoneEvent [static] |
Definition at line 145 of file SdpContents.hxx.
Referenced by resip::SdpContents::Session::Medium::findTelephoneEventPayloadType().
const Codec Codec::ULaw_8000 [static] |
Definition at line 140 of file SdpContents.hxx.
1.7.5.1