mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavfi/vf_crop: use ff_formats_pixdesc_filter().
This commit is contained in:
parent
563e1df5d6
commit
df123590f0
@ -94,24 +94,11 @@ typedef struct CropContext {
|
|||||||
static int query_formats(AVFilterContext *ctx)
|
static int query_formats(AVFilterContext *ctx)
|
||||||
{
|
{
|
||||||
AVFilterFormats *formats = NULL;
|
AVFilterFormats *formats = NULL;
|
||||||
int fmt, ret;
|
int ret;
|
||||||
|
|
||||||
for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) {
|
ret = ff_formats_pixdesc_filter(&formats, 0, AV_PIX_FMT_FLAG_BITSTREAM | FF_PIX_FMT_FLAG_SW_FLAT_SUB);
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
|
|
||||||
if (desc->flags & AV_PIX_FMT_FLAG_BITSTREAM)
|
|
||||||
continue;
|
|
||||||
if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
|
|
||||||
// Not usable if there is any subsampling but the format is
|
|
||||||
// not planar (e.g. YUYV422).
|
|
||||||
if ((desc->log2_chroma_w || desc->log2_chroma_h) &&
|
|
||||||
!(desc->flags & AV_PIX_FMT_FLAG_PLANAR))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
ret = ff_add_format(&formats, fmt);
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
return ff_set_common_formats(ctx, formats);
|
return ff_set_common_formats(ctx, formats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user