History

lavfi/vf_crop: use ff_formats_pixdesc_filter().

Nicolas George committed 6 years ago

Commit df123591 parent 563e1df1 file · +4 −17Browse files

Unified · Split

libavfilter/vf_crop.c+4−17
@@ -94,24 +94,11 @@ typedef struct CropContext { · 93 unmodified lines
9494 static int query_formats(AVFilterContext *ctx)
9595 {
9696 AVFilterFormats *formats = NULL;
97− int fmt, ret;
98−
99− for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) {
100− const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
101− if (desc->flags & AV_PIX_FMT_FLAG_BITSTREAM)
102− continue;
103− if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
104− // Not usable if there is any subsampling but the format is
105− // not planar (e.g. YUYV422).
106− if ((desc->log2_chroma_w || desc->log2_chroma_h) &&
107− !(desc->flags & AV_PIX_FMT_FLAG_PLANAR))
108− continue;
109− }
110− ret = ff_add_format(&formats, fmt);
111− if (ret < 0)
112− return ret;
113− }
97+ int ret;
11498
99+ ret = ff_formats_pixdesc_filter(&formats, 0, AV_PIX_FMT_FLAG_BITSTREAM | FF_PIX_FMT_FLAG_SW_FLAT_SUB);
100+ if (ret < 0)
101+ return ret;
115102 return ff_set_common_formats(ctx, formats);
116103 }
117104

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