#include "common.h"
#include "samplefmt.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
Definition at line 47 of file samplefmt.c.
Referenced by audio_decode_frame(), audio_encode_example(), av_opt_get(), avcodec_open2(), avcodec_string(), avresample_open(), choose_sample_fmt(), config_output(), config_props(), configure_input_audio_filter(), decode_audio(), dprint_options(), ff_audio_convert_set_func(), ff_audio_mix_alloc(), ff_audio_mix_set_func(), ff_audio_resample_init(), ff_dither_alloc(), ff_tlog_link(), filter_frame(), get_format_from_sample_fmt(), init_filters(), lavfi_read_header(), main(), mix_function_init(), opt_list(), print_digraph(), print_link_prop(), show_frame(), show_stream(), and swr_init().
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error.
Definition at line 54 of file samplefmt.c.
Referenced by av_opt_set(), ff_parse_sample_format(), init(), init_audio(), and new_audio_stream().
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 64 of file samplefmt.c.
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 73 of file samplefmt.c.
Referenced by auto_matrix(), cmp_audio_fmts(), ff_audio_convert_set_func(), ff_dither_alloc(), ff_volume_init_x86(), filter_frame(), main(), PUT_FUNC(), swap_sample_fmts_on_filter(), swri_dither_init(), and volume_init().
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 82 of file samplefmt.c.
Referenced by avcodec_open2(), avresample_open(), config_output(), swap_sample_fmts_on_filter(), and swr_init().
Generate a string corresponding to the sample format with sample_fmt, or a header if sample_fmt is negative.
Definition at line 91 of file samplefmt.c.
Referenced by show_sample_fmts().
Return number of bytes per sample.
Definition at line 104 of file samplefmt.c.
Referenced by audio_decode_frame(), av_samples_copy(), av_samples_get_buffer_size(), av_samples_set_silence(), avresample_open(), buffer_offset(), config_input(), config_output(), copy_samples(), decode_frame(), decode_init(), decode_packet(), fdk_aac_decode_frame(), ff_audio_data_alloc(), ff_audio_data_init(), ff_audio_resample_init(), ff_dither_alloc(), filter_frame(), flac_set_bps(), init_sample_buffers(), lavfi_read_packet(), libopus_encode(), libopus_encode_init(), mkv_write_tracks(), pulse_write_packet(), resample_init(), sdl_audio_callback(), set_audiodata_fmt(), setup_array(), shift(), swap_sample_fmts_on_filter(), swri_dither_init(), swri_rematrix(), vmdaudio_decode_init(), wavpack_decode_block(), and yae_reset().
Definition at line 111 of file samplefmt.c.
Check if the sample format is planar.
Definition at line 118 of file samplefmt.c.
Referenced by alac_decode_init(), allocate_buffers(), 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(), avcodec_encode_audio2(), avcodec_fill_audio_frame(), avresample_open(), buffer_offset(), calc_ptr_alignment(), config_output(), decode_element(), ff_audio_data_alloc(), ff_audio_data_init(), ff_planar_sample_fmts(), filter_frame(), flac_set_bps(), get(), get_audio_buffer(), get_buffer_internal(), main(), set(), set_audiodata_fmt(), setup_array(), shift(), and update_frame_pool().
Get the required buffer size for the given audio parameters.
Definition at line 125 of file samplefmt.c.
Referenced by allocate_buffers(), audio_decode_example(), audio_decode_frame(), audio_encode_example(), av_audio_fifo_alloc(), av_audio_fifo_realloc(), av_samples_alloc(), av_samples_fill_arrays(), avcodec_fill_audio_frame(), dca_decode_frame(), ff_audio_data_realloc(), get_audio_buffer(), main(), open_audio(), sdl_audio_callback(), stream_component_open(), tak_decode_frame(), update_frame_pool(), and write_audio_frame().
Fill plane data pointers and linesize for samples with sample format sample_fmt.
The audio_data array is filled with the pointers to the samples data planes: for planar, set the start point of each channel's data within the buffer, for packed, set the start point of the entire buffer only.
The value pointed to by linesize is set to the aligned size of each channel's data buffer for planar layout, or to the aligned size of the buffer for all channels for packed layout.
The buffer in buf must be big enough to contain all the samples (use av_samples_get_buffer_size() to compute its minimum size), otherwise the audio_data pointers will point to invalid data.
Definition at line 155 of file samplefmt.c.
Referenced by allocate_buffers(), av_samples_alloc(), avcodec_fill_audio_frame(), dca_decode_frame(), ff_audio_data_realloc(), main(), and tak_decode_frame().
Allocate a samples buffer for nb_samples samples, and fill data pointers and linesize accordingly.
The allocated samples buffer can be freed by using av_freep(&audio_data[0]) Allocated data will be initialized to silence.
Definition at line 181 of file samplefmt.c.
Referenced by av_samples_alloc_array_and_samples(), ff_audio_data_realloc(), main(), and write_audio_frame().
Allocate a data pointers array, samples buffer for nb_samples samples, and fill data pointers and linesize accordingly.
This is the same as av_samples_alloc(), but also allocates the data pointers array.
Definition at line 210 of file samplefmt.c.
Referenced by config_output(), main(), and open_audio().
Copy samples from src to dst.
Definition at line 225 of file samplefmt.c.
Referenced by av_frame_make_writable(), av_frame_ref(), avcodec_decode_audio4(), ff_filter_frame_framed(), ff_filter_frame_needs_framing(), pad_last_frame(), and return_audio_frame().
Fill an audio buffer with silence.
Definition at line 249 of file samplefmt.c.
Referenced by av_samples_alloc(), ff_audio_data_copy(), ff_audio_mix(), ff_default_get_audio_buffer(), filter_frame(), pad_last_frame(), push_samples(), request_frame(), return_audio_frame(), and send_silence().
this table gives more information about formats
Definition at line 34 of file samplefmt.c.