FFmpeg
Loading...
Searching...
No Matches
aeval.c File Reference

eval audio source More...

#include "config_components.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/eval.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"
#include "formats.h"

Go to the source code of this file.

Data Structures

struct  EvalContext
 

Macros

#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define ADD_EXPRESSION(expr_)
 
#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Enumerations

enum  var_name {
  VAR_CH , VAR_N , VAR_NB_IN_CHANNELS , VAR_NB_OUT_CHANNELS ,
  VAR_T , VAR_S , VAR_VARS_NB
}
 

Functions

static double val (void *priv, double ch)
 
 AVFILTER_DEFINE_CLASS (aevalsrc)
 
static int parse_channel_expressions (AVFilterContext *ctx, int expected_nb_channels)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *outlink)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static int activate (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (aeval)
 
static int aeval_query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static int aeval_config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const char *const var_names []
 
static double(*const aeval_func1 [])(void *, double) = { val, NULL }
 
static const char *const aeval_func1_names [] = { "val", NULL }
 
static const AVOption aevalsrc_options []
 
static const AVOption aeval_options []
 

Detailed Description

eval audio source

Definition in file aeval.c.

Macro Definition Documentation

◆ OFFSET [1/2]

#define OFFSET ( x)
Value:
offsetof(EvalContext, x)

Definition at line 86 of file aeval.c.

◆ FLAGS [1/2]

Definition at line 87 of file aeval.c.

◆ ADD_EXPRESSION

#define ADD_EXPRESSION ( expr_)
Value:
do { \
ret = av_dynarray_add_nofree(&eval->expr, \
&eval->nb_channels, NULL); \
if (ret < 0) \
goto end; \
eval->expr[eval->nb_channels-1] = NULL; \
ret = av_expr_parse(&eval->expr[eval->nb_channels - 1], expr_, \
NULL, NULL, 0, ctx); \
if (ret < 0) \
goto end; \
} while (0)
#define NULL
Definition coverity.c:32
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
Definition eval.c:735
int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem)
Add an element to a dynamic array.
Definition mem.c:313
static const char *const var_names[]
Definition noise.c:30
static AVFormatContext * ctx
Definition movenc.c:49
static double(*const func1[])(void *, double)
Definition vf_rotate.c:182
static const char *const func1_names[]
Definition vf_rotate.c:188

Referenced by parse_channel_expressions().

◆ OFFSET [2/2]

#define OFFSET ( x)
Value:
offsetof(EvalContext, x)

Definition at line 86 of file aeval.c.

◆ FLAGS [2/2]

Definition at line 87 of file aeval.c.

Enumeration Type Documentation

◆ var_name

enum var_name
Enumerator
VAR_CH 
VAR_N 
VAR_NB_IN_CHANNELS 
VAR_NB_OUT_CHANNELS 
VAR_T 
VAR_S 
VAR_VARS_NB 

Definition at line 48 of file aeval.c.

Function Documentation

◆ val()

static double val ( void * priv,
double ch )
static

Definition at line 77 of file aeval.c.

Referenced by aa_read_header(), ac_uncompress(), add_entry1(), add_level(), add_opt(), addroi_config_input(), aic_decode_coeffs(), alac_linear_predictor(), aligned(), all_same(), amdl_decode_int(), amdl_update_prob(), amf_get_property_buffer(), amf_set_property_buffer(), aom_codecctl(), apac_decode(), apcm_dequant_add(), apply_param_change(), apply_prof(), apply_prof_uni(), apply_prof_uni_w(), apply_sign(), arith2_get_number(), arith2_get_prob(), arith_get_bits(), arith_get_number(), arith_get_prob(), ascii_to_wc(), asmgen_setup_unpack(), aura_decode_frame(), av_disposition_to_string(), av_freep(), av_opt_eval_double(), av_opt_eval_flags(), av_opt_eval_float(), av_opt_eval_int(), av_opt_eval_int64(), av_opt_eval_q(), av_opt_eval_uint(), av_opt_get_key_value(), av_opt_is_set_to_default(), av_opt_set(), av_opt_set_array(), av_opt_set_bin(), av_opt_set_defaults2(), av_opt_set_dict_val(), av_opt_set_double(), av_opt_set_int(), av_opt_set_q(), av_opt_set_video_rate(), av_packet_unpack_dictionary(), av_read_image_line2(), av_reallocp(), av_reallocp_array(), av_small_strptime(), av_sqrt_sf(), av_ts_make_time_string2(), av_write_image_line2(), avio_rb16(), avio_rb24(), avio_rb32(), avio_rb64(), avio_rl16(), avio_rl24(), avio_rl32(), avio_rl64(), avio_wb16(), avio_wb24(), avio_wb32(), avio_wb64(), avio_wl16(), avio_wl24(), avio_wl32(), avio_wl64(), avisynth_open_file(), avtext_print_integer(), avtext_print_string(), avtext_print_unit_double(), avtext_print_unit_integer(), aw_pulse_set1(), batch_assign(), binkb_get_value(), block_fill(), bound(), bswap(), build_chord_set(), build_vlc(), build_vlc(), bytestream2_get_levarint(), calc_add_mv(), camera_status_string(), cdtoons_render_sprite(), celt_cwrsi(), cfhd_init(), check_mc(), check_opt_bitexact(), check_scalarproduct_and_madd_int16(), check_scalarproduct_and_madd_int32(), checkasm_clear16(), checkasm_clear8(), chomp3(), chomp6(), clip(), clip_with_log(), codecctl_int(), codecctl_int(), compat_sem_init(), compile(), compress_alpha(), compute_gammaval(), compute_gammaval709(), config_input(), config_output(), config_props(), constpx(), convert(), convert_to_aarch64_impl(), copy_8bit_value_width16_msa(), copy_8bit_value_width8_msa(), copyadd_block(), count_idx(), count_vc2_ue_uint(), create_default_qtables(), create_entry(), date_get_num(), dc_127_16x16_c(), dc_127_32x32_c(), dc_127_4x4_c(), dc_127_8x8_c(), dc_128_16x16_c(), dc_128_32x32_c(), dc_128_4x4_c(), dc_128_8x8_c(), dc_129_16x16_c(), dc_129_32x32_c(), dc_129_4x4_c(), dc_129_8x8_c(), dds_decode(), dec_bark_env(), dec_bark_env(), dec_gain(), DECL_FUNC(), DECL_FUNC(), decode_0(), decode_aiff_header(), decode_block(), decode_block(), decode_block(), decode_block_progressive(), decode_block_refinement(), decode_bmv_frame(), decode_cblk(), decode_clnpass(), decode_coeff(), decode_coeff(), decode_coeffs_b_generic(), decode_const_block_data(), decode_dc_progressive(), decode_dct(), decode_exp_lsp(), decode_filt_coeffs(), decode_filter(), decode_fixed_sparse(), decode_frame(), decode_frame(), decode_frame(), decode_frame(), decode_huffman2(), decode_i_block(), decode_pivot(), decode_pixel(), decode_qu_spectra(), decode_row(), decode_scale_factors(), decode_static1(), decode_static2(), decode_static3(), decode_sym(), decode_sym_565(), decode_usac_stereo_cplx(), decompress_68(), delta_decode(), dequantization_float(), dequantization_int(), dequantization_int_97(), dnxhd_mb_var_thread(), do_hsvhold16_slice(), do_hsvhold_slice(), do_hsvkey16_slice(), do_hsvkey_pixel(), do_hsvkey_slice(), dss_sp_get_normalize_bits(), ebml_writer_add_float(), ebml_writer_add_sint(), ebml_writer_add_uid(), ebml_writer_add_uint(), ebml_writer_elem_write(), enc_stats_init(), encode_block(), encode_block(), encode_color_spec(), encode_float32_remap(), encode_float32_remap_segment(), encode_frame(), encode_vlc_codeword(), encode_vlc_codeword(), error_state_callback_string(), estimate_sid_gain(), estimate_vlc(), extend_code(), fast_malloc(), ff_aac_ac_decode(), ff_aac_huff_dec_reshape(), ff_amf_read_number(), ff_amf_write_bool(), ff_amf_write_number(), ff_amr_set_fixed_gain(), ff_ape_parse_tag(), ff_celp_lp_synthesis_filterf(), ff_clean_h263_qscales(), ff_decode_preinit(), ff_detect_range16_impl_c(), ff_detect_range_impl_c(), ff_dirac_golomb_read_16bit(), ff_dirac_golomb_read_32bit(), ff_draw_color(), ff_fill_block16_msa(), ff_fill_block8_msa(), ff_h263_decode_motion(), ff_h263_encode_motion(), ff_h264_build_ref_list(), ff_h264_decode_mb_cabac(), ff_h264_decode_mb_cavlc(), ff_hashtable_get(), ff_hashtable_set(), ff_hscale_16_to_15_lasx(), ff_hscale_16_to_19_lasx(), ff_hscale_8_to_15_lasx(), ff_hscale_8_to_19_lasx(), ff_jpeg2000_decode_htj2k(), ff_mjpeg_encode_dc(), ff_mjpeg_encode_huffman_close(), ff_mjpeg_encode_huffman_increment(), ff_mjpeg_find_marker(), ff_mss12_model_update(), ff_nut_reset_ts(), ff_opus_rc_enc_cdf(), ff_opus_rc_enc_laplace(), ff_opus_rc_enc_log(), ff_opus_rc_enc_uint(), ff_opus_rc_enc_uint_step(), ff_opus_rc_put_raw(), ff_rm_read_mdpr_codecdata(), ff_rtmp_packet_dump(), ff_snappy_uncompress(), ff_sws_apply_op_q(), ff_tag_tree_zero(), ff_tee_parse_slave_options(), ff_text_r8(), ff_tx_mdct_naive_inv(), ff_vdpau_common_end_frame(), ff_vk_exec_add_dep_wait_sem(), ff_vp8_luma_dc_wht_dc_mmi(), ffintscan(), ffio_read_varlen(), ffio_write_leb(), fguv_32x32xn_c(), fill_rectangle(), fillPlane(), fillPlane(), filter_frame(), filter_frame(), filter_opt_apply(), find_next_start_code(), format_child_class_iterate(), frac_init(), frame_header_obu(), g2m_load_cursor(), gather_input(), get_aiff_header(), get_bool_name(), get_cabac_bypass_sign(), get_cabac_bypass_sign_loongarch(), get_cabac_bypass_sign_mips(), get_coeff(), get_coeff_bits(), get_content_type(), get_content_url(), get_dimension(), get_escaped_value(), get_geokey_val(), get_master_clock(), get_mvdata_interlaced(), get_opcodes(), get_output_dimension(), get_prediction(), get_utf8(), get_v_length(), get_val_from_nodes_tab(), h261_decode_gob_header(), h261_encode_motion(), h263_decode_gob_header(), hdr_decode_frame(), heap_sift(), hevc_idct_dc_16x16_msa(), hevc_idct_dc_32x32_msa(), hevc_idct_dc_4x4_msa(), hevc_idct_dc_8x8_msa(), hevc_intra_pred_dc_16x16_msa(), hevc_intra_pred_dc_8x8_msa(), hls_slice_header(), hScale16To15_c(), hScale16To19_c(), hScale8To15_c(), hScale8To19_c(), hScale_real(), huff_data_1d(), init(), init_mv_penalty(), init_report(), int_from_list_or_default(), interpolate_pchip(), intersection_word(), intra_pred(), ivi_decode_coded_blocks(), ivr_read_header(), jpeg2000_decode_mag_sgn(), jpg_decode_block(), kmvc_decode_inter_8x8(), kmvc_decode_intra_8x8(), l1_unscale(), l2_unscale_group(), laf_read_packet(), lag_decode_prob(), lag_get_rac(), latm_parse_packet(), lfo_get(), lfo_get_value(), limited_kth_order_egk_decode(), loco_decode_plane(), loco_get_rice_param(), loco_update_rice_param(), lowpass_prediction(), lpc_prediction(), ls_encode_regular(), ls_encode_runterm(), lsp2polyf(), mace_decode_frame(), main(), main(), make_gauss_kernel(), match_stream_specifier(), max_nbits(), mdl64_decode(), media_status_string(), memset_bpc(), mjpeg_decode_dc(), mjpeg_encode_coef(), mode1112(), mode19(), mode20(), model256_update(), model_update(), mov_parse_stsd_data(), mov_parse_uuid_spherical(), mov_read_custom(), mov_read_udta_string(), mp3_update_xing(), mpeg_decode_mb(), mpeg_decode_motion(), mpegaudiodec_common_init_static(), mpegts_write_pes(), mpegts_write_pmt(), mpegts_write_sdt(), msmpeg4_encode_mb(), msmpeg4v2_decode_motion(), msmpeg4v2_encode_motion(), msmpeg4v34_decode_mb(), mss4_decode_dct(), mux_log_debug_ts(), mxf_get_wrapping_kind(), myrnd(), myrnd(), nearest_alive(), nelly_decode_block(), nvenc_check_cap(), of_add_metadata(), ogm_chapter(), old_codec45(), on2avc_decode_pairs(), on2avc_decode_quads(), opt_get_array(), opt_set_array(), opt_set_elem(), pack_fcb_param(), parse_cc_stream_mapstring(), parse_content_length(), parse_fmtp(), parse_heatmaps(), parse_int(), parse_key_value_pair(), parse_key_value_pair(), parse_m3d(), parse_manifest(), parse_manifest_representation(), parse_manifest_segmenttimeline(), parse_programinformation(), parse_psfile(), parse_section_header(), parse_variant_stream_mapstring(), parseu(), pcm_decode(), pcm_read_header(), pick_4(), pick_5(), pick_6(), pick_8(), pixel_from_q64(), pixel_is_1s(), pixel_is_repeating(), pop(), pred_angular_v(), predict_intra(), print_alpha_mode(), print_chroma_location(), print_color_range(), print_color_space(), print_color_trc(), print_primaries(), print_threestate(), pulse_audio_sink_input_cb(), pulse_stream_writable(), put16(), put_bits(), put_ebml_float(), put_ebml_uint(), put_payload_header(), put_s(), put_scaled(), put_tt(), put_uni_luma_h(), put_uni_luma_hv(), put_uni_luma_v(), put_uni_w_scaled(), put_v(), put_vc2_ue_uint(), put_vc2_ue_uint_inline(), qpeg_decode_inter(), quant_array_idx(), quantize_pcm(), rac_get_bits(), rac_get_model256_sym(), rac_get_model_sym(), rasm_op_imm(), read_coeffs_coarse(), read_len_table(), read_qp_offset(), read_scalefactors(), read_table(), realloc_alpha_uv(), record_block(), refine_full(), refine_residual(), resample_common_TMPL(), resample_linear_TMPL(), ringbuf_float_at(), rl2_rle_decode(), run_implementation(), sdt_cb(), sender_thread(), separate_output_names(), set_frame_data(), set_meta(), set_meta(), set_param(), set_src_position(), set_string(), set_string_binary(), set_string_bool(), set_string_channel_layout(), set_string_color(), set_string_dict(), set_string_fmt(), set_string_image_size(), set_string_number(), set_string_pixel_fmt(), set_string_sample_fmt(), set_string_video_rate(), setup_bumping(), setup_pps(), sgi_rle_encode(), sign_extend(), sign_extend64(), sint_size(), smacker_decode_bigtree(), smka_decode_frame(), snappy_copy1(), snappy_copy2(), snappy_copy4(), snappy_literal(), solve_shuffle(), spdif_put_16(), spi_OpConstantDouble(), spi_OpConstantFloat(), spi_OpConstantInt(), spi_OpConstantInt64(), spi_OpConstantUInt(), spi_OpConstantUInt64(), square_root(), store_table(), tag_tree_decode(), tdsc_load_cursor(), test_separators(), tiff_decode_tag(), tm2_get_token(), tnput(), translate_dither_op(), tscc2_decode_frame(), tscc2_decode_mb(), twinvq_memset_float(), uint_size(), union_word(), unpack_alpha(), unquant_block(), unsharp_opencl_make_filter_params(), update_metadata(), update_model1_to_2(), update_model1_to_4(), update_model1_to_5(), update_model2_to_3(), update_stats(), url_alloc_for_protocol(), utf8len(), v210_enc_TMPL(), v210_planar_pack_10_c(), v210_planar_pack_8_c(), v210_planar_unpack_c(), v4l2_prepare_encoder(), val_in_array(), vble_restore_plane(), vble_unpack(), vc1_decode_b_mb(), vc1_decode_b_mb_intfi(), vc1_decode_b_mb_intfr(), vc1_decode_i_blocks(), vc1_decode_i_blocks_adv(), vc1_decode_p_mb(), vc1_decode_p_mb_intfi(), vc1_decode_p_mb_intfr(), vdpau_av1_decode_slice(), vdpau_av1_end_frame(), vdpau_h264_decode_slice(), vdpau_h264_end_frame(), vdpau_hevc_decode_slice(), vdpau_hevc_end_frame(), vdpau_mpeg_decode_slice(), vdpau_vc1_decode_slice(), vdpau_vp9_decode_slice(), vdpau_vp9_end_frame(), vorbis_floor1_decode(), vorbisfloat2float(), vp6_get_nb_null(), vp9_idct8x8_1_add_lsx(), vp9_idct8x8_1_add_msa(), wavesynth_synth_sample(), wavpack_decode_block(), wma_decode_block(), wmv2_decode_mb(), wmv2_encode_mb(), wp_exp2(), wp_log2(), write_pts(), write_sm_data(), write_utf8(), X264_init(), xan_decode_chroma(), xan_huffman_decode(), xbm_decode_frame(), xiph_lacing_16bit(), xiph_lacing_full(), xwd_encode_frame(), yuv2msbplaneX_10_c_template(), yuv2NBPS(), yuv2p01xl1_c(), yuv2p01xlX_c(), yuv2plane1_16_c_template(), yuv2plane1_8_c(), yuv2plane1_float(), yuv2plane1_float_bswap_c_template(), yuv2plane1_float_c_template(), yuv2planeX_10_c_template(), yuv2planeX_16_c_template(), yuv2planeX_8_16(), yuv2planeX_8_c(), yuv2planeX_8_lasx(), yuv2planeX_8_ref(), yuv2planeX_float_bswap_c_template(), yuv2planeX_float_c_template(), and zero_extend().

