The unbuffered URLContext API will be made private, so there's no point in this function being public.
Unified · Split
| @@ -450,6 +450,7 @@ attribute_deprecated void put_flush_packet(AVIOContext *s); · 449 unmodified lines | |||
| 450 | attribute_deprecated int url_open_dyn_buf(AVIOContext **s); | 450 | attribute_deprecated int url_open_dyn_buf(AVIOContext **s); |
| 451 | attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); | 451 | attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); |
| 452 | attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); | 452 | attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); |
| 453 | attribute_deprecated int url_fdopen(AVIOContext **s, URLContext *h); | ||
| 453 | /** | 454 | /** |
| 454 | * @} | 455 | * @} |
| 455 | */ | 456 | */ |
| @@ -625,19 +626,6 @@ attribute_deprecated static inline int url_is_streamed(AVIOContext *s) · 169 unmodified lines | |||
| 625 | } | 626 | } |
| 626 | #endif | 627 | #endif |
| 627 | 628 | ||
| 628 | /** | ||
| 629 | * Create and initialize a AVIOContext for accessing the | ||
| 630 | * resource referenced by the URLContext h. | ||
| 631 | * @note When the URLContext h has been opened in read+write mode, the | ||
| 632 | * AVIOContext can be used only for writing. | ||
| 633 | * | ||
| 634 | * @param s Used to return the pointer to the created AVIOContext. | ||
| 635 | * In case of failure the pointed to value is set to NULL. | ||
| 636 | * @return 0 in case of success, a negative value corresponding to an | ||
| 637 | * AVERROR code in case of failure | ||
| 638 | */ | ||
| 639 | int url_fdopen(AVIOContext **s, URLContext *h); | ||
| 640 | |||
| 641 | #if FF_API_URL_RESETBUF | 629 | #if FF_API_URL_RESETBUF |
| 642 | /** Reset the buffer for reading or writing. | 630 | /** Reset the buffer for reading or writing. |
| 643 | * @note Will drop any data currently in the buffer without transmitting it. | 631 | * @note Will drop any data currently in the buffer without transmitting it. |
| @@ -92,4 +92,17 @@ unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, · 91 unmodified lines | |||
| 92 | */ | 92 | */ |
| 93 | int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); | 93 | int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); |
| 94 | 94 | ||
| 95 | /** | ||
| 96 | * Create and initialize a AVIOContext for accessing the | ||
| 97 | * resource referenced by the URLContext h. | ||
| 98 | * @note When the URLContext h has been opened in read+write mode, the | ||
| 99 | * AVIOContext can be used only for writing. | ||
| 100 | * | ||
| 101 | * @param s Used to return the pointer to the created AVIOContext. | ||
| 102 | * In case of failure the pointed to value is set to NULL. | ||
| 103 | * @return 0 in case of success, a negative value corresponding to an | ||
| 104 | * AVERROR code in case of failure | ||
| 105 | */ | ||
| 106 | int ffio_fdopen(AVIOContext **s, URLContext *h); | ||
| 107 | |||
| 95 | #endif // AVFORMAT_AVIO_INTERNAL_H | 108 | #endif // AVFORMAT_AVIO_INTERNAL_H |
| @@ -431,6 +431,10 @@ int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) · 430 unmodified lines | |||
| 431 | { | 431 | { |
| 432 | return avio_close_dyn_buf(s, pbuffer); | 432 | return avio_close_dyn_buf(s, pbuffer); |
| 433 | } | 433 | } |
| 434 | int url_fdopen(AVIOContext **s, URLContext *h) | ||
| 435 | { | ||
| 436 | return ffio_fdopen(s, h); | ||
| 437 | } | ||
| 434 | #endif | 438 | #endif |
| 435 | 439 | ||
| 436 | int avio_put_str(AVIOContext *s, const char *str) | 440 | int avio_put_str(AVIOContext *s, const char *str) |
| @@ -818,7 +822,7 @@ uint64_t ffio_read_varlen(AVIOContext *bc){ · 381 unmodified lines | |||
| 818 | return val; | 822 | return val; |
| 819 | } | 823 | } |
| 820 | 824 | ||
| 821 | int url_fdopen(AVIOContext **s, URLContext *h) | 825 | int ffio_fdopen(AVIOContext **s, URLContext *h) |
| 822 | { | 826 | { |
| 823 | uint8_t *buffer; | 827 | uint8_t *buffer; |
| 824 | int buffer_size, max_packet_size; | 828 | int buffer_size, max_packet_size; |
| @@ -943,7 +947,7 @@ int avio_open(AVIOContext **s, const char *filename, int flags) · 118 unmodified lines | |||
| 943 | err = url_open(&h, filename, flags); | 947 | err = url_open(&h, filename, flags); |
| 944 | if (err < 0) | 948 | if (err < 0) |
| 945 | return err; | 949 | return err; |
| 946 | err = url_fdopen(s, h); | 950 | err = ffio_fdopen(s, h); |
| 947 | if (err < 0) { | 951 | if (err < 0) { |
| 948 | url_close(h); | 952 | url_close(h); |
| 949 | return err; | 953 | return err; |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | |||
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include "avformat.h" | 22 | #include "avformat.h" |
| 23 | #include "avio_internal.h" | ||
| 23 | #include "rtpenc_chain.h" | 24 | #include "rtpenc_chain.h" |
| 24 | #include "avio_internal.h" | 25 | #include "avio_internal.h" |
| 25 | 26 | ||
| @@ -54,7 +55,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, · 28 unmodified lines | |||
| 54 | avcodec_copy_context(rtpctx->streams[0]->codec, st->codec); | 55 | avcodec_copy_context(rtpctx->streams[0]->codec, st->codec); |
| 55 | 56 | ||
| 56 | if (handle) { | 57 | if (handle) { |
| 57 | url_fdopen(&rtpctx->pb, handle); | 58 | ffio_fdopen(&rtpctx->pb, handle); |
| 58 | } else | 59 | } else |
| 59 | ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size); | 60 | ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size); |
| 60 | ret = av_write_header(rtpctx); | 61 | ret = av_write_header(rtpctx); |