diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-14 15:31:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-14 15:31:11 +0200 |
commit | 953dd72321b7eb651351eb46d7c333cb097d18bb (patch) | |
tree | 84919dd7a726ded8b10d2ca1f86f79c4bdd115be /libavformat/rtmppkt.h | |
parent | 1d4476d5dab1dd347f6870d6c5537dced8516986 (diff) | |
parent | 84a125c4c28f3e3e215d2e6c32f7f0ec43bbc04c (diff) | |
download | ffmpeg-953dd72321b7eb651351eb46d7c333cb097d18bb.tar.gz |
Merge commit '84a125c4c28f3e3e215d2e6c32f7f0ec43bbc04c'
* commit '84a125c4c28f3e3e215d2e6c32f7f0ec43bbc04c':
rtmp: Allocate the prev_pkt arrays dynamically
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtmppkt.h')
-rw-r--r-- | libavformat/rtmppkt.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/libavformat/rtmppkt.h b/libavformat/rtmppkt.h index e9c7ea7e65..fb79fedac6 100644 --- a/libavformat/rtmppkt.h +++ b/libavformat/rtmppkt.h @@ -114,10 +114,12 @@ void ff_rtmp_packet_destroy(RTMPPacket *pkt); * @param chunk_size current chunk size * @param prev_pkt previously read packet headers for all channels * (may be needed for restoring incomplete packet header) + * @param nb_prev_pkt number of allocated elements in prev_pkt * @return number of bytes read on success, negative value otherwise */ int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p, - int chunk_size, RTMPPacket *prev_pkt); + int chunk_size, RTMPPacket **prev_pkt, + int *nb_prev_pkt); /** * Read internal RTMP packet sent by the server. * @@ -126,11 +128,13 @@ int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p, * @param chunk_size current chunk size * @param prev_pkt previously read packet headers for all channels * (may be needed for restoring incomplete packet header) + * @param nb_prev_pkt number of allocated elements in prev_pkt * @param c the first byte already read * @return number of bytes read on success, negative value otherwise */ int ff_rtmp_packet_read_internal(URLContext *h, RTMPPacket *p, int chunk_size, - RTMPPacket *prev_pkt, uint8_t c); + RTMPPacket **prev_pkt, int *nb_prev_pkt, + uint8_t c); /** * Send RTMP packet to the server. @@ -140,10 +144,12 @@ int ff_rtmp_packet_read_internal(URLContext *h, RTMPPacket *p, int chunk_size, * @param chunk_size current chunk size * @param prev_pkt previously sent packet headers for all channels * (may be used for packet header compressing) + * @param nb_prev_pkt number of allocated elements in prev_pkt * @return number of bytes written on success, negative value otherwise */ int ff_rtmp_packet_write(URLContext *h, RTMPPacket *p, - int chunk_size, RTMPPacket *prev_pkt); + int chunk_size, RTMPPacket **prev_pkt, + int *nb_prev_pkt); /** * Print information and contents of RTMP packet. @@ -154,6 +160,16 @@ int ff_rtmp_packet_write(URLContext *h, RTMPPacket *p, void ff_rtmp_packet_dump(void *ctx, RTMPPacket *p); /** + * Enlarge the prev_pkt array to fit the given channel + * + * @param prev_pkt array with previously sent packet headers + * @param nb_prev_pkt number of allocated elements in prev_pkt + * @param channel the channel number that needs to be allocated + */ +int ff_rtmp_check_alloc_array(RTMPPacket **prev_pkt, int *nb_prev_pkt, + int channel); + +/** * @name Functions used to work with the AMF format (which is also used in .flv) * @see amf_* funcs in libavformat/flvdec.c * @{ |