Blender V2.61 - r43446
Public Member Functions

AUD_FFMPEGWriter Class Reference

#include <AUD_FFMPEGWriter.h>

Inheritance diagram for AUD_FFMPEGWriter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 AUD_FFMPEGWriter (std::string filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate)
virtual ~AUD_FFMPEGWriter ()
virtual int getPosition () const
virtual AUD_DeviceSpecs getSpecs () const
virtual void write (unsigned int length, sample_t *buffer)

Detailed Description

This class writes a sound file via ffmpeg.

Definition at line 47 of file AUD_FFMPEGWriter.h.


Constructor & Destructor Documentation

AUD_FFMPEGWriter::AUD_FFMPEGWriter ( std::string  filename,
AUD_DeviceSpecs  specs,
AUD_Container  format,
AUD_Codec  codec,
unsigned int  bitrate 
)

Creates a new writer.

Parameters:
filenameThe path to the file to be read.
specsThe file's audio specification.
formatThe file's container format.
codecThe codec used for encoding the audio data.
bitrateThe bitrate for encoding.
Exceptions:
AUD_ExceptionThrown if the file specified does not exist or cannot be read with ffmpeg.

Definition at line 51 of file AUD_FFMPEGWriter.cpp.

References AUD_CODEC_AAC, AUD_CODEC_AC3, AUD_CODEC_FLAC, AUD_CODEC_MP2, AUD_CODEC_MP3, AUD_CODEC_PCM, AUD_CODEC_VORBIS, AUD_convert_float_double(), AUD_convert_float_s16(), AUD_convert_float_s32(), AUD_convert_float_u8(), AUD_DEVICE_SAMPLE_SIZE, AUD_ERROR_FFMPEG, AUD_ERROR_FILE, AUD_ERROR_SPECS, AUD_FORMAT_FLOAT32, AUD_FORMAT_FLOAT64, AUD_FORMAT_S16, AUD_FORMAT_S24, AUD_FORMAT_S32, AUD_FORMAT_U8, AUD_MAX, AUD_SAMPLE_SIZE, AUD_THROW, AVIO_FLAG_WRITE, avio_open, AVMEDIA_TYPE_AUDIO, AUD_DeviceSpecs::channels, codec_error, context_error, file_error, AUD_DeviceSpecs::format, format_error, NULL, AUD_DeviceSpecs::rate, AUD_Buffer::resize(), and stream_error.

AUD_FFMPEGWriter::~AUD_FFMPEGWriter ( ) [virtual]

Destroys the writer and closes the file.

Definition at line 208 of file AUD_FFMPEGWriter.cpp.

References AUD_DEVICE_SAMPLE_SIZE, avio_close, AUD_DeviceSpecs::channels, and AUD_Buffer::getBuffer().


Member Function Documentation

int AUD_FFMPEGWriter::getPosition ( ) const [virtual]

Returns how many samples have been written so far.

Returns:
The writing position as sample count. May be negative if unknown.

Implements AUD_IWriter.

Definition at line 231 of file AUD_FFMPEGWriter.cpp.

AUD_DeviceSpecs AUD_FFMPEGWriter::getSpecs ( ) const [virtual]

Returns the specification of the audio data being written into the sink.

Returns:
The AUD_DeviceSpecs structure.
Note:
Regardless of the format the input still has to be float!

Implements AUD_IWriter.

Definition at line 236 of file AUD_FFMPEGWriter.cpp.

void AUD_FFMPEGWriter::write ( unsigned int  length,
sample_t buffer 
) [virtual]

Request to write the next length samples out into the sink.

Parameters:
lengthThe count of samples to write.
bufferThe pointer to the buffer containing the data.

Implements AUD_IWriter.

Definition at line 262 of file AUD_FFMPEGWriter.cpp.

References AUD_Buffer::assureSize(), AUD_DEVICE_SAMPLE_SIZE, AUD_MAX, AUD_MIN, AUD_SAMPLE_SIZE, AUD_DeviceSpecs::channels, AUD_Buffer::getBuffer(), AUD_Buffer::getSize(), len(), length(), and AUD_Buffer::resize().


The documentation for this class was generated from the following files: