aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/defaults.c
diff options
context:
space:
mode:
authorS.N. Hemanth Meenakshisundaram <smeenaks@ucsd.edu>2010-07-22 11:12:47 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-07-22 11:12:47 +0000
commitbdab614be8df5681b7fbb89abfd08312f2686279 (patch)
tree0bb0e0fcbf6944d69ab2567197fbd52aa2bb281f /libavfilter/defaults.c
parent98137a1a5b1a4438ab4d84e63a957dc83c7dacaf (diff)
downloadffmpeg-bdab614be8df5681b7fbb89abfd08312f2686279.tar.gz
Generalize pixel format enum fields to int formats.
This is needed to make the libavfilter framework work with audio filters. In particular add a type field to AVFilterLink, change the field types: enum PixelFormat format -> int format in AVFilterBuffer enum PixelFormat *formats -> int *formats in AVFilterFormats enum PixelFormat *format -> int format in AVFilterLink and change the function signatures: AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts); -> AVFilterFormats *avfilter_make_format_list(const int *fmts); int avfilter_add_colorspace(AVFilterFormats **avff, enum PixelFormat pix_fmt); -> int avfilter_add_format(AVFilterFormats **avff, int fmt); AVFilterFormats *avfilter_all_colorspaces(void); -> AVFilterFormats *avfilter_all_formats(enum AVMediaType type); This change breaks libavfilter API/ABI. Patch by S.N. Hemanth Meenakshisundaram |smeenaks|ucsd|edu|. Originally committed as revision 24424 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/defaults.c')
-rw-r--r--libavfilter/defaults.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c
index ed1db94b69..27c8a3bcdc 100644
--- a/libavfilter/defaults.c
+++ b/libavfilter/defaults.c
@@ -160,7 +160,11 @@ void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
int avfilter_default_query_formats(AVFilterContext *ctx)
{
- avfilter_set_common_formats(ctx, avfilter_all_colorspaces());
+ enum AVMediaType type = ctx->inputs [0] ? ctx->inputs [0]->type :
+ ctx->outputs[0] ? ctx->outputs[0]->type :
+ AVMEDIA_TYPE_VIDEO;
+
+ avfilter_set_common_formats(ctx, avfilter_all_formats(type));
return 0;
}