You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	vf_copy: exclude hwaccel formats
This does obviously not work. (Additions based on vf_crop.c.)
This commit is contained in:
		| @@ -27,6 +27,23 @@ | ||||
| #include "internal.h" | ||||
| #include "video.h" | ||||
|  | ||||
| static int query_formats(AVFilterContext *ctx) | ||||
| { | ||||
|     AVFilterFormats *formats = NULL; | ||||
|     int fmt; | ||||
|  | ||||
|     for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) { | ||||
|         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt); | ||||
|         int ret; | ||||
|         if (desc->flags & AV_PIX_FMT_FLAG_HWACCEL) | ||||
|             continue; | ||||
|         if ((ret = ff_add_format(&formats, fmt)) < 0) | ||||
|             return ret; | ||||
|     } | ||||
|  | ||||
|     return ff_set_common_formats(ctx, formats); | ||||
| } | ||||
|  | ||||
| static int filter_frame(AVFilterLink *inlink, AVFrame *in) | ||||
| { | ||||
|     AVFilterLink *outlink = inlink->dst->outputs[0]; | ||||
| @@ -64,4 +81,5 @@ AVFilter ff_vf_copy = { | ||||
|     .description = NULL_IF_CONFIG_SMALL("Copy the input video unchanged to the output."), | ||||
|     .inputs      = avfilter_vf_copy_inputs, | ||||
|     .outputs     = avfilter_vf_copy_outputs, | ||||
|     .query_formats = query_formats, | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user