You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	avfilter/formats: Add function to create AVFilterFormats with one entry
Most instances ff_add_formats() actually only ever add one format; this function can be used to simplify those callers. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
		| @@ -431,6 +431,12 @@ int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout) | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
| AVFilterFormats *ff_make_formats_list_singleton(int fmt) | ||||
| { | ||||
|     int fmts[2] = { fmt, -1 }; | ||||
|     return ff_make_format_list(fmts); | ||||
| } | ||||
|  | ||||
| AVFilterFormats *ff_all_formats(enum AVMediaType type) | ||||
| { | ||||
|     AVFilterFormats *ret = NULL; | ||||
|   | ||||
| @@ -208,6 +208,12 @@ int ff_default_query_formats(AVFilterContext *ctx); | ||||
| av_warn_unused_result | ||||
| AVFilterFormats *ff_make_format_list(const int *fmts); | ||||
|  | ||||
| /** | ||||
|  * Equivalent to ff_make_format_list({const int[]}{ fmt, -1 }) | ||||
|  */ | ||||
| av_warn_unused_result | ||||
| AVFilterFormats *ff_make_formats_list_singleton(int fmt); | ||||
|  | ||||
| /** | ||||
|  * Add fmt to the list of media formats contained in *avff. | ||||
|  * If *avff is NULL the function allocates the filter formats struct | ||||
|   | ||||
		Reference in New Issue
	
	Block a user