summaryrefslogtreecommitdiff
path: root/libavformat/rtmppkt.c
Commit message (Collapse)AuthorAge
* Merge commit '44127b157e9f8acb837d4bb3a094f56b40da3ef5'Michael Niedermayer2014-11-28
|\ | | | | | | | | | | | | * commit '44127b157e9f8acb837d4bb3a094f56b40da3ef5': rtmppkt: Make pkt->data reallocable Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmppkt: Make pkt->data reallocableMartin Storsjö2014-11-28
| | | | | | | | | | | | | | | | We try to avoid mixing av_malloc with av_realloc, since av_malloc may be implemented with functions that can't (formally) be mixed with the functions used in av_realloc. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '3b18857ab301d2a0b3e86e9d85eed76f0798a29c'Michael Niedermayer2014-06-01
|\| | | | | | | | | | | | | * commit '3b18857ab301d2a0b3e86e9d85eed76f0798a29c': rtmppkt: Add method to read an AMF string that is not prefixed by its type Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmppkt: Add method to read an AMF string that is not prefixed by its typeUwe L. Korn2014-06-01
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/rtmppkt: Fix random crashkyh964032014-04-23
| | | | | | | | | | | | Fixes Ticket3564 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2014-03-07
|\| | | | | | | | | | | | | * qatar/master: rtmppkt: Rename the ts_delta field to ts_field Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmppkt: Rename the ts_delta field to ts_fieldMartin Storsjö2014-03-07
| | | | | | | | | | | | | | | | | | | | | | Based on a suggestion by Martin Panter. This is more descriptive, since it's the actual timestamp field from the RTMP packet, which might or might not be a delta depending on context (in some packets it's a delta, in some packets it's an absolute timestamp, and in some packets it's 0xffffff to indicate that the actual delta or absolute timestamp is transmitted separately). Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '8bbb02ae4f44f1cddc1ce1e74a71fa2022e93da3'Michael Niedermayer2014-03-07
|\| | | | | | | | | | | | | * commit '8bbb02ae4f44f1cddc1ce1e74a71fa2022e93da3': rtmppkt: Properly handle extended timestamps when writing Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmppkt: Properly handle extended timestamps when writingMartin Panter2014-03-07
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '48cfb5f4114048383a4ee85b2f500eefce24cad2'Michael Niedermayer2014-03-07
|\| | | | | | | | | | | | | * commit '48cfb5f4114048383a4ee85b2f500eefce24cad2': rtmppkt: Add a descriptive comment Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmppkt: Add a descriptive commentMartin Panter2014-03-07
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '5b2ad78f97d43299adcb038c04346999fe9b196c'Michael Niedermayer2014-03-07
|\| | | | | | | | | | | | | * commit '5b2ad78f97d43299adcb038c04346999fe9b196c': rtmppkt: Handle extended timestamp field even for one-byte header Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmppkt: Handle extended timestamp field even for one-byte headerMartin Panter2014-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related fix in "rtmpdump": https://repo.or.cz/w/rtmpdump.git/commitdiff/79459a2 Adobe's RTMP specification (21 Dec 2012), section 5.3.1.3 ("Extended Timestamp"), says "this field is present in Type 3 chunks". Type 3 chunks are those with the one-byte header size. This resolves intermittent hangs and segfaults caused by the read function, and also includes an untested fix for the write function. The read function was tested with ABC (Australia) News 24 streams, however they are probably restricted to only Australian internet addresses. Some of the packets at the start of these streams seem to contain junk timestamp fields, often requiring the extended field. Test command: avplay rtmp://cp81899.live.edgefcs.net/live/news24-med@28772 Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '89564be444d24f75ea5add8b6987e414cf7aa7d5'Michael Niedermayer2014-01-21
|\| | | | | | | | | | | | | * commit '89564be444d24f75ea5add8b6987e414cf7aa7d5': rtmpproto: Send a full, absolute timestamp if it isn't monotonically growing Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmpproto: Send a full, absolute timestamp if it isn't monotonically growingMartin Storsjö2014-01-20
| | | | | | | | | | | | | | | | The normal differential timestamps can't handle negative differences, thus send a full packet header with an absolute timestamp in these cases. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '84a125c4c28f3e3e215d2e6c32f7f0ec43bbc04c'Michael Niedermayer2013-10-14
|\| | | | | | | | | | | | | * commit '84a125c4c28f3e3e215d2e6c32f7f0ec43bbc04c': rtmp: Allocate the prev_pkt arrays dynamically Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: Allocate the prev_pkt arrays dynamicallyMartin Storsjö2013-10-14
| | | | | | | | | | | | | | | | | | | | Normally, all channel ids are between 0 and 10, while they in uncommon cases can have values up to 64k. This avoids allocating two arrays for up to 64k entries (at a total of over 6 MB in size) each when most of them aren't used at all. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '32a414f316c7f0eea877370e3f9d9f25afbf5da2'Michael Niedermayer2013-09-23
|\| | | | | | | | | | | | | * commit '32a414f316c7f0eea877370e3f9d9f25afbf5da2': rtmp: Support AMF_DATA_TYPE_MIXEDARRAY Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: Support AMF_DATA_TYPE_MIXEDARRAYLuca Barbato2013-09-22
| | | | | | | | | | | | | | | | | | And fix the AMF_DATA_TYPE_ARRAY parsing while at it. A MIXEDARRAY type, as the ARRAY, store the number of elements in an uint32 before the list. The ARRAY is strict and does not have an OBJECT terminator, MIXEDARRAY behaves like an OBJECT type and a different than stated number of element can be present.
* | Merge commit '8583b14252deac71136f1dec231910abab0ba503'Michael Niedermayer2013-09-18
|\| | | | | | | | | | | | | * commit '8583b14252deac71136f1dec231910abab0ba503': rtmp: Support reading interleaved chunks. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: Support reading interleaved chunks.Josh Allmann2013-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A given packet won't always come in contiguously; sometimes they may be broken up on chunk boundaries by packets of another channel. This support primarily involves tracking information about the data that's been read, so the reader can pick up where it left off for a given channel. As a side effect, we no longer over-report the bytes read if (toread = MIN(size, chunk_size)) == size Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-08-11
|\| | | | | | | | | | | | | * qatar/master: rtmp: Do not misuse memcmp Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: Do not misuse memcmpLuca Barbato2013-08-11
| | | | | | | | CC: libav-stable@libav.org
* | Merge commit 'ba5393a609c723ec8ab7f9727c10fef734c09278'Michael Niedermayer2013-08-11
|\| | | | | | | | | | | | | * commit 'ba5393a609c723ec8ab7f9727c10fef734c09278': rtmp: rename data_size to size Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: rename data_size to sizeLuca Barbato2013-08-10
| |
* | Merge commit '28306e6d620c109ddd672f7243adfbc2bbb3b18f'Michael Niedermayer2013-06-02
|\| | | | | | | | | | | | | | | | | | | | | * commit '28306e6d620c109ddd672f7243adfbc2bbb3b18f': network: factor out bind-listening code use my full first name instead of short one in copyrights Conflicts: libavformat/tcp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * use my full first name instead of short one in copyrightsKostya Shishkov2013-06-01
| |
* | Merge commit 'e926b5ceb1962833f0c884a328382bc2eca67aff'Michael Niedermayer2013-05-01
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'e926b5ceb1962833f0c884a328382bc2eca67aff': avformat: Drop unnecessary ff_ name prefixes from static functions Conflicts: libavformat/audiointerleave.c libavformat/mux.c libavformat/mxfenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Drop unnecessary ff_ name prefixes from static functionsDiego Biurrun2013-04-30
| |
| * rtmp: fix buffer overflows in ff_amf_tag_contents()Xi Wang2013-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A negative `size' will bypass FFMIN(). In the subsequent memcpy() call, `size' will be considered as a large positive value, leading to a buffer overflow. Change the type of `size' to unsigned int to avoid buffer overflow, and simplify overflow checks accordingly. Also change a literal buffer size to use sizeof, and limit the amount of data copied in another memcpy call as well. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
| * rtmp: fix multiple broken overflow checksXi Wang2013-01-23
| | | | | | | | | | | | | | | | | | | | | | | | Sanity checks like `data + size >= data_end || data + size < data' are broken, because `data + size < data' assumes pointer overflow, which is undefined behavior in C. Many compilers such as gcc/clang optimize such checks away. Use `size < 0 || size >= data_end - data' instead. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* | rtmp: fix buffer overflows in ff_amf_tag_contents()Xi Wang2013-01-23
| | | | | | | | | | | | | | | | | | | | | | | | A negative `size' will bypass FFMIN(). In the subsequent memcpy() call, `size' will be considered as a large positive value, leading to a buffer overflow. Change the type of `size' to unsigned int to avoid buffer overflow, and simplify overflow checks accordingly. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | rtmp: fix multiple broken overflow checksXi Wang2013-01-23
| | | | | | | | | | | | | | | | | | | | | | | | Sanity checks like `data + size >= data_end || data + size < data' are broken, because `data + size < data' assumes pointer overflow, which is undefined behavior in C. Many compilers such as gcc/clang optimize such checks away. Use `size < 0 || size >= data_end - data' instead. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '33f28a3be3092f642778253d9529dd66fe2a014a'Michael Niedermayer2013-01-01
|\| | | | | | | | | | | | | | | * commit '33f28a3be3092f642778253d9529dd66fe2a014a': rtmp: Add a function for writing AMF strings based on two substrings rtmp: Return a proper error code in handle_invoke_error Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: Add a function for writing AMF strings based on two substringsMartin Storsjö2012-12-31
| | | | | | | | | | | | | | This avoids having to concatenate them into one buffer before writing them as AMF. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-02
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: x86: fft: fix imdct_half() for AVX rtmppkt: Add missing libavcodec/bytestream.h include. rtmp: add functions for reading AMF values vc1dec: remove useless #include simple_idct.h dct-test: always link with aandcttab.o vp8: pack struct VP8ThreadData more efficiently x86: remove libmpeg2 mmx(ext) idct functions eamad: Use dsputils instead of a custom bswap16_buf Canopus Lossless decoder Conflicts: Changelog LICENSE libavcodec/avcodec.h libavcodec/cllc.c libavcodec/eamad.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: add functions for reading AMF valuesJordi Ortiz2012-08-02
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Avoid C99 variable declarations within for statements. rtmp: Read and handle incoming packets while writing data doc: document THREAD_TYPE fate variable rtpdec: Don't require frames to start with a Mode A packet avconv: don't try to free threads that were not initialized. Conflicts: doc/fate.texi ffplay.c libavdevice/dv1394.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: Read and handle incoming packets while writing dataSamuel Pitoiset2012-06-14
| | | | | | | | | | | | | | | | | | | | | | This makes sure all incoming packets are read and handled (and reacted to) while sending an FLV stream over RTMP to a server. If there were enough incoming data to fill the TCP buffers, this could potentially make things block at unexpected places. For the upcoming RTMPT support, we need to consume all incoming data before we can send the next request. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-05-25
|\| | | | | | | | | | | | | | | | | | | * qatar/master: movenc: Don't write the 'wave' atom or its child 'enda' for lpcm audio. imc: some cosmetics rtmp: Pass the proper return code in rtmp_handshake rtmp: Check return codes of net IO operations Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: Check return codes of net IO operationsSamuel Pitoiset2012-05-24
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-05-25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: rtmp: Return a proper error code instead of -1 rtmp: Check malloc calls rtmp: Check ff_rtmp_packet_create calls lavfi: add audio mix filter flvdec: Make sure sample_rate is set to the updated value tqi: Pass errors from the MB decoder Conflicts: Changelog doc/filters.texi libavcodec/eatqi.c libavfilter/Makefile libavfilter/allfilters.c libavfilter/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: Check ff_rtmp_packet_create callsSamuel Pitoiset2012-05-24
| | | | | | | | | | | | | | Check malloc calls used by ff_rtmp_packet_create, unify error handling and pass on error codes. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: x86: cabac: replace explicit memory references with "m" operands avplay: don't request a stereo downmix wmapro: use av_float2int() lavc: avoid invalid memcpy() in avcodec_default_release_buffer() lavu: replace int/float punning functions lavfi: install libavfilter/vsrc_buffer.h Remove extraneous semicolons sdp: Restore the original mp4 format h264 extradata if converted rtpenc: Add support for mp4 format h264 rtpenc: Simplify code by introducing a separate end pointer movenc: Use the actual converted sample for RTP hinting Fix a bunch of common typos. Conflicts: doc/developer.texi doc/eval.texi doc/filters.texi doc/protocols.texi ffmpeg.c ffplay.c libavcodec/mpegvideo.h libavcodec/x86/cabac.h libavfilter/Makefile libavformat/avformat.h libavformat/cafdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/gxfenc.c libavformat/img2.c libavformat/movenc.c libavformat/mpegts.c libavformat/rtpenc_h264.c libavformat/utils.c libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavu: replace int/float punning functionsMans Rullgard2011-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing functions defined in intfloat_readwrite.[ch] are both slow and incorrect (infinities are not handled). This introduces a new header with fast, inline conversion functions using direct union punning assuming an IEEE-754 system, an assumption already made throughout the code. The one use of Intel/Motorola extended 80-bit format is replaced by simpler code sufficient under the present constraints (positive normal values). The old functions are marked deprecated and retained for compatibility. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (40 commits) H.264: template left MB handling H.264: faster fill_decode_caches H.264: faster write_back_* H.264: faster fill_filter_caches H.264: make filter_mb_fast support the case of unavailable top mb Do not include log.h in avutil.h Do not include pixfmt.h in avutil.h Do not include rational.h in avutil.h Do not include mathematics.h in avutil.h Do not include intfloat_readwrite.h in avutil.h Remove return statements following infinite loops without break RTSP: Doxygen comment cleanup doxygen: Escape '\' in Doxygen documentation. md5: cosmetics md5: use AV_WL32 to write result md5: add fate test md5: include correct headers md5: fix test program doxygen: Drop array size declarations from Doxygen parameter names. doxygen: Fix parameter names to match the function prototypes. ... Conflicts: libavcodec/x86/dsputil_mmx.c libavformat/flvenc.c libavformat/oggenc.c libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Do not include intfloat_readwrite.h in avutil.hMans Rullgard2011-07-03
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-05-26
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (32 commits) doc: create separate section for audio encoders swscale: Remove orphaned, commented-out function declaration. swscale: Eliminate rgb24toyv12_c() duplication. Remove h263_msmpeg4 from MpegEncContext. APIchanges: Fill in git hash for fps_probe_size (30315a8) avformat: Add fpsprobesize as an AVOption. avoptions: Return explicitly NAN or {0,0} if the option isn't found rtmp: Reindent rtmp: Don't try to do av_malloc(0) tty: replace AVFormatParameters.sample_rate abuse with a private option. Fix end time of last chapter in compute_chapters_end ffmpeg: get rid of useless AVInputStream.nb_streams. ffmpeg: simplify managing input files and streams ffmpeg: purge redundant AVInputStream.index. lavf: deprecate AVFormatParameters.channel. libdc1394: add a private option for channel. dv1394: add a private option for channel. v4l2: reindent. v4l2: add a private option for channel. lavf: deprecate AVFormatParameters.standard. ... Conflicts: doc/APIchanges doc/encoders.texi ffmpeg.c libavdevice/alsa-audio.h libavformat/version.h libavutil/opt.c libswscale/rgb2rgb.h libswscale/rgb2rgb_template.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtmp: ReindentMartin Storsjö2011-05-25
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * rtmp: Don't try to do av_malloc(0)Martin Storsjö2011-05-25
| | | | | | | | | | | | | | | | | | Some received packets can have size 0. The return value from av_malloc(0) may be NULL, which is ok if the size was 0. On OS X, however, the returned pointer is non-null but leads to crashes when trying to free it. Signed-off-by: Martin Storsjö <martin@martin.st>