Commit Graph

79 Commits

Author SHA1 Message Date
Samuel Pitoiset 8ee3e1874e rtmp: support connection parameters
Allow using connection parameters in order to append arbitrary
AMF data like "B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0" to the
Connect message. You can pass these parameters through the -rtmp_conn
option.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-11 13:46:50 +03:00
Luca Barbato c6eeb9b7b6 rtmp: fix url parsing
The application component can have a subcomponent to specify the
application instance even if it doesn't have a ":" in the playpath.
2012-05-25 14:20:34 -07:00
Samuel Pitoiset 177bcc9593 rtmp: Pass the proper return code in rtmp_handshake
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-24 22:16:46 +03:00
Samuel Pitoiset bba287fdac rtmp: Check return codes of net IO operations
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-24 22:16:46 +03:00
Samuel Pitoiset a4d3f3580b rtmp: Return a proper error code instead of -1
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-24 00:25:36 +03:00
Samuel Pitoiset 08e93f5b46 rtmp: Check malloc calls
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-24 00:25:35 +03:00
Samuel Pitoiset f645f1d6ea rtmp: Check ff_rtmp_packet_create calls
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>
2012-05-24 00:25:35 +03:00
Martin Storsjö 4b7304e80d rtmp: Don't assume path points to a string of nonzero length
If using the new -rtmp_app and -rtmp_playpath parameters,
one can in many cases set the main url to just rtmp://server/.
If the trailing slash is omitted, path is a string of zero length,
and using path+1 will end up reading uninitialized data.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-17 21:16:52 +03:00
Samuel Pitoiset d55961fa82 rtmp: Implement check bandwidth notification.
According to the behaviour of librtmp, it is recommended to send this
message to the server after receiving the 'onBWDone' callback in order
to do bandwidth checking and improve compatibility with some servers.
2012-05-10 13:55:32 +03:00
Samuel Pitoiset 05945db9ce rtmp: Support 'rtmp_swfurl', an option which specifies the URL of the SWF player. 2012-05-10 13:55:31 +03:00
Samuel Pitoiset e64673e4f4 rtmp: Support 'rtmp_flashver', an option which overrides the version of the Flash plugin. 2012-05-10 13:55:30 +03:00
Samuel Pitoiset 55c9320e06 rtmp: Support 'rtmp_tcurl', an option which overrides the URL of the target stream.
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-10 13:55:26 +03:00
Samuel Pitoiset b2e495afa8 rtmp: Support 'rtmp_live', an option which specifies if the media is a live stream.
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-08 13:21:35 +03:00
Samuel Pitoiset b3b1751201 rtmp: Support 'rtmp_playpath', an option which overrides the stream identifier
This option is the stream identifier to play or to publish.
Sometimes the URL parser cannot determine the correct
playpath automatically, so it must be given explicitly
using this option (ie. -rtmp_playpath).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-16 23:11:58 +03:00
Samuel Pitoiset 6465562e13 rtmp: Support 'rtmp_app', an option which overrides the name of application
This option is the name of application to connect on the RTMP server.
Sometimes the URL parser cannot determine the app name automatically,
so it must be given explicitly using this option (ie. -rtmp_app).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-16 23:11:53 +03:00
Raffaele Sena 34d908c083 rtmp: implement bandwidth notification
Improve compatibility with some servers.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-04-03 12:37:31 -07:00
Samuel Pitoiset faba4a9b88 rtmp: update supported audio codecs value
The audio codecs property is composed by all values except
SUPPORT_SND_INTEL (0x0008) and SUPPORT_SND_UNUSED (0x0010) which are
unused.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-04-03 12:24:33 -07:00
Martin Storsjö 32b83aeec1 avio: Add an URLProtocol flag for indicating that a protocol uses network
This definition is in two files, since the definitions will move
to the private header at the next bump.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-05 23:56:52 +02:00
Mans Rullgard 3383a53e7d lavu: replace int/float punning functions
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>
2011-12-11 18:47:19 +00:00
Martin Storsjö 1eef08f98c rtmp: Use nb_invokes for all invoke commands
704af3e29c broke publishing
of rtmp streams, at least publishing to Wowza servers.

This changes all invoke commands to use nb_invokes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-07 09:01:55 +02:00
Martin Storsjö c3b05d2159 proto: Realign struct initializers
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-01 13:47:28 +02:00
Martin Storsjö 7e58050590 proto: Use .priv_data_size to allocate the private context
This simplifies the open functions by avoiding one function
call that needs error checking, reducing the amount of
extra bulk code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-01 13:47:26 +02:00
Martin Storsjö 02490bf358 rtmp: Clean up properly if the handshake failed
This prevents memory leaks if this function returns an error.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-01 13:47:25 +02:00
Josh Allmann 704af3e29c rtmp: do not hardcode invoke numbers
Note: FCPublish/FCUnpublish are adobe server specific and not described
in the rtmp specification. Some servers might not cope with them at
all.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-11-18 13:57:44 +01:00
Anton Khirnov ddffc2fdc3 avio: add support for passing options to protocols.
Not used anywhere yet, support for passing options from avio_open() will
follow.
2011-11-13 13:14:39 +01:00
Martin Storsjö 6f1b7b3944 avio: Add an AVIOInterruptCB parameter to ffurl_open/ffurl_alloc
Change all uses of these function to pass the relevant
callback on.
2011-11-13 13:12:17 +01:00
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