The list type was changed to int64_t to be able to hold channel layouts. avfilter_make_format_list() still takes a int32_t array and converts it to int64_t. A new function, avfilter_make_format64_list, that takes int64_t arrays has been added.
Unified · Split
| @@ -13,6 +13,14 @@ libavutil: 2011-04-18 · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | API changes, most recent first: | 14 | API changes, most recent first: |
| 15 | 15 | ||
| 16 | 2011-06-19 - xxxxxxx - lavfi 2.22.0 - AVFilterFormats | ||
| 17 | Change type of AVFilterFormats.formats from int * to int64_t *, | ||
| 18 | and update formats handling API accordingly. | ||
| 19 | |||
| 20 | avfilter_make_format_list() still takes a int32_t array and converts | ||
| 21 | it to int64_t. A new function, avfilter_make_format64_list(), that | ||
| 22 | takes int64_t arrays has been added. | ||
| 23 | |||
| 16 | 2011-06-19 - xxxxxxx - lavfi 2.21.0 - vsink_buffer.h | 24 | 2011-06-19 - xxxxxxx - lavfi 2.21.0 - vsink_buffer.h |
| 17 | Add video sink buffer and vsink_buffer.h public header. | 25 | Add video sink buffer and vsink_buffer.h public header. |
| 18 | 26 | ||
| @@ -26,7 +26,7 @@ · 25 unmodified lines | |||
| 26 | #include "libavutil/samplefmt.h" | 26 | #include "libavutil/samplefmt.h" |
| 27 | 27 | ||
| 28 | #define LIBAVFILTER_VERSION_MAJOR 2 | 28 | #define LIBAVFILTER_VERSION_MAJOR 2 |
| 29 | #define LIBAVFILTER_VERSION_MINOR 21 | 29 | #define LIBAVFILTER_VERSION_MINOR 22 |
| 30 | #define LIBAVFILTER_VERSION_MICRO 0 | 30 | #define LIBAVFILTER_VERSION_MICRO 0 |
| 31 | 31 | ||
| 32 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ | 32 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ |
| @@ -223,7 +223,7 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref); · 190 unmodified lines | |||
| 223 | */ | 223 | */ |
| 224 | typedef struct AVFilterFormats { | 224 | typedef struct AVFilterFormats { |
| 225 | unsigned format_count; ///< number of formats | 225 | unsigned format_count; ///< number of formats |
| 226 | int *formats; ///< list of media formats | 226 | int64_t *formats; ///< list of media formats |
| 227 | 227 | ||
| 228 | unsigned refcount; ///< number of references to this list | 228 | unsigned refcount; ///< number of references to this list |
| 229 | struct AVFilterFormats ***refs; ///< references to this list | 229 | struct AVFilterFormats ***refs; ///< references to this list |
| @@ -238,6 +238,7 @@ typedef struct AVFilterFormats { · 8 unmodified lines | |||
| 238 | * @return the format list, with no existing references | 238 | * @return the format list, with no existing references |
| 239 | */ | 239 | */ |
| 240 | AVFilterFormats *avfilter_make_format_list(const int *fmts); | 240 | AVFilterFormats *avfilter_make_format_list(const int *fmts); |
| 241 | AVFilterFormats *avfilter_make_format64_list(const int64_t *fmts); | ||
| 241 | 242 | ||
| 242 | /** | 243 | /** |
| 243 | * Add fmt to the list of media formats contained in *avff. | 244 | * Add fmt to the list of media formats contained in *avff. |
| @@ -247,7 +248,7 @@ AVFilterFormats *avfilter_make_format_list(const int *fmts); · 3 unmodified lines | |||
| 247 | * @return a non negative value in case of success, or a negative | 248 | * @return a non negative value in case of success, or a negative |
| 248 | * value corresponding to an AVERROR code in case of error | 249 | * value corresponding to an AVERROR code in case of error |
| 249 | */ | 250 | */ |
| 250 | int avfilter_add_format(AVFilterFormats **avff, int fmt); | 251 | int avfilter_add_format(AVFilterFormats **avff, int64_t fmt); |
| 251 | 252 | ||
| 252 | /** | 253 | /** |
| 253 | * Return a list of all formats supported by FFmpeg for the given media type. | 254 | * Return a list of all formats supported by FFmpeg for the given media type. |
| @@ -72,28 +72,44 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b) · 71 unmodified lines | |||
| 72 | return ret; | 72 | return ret; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | #define MAKE_FORMAT_LIST() \ | ||
| 76 | AVFilterFormats *formats; \ | ||
| 77 | int count = 0; \ | ||
| 78 | if (fmts) \ | ||
| 79 | for (count = 0; fmts[count] != -1; count++) \ | ||
| 80 | ; \ | ||
| 81 | formats = av_mallocz(sizeof(AVFilterFormats)); \ | ||
| 82 | if (!formats) return NULL; \ | ||
| 83 | formats->format_count = count; \ | ||
| 84 | if (count) { \ | ||
| 85 | formats->formats = av_malloc(sizeof(*formats->formats)*count); \ | ||
| 86 | if (!formats->formats) { \ | ||
| 87 | av_free(formats); \ | ||
| 88 | return NULL; \ | ||
| 89 | } \ | ||
| 90 | } | ||
| 91 | |||
| 75 | AVFilterFormats *avfilter_make_format_list(const int *fmts) | 92 | AVFilterFormats *avfilter_make_format_list(const int *fmts) |
| 76 | { | 93 | { |
| 77 | AVFilterFormats *formats; | 94 | MAKE_FORMAT_LIST(); |
| 78 | int count = 0; | 95 | while (count--) |
| 96 | formats->formats[count] = fmts[count]; | ||
| 79 | 97 | ||
| 80 | if (fmts) | 98 | return formats; |
| 81 | for (count = 0; fmts[count] != -1; count++) | 99 | } |
| 82 | ; | ||
| 83 | 100 | ||
| 84 | formats = av_mallocz(sizeof(AVFilterFormats)); | 101 | AVFilterFormats *avfilter_make_format64_list(const int64_t *fmts) |
| 85 | formats->format_count = count; | 102 | { |
| 86 | if (count) { | 103 | MAKE_FORMAT_LIST(); |
| 87 | formats->formats = av_malloc(sizeof(*formats->formats) * count); | 104 | if (count) |
| 88 | memcpy(formats->formats, fmts, sizeof(*formats->formats) * count); | 105 | memcpy(formats->formats, fmts, sizeof(*formats->formats) * count); |
| 89 | } | ||
| 90 | 106 | ||
| 91 | return formats; | 107 | return formats; |
| 92 | } | 108 | } |
| 93 | 109 | ||
| 94 | int avfilter_add_format(AVFilterFormats **avff, int fmt) | 110 | int avfilter_add_format(AVFilterFormats **avff, int64_t fmt) |
| 95 | { | 111 | { |
| 96 | int *fmts; | 112 | int64_t *fmts; |
| 97 | 113 | ||
| 98 | if (!(*avff) && !(*avff = av_mallocz(sizeof(AVFilterFormats)))) | 114 | if (!(*avff) && !(*avff = av_mallocz(sizeof(AVFilterFormats)))) |
| 99 | return AVERROR(ENOMEM); | 115 | return AVERROR(ENOMEM); |