Browse Source

Implement avfilter_add_colorspace().

Originally committed as revision 21007 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Stefano Sabatini 15 years ago
parent
commit
4fd1f1876a
2 changed files with 22 additions and 1 deletions
  1. +9
    -1
      libavfilter/avfilter.h
  2. +13
    -0
      libavfilter/formats.c

+ 9
- 1
libavfilter/avfilter.h View File

@@ -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, \
@@ -191,6 +191,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.
*/


+ 13
- 0
libavfilter/formats.c View File

@@ -85,6 +85,19 @@ AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts)
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;


Loading…
Cancel
Save