History

avfilter/buffersink: replace init_opaque by init

The argument 'opaque' is always NULL since 0acf7e2 (2013), and avfilter_init_filter() was removed in 52067b3c0e (2016).

Zhao Zhili committed 6 years ago

Commit 07ffded1 parent 807e90d1 file · +2 −33Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/buffersink.c+2−33
@@ -199,20 +199,6 @@ MAKE_AVFILTERLINK_ACCESSOR(int , sample_rate ) · 198 unmodified lines
199199
200200 MAKE_AVFILTERLINK_ACCESSOR(AVBufferRef * , hw_frames_ctx )
201201
202−static av_cold int vsink_init(AVFilterContext *ctx, void *opaque)
203−{
204− BufferSinkContext *buf = ctx->priv;
205− AVBufferSinkParams *params = opaque;
206− int ret;
207−
208− if (params) {
209− if ((ret = av_opt_set_int_list(buf, "pix_fmts", params->pixel_fmts, AV_PIX_FMT_NONE, 0)) < 0)
210− return ret;
211− }
212−
213− return common_init(ctx);
214−}
215−
216202 #define CHECK_LIST_SIZE(field) \
217203 if (buf->field ## _size % sizeof(*buf->field)) { \
218204 av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \
@@ -242,23 +228,6 @@ static int vsink_query_formats(AVFilterContext *ctx) · 23 unmodified lines
242228 return 0;
243229 }
244230
245−static av_cold int asink_init(AVFilterContext *ctx, void *opaque)
246−{
247− BufferSinkContext *buf = ctx->priv;
248− AVABufferSinkParams *params = opaque;
249− int ret;
250−
251− if (params) {
252− if ((ret = av_opt_set_int_list(buf, "sample_fmts", params->sample_fmts, AV_SAMPLE_FMT_NONE, 0)) < 0 ||
253− (ret = av_opt_set_int_list(buf, "sample_rates", params->sample_rates, -1, 0)) < 0 ||
254− (ret = av_opt_set_int_list(buf, "channel_layouts", params->channel_layouts, -1, 0)) < 0 ||
255− (ret = av_opt_set_int_list(buf, "channel_counts", params->channel_counts, -1, 0)) < 0 ||
256− (ret = av_opt_set_int(buf, "all_channel_counts", params->all_channel_counts, 0)) < 0)
257− return ret;
258− }
259− return common_init(ctx);
260−}
261−
262231 static int asink_query_formats(AVFilterContext *ctx)
263232 {
264233 BufferSinkContext *buf = ctx->priv;
@@ -345,7 +314,7 @@ AVFilter ff_vsink_buffer = { · 80 unmodified lines
345314 .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
346315 .priv_size = sizeof(BufferSinkContext),
347316 .priv_class = &buffersink_class,
348− .init_opaque = vsink_init,
317+ .init = common_init,
349318 .query_formats = vsink_query_formats,
350319 .activate = activate,
351320 .inputs = avfilter_vsink_buffer_inputs,
@@ -365,7 +334,7 @@ AVFilter ff_asink_abuffer = { · 13 unmodified lines
365334 .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
366335 .priv_class = &abuffersink_class,
367336 .priv_size = sizeof(BufferSinkContext),
368− .init_opaque = asink_init,
337+ .init = common_init,
369338 .query_formats = asink_query_formats,
370339 .activate = activate,
371340 .inputs = avfilter_asink_abuffer_inputs,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t