◆ AVFILTER_DEFINE_CLASS() [1/2]

AVFILTER_DEFINE_CLASS ( aevalsrc )

◆ parse_channel_expressions()

static int parse_channel_expressions ( AVFilterContext * ctx,
int expected_nb_channels )
static

Definition at line 104 of file aeval.c.

Referenced by aeval_config_output(), and init().

◆ init()

static av_cold int init ( AVFilterContext * ctx)
static

Definition at line 173 of file aeval.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 211 of file aeval.c.

◆ config_props()

static int config_props ( AVFilterLink * outlink)
static

Definition at line 225 of file aeval.c.

◆ query_formats()

static int query_formats ( const AVFilterContext * ctx,
AVFilterFormatsConfig ** cfg_in,
AVFilterFormatsConfig ** cfg_out )
static

Definition at line 246 of file aeval.c.

◆ activate()

static int activate ( AVFilterContext * ctx)
static

Definition at line 267 of file aeval.c.

◆ AVFILTER_DEFINE_CLASS() [2/2]

AVFILTER_DEFINE_CLASS ( aeval )

◆ aeval_query_formats()

static int aeval_query_formats ( const AVFilterContext * ctx,
AVFilterFormatsConfig ** cfg_in,
AVFilterFormatsConfig ** cfg_out )
static

