Skip to content

Commit be8bc64

Browse files
committed
avfilter/opencl: Store format in filter, remove query function
Signed-off-by: Andreas Rheinhardt <[email protected]>
1 parent 94047d6 commit be8bc64

15 files changed

+19
-34
lines changed

libavfilter/opencl.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@
2525
#include "formats.h"
2626
#include "opencl.h"
2727

28-
int ff_opencl_filter_query_formats(AVFilterContext *avctx)
29-
{
30-
const static enum AVPixelFormat pix_fmts[] = {
31-
AV_PIX_FMT_OPENCL,
32-
AV_PIX_FMT_NONE,
33-
};
34-
35-
return ff_set_common_formats_from_list(avctx, pix_fmts);
36-
}
37-
3828
static int opencl_filter_set_device(AVFilterContext *avctx,
3929
AVBufferRef *device)
4030
{

libavfilter/opencl.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,6 @@ do {
236236
*/
237237
#define CL_CREATE_BUFFER(ctx, buffer_name, size) CL_CREATE_BUFFER_FLAGS(ctx, buffer_name, 0, size, NULL)
238238

239-
/**
240-
* Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.
241-
*/
242-
int ff_opencl_filter_query_formats(AVFilterContext *avctx);
243-
244239
/**
245240
* Check that the input link contains a suitable hardware frames
246241
* context and extract the device from it.

libavfilter/vf_avgblur_opencl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ const AVFilter ff_vf_avgblur_opencl = {
347347
.uninit = &avgblur_opencl_uninit,
348348
FILTER_INPUTS(avgblur_opencl_inputs),
349349
FILTER_OUTPUTS(avgblur_opencl_outputs),
350-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
350+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
351351
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
352352
};
353353

@@ -386,7 +386,7 @@ const AVFilter ff_vf_boxblur_opencl = {
386386
.uninit = &avgblur_opencl_uninit,
387387
FILTER_INPUTS(avgblur_opencl_inputs),
388388
FILTER_OUTPUTS(avgblur_opencl_outputs),
389-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
389+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
390390
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
391391
};
392392

libavfilter/vf_colorkey_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,6 @@ const AVFilter ff_vf_colorkey_opencl = {
237237
.uninit = &colorkey_opencl_uninit,
238238
FILTER_INPUTS(colorkey_opencl_inputs),
239239
FILTER_OUTPUTS(colorkey_opencl_outputs),
240-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
240+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
241241
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE
242242
};

libavfilter/vf_convolution_opencl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ const AVFilter ff_vf_convolution_opencl = {
369369
.uninit = &convolution_opencl_uninit,
370370
FILTER_INPUTS(convolution_opencl_inputs),
371371
FILTER_OUTPUTS(convolution_opencl_outputs),
372-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
372+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
373373
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
374374
};
375375

@@ -395,7 +395,7 @@ const AVFilter ff_vf_sobel_opencl = {
395395
.uninit = &convolution_opencl_uninit,
396396
FILTER_INPUTS(convolution_opencl_inputs),
397397
FILTER_OUTPUTS(convolution_opencl_outputs),
398-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
398+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
399399
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
400400
};
401401

@@ -421,7 +421,7 @@ const AVFilter ff_vf_prewitt_opencl = {
421421
.uninit = &convolution_opencl_uninit,
422422
FILTER_INPUTS(convolution_opencl_inputs),
423423
FILTER_OUTPUTS(convolution_opencl_outputs),
424-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
424+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
425425
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
426426
};
427427

@@ -447,7 +447,7 @@ const AVFilter ff_vf_roberts_opencl = {
447447
.uninit = &convolution_opencl_uninit,
448448
FILTER_INPUTS(convolution_opencl_inputs),
449449
FILTER_OUTPUTS(convolution_opencl_outputs),
450-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
450+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
451451
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
452452
};
453453

libavfilter/vf_deshake_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2195,6 +2195,6 @@ const AVFilter ff_vf_deshake_opencl = {
21952195
.activate = activate,
21962196
FILTER_INPUTS(deshake_opencl_inputs),
21972197
FILTER_OUTPUTS(deshake_opencl_outputs),
2198-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
2198+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
21992199
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE
22002200
};

libavfilter/vf_neighbor_opencl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ const AVFilter ff_vf_erosion_opencl = {
280280
.uninit = &neighbor_opencl_uninit,
281281
FILTER_INPUTS(neighbor_opencl_inputs),
282282
FILTER_OUTPUTS(neighbor_opencl_outputs),
283-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
283+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
284284
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
285285
};
286286

@@ -306,9 +306,9 @@ const AVFilter ff_vf_dilation_opencl = {
306306
.priv_class = &dilation_opencl_class,
307307
.init = &ff_opencl_filter_init,
308308
.uninit = &neighbor_opencl_uninit,
309-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
310309
FILTER_INPUTS(neighbor_opencl_inputs),
311310
FILTER_OUTPUTS(neighbor_opencl_outputs),
311+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
312312
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
313313
};
314314

libavfilter/vf_nlmeans_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,6 @@ const AVFilter ff_vf_nlmeans_opencl = {
436436
.uninit = &nlmeans_opencl_uninit,
437437
FILTER_INPUTS(nlmeans_opencl_inputs),
438438
FILTER_OUTPUTS(nlmeans_opencl_outputs),
439-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
439+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
440440
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
441441
};

libavfilter/vf_overlay_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,6 @@ const AVFilter ff_vf_overlay_opencl = {
320320
.activate = &overlay_opencl_activate,
321321
FILTER_INPUTS(overlay_opencl_inputs),
322322
FILTER_OUTPUTS(overlay_opencl_outputs),
323-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
323+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
324324
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
325325
};

libavfilter/vf_pad_opencl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,6 @@ const AVFilter ff_vf_pad_opencl = {
390390
.uninit = &pad_opencl_uninit,
391391
FILTER_INPUTS(pad_opencl_inputs),
392392
FILTER_OUTPUTS(pad_opencl_outputs),
393-
FILTER_QUERY_FUNC(&ff_opencl_filter_query_formats),
393+
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
394394
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE
395395
};

0 commit comments

Comments
 (0)