Unified · Split
| @@ -15,6 +15,10 @@ libavutil: 2015-08-28 · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | API changes, most recent first: |
| 17 | 17 | |
| 18 | +2017-03-xx - xxxxxxx - lavu 55.52.100 - avutil.h | |
| 19 | + add av_fourcc_make_string() function and av_fourcc2str() macro to replace | |
| 20 | + av_get_codec_tag_string() from lavc. | |
| 21 | + | |
| 18 | 22 | 2017-03-xx - xxxxxxx - lavf 57.68.100 - avformat.h |
| 19 | 23 | Deprecate that demuxers export the stream rotation angle in AVStream.metadata |
| 20 | 24 | (via an entry named "rotate"). Use av_stream_get_side_data() with |
| @@ -343,6 +343,20 @@ FILE *av_fopen_utf8(const char *path, const char *mode); · 342 unmodified lines | ||
| 343 | 343 | */ |
| 344 | 344 | AVRational av_get_time_base_q(void); |
| 345 | 345 | |
| 346 | +#define AV_FOURCC_MAX_STRING_SIZE 32 | |
| 347 | + | |
| 348 | +#define av_fourcc2str(fourcc) av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc) | |
| 349 | + | |
| 350 | +/** | |
| 351 | + * Fill the provided buffer with a string containing a FourCC (four-character | |
| 352 | + * code) representation. | |
| 353 | + * | |
| 354 | + * @param buf a buffer with size in bytes of at least AV_FOURCC_MAX_STRING_SIZE | |
| 355 | + * @param fourcc the fourcc to represent | |
| 356 | + * @return the buffer in input | |
| 357 | + */ | |
| 358 | +char *av_fourcc_make_string(char *buf, uint32_t fourcc); | |
| 359 | + | |
| 346 | 360 | /** |
| 347 | 361 | * @} |
| 348 | 362 | * @} |
| @@ -121,6 +121,29 @@ unsigned av_int_list_length_for_size(unsigned elsize, · 120 unmodified lines | ||
| 121 | 121 | return i; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | +char *av_fourcc_make_string(char *buf, uint32_t fourcc) | |
| 125 | +{ | |
| 126 | + int i; | |
| 127 | + char *orig_buf = buf; | |
| 128 | + size_t buf_size = AV_FOURCC_MAX_STRING_SIZE; | |
| 129 | + | |
| 130 | + for (i = 0; i < 4; i++) { | |
| 131 | + const int c = fourcc & 0xff; | |
| 132 | + const int print_chr = (c >= '0' && c <= '9') || | |
| 133 | + (c >= 'a' && c <= 'z') || | |
| 134 | + (c >= 'A' && c <= 'Z') || | |
| 135 | + (c && strchr(". -_", c)); | |
| 136 | + const int len = snprintf(buf, buf_size, print_chr ? "%c" : "[%d]", c); | |
| 137 | + if (len < 0) | |
| 138 | + break; | |
| 139 | + buf += len; | |
| 140 | + buf_size = buf_size > len ? buf_size - len : 0; | |
| 141 | + fourcc >>= 8; | |
| 142 | + } | |
| 143 | + | |
| 144 | + return orig_buf; | |
| 145 | +} | |
| 146 | + | |
| 124 | 147 | AVRational av_get_time_base_q(void) |
| 125 | 148 | { |
| 126 | 149 | return (AVRational){1, AV_TIME_BASE}; |
| @@ -79,7 +79,7 @@ · 78 unmodified lines | ||
| 79 | 79 | */ |
| 80 | 80 | |
| 81 | 81 | #define LIBAVUTIL_VERSION_MAJOR 55 |
| 82 | −#define LIBAVUTIL_VERSION_MINOR 51 | |
| 82 | +#define LIBAVUTIL_VERSION_MINOR 52 | |
| 83 | 83 | #define LIBAVUTIL_VERSION_MICRO 100 |
| 84 | 84 | |
| 85 | 85 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |