Unified · Split
| @@ -15,6 +15,9 @@ libavutil: 2012-10-22 · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | API changes, most recent first: |
| 17 | 17 | |
| 18 | +2013-03-30 - xxxxxxx - lavu 52.24.100 - samplefmt.h | |
| 19 | + Add av_samples_alloc_array_and_samples(). | |
| 20 | + | |
| 18 | 21 | 2013-03-29 - xxxxxxx - lavf 55.1.100 - avformat.h |
| 19 | 22 | Add av_guess_frame_rate() |
| 20 | 23 | |
| @@ -207,6 +207,21 @@ int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels, · 206 unmodified lines | ||
| 207 | 207 | #endif |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | +int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int nb_channels, | |
| 211 | + int nb_samples, enum AVSampleFormat sample_fmt, int align) | |
| 212 | +{ | |
| 213 | + int ret, nb_planes = av_sample_fmt_is_planar(sample_fmt) ? nb_channels : 1; | |
| 214 | + | |
| 215 | + *audio_data = av_calloc(nb_planes, sizeof(*audio_data)); | |
| 216 | + if (!*audio_data) | |
| 217 | + return AVERROR(ENOMEM); | |
| 218 | + ret = av_samples_alloc(*audio_data, linesize, nb_channels, | |
| 219 | + nb_samples, sample_fmt, align); | |
| 220 | + if (ret < 0) | |
| 221 | + av_freep(audio_data); | |
| 222 | + return ret; | |
| 223 | +} | |
| 224 | + | |
| 210 | 225 | int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, |
| 211 | 226 | int src_offset, int nb_samples, int nb_channels, |
| 212 | 227 | enum AVSampleFormat sample_fmt) |
| @@ -209,10 +209,23 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, · 208 unmodified lines | ||
| 209 | 209 | * @return >=0 on success or a negative error code on failure |
| 210 | 210 | * @todo return the size of the allocated buffer in case of success at the next bump |
| 211 | 211 | * @see av_samples_fill_arrays() |
| 212 | + * @see av_samples_alloc_array_and_samples() | |
| 212 | 213 | */ |
| 213 | 214 | int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels, |
| 214 | 215 | int nb_samples, enum AVSampleFormat sample_fmt, int align); |
| 215 | 216 | |
| 217 | +/** | |
| 218 | + * Allocate a data pointers array, samples buffer for nb_samples | |
| 219 | + * samples, and fill data pointers and linesize accordingly. | |
| 220 | + * | |
| 221 | + * This is the same as av_samples_alloc(), but also allocates the data | |
| 222 | + * pointers array. | |
| 223 | + * | |
| 224 | + * @see av_samples_alloc() | |
| 225 | + */ | |
| 226 | +int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int nb_channels, | |
| 227 | + int nb_samples, enum AVSampleFormat sample_fmt, int align); | |
| 228 | + | |
| 216 | 229 | /** |
| 217 | 230 | * Copy samples from src to dst. |
| 218 | 231 | * |
| @@ -75,7 +75,7 @@ · 74 unmodified lines | ||
| 75 | 75 | */ |
| 76 | 76 | |
| 77 | 77 | #define LIBAVUTIL_VERSION_MAJOR 52 |
| 78 | −#define LIBAVUTIL_VERSION_MINOR 23 | |
| 78 | +#define LIBAVUTIL_VERSION_MINOR 24 | |
| 79 | 79 | #define LIBAVUTIL_VERSION_MICRO 100 |
| 80 | 80 | |
| 81 | 81 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |