FFmpeg
|
Audio sample format enumeration and related convenience functions. More...
Enumerations | |
enum | AVSampleFormat { AV_SAMPLE_FMT_NONE = -1, AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64P, AV_SAMPLE_FMT_NB } |
Audio sample formats. More... | |
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. More... | |
enum AVSampleFormat | av_get_sample_fmt (const char *name) |
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error. More... | |
enum AVSampleFormat | av_get_alt_sample_fmt (enum AVSampleFormat sample_fmt, int planar) |
Return the planar<->packed alternative form of the given sample format, or AV_SAMPLE_FMT_NONE on error. More... | |
enum AVSampleFormat | av_get_packed_sample_fmt (enum AVSampleFormat sample_fmt) |
Get the packed alternative form of the given sample format. More... | |
enum AVSampleFormat | av_get_planar_sample_fmt (enum AVSampleFormat sample_fmt) |
Get the planar alternative form of the given sample format. More... | |
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. More... | |
int | av_get_bytes_per_sample (enum AVSampleFormat sample_fmt) |
Return number of bytes per sample. More... | |
int | av_sample_fmt_is_planar (enum AVSampleFormat sample_fmt) |
Check if the sample format is planar. More... | |
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. More... | |
Audio sample format enumeration and related convenience functions.
enum AVSampleFormat |
Audio sample formats.
Definition at line 55 of file samplefmt.h.
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 51 of file samplefmt.c.
Referenced by audio_decode_frame(), audio_frame_cksum(), audio_thread(), av_opt_get(), avcodec_string(), config_input(), config_output(), config_props(), configure_audio_filters(), configure_input_audio_filter(), dprint_options(), draw_items(), encode_preinit_audio(), ff_all_formats(), ff_attributes_dump(), filter_frame(), get_format_from_sample_fmt(), init_audio(), init_filter(), init_filter_graph(), init_filters(), lavfi_read_header(), main(), opt_list(), pick_format(), print_digraph(), print_formats_internal(), print_link_prop(), show_frame(), show_stream(), and swr_init().
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 58 of file samplefmt.c.
Referenced by init(), new_stream_audio(), and set_string_sample_fmt().
enum AVSampleFormat av_get_alt_sample_fmt | ( | enum AVSampleFormat | sample_fmt, |
int | planar | ||
) |
Return the planar<->packed alternative form of the given sample format, or AV_SAMPLE_FMT_NONE on error.
If the passed sample_fmt is already in the requested planar/packed format, the format returned is the same as the input.
Definition at line 68 of file samplefmt.c.
enum AVSampleFormat av_get_packed_sample_fmt | ( | enum AVSampleFormat | sample_fmt | ) |
Get the packed alternative form of the given sample format.
If the passed sample_fmt is already in packed format, the format returned is the same as the input.
Definition at line 77 of file samplefmt.c.
Referenced by activate(), auto_matrix(), cmp_audio_fmts(), ff_volume_init_x86(), filter_frame(), get_fmt_score(), main(), swap_sample_fmts_on_filter(), swri_dither_init(), and volume_init().
enum AVSampleFormat av_get_planar_sample_fmt | ( | enum AVSampleFormat | sample_fmt | ) |
Get the planar alternative form of the given sample format.
If the passed sample_fmt is already in planar format, the format returned is the same as the input.
Definition at line 86 of file samplefmt.c.
Referenced by encode_preinit_audio(), swap_sample_fmts_on_filter(), and swr_init().
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 95 of file samplefmt.c.
Referenced by show_sample_fmts().
int av_get_bytes_per_sample | ( | enum AVSampleFormat | sample_fmt | ) |
Return number of bytes per sample.
sample_fmt | the sample format |
Definition at line 108 of file samplefmt.c.
Referenced by at_write_header(), audio_decode_frame(), av_samples_copy(), av_samples_get_buffer_size(), av_samples_set_silence(), available_samples(), avcodec_string(), celt_frame_setup_input(), config_filter(), config_input(), config_output(), copy_samples(), decode(), decode_frame(), decode_init(), enc_open(), encode_preinit_audio(), fdk_aac_decode_frame(), ff_framequeue_skip_samples(), ff_planar_sample_fmts(), ffat_create_decoder(), ffat_decode(), ffat_encode_callback(), ffat_init_encoder(), filter_frame(), flac_set_bps(), ftr_decode_frame(), get_fmt_score(), init_sample_buffers(), lavfi_read_packet(), libopus_encode(), libopus_encode_init(), mf_a_avframe_to_sample(), mkv_write_track(), offset_audio(), output_audio_frame(), print_audio_bytes(), process_output(), pulse_write_frame(), pulse_write_header(), pulse_write_packet(), resample_init(), set_audiodata_fmt(), setup_array(), shift(), spawn_empty_frame(), swap_sample_fmts_on_filter(), swr_init(), swri_dither_init(), swri_rematrix(), vmdaudio_decode_init(), wavpack_decode_block(), wv_unpack_mono(), wv_unpack_stereo(), and yae_reset().
int av_sample_fmt_is_planar | ( | enum AVSampleFormat | sample_fmt | ) |
Check if the sample format is planar.
sample_fmt | the sample format to inspect |
Definition at line 114 of file samplefmt.c.
Referenced by activate(), at_write_header(), audio_frame_cksum(), audio_write_frame(), av_audio_fifo_alloc(), av_frame_get_plane_buffer(), av_samples_alloc_array_and_samples(), av_samples_copy(), av_samples_fill_arrays(), av_samples_get_buffer_size(), av_samples_set_silence(), available_samples(), avcodec_fill_audio_frame(), config_output(), ff_frame_pool_audio_init(), ff_framequeue_skip_samples(), ff_planar_sample_fmts(), filter_frame(), flac_set_bps(), frame_copy_audio(), ftr_init(), get(), get_audio_buffer(), get_fmt_score(), main(), offset_audio(), print_audio_bytes(), process_output(), pulse_write_frame(), read_samples_from_audio_fifo(), set(), set_audiodata_fmt(), setup_array(), shift(), and update_frame_pool().
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.
[out] | linesize | calculated linesize, may be NULL |
nb_channels | the number of channels | |
nb_samples | the number of samples in a single channel | |
sample_fmt | the sample format | |
align | buffer size alignment (0 = default, 1 = no alignment) |
Definition at line 121 of file samplefmt.c.
Referenced by allocate_buffers(), audio_decode_frame(), audio_open(), av_audio_fifo_alloc(), av_audio_fifo_realloc(), av_samples_alloc(), av_samples_fill_arrays(), avcodec_fill_audio_frame(), ff_frame_pool_audio_init(), get_audio_buffer(), main(), tak_decode_frame(), and update_frame_pool().