00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AVRESAMPLE_AUDIO_DATA_H
00022 #define AVRESAMPLE_AUDIO_DATA_H
00023
00024 #include <stdint.h>
00025
00026 #include "libavutil/audio_fifo.h"
00027 #include "libavutil/log.h"
00028 #include "libavutil/samplefmt.h"
00029 #include "avresample.h"
00030
00034 typedef struct AudioData {
00035 const AVClass *class;
00036 uint8_t *data[AVRESAMPLE_MAX_CHANNELS];
00037 uint8_t *buffer;
00038 unsigned int buffer_size;
00039 int allocated_samples;
00040 int nb_samples;
00041 enum AVSampleFormat sample_fmt;
00042 int channels;
00043 int allocated_channels;
00044 int is_planar;
00045 int planes;
00046 int sample_size;
00047 int stride;
00048 int read_only;
00049 int allow_realloc;
00050 int ptr_align;
00051 int samples_align;
00052 const char *name;
00053 } AudioData;
00054
00055 int ff_audio_data_set_channels(AudioData *a, int channels);
00056
00076 int ff_audio_data_init(AudioData *a, void **src, int plane_size, int channels,
00077 int nb_samples, enum AVSampleFormat sample_fmt,
00078 int read_only, const char *name);
00079
00091 AudioData *ff_audio_data_alloc(int channels, int nb_samples,
00092 enum AVSampleFormat sample_fmt,
00093 const char *name);
00094
00104 int ff_audio_data_realloc(AudioData *a, int nb_samples);
00105
00113 void ff_audio_data_free(AudioData **a);
00114
00122 int ff_audio_data_copy(AudioData *out, AudioData *in);
00123
00136 int ff_audio_data_combine(AudioData *dst, int dst_offset, AudioData *src,
00137 int src_offset, int nb_samples);
00138
00147 void ff_audio_data_drain(AudioData *a, int nb_samples);
00148
00159 int ff_audio_data_add_to_fifo(AVAudioFifo *af, AudioData *a, int offset,
00160 int nb_samples);
00161
00171 int ff_audio_data_read_from_fifo(AVAudioFifo *af, AudioData *a, int nb_samples);
00172
00173 #endif