Commit 792b62f7 authored by stefano's avatar stefano

Implement avfilter_make_format_list2(), which is going to replace

avfilter_make_format_list().

See the thread:
"[PATCH] Implement avfilter_make_format_list2(enum PixelFormat pix_fmt, ...)".


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20299 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1b66bef5
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
#define AVFILTER_AVFILTER_H #define AVFILTER_AVFILTER_H
#define LIBAVFILTER_VERSION_MAJOR 1 #define LIBAVFILTER_VERSION_MAJOR 1
#define LIBAVFILTER_VERSION_MINOR 0 #define LIBAVFILTER_VERSION_MINOR 1
#define LIBAVFILTER_VERSION_MICRO 1 #define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \ LIBAVFILTER_VERSION_MINOR, \
...@@ -179,6 +179,14 @@ struct AVFilterFormats ...@@ -179,6 +179,14 @@ struct AVFilterFormats
*/ */
AVFilterFormats *avfilter_make_format_list(int len, ...); AVFilterFormats *avfilter_make_format_list(int len, ...);
/**
* Creates a list of supported formats. This is intended for use in
* AVFilter->query_formats().
* @param pix_fmt list of pixel formats, terminated by PIX_FMT_NONE
* @return the format list, with no existing references
*/
AVFilterFormats *avfilter_make_format_list2(enum PixelFormat *pix_fmt);
/** /**
* Returns a list of all colorspaces supported by FFmpeg. * Returns a list of all colorspaces supported by FFmpeg.
*/ */
......
...@@ -87,6 +87,22 @@ AVFilterFormats *avfilter_make_format_list(int len, ...) ...@@ -87,6 +87,22 @@ AVFilterFormats *avfilter_make_format_list(int len, ...)
return ret; return ret;
} }
AVFilterFormats *avfilter_make_format_list2(enum PixelFormat *pix_fmt)
{
AVFilterFormats *formats;
int count;
for (count = 0; pix_fmt[count] != PIX_FMT_NONE; count++)
;
formats = av_mallocz(sizeof(AVFilterFormats));
formats->formats = av_malloc(sizeof(*formats->formats) * count);
formats->format_count = count;
memcpy(formats->formats, pix_fmt, sizeof(*formats->formats) * count);
return formats;
}
AVFilterFormats *avfilter_all_colorspaces(void) AVFilterFormats *avfilter_all_colorspaces(void)
{ {
AVFilterFormats *ret; AVFilterFormats *ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment