[4/9] avio: avio_ prefix for url_fdopen

Message ID 1300367015-21591-5-git-send-email-anton@khirnov.net
State Superseded
Headers show

Commit Message

Anton Khirnov March 17, 2011, 1:03 p.m.
---
 libavformat/avio.h         |    3 ++-
 libavformat/aviobuf.c      |    8 ++++++--
 libavformat/rtpenc_chain.c |    2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)

Comments

Ronald Bultje March 30, 2011, 5:46 a.m. | #1
Hi,

On Thu, Mar 17, 2011 at 6:03 AM, Anton Khirnov <anton@khirnov.net> wrote:
> ---
>  libavformat/avio.h         |    3 ++-
>  libavformat/aviobuf.c      |    8 ++++++--
>  libavformat/rtpenc_chain.c |    2 +-
>  3 files changed, 9 insertions(+), 4 deletions(-)

url_fdopen() publicness depends on URLProtocol being public. I thought
we said we wanted that private. If URLProtocol is private, apps have
no reason to ever need to call url_fdopen() and thus it should be
private.

Ronald

Patch

diff --git a/libavformat/avio.h b/libavformat/avio.h
index ffb9a89..017264b 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -451,6 +451,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);
 /**
  * @}
  */
@@ -616,7 +617,7 @@  attribute_deprecated static inline int url_is_streamed(AVIOContext *s)
  * @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);
+int avio_fdopen(AVIOContext **s, URLContext *h);
 
 #if FF_API_URL_RESETBUF
 /** Reset the buffer for reading or writing.
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 46d85e3..0dbfa54 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -421,6 +421,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 avio_fdopen(s, h);
+}
 #endif
 
 int avio_put_str(AVIOContext *s, const char *str)
@@ -808,7 +812,7 @@  uint64_t ffio_read_varlen(AVIOContext *bc){
     return val;
 }
 
-int url_fdopen(AVIOContext **s, URLContext *h)
+int avio_fdopen(AVIOContext **s, URLContext *h)
 {
     uint8_t *buffer;
     int buffer_size, max_packet_size;
@@ -933,7 +937,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 = avio_fdopen(s, h);
     if (err < 0) {
         url_close(h);
         return err;
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index 2a5a75d..b5749f0 100644
--- a/libavformat/rtpenc_chain.c
+++ b/libavformat/rtpenc_chain.c
@@ -53,7 +53,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);
+        avio_fdopen(&rtpctx->pb, handle);
     } else
         avio_open_dyn_packet_buf(&rtpctx->pb, packet_size);
     ret = av_write_header(rtpctx);