MPD
0.20.6
|
#include <EncoderInterface.hxx>
Public Member Functions | |
Encoder (bool _implements_tag) | |
virtual | ~Encoder () |
bool | ImplementsTag () const |
virtual void | End () |
Ends the stream: flushes the encoder object, generate an end-of-stream marker (if applicable), make everything which might currently be buffered available by encoder_read(). More... | |
virtual void | Flush () |
Flushes an encoder object, make everything which might currently be buffered available by Read(). More... | |
virtual void | PreTag () |
Prepare for sending a tag to the encoder. More... | |
virtual void | SendTag (gcc_unused const Tag &tag) |
Sends a tag to the encoder. More... | |
virtual void | Write (const void *data, size_t length)=0 |
Writes raw PCM data to the encoder. More... | |
virtual size_t | Read (void *dest, size_t length)=0 |
Reads encoded data from the encoder. More... | |
Definition at line 32 of file EncoderInterface.hxx.
|
inlineexplicit |
Definition at line 36 of file EncoderInterface.hxx.
|
inlinevirtual |
Definition at line 38 of file EncoderInterface.hxx.
|
inlinevirtual |
Ends the stream: flushes the encoder object, generate an end-of-stream marker (if applicable), make everything which might currently be buffered available by encoder_read().
After this function has been called, the encoder may not be usable for more data, and only Read() and Close() can be called.
Throws #std::runtime_error on error.
Definition at line 55 of file EncoderInterface.hxx.
|
inlinevirtual |
Flushes an encoder object, make everything which might currently be buffered available by Read().
Throws #std::runtime_error on error.
Reimplemented in OggEncoder.
Definition at line 64 of file EncoderInterface.hxx.
|
inline |
Definition at line 40 of file EncoderInterface.hxx.
|
inlinevirtual |
Prepare for sending a tag to the encoder.
This is used by some encoders to flush the previous sub-stream, in preparation to begin a new one.
Throws #std::runtime_error on error.
Definition at line 74 of file EncoderInterface.hxx.
|
pure virtual |
Reads encoded data from the encoder.
Call this repeatedly until no more data is returned.
dest | the destination buffer to copy to |
length | the maximum length of the destination buffer |
Implemented in OggEncoder.
|
inlinevirtual |
Sends a tag to the encoder.
Instructions: call PreTag(); then obtain flushed data with Read(); finally call Tag().
Throws #std::runtime_error on error.
tag | the tag object |
Definition at line 87 of file EncoderInterface.hxx.
|
pure virtual |
Writes raw PCM data to the encoder.
Throws #std::runtime_error on error.
data | the buffer containing PCM samples |
length | the length of the buffer in bytes |