|
|
@ -130,9 +130,11 @@ static av_cold void uninit(AVFilterContext *ctx) |
|
|
|
av_freep(&vol->fdsp); |
|
|
|
av_freep(&vol->fdsp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int query_formats(AVFilterContext *ctx) |
|
|
|
static int query_formats(const AVFilterContext *ctx, |
|
|
|
|
|
|
|
AVFilterFormatsConfig **cfg_in, |
|
|
|
|
|
|
|
AVFilterFormatsConfig **cfg_out) |
|
|
|
{ |
|
|
|
{ |
|
|
|
VolumeContext *vol = ctx->priv; |
|
|
|
const VolumeContext *vol = ctx->priv; |
|
|
|
static const enum AVSampleFormat sample_fmts[][7] = { |
|
|
|
static const enum AVSampleFormat sample_fmts[][7] = { |
|
|
|
[PRECISION_FIXED] = { |
|
|
|
[PRECISION_FIXED] = { |
|
|
|
AV_SAMPLE_FMT_U8, |
|
|
|
AV_SAMPLE_FMT_U8, |
|
|
@ -154,15 +156,13 @@ static int query_formats(AVFilterContext *ctx) |
|
|
|
AV_SAMPLE_FMT_NONE |
|
|
|
AV_SAMPLE_FMT_NONE |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
int ret = ff_set_common_all_channel_counts(ctx); |
|
|
|
int ret; |
|
|
|
if (ret < 0) |
|
|
|
|
|
|
|
return ret; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ret = ff_set_common_formats_from_list(ctx, sample_fmts[vol->precision]); |
|
|
|
ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts[vol->precision]); |
|
|
|
if (ret < 0) |
|
|
|
if (ret < 0) |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
|
|
|
|
|
|
|
|
return ff_set_common_all_samplerates(ctx); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static inline void scale_samples_u8(uint8_t *dst, const uint8_t *src, |
|
|
|
static inline void scale_samples_u8(uint8_t *dst, const uint8_t *src, |
|
|
@ -480,7 +480,7 @@ const AVFilter ff_af_volume = { |
|
|
|
.uninit = uninit, |
|
|
|
.uninit = uninit, |
|
|
|
FILTER_INPUTS(avfilter_af_volume_inputs), |
|
|
|
FILTER_INPUTS(avfilter_af_volume_inputs), |
|
|
|
FILTER_OUTPUTS(avfilter_af_volume_outputs), |
|
|
|
FILTER_OUTPUTS(avfilter_af_volume_outputs), |
|
|
|
FILTER_QUERY_FUNC(query_formats), |
|
|
|
FILTER_QUERY_FUNC2(query_formats), |
|
|
|
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, |
|
|
|
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, |
|
|
|
.process_command = process_command, |
|
|
|
.process_command = process_command, |
|
|
|
}; |
|
|
|
}; |
|
|
|