[3/9] avio: avio_ prefix for url_open_dyn_packet_buf

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

Commit Message

Anton Khirnov March 17, 2011, 1:03 p.m.
---
 ffserver.c                 |    4 ++--
 libavformat/avio.h         |    5 +++--
 libavformat/aviobuf.c      |    6 +++++-
 libavformat/movenchint.c   |    2 +-
 libavformat/rtpdec.c       |    2 +-
 libavformat/rtpenc_chain.c |    2 +-
 libavformat/rtspenc.c      |    4 ++--
 7 files changed, 15 insertions(+), 10 deletions(-)

Patch

diff --git a/ffserver.c b/ffserver.c
index 829b4c9..beddd01 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2389,7 +2389,7 @@  static int http_prepare_data(HTTPContext *c)
                             max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
                         else
                             max_packet_size = url_get_max_packet_size(c->rtp_handles[c->packet_stream_index]);
-                        ret = url_open_dyn_packet_buf(&ctx->pb, max_packet_size);
+                        ret = avio_open_dyn_packet_buf(&ctx->pb, max_packet_size);
                     } else {
                         ret = avio_open_dyn_buf(&ctx->pb);
                     }
@@ -3444,7 +3444,7 @@  static int rtp_new_av_stream(HTTPContext *c,
              c->stream->filename, stream_index, c->protocol);
 
     /* normally, no packets should be output here, but the packet size may be checked */
-    if (url_open_dyn_packet_buf(&ctx->pb, max_packet_size) < 0) {
+    if (avio_open_dyn_packet_buf(&ctx->pb, max_packet_size) < 0) {
         /* XXX: close stream */
         goto fail;
     }
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 9b68000..ffb9a89 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -449,6 +449,7 @@  attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...);
 #endif
 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);
 /**
  * @}
@@ -672,13 +673,13 @@  int avio_open_dyn_buf(AVIOContext **s);
  * @param max_packet_size maximum packet size (must be > 0)
  * @return zero if no error.
  */
-int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
+int avio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
 
 /**
  * Return the written size and a pointer to the buffer. The buffer
  * must be freed with av_free(). If the buffer is opened with
  * avio_open_dyn_buf, then padding of FF_INPUT_BUFFER_PADDING_SIZE is
- * added; if opened with url_open_dyn_packet_buf, no padding is added.
+ * added; if opened with avio_open_dyn_packet_buf, no padding is added.
  *
  * @param s IO context
  * @param pbuffer pointer to a byte buffer
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 6e5778a..46d85e3 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -413,6 +413,10 @@  int url_open_dyn_buf(AVIOContext **s)
 {
     return avio_open_dyn_buf(s);
 }
+int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
+{
+    return avio_open_dyn_packet_buf(s, max_packet_size);
+}
 int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
 {
     return avio_close_dyn_buf(s, pbuffer);
@@ -1148,7 +1152,7 @@  int avio_open_dyn_buf(AVIOContext **s)
     return url_open_dyn_buf_internal(s, 0);
 }
 
-int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
+int avio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
 {
     if (max_packet_size <= 0)
         return -1;
diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c
index ba0be16..1f4bd84 100644
--- a/libavformat/movenchint.c
+++ b/libavformat/movenchint.c
@@ -409,7 +409,7 @@  int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
     /* Fetch the output from the RTP muxer, open a new output buffer
      * for next time. */
     size = avio_close_dyn_buf(rtp_ctx->pb, &buf);
-    if ((ret = url_open_dyn_packet_buf(&rtp_ctx->pb,
+    if ((ret = avio_open_dyn_packet_buf(&rtp_ctx->pb,
                                        RTP_MAX_PACKET_SIZE)) < 0)
         goto done;
 
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 06fcf85..8ae3ac4 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -41,7 +41,7 @@ 
          buffer to 'rtp_write_packet' contains all the packets for ONE
          frame. Each packet should have a four byte header containing
          the length in big endian format (same trick as
-         'url_open_dyn_packet_buf')
+         'avio_open_dyn_packet_buf')
 */
 
 static RTPDynamicProtocolHandler ff_realmedia_mp3_dynamic_handler = {
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index d8e0d4f..2a5a75d 100644
--- a/libavformat/rtpenc_chain.c
+++ b/libavformat/rtpenc_chain.c
@@ -55,7 +55,7 @@  AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
     if (handle) {
         url_fdopen(&rtpctx->pb, handle);
     } else
-        url_open_dyn_packet_buf(&rtpctx->pb, packet_size);
+        avio_open_dyn_packet_buf(&rtpctx->pb, packet_size);
     ret = av_write_header(rtpctx);
 
     if (ret) {
diff --git a/libavformat/rtspenc.c b/libavformat/rtspenc.c
index 04bf576..0f1eb65 100644
--- a/libavformat/rtspenc.c
+++ b/libavformat/rtspenc.c
@@ -143,7 +143,7 @@  static int tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st)
         int id;
         /* The interleaving header is exactly 4 bytes, which happens to be
          * the same size as the packet length header from
-         * url_open_dyn_packet_buf. So by writing the interleaving header
+         * avio_open_dyn_packet_buf. So by writing the interleaving header
          * over these bytes, we get a consecutive interleaved packet
          * that can be written in one call. */
         interleaved_packet = interleave_header = ptr;
@@ -163,7 +163,7 @@  static int tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st)
         size -= packet_len;
     }
     av_free(buf);
-    url_open_dyn_packet_buf(&rtpctx->pb, RTSP_TCP_MAX_PACKET_SIZE);
+    avio_open_dyn_packet_buf(&rtpctx->pb, RTSP_TCP_MAX_PACKET_SIZE);
     return 0;
 }