Libav
samplefmt.h
Go to the documentation of this file.
1 /*
2  * This file is part of Libav.
3  *
4  * Libav is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * Libav is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with Libav; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef AVUTIL_SAMPLEFMT_H
20 #define AVUTIL_SAMPLEFMT_H
21 
22 #include <stdint.h>
23 
24 #include "avutil.h"
25 #include "attributes.h"
26 
68 
74 
76 };
77 
83 
88 enum AVSampleFormat av_get_sample_fmt(const char *name);
89 
100 
111 
124 char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
125 
134 
142 
153 int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
154  enum AVSampleFormat sample_fmt, int align);
155 
189 int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
190  const uint8_t *buf,
191  int nb_channels, int nb_samples,
192  enum AVSampleFormat sample_fmt, int align);
193 
211 int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
212  int nb_samples, enum AVSampleFormat sample_fmt, int align);
213 
225 int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
226  int src_offset, int nb_samples, int nb_channels,
228 
238 int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
240 
245 #endif /* AVUTIL_SAMPLEFMT_H */
float, planar
Definition: samplefmt.h:72
Number of sample formats. DO NOT USE if linking dynamically.
Definition: samplefmt.h:75
double, planar
Definition: samplefmt.h:73
uint8_t
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
Definition: samplefmt.c:47
const char * name
enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt)
Get the planar alternative form of the given sample format.
Definition: samplefmt.c:73
signed 32 bits
Definition: samplefmt.h:65
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
Definition: samplefmt.c:101
int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
Fill an audio buffer with silence.
Definition: samplefmt.c:206
unsigned 8 bits
Definition: samplefmt.h:63
signed 32 bits, planar
Definition: samplefmt.h:71
unsigned 8 bits, planar
Definition: samplefmt.h:69
int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
Allocate a samples buffer for nb_samples samples, and fill data pointers and linesize accordingly...
Definition: samplefmt.c:162
sample_fmt
Definition: avconv_filter.c:68
AVSampleFormat
Audio Sample Formats.
Definition: samplefmt.h:61
external API header
int av_samples_copy(uint8_t **dst, uint8_t *const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
Copy samples from src to dst.
Definition: samplefmt.c:187
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
Get the required buffer size for the given audio parameters.
Definition: samplefmt.c:108
enum AVSampleFormat av_get_sample_fmt(const char *name)
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error.
Definition: samplefmt.c:54
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
Definition: samplefmt.c:95
Macro definitions for various function/variable attributes.
enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt)
Get the packed alternative form of the given sample format.
Definition: samplefmt.c:64
signed 16 bits
Definition: samplefmt.h:64
int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, const uint8_t *buf, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
Fill channel data pointers and linesize for samples with sample format sample_fmt.
Definition: samplefmt.c:140
char * av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt)
Generate a string corresponding to the sample format with sample_fmt, or a header if sample_fmt is ne...
Definition: samplefmt.c:82
signed 16 bits, planar
Definition: samplefmt.h:70
int nb_channels