Definition at line 350 of file aeval.c.

◆ aeval_config_output()

static int aeval_config_output ( AVFilterLink * outlink)
static

Definition at line 381 of file aeval.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * in )
static

Definition at line 410 of file aeval.c.

Variable Documentation

◆ var_names

const char* const var_names[]
static
Initial value:
= {
"ch",
"n",
"nb_in_channels",
"nb_out_channels",
"t",
"s",
}

Definition at line 38 of file aeval.c.

◆ aeval_func1

double(*const aeval_func1[])(void *, double) ( void * ,
double  ) = { val, NULL }
static

Definition at line 83 of file aeval.c.

Referenced by parse_channel_expressions().

◆ aeval_func1_names

const char* const aeval_func1_names[] = { "val", NULL }
static

Definition at line 84 of file aeval.c.

Referenced by parse_channel_expressions().

◆ aevalsrc_options

const AVOption aevalsrc_options[]
static
Initial value:
= {
{ "exprs", "set the '|'-separated list of channels expressions", OFFSET(exprs), AV_OPT_TYPE_STRING, {.str = NULL}, .flags = FLAGS },
{ "nb_samples", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 1024}, 0, INT_MAX, FLAGS },
{ "n", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.i64 = 1024}, 0, INT_MAX, FLAGS },
{ "sample_rate", "set the sample rate", OFFSET(sample_rate_str), AV_OPT_TYPE_STRING, {.str = "44100"}, 0, 0, FLAGS },
{ "s", "set the sample rate", OFFSET(sample_rate_str), AV_OPT_TYPE_STRING, {.str = "44100"}, 0, 0, FLAGS },
{ "duration", "set audio duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },
{ "d", "set audio duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },
{ "channel_layout", "set channel layout", OFFSET(chlayout_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
{ "c", "set channel layout", OFFSET(chlayout_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
{ NULL }
}
#define FLAGS
Definition cmdutils.c:598
#define OFFSET(x)
static int64_t duration
Definition ffplay.c:330
@ AV_OPT_TYPE_DURATION
Underlying C type is int64_t.
Definition opt.h:318
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275

Definition at line 89 of file aeval.c.

◆ aeval_options

const AVOption aeval_options[]
static
Initial value:
= {
{ "exprs", "set the '|'-separated list of channels expressions", OFFSET(exprs), AV_OPT_TYPE_STRING, {.str = NULL}, .flags = FLAGS },
{ "channel_layout", "set channel layout", OFFSET(chlayout_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
{ "c", "set channel layout", OFFSET(chlayout_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
{ NULL }
}

Definition at line 341 of file aeval.c.