Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -94,24 +94,11 @@ typedef struct CropContext { · 93 unmodified lines | |||
| 94 | static int query_formats(AVFilterContext *ctx) | 94 | static 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 | ||