Commit Graph

53 Commits

Author SHA1 Message Date
Martin Storsjö b14629e5ea rtmp: Make the input FLV parser handle data cut at any point
This makes the RTMP writing code able to handle FLV data
fed in arbitrarily small or large chunks, with multiple
consecutive packets in one write call, or having the FLV
packet header split over numerous write calls.

When used in conjunction with the flv muxer, the AVIO buffer
size still needs to be large enough to fit the initial metadata
packet though, since the size of that packet is written with a
seekback.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-22 10:36:16 +03:00
Martin Storsjö 3ffe32eb96 rtmp: Don't blindly skip the 4 trailer bytes from the FLV packets
If not enough bytes are available, keep track of them and skip
them on next call.

In practice, if these trailer bytes are written in a separate
call, there is no other data written in this call, making it
fall into the "FLV packet too small" case currently - working,
but not as intended.

This patch makes the code more robust, handling all cases
except for having the FLV packet header split over multiple
write calls.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-20 16:23:48 +03:00
Chiranjeevi Melam a14c784210 rtmp: Handle FLV packets written in more than one write call
If the FLV packet is larger than the AVIO buffer, a partial
FLV packet will be flushed to the RTMP protocol.

This commit handles the most common cases of FLV packets
being written in more than one call.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-20 16:23:46 +03:00
Mans Rullgard ee8aecd23a Do not include intfloat_readwrite.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:06 +01:00
Mans Rullgard add41decd9 Remove return statements following infinite loops without break
These statements cannot be reached and are thus not needed.
This removes a number of compiler warnings.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:39:07 +01:00
Martin Storsjö 271c869cc3 rtmp: Don't try to do av_malloc(0)
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>
2011-05-25 22:00:42 +03:00
Stefano Sabatini 59d96941f0 avio: remove AVIO_* access symbols in favor of new AVIO_FLAG_* symbols
Make AVIO_FLAG_ access constants work as flags, and in particular fix
the behavior of functions (such as avio_check()) which expect them to
be flags rather than modes.

This breaks API.
2011-04-19 19:47:58 +02:00
Anton Khirnov 7f804085f1 lavf: remove FF_API_URL_CLASS cruft. 2011-04-19 18:31:12 +02:00
Anton Khirnov f35ff97f2e lavf: use designated initializers for all protocols
This is more readable and makes it easier to reorder URLProtocol
members.
2011-04-08 11:08:26 +02:00
Anton Khirnov f87b1b373a avio: AVIO_ prefixes for URL_ open flags. 2011-04-07 18:07:16 +02:00
Anton Khirnov 5958df341d avio: deprecate url_max_packet_size().
URLContext.max_packet_size should be used directly.
2011-04-04 17:45:20 +02:00
Anton Khirnov e52a9145c8 avio: make url_close() internal. 2011-04-04 17:45:20 +02:00
Anton Khirnov 925e908bc7 avio: make url_write() internal. 2011-04-04 17:45:20 +02:00
Anton Khirnov dce3756459 avio: make url_read_complete() internal. 2011-04-04 17:45:20 +02:00
Anton Khirnov 0589da0aa5 avio: make url_open() internal. 2011-04-04 17:45:20 +02:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Anton Khirnov 9ad4c65f6f rtmpproto: rename URLContext* argument in rtmp_write()
Now the first argument is URLContext *h. However, the function logs to
LOG_CONTEXT, which is #defined as 's' for new lavf major versions.

Therefore, rename h -> s.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-03 11:43:48 +00:00
Diego Elio Pettenò c6610a216e Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.
This also lists the objects from those two libraries as internal (by adding
the ff_ prefix) so that they can then be hidden via linker scripts.
2011-01-26 22:10:09 +00:00
Aurelien Jacobs ade800c5b7 properly check for FF_API_URL_CLASS instead of LIBAVFORMAT_VERSION_MAJOR
Originally committed as revision 25484 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-15 13:09:35 +00:00
Måns Rullgård 49bd8e4b84 Fix grammar errors in documentation
Originally committed as revision 23904 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-30 15:38:06 +00:00
Måns Rullgård f3bfe388b5 Make ff_url_split() public
ff_url_split() is retained as an alias, as it was used by ffserver,
to avoid breaking ABI compatibility with it.

Originally committed as revision 23822 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-27 14:16:46 +00:00
Martin Storsjö e8ccf24527 RTMP: Return from rtmp_read as soon as some data is available
Earlier, the function only returned when the enough data to fill the
requested buffer was available. This lead to high latency when receiving
low-bandwidth streams.

Originally committed as revision 23642 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-18 12:02:51 +00:00
Martin Storsjö 27241cbffe Declare the url_write buffer parameter as const
Originally committed as revision 23401 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-01 07:46:23 +00:00
trueice@gmail.com aae9a0931c 24l trocadero: RTMP reader forgot to shift high byte of timestamp to its
proper position

Patch by trueice (his gmail account is obvious)

Originally committed as revision 23305 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-05-25 07:01:04 +00:00
Diego Biurrun ba87f0801d Remove explicit filename from Doxygen @file commands.
Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.

Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-20 14:45:34 +00:00
Aurelien Jacobs e4a9e3cc7c move ff_url_split() and ff_url_join() declarations to internal.h
those functions are not part of the public API

Originally committed as revision 22534 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-14 23:59:48 +00:00
Martin Storsjö f984dcf6dd Reindent
Originally committed as revision 22322 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-08 09:05:03 +00:00
Martin Storsjö c5c6e67c28 Rename url_split to ff_url_split
Since this function isn't in the public API, it should have an ff_ prefix.

Originally committed as revision 22321 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-08 09:03:25 +00:00
Martin Storsjö 57b5555c91 Use ff_url_join for assembling URLs, instead of snprintf
This ensures proper escaping of numerical IPv6 addresses.

The RTSP (de)muxer needs its own network initialization, since it isn't
a protocol and url_open hasn't been called yet.

Originally committed as revision 22226 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-05 22:35:21 +00:00
Kostya Shishkov bf7c17192f Make RTMP client send bytes read report
Originally committed as revision 21882 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-02-18 16:27:18 +00:00
Kostya Shishkov adb5496146 another 10l: forgot to change parent condition as well
Originally committed as revision 21535 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-30 09:47:57 +00:00
Kostya Shishkov b381a823cd 10l trocadero: now return value of ff_rtmp_packet_read() has different meaning
Originally committed as revision 21534 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-30 09:45:52 +00:00
Sergiy 56e29bf2c9 Correct timestamps inside FLV data received by RTMP.
Patch by Sergiy (gmail(piratfm))

Originally committed as revision 21161 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-12 07:10:47 +00:00
Art Clarke e2ee11e868 Use old-style RTMP handshake for old servers.
This fixes issue streaming from Red5 server.
Patch by Art Clarke (aclarke@`echo xyzzy|sed s/y/u/|sed s/y/le/|tr z g`.com)

Originally committed as revision 21160 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-12 06:44:49 +00:00
Martin Storsjö 4aaebf78f5 Reply to RTMP ping with the same value as received by client.
Patch by Martin Storsjö ($name at $name dot \163\164)

Originally committed as revision 20881 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-16 12:49:38 +00:00
Kostya Shishkov cfac91fec3 Dump RTMP packet contents in debug mode
Originally committed as revision 20799 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-11 17:13:35 +00:00
Martin Storsjö f8caa5441b 5l trocadero: don't forget to free packet in gen_connect()
Patch by Martin Storsjö ($name at $name dot `abbreviation for "street"`)

Originally committed as revision 20798 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-11 15:31:58 +00:00
Martin Storsjö 72b870b95b Do not try to interact with RTMP server after "stop" command was received.
Patch by Martin Storsjö ($name at $name dot `Sao Tome and Principe domain`)

Originally committed as revision 20797 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-11 11:37:21 +00:00
Kostya Shishkov e07c92e4bb cosmetics: insert space between codeword and left parenthesis
Originally committed as revision 20746 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-06 07:03:46 +00:00
Sergiy 615c287990 Do not send invokes to RTMP server if we are not connected to it.
Patch by Sergiy (server.connect("gmail.com").selectAddress("piratfm"))

Originally committed as revision 20745 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-06 07:01:37 +00:00
Kostya Shishkov c72406112f cosmetics: reindent after last commit
Originally committed as revision 20732 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-04 16:52:42 +00:00
Sergiy 6bf22e18d1 Implement RTMP output (publishing FLV stream to RTMP server).
Patch by Sergiy (piratfm at `do-no-evil-mail`.com)

Originally committed as revision 20731 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-04 16:52:16 +00:00
Kostya Shishkov 2784ede40a Remove duplicating variable
Originally committed as revision 20718 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-03 17:11:48 +00:00
Sergiy 31da596634 Send connect() and createStream() in RTMP system channel, not video channel.
Patch by Sergiy (com gmail . piratfm @ mail =)

Originally committed as revision 20716 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-03 15:59:51 +00:00
Sergiy 5e9ad75985 Move "app" string into RTMP protocol context.
Patch by Sergiy (com.gmail@piratfm)

Originally committed as revision 20715 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-03 15:47:00 +00:00
Sergiy b316991bb6 Move is_input flag into RTMP protocol context.
Patch by Sergiy (gmail(piratfm))
Thread "[PATCH] rtmp-output"

Originally committed as revision 20702 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-02 12:55:10 +00:00
Kostya Shishkov e6b244a3b9 Full-header RTMP packets contain real timestamp, others contain timestamp
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
2009-12-01 16:08:44 +00:00
Kostya Shishkov fe52395878 Print error when RTMP protocol can't open connection
Originally committed as revision 20574 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-22 08:42:55 +00:00
Kostya Shishkov afbacb931b Pass only useful FLV metadata from RTMP stream
Originally committed as revision 20573 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-22 08:40:55 +00:00
Stefano Sabatini 1d8041b36c Split overly long line in doxy.
Originally committed as revision 20529 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-12 23:05:56 +00:00