History

lavfi/vf_crop: use ff_formats_pixdesc_filter().

Nicolas George committed 6 years ago

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

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

Unified · Split

libavfilter/vf_crop.c+4−17
@@ -94,24 +94,11 @@ typedef struct CropContext { · 93 unmodified lines
94static int query_formats(AVFilterContext *ctx)94static int query_formats(AVFilterContext *ctx)
95{95{
96 AVFilterFormats *formats = NULL;96 AVFilterFormats *formats = NULL;
97 int fmt, ret;97 int 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 }
114 98
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;
115 return ff_set_common_formats(ctx, formats);102 return ff_set_common_formats(ctx, formats);
116}103}
117 104

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