|
|
@ -79,19 +79,32 @@ typedef struct EarwaxContext { |
|
|
|
AVFrame *frame[2]; |
|
|
|
AVFrame *frame[2]; |
|
|
|
} EarwaxContext; |
|
|
|
} EarwaxContext; |
|
|
|
|
|
|
|
|
|
|
|
static int query_formats(AVFilterContext *ctx) |
|
|
|
static int query_formats(const AVFilterContext *ctx, |
|
|
|
|
|
|
|
AVFilterFormatsConfig **cfg_in, |
|
|
|
|
|
|
|
AVFilterFormatsConfig **cfg_out) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
static const enum AVSampleFormat formats[] = { |
|
|
|
|
|
|
|
AV_SAMPLE_FMT_S16P, |
|
|
|
|
|
|
|
AV_SAMPLE_FMT_NONE, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
static const AVChannelLayout layouts[] = { |
|
|
|
|
|
|
|
AV_CHANNEL_LAYOUT_STEREO, |
|
|
|
|
|
|
|
{ .nb_channels = 0 }, |
|
|
|
|
|
|
|
}; |
|
|
|
static const int sample_rates[] = { 44100, -1 }; |
|
|
|
static const int sample_rates[] = { 44100, -1 }; |
|
|
|
|
|
|
|
|
|
|
|
int ret; |
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
|
|
AVFilterFormats *formats = NULL; |
|
|
|
ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats); |
|
|
|
AVFilterChannelLayouts *layout = NULL; |
|
|
|
if (ret < 0) |
|
|
|
|
|
|
|
return ret; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ret = ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates); |
|
|
|
|
|
|
|
if (ret < 0) |
|
|
|
|
|
|
|
return ret; |
|
|
|
|
|
|
|
|
|
|
|
if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_S16P )) < 0 || |
|
|
|
ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); |
|
|
|
(ret = ff_set_common_formats (ctx , formats )) < 0 || |
|
|
|
if (ret < 0) |
|
|
|
(ret = ff_add_channel_layout (&layout , &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) < 0 || |
|
|
|
|
|
|
|
(ret = ff_set_common_channel_layouts (ctx , layout )) < 0 || |
|
|
|
|
|
|
|
(ret = ff_set_common_samplerates_from_list(ctx, sample_rates)) < 0) |
|
|
|
|
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
@ -230,5 +243,5 @@ const AVFilter ff_af_earwax = { |
|
|
|
.uninit = uninit, |
|
|
|
.uninit = uninit, |
|
|
|
FILTER_INPUTS(earwax_inputs), |
|
|
|
FILTER_INPUTS(earwax_inputs), |
|
|
|
FILTER_OUTPUTS(ff_audio_default_filterpad), |
|
|
|
FILTER_OUTPUTS(ff_audio_default_filterpad), |
|
|
|
FILTER_QUERY_FUNC(query_formats), |
|
|
|
FILTER_QUERY_FUNC2(query_formats), |
|
|
|
}; |
|
|
|
}; |
|
|
|