[FFmpeg-cvslog] avio: make url_fdopen internal.

Anton Khirnov git at videolan.org
Mon Apr 4 03:01:16 CEST 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Mar 17 08:44:44 2011 +0100| [724f6a0fa43f615dcebb2cb16ccb7c60ef7ec95c] | committer: Anton Khirnov

avio: make url_fdopen internal.

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=724f6a0fa43f615dcebb2cb16ccb7c60ef7ec95c
---

 libavformat/avio.h          |   14 +-------------
 libavformat/avio_internal.h |   13 +++++++++++++
 libavformat/aviobuf.c       |    8 ++++++--
 libavformat/rtpenc_chain.c  |    3 ++-
 4 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/libavformat/avio.h b/libavformat/avio.h
index 69896d1..ce6429c 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -450,6 +450,7 @@ attribute_deprecated void put_flush_packet(AVIOContext *s);
 attribute_deprecated int url_open_dyn_buf(AVIOContext **s);
 attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
 attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
+attribute_deprecated int url_fdopen(AVIOContext **s, URLContext *h);
 /**
  * @}
  */
@@ -625,19 +626,6 @@ attribute_deprecated static inline int url_is_streamed(AVIOContext *s)
 }
 #endif
 
-/**
- * Create and initialize a AVIOContext for accessing the
- * resource referenced by the URLContext h.
- * @note When the URLContext h has been opened in read+write mode, the
- * AVIOContext can be used only for writing.
- *
- * @param s Used to return the pointer to the created AVIOContext.
- * In case of failure the pointed to value is set to NULL.
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int url_fdopen(AVIOContext **s, URLContext *h);
-
 #if FF_API_URL_RESETBUF
 /** Reset the buffer for reading or writing.
  * @note Will drop any data currently in the buffer without transmitting it.
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
index 29553ed..b0f96cf 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -92,4 +92,17 @@ unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
  */
 int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
 
+/**
+ * Create and initialize a AVIOContext for accessing the
+ * resource referenced by the URLContext h.
+ * @note When the URLContext h has been opened in read+write mode, the
+ * AVIOContext can be used only for writing.
+ *
+ * @param s Used to return the pointer to the created AVIOContext.
+ * In case of failure the pointed to value is set to NULL.
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code in case of failure
+ */
+int ffio_fdopen(AVIOContext **s, URLContext *h);
+
 #endif // AVFORMAT_AVIO_INTERNAL_H
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 73045e6..ad969ae 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -431,6 +431,10 @@ int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
 {
     return avio_close_dyn_buf(s, pbuffer);
 }
+int url_fdopen(AVIOContext **s, URLContext *h)
+{
+    return ffio_fdopen(s, h);
+}
 #endif
 
 int avio_put_str(AVIOContext *s, const char *str)
@@ -818,7 +822,7 @@ uint64_t ffio_read_varlen(AVIOContext *bc){
     return val;
 }
 
-int url_fdopen(AVIOContext **s, URLContext *h)
+int ffio_fdopen(AVIOContext **s, URLContext *h)
 {
     uint8_t *buffer;
     int buffer_size, max_packet_size;
@@ -943,7 +947,7 @@ int avio_open(AVIOContext **s, const char *filename, int flags)
     err = url_open(&h, filename, flags);
     if (err < 0)
         return err;
-    err = url_fdopen(s, h);
+    err = ffio_fdopen(s, h);
     if (err < 0) {
         url_close(h);
         return err;
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index a923b2d..1727740 100644
--- a/libavformat/rtpenc_chain.c
+++ b/libavformat/rtpenc_chain.c
@@ -20,6 +20,7 @@
  */
 
 #include "avformat.h"
+#include "avio_internal.h"
 #include "rtpenc_chain.h"
 #include "avio_internal.h"
 
@@ -54,7 +55,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
     avcodec_copy_context(rtpctx->streams[0]->codec, st->codec);
 
     if (handle) {
-        url_fdopen(&rtpctx->pb, handle);
+        ffio_fdopen(&rtpctx->pb, handle);
     } else
         ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size);
     ret = av_write_header(rtpctx);



More information about the ffmpeg-cvslog mailing list