Definition at line 84 of file wvaudioencoder.h.
Public Types | |
typedef unsigned char | IType |
typedef float | OType |
typedef WvBufBase< IType > | IBuffer |
typedef WvBufBase< OType > | OBuffer |
typedef WvBufViewBase< IType > | IBufferView |
typedef WvBufViewBase< OType > | OBufferView |
Public Member Functions | |
WvSimpleAudioDecoder (unsigned int channels, unsigned int samplerate) | |
virtual unsigned int | channels () const |
Returns the number of channels. | |
virtual size_t | samplesperframe () const |
Returns the number of samples per frame. | |
virtual bool | missing (OBuffer &outbuf) |
Synthesizes one audio frame to compensate for a missing packet. | |
bool | encode (IBuffer &inbuf, OBuffer &outbuf, bool flush=false, bool finish=false) |
Typed variant of encode(). | |
bool | encode (WvBuf &inbuf, WvBuf &outbuf, bool flush=false, bool finish=false) |
Reads data from the input buffer, encodes it, and writes the result to the output buffer. | |
bool | flush (IBuffer &inbuf, OBuffer &outbuf, bool finish=false) |
Typed variant of flush(). | |
bool | flush (WvBuf &inbuf, WvBuf &outbuf, bool finish=false) |
Flushes the encoder and optionally finishes it. | |
bool | finish (OBuffer &outbuf) |
Typed variant of finish(). | |
bool | finish (WvBuf &outbuf) |
Tells the encoder that NO MORE DATA will ever be encoded. | |
bool | isok () const |
Returns true if the encoder has not encountered an error. | |
bool | isfinished () const |
Returns true if the encoder can no longer encode data. | |
WvString | geterror () const |
Returns an error message if any is available. | |
bool | reset () |
Asks an encoder to reset itself to its initial state at creation time, if supported. | |
bool | flushstrbuf (WvStringParm instr, WvBuf &outbuf, bool finish=false) |
Flushes data through the encoder from a string to a buffer. | |
bool | flushstrstr (WvStringParm instr, WvString &outstr, bool finish=false) |
Flushes data through the encoder from a string to a string. | |
bool | encodebufstr (WvBuf &inbuf, WvString &outstr, bool flush=false, bool finish=false) |
Encodes data from a buffer to a string. | |
bool | flushbufstr (WvBuf &inbuf, WvString &outstr, bool finish=false) |
Flushes data through the encoder from a buffer to a string. | |
WvString | strflushstr (WvStringParm instr, bool finish=false) |
Flushes data through the encoder from a string to a string. | |
WvString | strflushbuf (WvBuf &inbuf, bool finish=false) |
Flushes data through the encoder from a buffer to a string. | |
bool | flushmembuf (const void *inmem, size_t inlen, WvBuf &outbuf, bool finish=false) |
Flushes data through the encoder from memory to a buffer. | |
bool | flushmemmem (const void *inmem, size_t inlen, void *outmem, size_t *outlen, bool finish=false) |
Flushes data through the encoder from memory to memory. | |
bool | encodebufmem (WvBuf &inbuf, void *outmem, size_t *outlen, bool flush=false, bool finish=false) |
Encodes data from a buffer to memory. | |
bool | flushbufmem (WvBuf &inbuf, void *outmem, size_t *outlen, bool finish=false) |
Flushes data through the encoder from a buffer to memory. | |
bool | flushstrmem (WvStringParm instr, void *outmem, size_t *outlen, bool finish=false) |
Flushes data through the encoder from a string to memory. | |
WvString | strflushmem (const void *inmem, size_t inlen, bool finish=false) |
Flushes data through the encoder from memory to a string. | |
Protected Member Functions | |
virtual bool | _typedencode (IBuffer &inbuf, OBuffer &outbuf, bool flush) |
Typed variant of _encode(). | |
virtual bool | _typedfinish (OBuffer &outbuf) |
Typed variant of _finish(). | |
virtual bool | _encode (WvBuf &inbuf, WvBuf &outbuf, bool flush) |
Wrapper implementation of _encode(). | |
virtual bool | _finish (WvBuf &outbuf) |
Wrapper implementation of _finish(). | |
void | setnotok () |
Sets 'okay' to false explicitly. | |
void | seterror (WvStringParm message) |
Sets an error condition, then setnotok(). | |
void | seterror (WVSTRING_FORMAT_DECL) |
Sets an error condition, then setnotok(). | |
void | setfinished () |
Sets 'finished' to true explicitly. | |
virtual bool | _isok () const |
Template method implementation of isok(). | |
virtual bool | _isfinished () const |
Template method implementation of isfinished(). | |
virtual WvString | _geterror () const |
Template method implementation of geterror(). | |
virtual bool | _reset () |
Template method implementation of reset(). | |
Protected Attributes | |
bool | okay |
bool | finished |
WvString | errstr |
virtual unsigned int WvSimpleAudioDecoder::channels | ( | ) | const [inline, virtual] |
Returns the number of channels.
Returns: the number of channels
Implements WvAudioDecoder.
Definition at line 90 of file wvaudioencoder.h.
virtual size_t WvSimpleAudioDecoder::samplesperframe | ( | ) | const [inline, virtual] |
Returns the number of samples per frame.
Returns: the frame size
Implements WvAudioDecoder.
Definition at line 92 of file wvaudioencoder.h.
virtual bool WvSimpleAudioDecoder::missing | ( | OBuffer & | outbuf | ) | [inline, virtual] |
Synthesizes one audio frame to compensate for a missing packet.
"outbuf" is the output buffer Returns: true on success
Implements WvAudioDecoder.
Definition at line 94 of file wvaudioencoder.h.
bool WvSimpleAudioDecoder::_typedencode | ( | IBuffer & | inbuf, | |
OBuffer & | outbuf, | |||
bool | flush | |||
) | [protected, virtual] |
Typed variant of _encode().
Implements WvTypedEncoder< unsigned char, float >.
Definition at line 75 of file wvaudioencoder.cc.
References WvBufBaseCommonImpl< T >::alloc(), WvBufBaseCommonImpl< T >::free(), WvBufBaseCommonImpl< T >::get(), WvBufBaseCommonImpl< T >::skip(), and WvBufBaseCommonImpl< T >::used().
bool WvSimpleAudioDecoder::_typedfinish | ( | OBuffer & | outbuf | ) | [protected, virtual] |
Typed variant of _finish().
Reimplemented from WvTypedEncoder< unsigned char, float >.
Definition at line 107 of file wvaudioencoder.cc.
bool WvTypedEncoder< unsigned char , float , WvEncoder >::encode | ( | IBuffer & | inbuf, | |
OBuffer & | outbuf, | |||
bool | flush = false , |
|||
bool | finish = false | |||
) | [inline, inherited] |
Typed variant of encode().
Definition at line 47 of file wvtypedencoder.h.
bool WvTypedEncoder< unsigned char , float , WvEncoder >::encode | ( | WvBuf & | inbuf, | |
WvBuf & | outbuf, | |||
bool | flush = false , |
|||
bool | finish = false | |||
) | [inline, inherited] |
bool WvTypedEncoder< unsigned char , float , WvEncoder >::flush | ( | IBuffer & | inbuf, | |
OBuffer & | outbuf, | |||
bool | finish = false | |||
) | [inline, inherited] |
Typed variant of flush().
Definition at line 59 of file wvtypedencoder.h.
bool WvTypedEncoder< unsigned char , float , WvEncoder >::flush | ( | WvBuf & | inbuf, | |
WvBuf & | outbuf, | |||
bool | finish = false | |||
) | [inline, inherited] |
bool WvTypedEncoder< unsigned char , float , WvEncoder >::finish | ( | OBuffer & | outbuf | ) | [inline, inherited] |
bool WvTypedEncoder< unsigned char , float , WvEncoder >::finish | ( | WvBuf & | outbuf | ) | [inline, inherited] |
bool WvEncoder::isok | ( | ) | const [inline, inherited] |
Returns true if the encoder has not encountered an error.
This should only be used to record permanent failures. Transient errors (eg. bad block, but recoverable) should be detected in a different fashion.
Returns: true if the encoder is ok
Definition at line 90 of file wvencoder.h.
References WvEncoder::_isok(), and WvEncoder::okay.
Referenced by WvEncoder::geterror().
bool WvEncoder::isfinished | ( | ) | const [inline, inherited] |
Returns true if the encoder can no longer encode data.
This will be set when the encoder detects and end-of-data mark in its input, or when finish() is called.
Returns: true if the encoder is finished
Definition at line 101 of file wvencoder.h.
References WvEncoder::_isfinished(), and WvEncoder::finished.
WvString WvEncoder::geterror | ( | ) | const [inherited] |
Returns an error message if any is available.
Returns: the error message, or the null string is isok() == true
Definition at line 23 of file wvencoder.cc.
References WvEncoder::_geterror(), WvEncoder::errstr, WvEncoder::isok(), and WvFastString::null.
bool WvEncoder::reset | ( | ) | [inherited] |
Asks an encoder to reset itself to its initial state at creation time, if supported.
This function may be called at any time, even if isok() == false, or isfinished() == true.
If the behaviour is not supported or an error occurs, then false is returned and afterwards isok() == false.
Returns: true on success
Definition at line 60 of file wvencoder.cc.
References WvEncoder::_reset(), WvEncoder::errstr, WvEncoder::finished, WvFastString::null, WvEncoder::okay, and WvEncoder::seterror().
bool WvEncoder::flushstrbuf | ( | WvStringParm | instr, | |
WvBuf & | outbuf, | |||
bool | finish = false | |||
) | [inherited] |
Flushes data through the encoder from a string to a buffer.
"instr" is the input string "outbuf" is the output buffer "finish" is if true, calls finish() on success Returns: true on success
Definition at line 77 of file wvencoder.cc.
References WvEncoder::encode().
Referenced by WvCRLMgr::decode(), and WvX509Mgr::signreq().
bool WvEncoder::flushstrstr | ( | WvStringParm | instr, | |
WvString & | outstr, | |||
bool | finish = false | |||
) | [inherited] |
Flushes data through the encoder from a string to a string.
The output data is appended to the target string.
"instr" is the input string "outstr" is the output string "finish" is if true, calls finish() on success Returns: true on success
Definition at line 86 of file wvencoder.cc.
References WvString::append(), and WvEncoder::encode().
Referenced by WvEncoder::strflushstr().
bool WvEncoder::encodebufstr | ( | WvBuf & | inbuf, | |
WvString & | outstr, | |||
bool | flush = false , |
|||
bool | finish = false | |||
) | [inherited] |
Encodes data from a buffer to a string.
The output data is appended to the target string.
"inbuf" is the input buffer "outstr" is the output string "flush" is if true, flushes the encoder "finish" is if true, calls finish() on success Returns: true on success
Definition at line 97 of file wvencoder.cc.
References WvString::append(), and WvEncoder::encode().
Referenced by WvEncoder::flushbufstr().
bool WvEncoder::flushbufstr | ( | WvBuf & | inbuf, | |
WvString & | outstr, | |||
bool | finish = false | |||
) | [inline, inherited] |
Flushes data through the encoder from a buffer to a string.
The output data is appended to the target string.
"inbuf" is the input buffer "outstr" is the output string "finish" is if true, calls finish() on success Returns: true on success
Definition at line 249 of file wvencoder.h.
References WvEncoder::encodebufstr(), and WvEncoder::finish().
Referenced by WvX509Mgr::encode(), WvCRLMgr::encode(), and WvEncoder::strflushbuf().
WvString WvEncoder::strflushstr | ( | WvStringParm | instr, | |
bool | finish = false | |||
) | [inherited] |
Flushes data through the encoder from a string to a string.
"inbuf" is the input buffer "finish" is if true, calls finish() on success Returns: the resulting encoded string, does not signal errors
Definition at line 107 of file wvencoder.cc.
References WvEncoder::flushstrstr().
Flushes data through the encoder from a buffer to a string.
"inbuf" is the input buffer "finish" is if true, calls finish() on success Returns: the resulting encoded string, does not signal errors
Definition at line 115 of file wvencoder.cc.
References WvEncoder::flushbufstr().
Referenced by WvEncoder::strflushmem().
bool WvEncoder::flushmembuf | ( | const void * | inmem, | |
size_t | inlen, | |||
WvBuf & | outbuf, | |||
bool | finish = false | |||
) | [inherited] |
Flushes data through the encoder from memory to a buffer.
"inmem" is the input data pointer "inlen" is the input data length "outbuf" is the output buffer "finish" is if true, calls finish() on success Returns: true on success
Definition at line 123 of file wvencoder.cc.
References WvEncoder::encode().
Referenced by WvDsp::uwrite().
bool WvEncoder::flushmemmem | ( | const void * | inmem, | |
size_t | inlen, | |||
void * | outmem, | |||
size_t * | outlen, | |||
bool | finish = false | |||
) | [inherited] |
Flushes data through the encoder from memory to memory.
The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.
"inmem" is the input data pointer "inlen" is the input data length "outmem" is the output data pointer "outlen" is the output data length, by reference "finish" is if true, calls finish() on success Returns: true on success
Definition at line 132 of file wvencoder.cc.
References WvEncoder::encodebufmem().
bool WvEncoder::encodebufmem | ( | WvBuf & | inbuf, | |
void * | outmem, | |||
size_t * | outlen, | |||
bool | flush = false , |
|||
bool | finish = false | |||
) | [inherited] |
Encodes data from a buffer to memory.
The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.
"inmem" is the input data pointer "inlen" is the input data length "outmem" is the output data pointer "outlen" is the output data length, by reference "flush" is if true, flushes the encoder "finish" is if true, calls finish() on success Returns: true on success
Definition at line 140 of file wvencoder.cc.
References WvEncoder::encode(), and WvBufBaseCommonImpl< T >::used().
Referenced by WvEncoder::flushbufmem(), and WvEncoder::flushmemmem().
bool WvEncoder::flushbufmem | ( | WvBuf & | inbuf, | |
void * | outmem, | |||
size_t * | outlen, | |||
bool | finish = false | |||
) | [inline, inherited] |
Flushes data through the encoder from a buffer to memory.
The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.
"inbuf" is the input buffer "outmem" is the output data pointer "outlen" is the output data length, by reference "finish" is if true, calls finish() on success Returns: true on success
Definition at line 337 of file wvencoder.h.
References WvEncoder::encodebufmem(), and WvEncoder::finish().
Referenced by WvEncoder::flushstrmem().
bool WvEncoder::flushstrmem | ( | WvStringParm | instr, | |
void * | outmem, | |||
size_t * | outlen, | |||
bool | finish = false | |||
) | [inherited] |
Flushes data through the encoder from a string to memory.
The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.
"instr" is the input string "outmem" is the output data pointer "outlen" is the output data length, by reference "finish" is if true, calls finish() on success Returns: true on success
Definition at line 150 of file wvencoder.cc.
References WvEncoder::flushbufmem().
WvString WvEncoder::strflushmem | ( | const void * | inmem, | |
size_t | inlen, | |||
bool | finish = false | |||
) | [inherited] |
Flushes data through the encoder from memory to a string.
"inmem" is the input data pointer "inlen" is the input data length "finish" is if true, calls finish() on success Returns: the resulting encoded string, does not signal errors
Definition at line 158 of file wvencoder.cc.
References WvEncoder::strflushbuf().
virtual bool WvEncoder::_isok | ( | ) | const [inline, protected, virtual, inherited] |
Template method implementation of isok().
Not called if any of the following cases are true:
Most implementations do not need to override this.
Returns: true if the encoder is ok
Reimplemented in WvEncoderChain.
Definition at line 400 of file wvencoder.h.
Referenced by WvEncoder::isok().
virtual bool WvEncoder::_isfinished | ( | ) | const [inline, protected, virtual, inherited] |
Template method implementation of isfinished().
Not called if any of the following cases are true:
Most implementations do not need to override this.
Returns: true if the encoder is finished
Reimplemented in WvEncoderChain.
Definition at line 416 of file wvencoder.h.
Referenced by WvEncoder::isfinished().
virtual WvString WvEncoder::_geterror | ( | ) | const [inline, protected, virtual, inherited] |
Template method implementation of geterror().
Not called if any of the following cases are true:
Most implementations do not need to override this.
Returns: the error message, or the null string if _isok() == true
Reimplemented in WvEncoderChain.
Definition at line 433 of file wvencoder.h.
References WvFastString::null.
Referenced by WvEncoder::geterror().
virtual bool WvEncoder::_reset | ( | ) | [inline, protected, virtual, inherited] |
Template method implementation of reset().
When this method is invoked, the current local state will be okay == true and finished == false. If false is returned, then okay will be set to false.
May set a detailed error message if an error occurs.
Returns: true on success, false on error or if not supported
Reimplemented in WvBackslashEncoder, WvBackslashDecoder, WvBase64Encoder, WvBase64Decoder, WvBlowfishEncoder, WvEVPMDDigest, WvHMACDigest, WvCrc32Digest, WvAdler32Digest, WvNullEncoder, WvPassthroughEncoder, WvEncoderChain, WvFunctorEncoder< IT, OT, FT >, WvGzipEncoder, WvHexEncoder, WvHexDecoder, WvRSAEncoder, WvTripleDESEncoder, WvWordWrapEncoder, WvFunctorEncoder< float, signed short int, WvPCMNormFloatToSigned16Functor >, WvFunctorEncoder< double, signed short int, WvPCMNormDoubleToSigned16Functor >, WvFunctorEncoder< float, signed short int, WvPCMUnnormFloatToSigned16Functor >, WvFunctorEncoder< signed short int, float, WvPCMSigned16ToNormFloatFunctor >, WvFunctorEncoder< signed short int, double, WvPCMSigned16ToNormDoubleFunctor >, and WvFunctorEncoder< signed short int, float, WvPCMSigned16ToUnnormFloatFunctor >.
Definition at line 498 of file wvencoder.h.
Referenced by WvEncoder::reset().
bool WvEncoder::okay [protected, inherited] |
false iff setnotok() was called
Definition at line 70 of file wvencoder.h.
Referenced by WvEncoder::encode(), WvEncoder::finish(), WvEncoder::isok(), WvEncoder::reset(), WvEncoder::setnotok(), and WvEncoder::WvEncoder().
bool WvEncoder::finished [protected, inherited] |
true iff setfinished()/finish() was called
Definition at line 71 of file wvencoder.h.
Referenced by WvEncoder::encode(), WvEncoder::finish(), WvEncoder::isfinished(), WvEncoder::reset(), WvEncoder::setfinished(), and WvEncoder::WvEncoder().
WvString WvEncoder::errstr [protected, inherited] |
the error message
Definition at line 72 of file wvencoder.h.
Referenced by WvEncoder::geterror(), WvEncoder::reset(), and WvEncoder::seterror().