[FFmpeg-cvslog] r21007 - in trunk/libavfilter: avfilter.h formats.c
stefano
subversion
Sun Jan 3 23:26:59 CET 2010
Author: stefano
Date: Sun Jan 3 23:26:59 2010
New Revision: 21007
Log:
Implement avfilter_add_colorspace().
Modified:
trunk/libavfilter/avfilter.h
trunk/libavfilter/formats.c
Modified: trunk/libavfilter/avfilter.h
==============================================================================
--- trunk/libavfilter/avfilter.h Sun Jan 3 22:21:41 2010 (r21006)
+++ trunk/libavfilter/avfilter.h Sun Jan 3 23:26:59 2010 (r21007)
@@ -25,7 +25,7 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 1
-#define LIBAVFILTER_VERSION_MINOR 12
+#define LIBAVFILTER_VERSION_MINOR 13
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -192,6 +192,14 @@ struct AVFilterFormats
AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts);
/**
+ * Adds pix_fmt to the list of pixel formats contained in avff.
+ *
+ * @return a non negative value in case of success, or a negative
+ * value corresponding to an AVERROR code in case of error
+ */
+int avfilter_add_colorspace(AVFilterFormats *avff, enum PixelFormat pix_fmt);
+
+/**
* Returns a list of all colorspaces supported by FFmpeg.
*/
AVFilterFormats *avfilter_all_colorspaces(void);
Modified: trunk/libavfilter/formats.c
==============================================================================
--- trunk/libavfilter/formats.c Sun Jan 3 22:21:41 2010 (r21006)
+++ trunk/libavfilter/formats.c Sun Jan 3 23:26:59 2010 (r21007)
@@ -85,6 +85,19 @@ AVFilterFormats *avfilter_make_format_li
return formats;
}
+int avfilter_add_colorspace(AVFilterFormats *avff, enum PixelFormat pix_fmt)
+{
+ enum PixelFormat *pix_fmts =
+ av_realloc(avff->formats, sizeof(avff->formats) * (avff->format_count+1));
+
+ if (!pix_fmts)
+ return AVERROR(ENOMEM);
+
+ avff->formats = pix_fmts;
+ avff->formats[avff->format_count++] = pix_fmt;
+ return 0;
+}
+
AVFilterFormats *avfilter_all_colorspaces(void)
{
AVFilterFormats *ret;
More information about the ffmpeg-cvslog
mailing list