Revision 403ee835

View differences:

ffserver.c
33 33
#include "libavformat/os_support.h"
34 34
#include "libavformat/rtpdec.h"
35 35
#include "libavformat/rtsp.h"
36
// XXX for ffio_open_dyn_packet_buffer, to be removed
37
#include "libavformat/avio_internal.h"
36 38
#include "libavutil/avstring.h"
37 39
#include "libavutil/lfg.h"
38 40
#include "libavutil/random_seed.h"
......
2389 2391
                            max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
2390 2392
                        else
2391 2393
                            max_packet_size = url_get_max_packet_size(c->rtp_handles[c->packet_stream_index]);
2392
                        ret = url_open_dyn_packet_buf(&ctx->pb, max_packet_size);
2394
                        ret = ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size);
2393 2395
                    } else {
2394 2396
                        ret = avio_open_dyn_buf(&ctx->pb);
2395 2397
                    }
......
3444 3446
             c->stream->filename, stream_index, c->protocol);
3445 3447

  
3446 3448
    /* normally, no packets should be output here, but the packet size may be checked */
3447
    if (url_open_dyn_packet_buf(&ctx->pb, max_packet_size) < 0) {
3449
    if (ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size) < 0) {
3448 3450
        /* XXX: close stream */
3449 3451
        goto fail;
3450 3452
    }
libavformat/avio.h
448 448
#endif
449 449
attribute_deprecated void put_flush_packet(AVIOContext *s);
450 450
attribute_deprecated int url_open_dyn_buf(AVIOContext **s);
451
attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
451 452
attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
452 453
/**
453 454
 * @}
......
685 686
int avio_open_dyn_buf(AVIOContext **s);
686 687

  
687 688
/**
688
 * Open a write only packetized memory stream with a maximum packet
689
 * size of 'max_packet_size'.  The stream is stored in a memory buffer
690
 * with a big endian 4 byte header giving the packet size in bytes.
691
 *
692
 * @param s new IO context
693
 * @param max_packet_size maximum packet size (must be > 0)
694
 * @return zero if no error.
695
 */
696
int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
697

  
698
/**
699 689
 * Return the written size and a pointer to the buffer. The buffer
700
 * must be freed with av_free(). If the buffer is opened with
701
 * avio_open_dyn_buf, then padding of FF_INPUT_BUFFER_PADDING_SIZE is
702
 * added; if opened with url_open_dyn_packet_buf, no padding is added.
690
 * must be freed with av_free().
691
 * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
703 692
 *
704 693
 * @param s IO context
705 694
 * @param pbuffer pointer to a byte buffer
libavformat/avio_internal.h
81 81
unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
82 82
                                    unsigned int len);
83 83

  
84
/**
85
 * Open a write only packetized memory stream with a maximum packet
86
 * size of 'max_packet_size'.  The stream is stored in a memory buffer
87
 * with a big endian 4 byte header giving the packet size in bytes.
88
 *
89
 * @param s new IO context
90
 * @param max_packet_size maximum packet size (must be > 0)
91
 * @return zero if no error.
92
 */
93
int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
94

  
84 95
#endif // AVFORMAT_AVIO_INTERNAL_H
libavformat/aviobuf.c
423 423
{
424 424
    return avio_open_dyn_buf(s);
425 425
}
426
int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
427
{
428
    return ffio_open_dyn_packet_buf(s, max_packet_size);
429
}
426 430
int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
427 431
{
428 432
    return avio_close_dyn_buf(s, pbuffer);
......
1160 1164
    return url_open_dyn_buf_internal(s, 0);
1161 1165
}
1162 1166

  
1163
int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
1167
int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
1164 1168
{
1165 1169
    if (max_packet_size <= 0)
1166 1170
        return -1;
libavformat/movenchint.c
23 23
#include "libavutil/intreadwrite.h"
24 24
#include "internal.h"
25 25
#include "rtpenc_chain.h"
26
#include "avio_internal.h"
26 27

  
27 28
int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index)
28 29
{
......
409 410
    /* Fetch the output from the RTP muxer, open a new output buffer
410 411
     * for next time. */
411 412
    size = avio_close_dyn_buf(rtp_ctx->pb, &buf);
412
    if ((ret = url_open_dyn_packet_buf(&rtp_ctx->pb,
413
    if ((ret = ffio_open_dyn_packet_buf(&rtp_ctx->pb,
413 414
                                       RTP_MAX_PACKET_SIZE)) < 0)
414 415
        goto done;
415 416

  
libavformat/rtpdec.c
41 41
         buffer to 'rtp_write_packet' contains all the packets for ONE
42 42
         frame. Each packet should have a four byte header containing
43 43
         the length in big endian format (same trick as
44
         'url_open_dyn_packet_buf')
44
         'ffio_open_dyn_packet_buf')
45 45
*/
46 46

  
47 47
static RTPDynamicProtocolHandler ff_realmedia_mp3_dynamic_handler = {
libavformat/rtpenc_chain.c
21 21

  
22 22
#include "avformat.h"
23 23
#include "rtpenc_chain.h"
24
#include "avio_internal.h"
24 25

  
25 26
AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
26 27
                                       URLContext *handle, int packet_size)
......
55 56
    if (handle) {
56 57
        url_fdopen(&rtpctx->pb, handle);
57 58
    } else
58
        url_open_dyn_packet_buf(&rtpctx->pb, packet_size);
59
        ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size);
59 60
    ret = av_write_header(rtpctx);
60 61

  
61 62
    if (ret) {
libavformat/rtspenc.c
29 29
#include "os_support.h"
30 30
#include "rtsp.h"
31 31
#include "internal.h"
32
#include "avio_internal.h"
32 33
#include "libavutil/intreadwrite.h"
33 34
#include "libavutil/avstring.h"
34 35

  
......
142 143
        int id;
143 144
        /* The interleaving header is exactly 4 bytes, which happens to be
144 145
         * the same size as the packet length header from
145
         * url_open_dyn_packet_buf. So by writing the interleaving header
146
         * ffio_open_dyn_packet_buf. So by writing the interleaving header
146 147
         * over these bytes, we get a consecutive interleaved packet
147 148
         * that can be written in one call. */
148 149
        interleaved_packet = interleave_header = ptr;
......
162 163
        size -= packet_len;
163 164
    }
164 165
    av_free(buf);
165
    url_open_dyn_packet_buf(&rtpctx->pb, RTSP_TCP_MAX_PACKET_SIZE);
166
    ffio_open_dyn_packet_buf(&rtpctx->pb, RTSP_TCP_MAX_PACKET_SIZE);
166 167
    return 0;
167 168
}
168 169

  

Also available in: Unified diff