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 | +2014-07-23 - XXXXXXX - lavf 55.49.100 - avio.h | |
| 19 | + Add avio_read_to_bprint() | |
| 20 | + | |
| 18 | 21 | 2014-07-14 - 62227a7 - lavf 55.47.100 - avformat.h |
| 19 | 22 | Add av_stream_get_parser() |
| 20 | 23 | |
| @@ -31,6 +31,7 @@ · 30 unmodified lines | ||
| 31 | 31 | #include "libavutil/common.h" |
| 32 | 32 | #include "libavutil/dict.h" |
| 33 | 33 | #include "libavutil/log.h" |
| 34 | +#include "libavutil/bprint.h" | |
| 34 | 35 | |
| 35 | 36 | #include "libavformat/version.h" |
| 36 | 37 | |
| @@ -500,4 +501,12 @@ int avio_pause(AVIOContext *h, int pause); · 463 unmodified lines | ||
| 500 | 501 | int64_t avio_seek_time(AVIOContext *h, int stream_index, |
| 501 | 502 | int64_t timestamp, int flags); |
| 502 | 503 | |
| 504 | +/** | |
| 505 | + * Read contents of h into print buffer, up to max_size bytes, or up to EOF. | |
| 506 | + * | |
| 507 | + * @return 0 for success (max_size bytes read or EOF reached), negative error | |
| 508 | + * code otherwise | |
| 509 | + */ | |
| 510 | +int avio_read_to_bprint(AVIOContext *h, AVBPrint *pb, size_t max_size); | |
| 511 | + | |
| 503 | 512 | #endif /* AVFORMAT_AVIO_H */ |
| @@ -953,6 +953,24 @@ int64_t avio_seek_time(AVIOContext *s, int stream_index, · 952 unmodified lines | ||
| 953 | 953 | return ret; |
| 954 | 954 | } |
| 955 | 955 | |
| 956 | +int avio_read_to_bprint(AVIOContext *h, AVBPrint *pb, size_t max_size) | |
| 957 | +{ | |
| 958 | + int ret; | |
| 959 | + char buf[1024]; | |
| 960 | + while (max_size) { | |
| 961 | + ret = avio_read(h, buf, FFMIN(max_size, sizeof(buf))); | |
| 962 | + if (ret == AVERROR_EOF) | |
| 963 | + return 0; | |
| 964 | + if (ret <= 0) | |
| 965 | + return ret; | |
| 966 | + av_bprint_append_data(pb, buf, ret); | |
| 967 | + if (!av_bprint_is_complete(pb)) | |
| 968 | + return AVERROR(ENOMEM); | |
| 969 | + max_size -= ret; | |
| 970 | + } | |
| 971 | + return 0; | |
| 972 | +} | |
| 973 | + | |
| 956 | 974 | /* output in a dynamic buffer */ |
| 957 | 975 | |
| 958 | 976 | typedef struct DynBuffer { |
| @@ -30,8 +30,8 @@ · 29 unmodified lines | ||
| 30 | 30 | #include "libavutil/version.h" |
| 31 | 31 | |
| 32 | 32 | #define LIBAVFORMAT_VERSION_MAJOR 55 |
| 33 | −#define LIBAVFORMAT_VERSION_MINOR 48 | |
| 34 | −#define LIBAVFORMAT_VERSION_MICRO 101 | |
| 33 | +#define LIBAVFORMAT_VERSION_MINOR 49 | |
| 34 | +#define LIBAVFORMAT_VERSION_MICRO 100 | |
| 35 | 35 | |
| 36 | 36 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |
| 37 | 37 | LIBAVFORMAT_VERSION_MINOR, \ |