summaryrefslogtreecommitdiff
path: root/libavformat/rtmppkt.c
Commit message (Collapse)AuthorAge
* rtmppkt: Repeat the full 32 bit timestamp for chunking continuation packetsMartin Storsjö2015-01-15
| | | | | | | | | | | | | | | | | | This fixes sending chunked packets (packets larger than the output chunk size, which often can be e.g. 4096 bytes) with a timestamp delta (or absolute timstamp, if it's a timestamp step backwards, or the first packet of the stream) larger than 0xffffffff. The RTMP spec explicitly says (in section 5.3.1.3.) that packets of type 3 (continuation packets) should include this field, if the previous non-continuation packet had it included. The receiving code handles these packets correctly. Pointed out by Cheolho Park. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* 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>
* 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>
* 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>
* rtmppkt: Properly handle extended timestamps when writingMartin Panter2014-03-07
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmppkt: Add a descriptive commentMartin Panter2014-03-07
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* 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>
* 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>
* 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>
* 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.
* 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>
* rtmp: Do not misuse memcmpLuca Barbato2013-08-11
| | | | CC: libav-stable@libav.org
* rtmp: rename data_size to sizeLuca Barbato2013-08-10
|
* use my full first name instead of short one in copyrightsKostya Shishkov2013-06-01
|
* 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: 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>
* rtmp: add functions for reading AMF valuesJordi Ortiz2012-08-02
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* 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>
* rtmp: Check return codes of net IO operationsSamuel Pitoiset2012-05-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* 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>
* 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>
* Do not include intfloat_readwrite.h in avutil.hMans Rullgard2011-07-03
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* 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>
* avio: make url_write() internal.Anton Khirnov2011-04-04
|
* avio: make url_read_complete() internal.Anton Khirnov2011-04-04
|
* avio: make url_read() internal.Anton Khirnov2011-04-04
|
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* 1l trocadero: forgot reference operator on bytestream_get_be32() argumentKostya Shishkov2010-03-07
| | | | Originally committed as revision 22277 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make RTMP send/receive packet functions report number of bytes read or sent.Kostya Shishkov2010-01-30
| | | | Originally committed as revision 21533 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: add an empty line between variable declarations and codeKostya Shishkov2010-01-30
| | | | Originally committed as revision 21532 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove some unused variables, fixes the warnings:Diego Biurrun2009-12-24
| | | | | | | libavformat/rtmppkt.c:350: warning: unused variable ‘i’ libavformat/rtmppkt.c:349: warning: unused variable ‘base’ Originally committed as revision 20917 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Dump RTMP packet contents in debug modeKostya Shishkov2009-12-11
| | | | Originally committed as revision 20799 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Compress headers for output RTMP packets.Sergiy2009-12-04
| | | | | | Patch by Sergiy (piratfmGMAIL) Originally committed as revision 20728 to svn://svn.ffmpeg.org/ffmpeg/trunk
* RTMP packets with one-byte header use previous packet timestamp difference, soSergiy2009-12-03
| | | | | | | track timestamp difference as well. Patch by Sergiy (mail.composeAddress("piratfm","gmail.com")) Originally committed as revision 20714 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Write timestamp deltas, not timestamps, for RTMP packets with partial headerKostya Shishkov2009-12-01
| | | | Originally committed as revision 20686 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Full-header RTMP packets contain real timestamp, others contain timestampKostya Shishkov2009-12-01
| | | | | | | | difference, so make all read packets store absolute timestamp. As a consequence, we don't need to track audio/video timestamps separately any longer in protocol handler. Originally committed as revision 20685 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Write header for RTMP packets with channel_id >= 64 correctlyKostya Shishkov2009-12-01
| | | | Originally committed as revision 20684 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Read and write extended timestamps for RTMP packets.Sergiy2009-12-01
| | | | | | Extracted from patch by Sergiy in thread "[PATCH] rtmp-output" Originally committed as revision 20683 to svn://svn.ffmpeg.org/ffmpeg/trunk
* 7l trocadero: reading right into enum variable may cause unwanted effects, useKostya Shishkov2009-12-01
| | | | | | intermediate buffer for reading value instead in RTMP protocol handler. Originally committed as revision 20682 to svn://svn.ffmpeg.org/ffmpeg/trunk
* When searching for AMF object field value, try to find that object firstKostya Shishkov2009-11-22
| | | | | | | instead of assuming it should occur right at given position. This helps finding human-readable error descriptions in RTMP server replies. Originally committed as revision 20575 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use enum instead of integer types where appropriate.Carl Eugen Hoyos2009-11-08
| | | | Originally committed as revision 20482 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Support more than 64 channels in RTMP inputKostya Shishkov2009-10-18
| | | | Originally committed as revision 20270 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Accept RTMP packets with one-byte headerKostya Shishkov2009-10-18
| | | | Originally committed as revision 20269 to svn://svn.ffmpeg.org/ffmpeg/trunk
* RTMP protocol support (as a client)Kostya Shishkov2009-07-31
Originally committed as revision 19556 to svn://svn.ffmpeg.org/ffmpeg/trunk