#include "samplefmt.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | SampleFmtInfo |
Functions | |
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. | |
enum AVSampleFormat | av_get_sample_fmt (const char *name) |
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error. | |
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 negative. | |
int | av_get_bytes_per_sample (enum AVSampleFormat sample_fmt) |
Return number of bytes per sample. | |
int | av_get_bits_per_sample_fmt (enum AVSampleFormat sample_fmt) |
int | av_samples_fill_arrays (uint8_t *pointers[8], int linesizes[8], uint8_t *buf, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int planar, int align) |
Fill channel data pointers and linesizes for samples with sample format sample_fmt. | |
int | av_samples_alloc (uint8_t *pointers[8], int linesizes[8], int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int planar, int align) |
Allocate a samples buffer for nb_samples samples, and fill pointers and linesizes accordingly. | |
Variables | |
static const SampleFmtInfo | sample_fmt_info [AV_SAMPLE_FMT_NB] |
this table gives more information about formats |
int av_get_bits_per_sample_fmt | ( | enum AVSampleFormat | sample_fmt | ) |
Definition at line 76 of file samplefmt.c.
Referenced by av_samples_fill_arrays(), and tta_decode_frame().
int av_get_bytes_per_sample | ( | enum AVSampleFormat | sample_fmt | ) |
Return number of bytes per sample.
sample_fmt | the sample format |
Definition at line 69 of file samplefmt.c.
Referenced by aac_decode_frame_int(), ac3_decode_frame(), atrac1_decode_frame(), audio_decode_frame(), av_audio_resample_init(), av_get_bits_per_sample_format(), dca_decode_frame(), decode_frame(), decode_init(), decode_tag(), do_audio_out(), libgsm_decode_frame(), mkv_write_tracks(), output_packet(), qcelp_decode_frame(), qdm2_decode_frame(), shorten_decode_frame(), sipr_decode_frame(), twin_decode_frame(), vmdaudio_decode_init(), and vorbis_decode_frame().
enum AVSampleFormat av_get_sample_fmt | ( | const char * | name | ) |
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error.
Definition at line 46 of file samplefmt.c.
Referenced by avcodec_get_sample_fmt(), and opt_audio_sample_fmt().
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 at line 39 of file samplefmt.c.
Referenced by audio_decode_frame(), av_audio_resample_init(), avcodec_get_sample_fmt_name(), avcodec_string(), choose_sample_fmt(), do_audio_out(), dprint_options(), ff_dlog_link(), and print_digraph().
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 negative.
buf | the buffer where to write the string | |
buf_size | the size of buf | |
sample_fmt | the number of the sample format to print the corresponding info string, or a negative value to print the corresponding header. |
Definition at line 56 of file samplefmt.c.
Referenced by avcodec_sample_fmt_string(), and opt_audio_sample_fmt().
int av_samples_alloc | ( | uint8_t * | pointers[8], | |
int | linesizes[8], | |||
int | nb_channels, | |||
int | nb_samples, | |||
enum AVSampleFormat | sample_fmt, | |||
int | planar, | |||
int | align | |||
) |
Allocate a samples buffer for nb_samples samples, and fill pointers and linesizes accordingly.
The allocated samples buffer has to be freed by using av_freep(&pointers[0]).
nb_channels | number of audio channels | |
nb_samples | number of samples per channel | |
planar | 1 if the samples layout is planar, 0 if packed, | |
align | the value to use for buffer size alignment |
Definition at line 113 of file samplefmt.c.
Referenced by avfilter_default_get_audio_buffer().
int av_samples_fill_arrays | ( | uint8_t * | pointers[8], | |
int | linesizes[8], | |||
uint8_t * | buf, | |||
int | nb_channels, | |||
int | nb_samples, | |||
enum AVSampleFormat | sample_fmt, | |||
int | planar, | |||
int | align | |||
) |
Fill channel data pointers and linesizes for samples with sample format sample_fmt.
The pointers array is filled with the pointers to the samples data: for planar, set the start point of each plane's data within the buffer, for packed, set the start point of the entire buffer only.
The linesize array is filled with the aligned size of each samples plane, that is linesize[i] will contain the linesize of the plane i, and will be zero for all the unused planes. All linesize values are equal.
pointers | array to be filled with the pointer for each plane, may be NULL | |
linesizes | array to be filled with the linesize, may be NULL | |
buf | the pointer to a buffer containing the samples | |
nb_samples | the number of samples in a single channel | |
planar | 1 if the samples layout is planar, 0 if it is packed | |
nb_channels | the number of channels |
Definition at line 83 of file samplefmt.c.
Referenced by av_samples_alloc().
const SampleFmtInfo sample_fmt_info[AV_SAMPLE_FMT_NB] [static] |
Initial value:
{ [AV_SAMPLE_FMT_U8] = { .name = "u8", .bits = 8 }, [AV_SAMPLE_FMT_S16] = { .name = "s16", .bits = 16 }, [AV_SAMPLE_FMT_S32] = { .name = "s32", .bits = 32 }, [AV_SAMPLE_FMT_FLT] = { .name = "flt", .bits = 32 }, [AV_SAMPLE_FMT_DBL] = { .name = "dbl", .bits = 64 }, }
Definition at line 31 of file samplefmt.c.