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

Unified · Split

libavfilter/buffersink.c+2−33
@@ -199,20 +199,6 @@ MAKE_AVFILTERLINK_ACCESSOR(int , sample_rate ) · 198 unmodified lines
199 199
200MAKE_AVFILTERLINK_ACCESSOR(AVBufferRef * , hw_frames_ctx )200MAKE_AVFILTERLINK_ACCESSOR(AVBufferRef * , hw_frames_ctx )
201 201
202static 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
216#define CHECK_LIST_SIZE(field) \202#define CHECK_LIST_SIZE(field) \
217 if (buf->field ## _size % sizeof(*buf->field)) { \203 if (buf->field ## _size % sizeof(*buf->field)) { \
218 av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \204 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
242 return 0;228 return 0;
243}229}
244 230
245static 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
262static int asink_query_formats(AVFilterContext *ctx)231static int asink_query_formats(AVFilterContext *ctx)
263{232{
264 BufferSinkContext *buf = ctx->priv;233 BufferSinkContext *buf = ctx->priv;
@@ -345,7 +314,7 @@ AVFilter ff_vsink_buffer = { · 80 unmodified lines
345 .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),314 .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
346 .priv_size = sizeof(BufferSinkContext),315 .priv_size = sizeof(BufferSinkContext),
347 .priv_class = &buffersink_class,316 .priv_class = &buffersink_class,
348 .init_opaque = vsink_init,317 .init = common_init,
349 .query_formats = vsink_query_formats,318 .query_formats = vsink_query_formats,
350 .activate = activate,319 .activate = activate,
351 .inputs = avfilter_vsink_buffer_inputs,320 .inputs = avfilter_vsink_buffer_inputs,
@@ -365,7 +334,7 @@ AVFilter ff_asink_abuffer = { · 13 unmodified lines
365 .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),334 .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
366 .priv_class = &abuffersink_class,335 .priv_class = &abuffersink_class,
367 .priv_size = sizeof(BufferSinkContext),336 .priv_size = sizeof(BufferSinkContext),
368 .init_opaque = asink_init,337 .init = common_init,
369 .query_formats = asink_query_formats,338 .query_formats = asink_query_formats,
370 .activate = activate,339 .activate = activate,
371 .inputs = avfilter_asink_abuffer_inputs,340 .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