Revision 59f65d95
libavformat/avio.h | ||
---|---|---|
429 | 429 |
attribute_deprecated int64_t url_fsize(AVIOContext *s); |
430 | 430 |
#define URL_EOF (-1) |
431 | 431 |
attribute_deprecated int url_fgetc(AVIOContext *s); |
432 |
attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size); |
|
432 | 433 |
/** |
433 | 434 |
* @} |
434 | 435 |
*/ |
... | ... | |
586 | 587 |
*/ |
587 | 588 |
int url_fdopen(AVIOContext **s, URLContext *h); |
588 | 589 |
|
589 |
/** @warning must be called before any I/O */ |
|
590 |
int url_setbufsize(AVIOContext *s, int buf_size); |
|
591 | 590 |
#if FF_API_URL_RESETBUF |
592 | 591 |
/** Reset the buffer for reading or writing. |
593 | 592 |
* @note Will drop any data currently in the buffer without transmitting it. |
libavformat/avio_internal.h | ||
---|---|---|
63 | 63 |
|
64 | 64 |
uint64_t ffio_read_varlen(AVIOContext *bc); |
65 | 65 |
|
66 |
/** @warning must be called before any I/O */ |
|
67 |
int ffio_set_buf_size(AVIOContext *s, int buf_size); |
|
68 |
|
|
66 | 69 |
#endif // AVFORMAT_AVIO_INTERNAL_H |
libavformat/aviobuf.c | ||
---|---|---|
377 | 377 |
{ |
378 | 378 |
return avio_size(s); |
379 | 379 |
} |
380 |
int url_setbufsize(AVIOContext *s, int buf_size) |
|
381 |
{ |
|
382 |
return ffio_set_buf_size(s, buf_size); |
|
383 |
} |
|
380 | 384 |
#endif |
381 | 385 |
|
382 | 386 |
int avio_put_str(AVIOContext *s, const char *str) |
... | ... | |
490 | 494 |
|
491 | 495 |
/* make buffer smaller in case it ended up large after probing */ |
492 | 496 |
if (s->buffer_size > max_buffer_size) { |
493 |
url_setbufsize(s, max_buffer_size);
|
|
497 |
ffio_set_buf_size(s, max_buffer_size);
|
|
494 | 498 |
|
495 | 499 |
s->checksum_ptr = dst = s->buffer; |
496 | 500 |
len = s->buffer_size; |
... | ... | |
801 | 805 |
return 0; |
802 | 806 |
} |
803 | 807 |
|
804 |
int url_setbufsize(AVIOContext *s, int buf_size)
|
|
808 |
int ffio_set_buf_size(AVIOContext *s, int buf_size)
|
|
805 | 809 |
{ |
806 | 810 |
uint8_t *buffer; |
807 | 811 |
buffer = av_malloc(buf_size); |
libavformat/utils.c | ||
---|---|---|
621 | 621 |
goto fail; |
622 | 622 |
} |
623 | 623 |
if (buf_size > 0) { |
624 |
url_setbufsize(pb, buf_size);
|
|
624 |
ffio_set_buf_size(pb, buf_size);
|
|
625 | 625 |
} |
626 | 626 |
if (!fmt && (err = av_probe_input_buffer(pb, &fmt, filename, logctx, 0, logctx ? (*ic_ptr)->probesize : 0)) < 0) { |
627 | 627 |
goto fail; |
Also available in: Unified diff