Main use-case is proxying avio through a foreign I/O layer and a custom AVIO context, without losing latency and performance characteristics.
Unified · Split
| @@ -13,6 +13,9 @@ libavutil: 2017-03-23 · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | API changes, most recent first: |
| 15 | 15 | |
| 16 | +2016-xx-xx - xxxxxxx - lavf 58.1.0 - avio.h | |
| 17 | + Add avio_read_partial(). | |
| 18 | + | |
| 16 | 19 | 2017-xx-xx - xxxxxxx - lavu 56.4.0 - imgutils.h |
| 17 | 20 | Add av_image_fill_black(). |
| 18 | 21 | |
| @@ -331,6 +331,15 @@ void avio_flush(AVIOContext *s); · 330 unmodified lines | ||
| 331 | 331 | */ |
| 332 | 332 | int avio_read(AVIOContext *s, unsigned char *buf, int size); |
| 333 | 333 | |
| 334 | +/** | |
| 335 | + * Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed | |
| 336 | + * to read fewer bytes than requested. The missing bytes can be read in the next | |
| 337 | + * call. This always tries to read at least 1 byte. | |
| 338 | + * Useful to reduce latency in certain cases. | |
| 339 | + * @return number of bytes read or AVERROR | |
| 340 | + */ | |
| 341 | +int avio_read_partial(AVIOContext *s, unsigned char *buf, int size); | |
| 342 | + | |
| 334 | 343 | /** |
| 335 | 344 | * @name Functions for reading from AVIOContext |
| 336 | 345 | * @{ |
| @@ -53,14 +53,6 @@ int ffio_init_context(AVIOContext *s, · 52 unmodified lines | ||
| 53 | 53 | */ |
| 54 | 54 | int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data); |
| 55 | 55 | |
| 56 | −/** | |
| 57 | − * Read size bytes from AVIOContext into buf. | |
| 58 | − * This reads at most 1 packet. If that is not enough fewer bytes will be | |
| 59 | − * returned. | |
| 60 | − * @return number of bytes read or AVERROR | |
| 61 | − */ | |
| 62 | −int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size); | |
| 63 | − | |
| 64 | 56 | void ffio_fill(AVIOContext *s, int b, int count); |
| 65 | 57 | |
| 66 | 58 | static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s) |
| @@ -621,7 +621,7 @@ int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsig · 620 unmodified lines | ||
| 621 | 621 | } |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | −int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size) | |
| 624 | +int avio_read_partial(AVIOContext *s, unsigned char *buf, int size) | |
| 625 | 625 | { |
| 626 | 626 | int len; |
| 627 | 627 | |
| @@ -42,7 +42,7 @@ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt) · 41 unmodified lines | ||
| 42 | 42 | |
| 43 | 43 | pkt->pos= avio_tell(s->pb); |
| 44 | 44 | pkt->stream_index = 0; |
| 45 | − ret = ffio_read_partial(s->pb, pkt->data, size); | |
| 45 | + ret = avio_read_partial(s->pb, pkt->data, size); | |
| 46 | 46 | if (ret < 0) { |
| 47 | 47 | av_packet_unref(pkt); |
| 48 | 48 | return ret; |
| @@ -2077,7 +2077,7 @@ static int read_packet(AVFormatContext *s, · 2076 unmodified lines | ||
| 2077 | 2077 | wait_end && wait_end < av_gettime_relative()) |
| 2078 | 2078 | len = AVERROR(EAGAIN); |
| 2079 | 2079 | else |
| 2080 | − len = ffio_read_partial(s->pb, rt->recvbuf, RECVBUF_SIZE); | |
| 2080 | + len = avio_read_partial(s->pb, rt->recvbuf, RECVBUF_SIZE); | |
| 2081 | 2081 | len = pick_stream(s, rtsp_st, rt->recvbuf, len); |
| 2082 | 2082 | if (len > 0 && (*rtsp_st)->transport_priv && rt->transport == RTSP_TRANSPORT_RTP) |
| 2083 | 2083 | ff_rtp_check_and_send_back_rr((*rtsp_st)->transport_priv, NULL, s->pb, len); |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | #include "libavutil/version.h" |
| 31 | 31 | |
| 32 | 32 | #define LIBAVFORMAT_VERSION_MAJOR 58 |
| 33 | −#define LIBAVFORMAT_VERSION_MINOR 0 | |
| 33 | +#define LIBAVFORMAT_VERSION_MINOR 1 | |
| 34 | 34 | #define LIBAVFORMAT_VERSION_MICRO 0 |
| 35 | 35 | |
| 36 | 36 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |