History

avio: make url_fdopen internal.

The unbuffered URLContext API will be made private, so there's no point in this function being public.

Anton Khirnov committed 15 years ago

Commit 724f6a01 parent 403ee834 files · +22 −16Browse files

Unified · Split

4 files
  1. libavformat/avio.h +1 −13
  2. libavformat/avio_internal.h +13 −0
  3. libavformat/aviobuf.c +6 −2
  4. libavformat/rtpenc_chain.c +2 −1
libavformat/avio.h+1−13
@@ -450,6 +450,7 @@ attribute_deprecated void put_flush_packet(AVIOContext *s); · 449 unmodified lines
450450 attribute_deprecated int url_open_dyn_buf(AVIOContext **s);
451451 attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
452452 attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
453+attribute_deprecated int url_fdopen(AVIOContext **s, URLContext *h);
453454 /**
454455 * @}
455456 */
@@ -625,19 +626,6 @@ attribute_deprecated static inline int url_is_streamed(AVIOContext *s) · 169 unmodified lines
625626 }
626627 #endif
627628
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−
641629 #if FF_API_URL_RESETBUF
642630 /** Reset the buffer for reading or writing.
643631 * @note Will drop any data currently in the buffer without transmitting it.
libavformat/avio_internal.h+13−0
@@ -92,4 +92,17 @@ unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, · 91 unmodified lines
9292 */
9393 int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
9494
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+
95108 #endif // AVFORMAT_AVIO_INTERNAL_H
libavformat/aviobuf.c+6−2
@@ -431,6 +431,10 @@ int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) · 430 unmodified lines
431431 {
432432 return avio_close_dyn_buf(s, pbuffer);
433433 }
434+int url_fdopen(AVIOContext **s, URLContext *h)
435+{
436+ return ffio_fdopen(s, h);
437+}
434438 #endif
435439
436440 int avio_put_str(AVIOContext *s, const char *str)
@@ -818,7 +822,7 @@ uint64_t ffio_read_varlen(AVIOContext *bc){ · 381 unmodified lines
818822 return val;
819823 }
820824
821−int url_fdopen(AVIOContext **s, URLContext *h)
825+int ffio_fdopen(AVIOContext **s, URLContext *h)
822826 {
823827 uint8_t *buffer;
824828 int buffer_size, max_packet_size;
@@ -943,7 +947,7 @@ int avio_open(AVIOContext **s, const char *filename, int flags) · 118 unmodified lines
943947 err = url_open(&h, filename, flags);
944948 if (err < 0)
945949 return err;
946− err = url_fdopen(s, h);
950+ err = ffio_fdopen(s, h);
947951 if (err < 0) {
948952 url_close(h);
949953 return err;
libavformat/rtpenc_chain.c+2−1
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 */
2121
2222 #include "avformat.h"
23+#include "avio_internal.h"
2324 #include "rtpenc_chain.h"
2425 #include "avio_internal.h"
2526
@@ -54,7 +55,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, · 28 unmodified lines
5455 avcodec_copy_context(rtpctx->streams[0]->codec, st->codec);
5556
5657 if (handle) {
57− url_fdopen(&rtpctx->pb, handle);
58+ ffio_fdopen(&rtpctx->pb, handle);
5859 } else
5960 ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size);
6061 ret = av_write_header(rtpctx);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t