20 #define AUD_BUILD_PLUGIN 38 struct AVCodecContext;
40 #include <libavformat/avformat.h> 77 AVFormatContext* m_formatCtx;
82 AVCodecContext* m_codecCtx;
92 AVIOContext* m_aviocontext;
107 std::shared_ptr<Buffer> m_membuffer;
117 long long m_membufferpos;
157 FFMPEGReader(
const std::string &filename,
int stream = 0);
166 FFMPEGReader(std::shared_ptr<Buffer> buffer,
int stream = 0);
178 virtual std::vector<StreamInfo> queryStreams();
188 static int read_packet(
void* opaque, uint8_t* buf,
int buf_size);
198 static int64_t seek_packet(
void* opaque, int64_t offset,
int whence);
201 virtual void seek(
int position);
205 virtual void read(
int& length,
bool& eos,
sample_t* buffer);
virtual int getLength() const =0
Returns an approximated length of the source in samples.
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition: Audaspace.h:116
This class represents a sound source as stream or as buffer which can be read for example by another ...
Definition: IReader.h:34
virtual void seek(int position)=0
Seeks to a specific position in the source.
void(* convert_f)(data_t *target, data_t *source, int length)
The function template for functions converting from one sample format to another, having the same par...
Definition: ConverterFunctions.h:35
virtual void read(int &length, bool &eos, sample_t *buffer)=0
Request to read the next length samples out of the source.
unsigned char data_t
Sample data type (format samples)
Definition: Audaspace.h:129
SampleFormat
The format of a sample.
Definition: Specification.h:46
Specification of a sound source.
Definition: Specification.h:118
This class reads a sound file via ffmpeg.
Definition: FFMPEGReader.h:51
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality...
Definition: Buffer.h:33
Specification of a sound device.
Definition: Specification.h:128
virtual Specs getSpecs() const =0
Returns the specification of the reader.
Defines several conversion functions between different sample formats.
float sample_t
Sample type.(float samples)
Definition: Audaspace.h:126
The FileInfo data structures.
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
virtual int getPosition() const =0
Returns the position of the source as a sample count value.
#define AUD_PLUGIN_API
Used for exporting symbols in the shared library.
Definition: Audaspace.h:94
virtual bool isSeekable() const =0
Tells whether the source provides seeking functionality or not.
#define AUD_LOCAL
Used for hiding symbols from export in the shared library.
Definition: Audaspace.h:80