|
reSIProcate/stack
9694
|
#include <Compression.hxx>

Public Types | |
| enum | Algorithm { NONE, DEFLATE } |
Public Member Functions | |
| Compression (Algorithm algorithm=DEFLATE, int stateMemorySize=8192, int cyclesPerBit=64, int decompressionMemorySize=8192, Data sigcompId=Data::Empty) | |
| ~Compression () | |
| bool | isEnabled () |
| Algorithm | getAlgorithm () const |
| osc::StateHandler & | getStateHandler () |
| void | addCompressorsToStack (osc::Stack *) |
| const Data & | getSigcompId () |
Static Public Attributes | |
| static Compression | Disabled |
| Represents a compression configuration object with compression disabled. | |
Private Attributes | |
| Algorithm | mAlgorithm |
| osc::StateHandler * | mStateHandler |
| Data | mSigcompId |
Definition at line 13 of file Compression.hxx.
Definition at line 16 of file Compression.hxx.
| resip::Compression::Compression | ( | Algorithm | algorithm = DEFLATE, |
| int | stateMemorySize = 8192, |
||
| int | cyclesPerBit = 64, |
||
| int | decompressionMemorySize = 8192, |
||
| Data | sigcompId = Data::Empty |
||
| ) |
Definition at line 19 of file Compression.cxx.
References DebugLog, resip::Data::Empty, resip::Random::getVersion4UuidUrn(), mAlgorithm, mSigcompId, mStateHandler, and NONE.
: mAlgorithm(algorithm), mStateHandler(0), mSigcompId(sigcompId) { #ifdef USE_SIGCOMP if (algorithm != NONE) { mStateHandler = new osc::StateHandler(stateMemorySize, cyclesPerBit, decompressionMemorySize); mStateHandler->useSipDictionary(); if (sigcompId == Data::Empty) { mSigcompId = "<"; mSigcompId += Random::getVersion4UuidUrn(); mSigcompId += ">"; } } DebugLog (<< "Set SigcompId to " << mSigcompId); #else mAlgorithm = NONE; DebugLog (<< "COMPRESSION SUPPORT NOT COMPILED IN"); #endif DebugLog (<< "Compression configuration object created; algorithm = " << static_cast<int>(mAlgorithm) ); }

| resip::Compression::~Compression | ( | ) |
Definition at line 50 of file Compression.cxx.
{
#ifdef USE_SIGCOMP
delete mStateHandler;
#endif
}
| void resip::Compression::addCompressorsToStack | ( | osc::Stack * | stack | ) |
Definition at line 58 of file Compression.cxx.
References DebugLog, and WarningLog.
Referenced by resip::ConnectionBase::ConnectionBase(), resip::TransportSelector::TransportSelector(), and resip::UdpTransport::UdpTransport().
{
#ifdef USE_SIGCOMP
switch(getAlgorithm())
{
case DEFLATE:
DebugLog (<< "Adding Deflate Compressor");
stack->addCompressor(new osc::DeflateCompressor(getStateHandler()));
break;
default:
WarningLog (<< "Invalid compressor specified! Using deflate Compressor");
stack->addCompressor(new osc::DeflateCompressor(getStateHandler()));
case NONE:
DebugLog (<< "Compression disabled: not adding any compressors");
break;
}
#else
DebugLog (<< "Compression not compiled in: not adding any compressors");
#endif
}
| Algorithm resip::Compression::getAlgorithm | ( | ) | const [inline] |
| const Data& resip::Compression::getSigcompId | ( | ) | [inline] |
Definition at line 36 of file Compression.hxx.
References mSigcompId.
Referenced by resip::TransportSelector::transmit().
{return mSigcompId;}
| osc::StateHandler& resip::Compression::getStateHandler | ( | ) | [inline] |
Definition at line 32 of file Compression.hxx.
References mStateHandler.
Referenced by resip::ConnectionBase::ConnectionBase(), resip::TransportSelector::TransportSelector(), and resip::UdpTransport::UdpTransport().
{ return *mStateHandler; }
| bool resip::Compression::isEnabled | ( | ) | [inline] |
Definition at line 30 of file Compression.hxx.
References mAlgorithm, and NONE.
Referenced by resip::ConnectionBase::ConnectionBase(), resip::Connection::performWrite(), resip::UdpTransport::processRxParse(), resip::Connection::read(), resip::Transport::setRemoteSigcompId(), resip::TransportSelector::transmit(), resip::TransportSelector::TransportSelector(), and resip::UdpTransport::UdpTransport().
{ return (mAlgorithm != NONE); }
Represents a compression configuration object with compression disabled.
Definition at line 40 of file Compression.hxx.
Algorithm resip::Compression::mAlgorithm [private] |
Definition at line 43 of file Compression.hxx.
Referenced by Compression(), getAlgorithm(), and isEnabled().
Data resip::Compression::mSigcompId [private] |
Definition at line 49 of file Compression.hxx.
Referenced by Compression(), and getSigcompId().
osc::StateHandler* resip::Compression::mStateHandler [private] |
Definition at line 44 of file Compression.hxx.
Referenced by Compression(), and getStateHandler().
1.7.5.1