aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-03-17 08:19:54 +0100
committerAnton Khirnov <anton@khirnov.net>2011-04-03 22:47:32 +0200
commit403ee835e7913eb9536b22c2b22edfdd700166a9 (patch)
treee93cbad528f5f9de1f3f8b9e4d3119a8ca942a33 /libavformat
parent6dc7d80de7236d04a6ee30f0e4cd03f055893bcf (diff)
downloadffmpeg-403ee835e7913eb9536b22c2b22edfdd700166a9.tar.gz
avio: make url_open_dyn_packet_buf internal.
It doesn't look fit to be a part of the public API. Adding a temporary hack to ffserver to be able to use it, should be cleaned up when somebody is up for it.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avio.h17
-rw-r--r--libavformat/avio_internal.h11
-rw-r--r--libavformat/aviobuf.c6
-rw-r--r--libavformat/movenchint.c3
-rw-r--r--libavformat/rtpdec.c2
-rw-r--r--libavformat/rtpenc_chain.c3
-rw-r--r--libavformat/rtspenc.c5
7 files changed, 27 insertions, 20 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 5bc85827d1..69896d1404 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -448,6 +448,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);
/**
* @}
@@ -685,21 +686,9 @@ attribute_deprecated int url_close_buf(AVIOContext *s);
int avio_open_dyn_buf(AVIOContext **s);
/**
- * Open a write only packetized memory stream with a maximum packet
- * size of 'max_packet_size'. The stream is stored in a memory buffer
- * with a big endian 4 byte header giving the packet size in bytes.
- *
- * @param s new IO context
- * @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);
-
-/**
* 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.
+ * must be freed with av_free().
+ * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
*
* @param s IO context
* @param pbuffer pointer to a byte buffer
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
index 916de8fcc7..29553ed614 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -81,4 +81,15 @@ unsigned long ffio_get_checksum(AVIOContext *s);
unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
unsigned int len);
+/**
+ * Open a write only packetized memory stream with a maximum packet
+ * size of 'max_packet_size'. The stream is stored in a memory buffer
+ * with a big endian 4 byte header giving the packet size in bytes.
+ *
+ * @param s new IO context
+ * @param max_packet_size maximum packet size (must be > 0)
+ * @return zero if no error.
+ */
+int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
+
#endif // AVFORMAT_AVIO_INTERNAL_H
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index cb5f2790f7..73045e6599 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -423,6 +423,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 ffio_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);
@@ -1160,7 +1164,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 ffio_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 eb93ef8d7e..615714627c 100644
--- a/libavformat/movenchint.c
+++ b/libavformat/movenchint.c
@@ -23,6 +23,7 @@
#include "libavutil/intreadwrite.h"
#include "internal.h"
#include "rtpenc_chain.h"
+#include "avio_internal.h"
int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index)
{
@@ -409,7 +410,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 = ffio_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 bbd5f338ed..281f51c443 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')
+ 'ffio_open_dyn_packet_buf')
*/
static RTPDynamicProtocolHandler ff_realmedia_mp3_dynamic_handler = {
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index 77633ed53e..a923b2deb6 100644
--- a/libavformat/rtpenc_chain.c
+++ b/libavformat/rtpenc_chain.c
@@ -21,6 +21,7 @@
#include "avformat.h"
#include "rtpenc_chain.h"
+#include "avio_internal.h"
AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
URLContext *handle, int packet_size)
@@ -55,7 +56,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);
+ ffio_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 e3631c4290..7f52b1fdb1 100644
--- a/libavformat/rtspenc.c
+++ b/libavformat/rtspenc.c
@@ -29,6 +29,7 @@
#include "os_support.h"
#include "rtsp.h"
#include "internal.h"
+#include "avio_internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/avstring.h"
@@ -142,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
+ * ffio_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;
@@ -162,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);
+ ffio_open_dyn_packet_buf(&rtpctx->pb, RTSP_TCP_MAX_PACKET_SIZE);
return 0;
}