Commit Graph

142 Commits

Author SHA1 Message Date
Diego Biurrun 2832ea26f3 Remove commented-out debug #define cruft 2013-05-16 00:23:30 +02:00
Martin Storsjö a5e6080a8d rtmp: Pass the parameters to do_adobe_auth in the right order
do_adobe_auth takes the parameters in the order "opaque, challenge".

Due to the way they are treated, this didn't matter in the tested
setups though - if both are set, we only use one. In the tested
setups (Wowza and Akamai) either one of them were null or they
were both set to the same value, which is why this worked before.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-20 12:00:28 +02:00
Michael Niedermayer 6dc8505417 rtmpproto: Fix assignments in if()
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-14 13:13:00 +02:00
Martin Storsjö c1ea44c54d rtmp: Add support for limelight authentication
Limelight is a not too uncommon CDN. The authentication scheme is
pretty similar to the adobe authentication, but is even closer to
normal http digest authentication (but not close enough to warrant
sharing code) than the adobe version.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-12-31 13:39:09 +02:00
Martin Storsjö 08225d0126 rtmp: Add support for adobe authentication
This is mostly used to authenticate the client when publishing.
Tested with wowza and akamai.

Some but not all servers support resending a new connect invoke
within the same connection, so always reconnect for sending a new
connection attempt. This matches what other applications do as well.

The authentication scheme is structurally pretty similar to http
digest authentication, but uses base64 instead of hex strings.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-12-31 13:39:08 +02:00
Martin Storsjö c76daa89ab rtmp: Return a proper error code in handle_invoke_error
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-12-31 13:39:06 +02:00
Martin Storsjö d578f94746 rtmp: Use av_strlcat instead of strncat
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-11-05 15:37:09 +02:00
Michael Niedermayer 2f1b2ff934 rtmpproto: Fix an out of array write
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-12 18:16:59 +03:00
Martin Storsjö e002e3291e Use the new aes/md5/sha/tree allocation functions
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-11 23:35:28 +03:00
Martin Storsjö e6153f173a avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:44 +03:00
Martin Storsjö 124134e424 avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:32 +03:00
Samuel Pitoiset 7011a42b1a rtmp: support strict rtmp servers
In order to send or receive a stream FCPublish, FCSubscribe and _checkbw
are completely optional and often not implemented. releaseStream over a
non-existen stream might report an error instead of being silent.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-22 17:55:17 +02:00
Martin Storsjö cb5ab02a88 rtmp: Use int instead of ssize_t
Not all compilers support ssize_t (MSVC doesn't), and none of these
variables need to be larger than 32 bit.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-16 23:02:26 +03:00
Jordi Ortiz e5f2731c73 rtmp: Add support for receiving incoming streams
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-16 18:13:41 +03:00
Samuel Pitoiset 93f257db6b rtmp: Automatically compute the hash for SWFVerification
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:05:36 +03:00
Samuel Pitoiset 635ac8e1be rtmp: Add support for SWFVerification
Specifies how the server verifies client SWF files before allowing the
files to connect to an application. Verifying SWF files is a security
measure that prevents someone from creating their own SWF files that can
attempt to stream your resources.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 10:37:34 +03:00
Samuel Pitoiset fb7e78089b rtmp: Gracefully ignore _checkbw errors by tracking them
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-14 22:36:35 +03:00
Samuel Pitoiset 8b6a5a7923 rtmp: Do not send _checkbw calls as notifications
The _checkbw calls were changed to use transactionId 0 in commit
82613564 so that servers would not return _result/_error about it.
While this is the strict interpretation of the spec, there are
servers that return _error about it, even if transactionId was 0.

The latest version of EvoStream Media Server (the commercial version
of crtmpserver) behaves properly as described, i.e. returning an
_error normally but not returning anything when using transactionId
0. The latest version of crtmpserver (right now at least) doesn't
behave like this though, it returns an error even if transactionId
was 0.

There are also other servers that return errors even if transactionId
is set to 0. Therefore set a proper transaction id so that the invoke
can be tracked and the error properly ignored instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-14 22:31:53 +03:00
Luca Barbato fb96c1c5fe rtmp: handle bytes read reports
0x03 (bytes read report) is a known type and should be safely ignored
beside in debug situations.
2012-08-13 21:03:59 +02:00
Jordi Ortiz f5ce90f2de rtmp: split chunk_size var into in_chunk_size and out_chunk_size
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-11 15:49:37 +03:00
Samuel Pitoiset a8103503b3 rtmp: Factorize the code by adding find_tracked_method
Also fix the bytestream reader size parameter to take the
offset into account.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-11 15:15:51 +03:00
Samuel Pitoiset 3eebc1e174 rtmp: Factorize the code by adding handle_invoke_error
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-09 22:44:30 +02:00
Samuel Pitoiset 71036a3a5e rtmp: Factorize the code by adding handle_invoke_status
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-09 22:44:30 +02:00
Samuel Pitoiset 5e6001db8f rtmp: Factorize the code by adding handle_invoke_result
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-09 22:44:29 +02:00
Samuel Pitoiset f89584ca44 rtmp: Add message tracking
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-09 00:32:29 +03:00
Luca Barbato 82613564cf rtmp: send check_bw as notification
Set the transactionId to 0 to signal the server a return _result/_error
is not expected.

Solves the problems experienced with strict rtmp servers.
2012-08-08 14:22:34 +02:00
Samuel Pitoiset 00cb52c65c rtmp: Add a new option 'rtmp_subscribe'
This option specifies the name of live stream to subscribe.
Defaults to rtmp_playpath.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-07 23:35:39 +03:00
Samuel Pitoiset f9e77c1762 rtmp: Add support for subscribing live streams
When streaming live streams using the Akamai, Edgecast or Limelight CDN,
players cannot simply connect to the live stream. Instead, they have to
subscribe to it, by sending an FC Subscribe call to the server.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-07 23:35:39 +03:00
Samuel Pitoiset 12127b65b0 rtmp: Factorize simultaneous URLProtocol / AVClass declarations with a macro
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-07 23:35:39 +03:00
Samuel Pitoiset 9c9c21eaa1 rtmp: do not warn about receiving metadata packets
They are managed in get_packet()

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-07-31 14:52:25 +02:00
Samuel Pitoiset 8ea1459bc3 rtmp: Check the buffer length of ping packets
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-26 22:57:15 +03:00
Samuel Pitoiset e49e6b6451 rtmp: Allow having more unknown data at the end of a chunk size packet without failing
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-26 22:56:54 +03:00
Samuel Pitoiset 2357f60687 rtmp: Prevent reading outside of an allocate buffer when receiving server bandwidth packets
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-26 22:56:54 +03:00
Samuel Pitoiset abf77a247b rtmp: Return an error when the client bandwidth is incorrect
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 23:57:01 +03:00
Samuel Pitoiset be8f949219 rtmp: Return proper error code in handle_server_bw
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 23:57:00 +03:00
Samuel Pitoiset 088a82bb33 rtmp: Return proper error code in handle_client_bw
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 23:57:00 +03:00
Samuel Pitoiset e7ea6883bf rtmp: Return proper error codes in handle_chunk_size
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 23:57:00 +03:00
Samuel Pitoiset 6d1c9945dd rtmp: Factorize the code by adding handle_invoke
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 21:08:24 +03:00
Samuel Pitoiset 7be2a7d8ff rtmp: Factorize the code by adding handle_chunk_size
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 21:08:22 +03:00
Samuel Pitoiset 0ffd5161c4 rtmp: Factorize the code by adding handle_ping
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 21:08:20 +03:00
Samuel Pitoiset 912ecc9a19 rtmp: Factorize the code by adding handle_client_bw
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 21:08:18 +03:00
Samuel Pitoiset 9b498148ca rtmp: Factorize the code by adding handle_server_bw
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 21:08:09 +03:00
Samuel Pitoiset 758377a2b7 rtmp: Add a new option 'rtmp_pageurl'
This option specifies the URL of the web page in which the media
was embedded.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 20:33:13 +03:00
Samuel Pitoiset 63ffa154e9 rtmp: Make the description of the rtmp_tcurl option more generic
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 20:33:10 +03:00
Samuel Pitoiset f7bfb126cd rtmp: Move the CONFIG_ condition into the if conditions
This makes sure these calls are removed by dead code elimination
even if optimization is disabled. This fixes building without
crypto libraries without optimization.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-24 15:54:10 +03:00
Samuel Pitoiset 08cd95e8a3 RTMPTE protocol support
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-23 16:32:09 +03:00
Samuel Pitoiset acd554c103 RTMPE protocol support
This adds two protocols, but one of them is an internal implementation
detail just used as an abstraction layer/generalization in the code. The
RTMPE protocol implementation uses ffrtmpcrypt:// as an alternative to the
tcp:// protocol. This allows moving most of the lower level logic out
from the higher level generic rtmp code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-23 16:32:07 +03:00
Samuel Pitoiset 0e31088b6c rtmp: Add ff_rtmp_calc_digest_pos()
This function is used for calculating digest position for RTMP handshake
packets.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-23 16:32:05 +03:00
Samuel Pitoiset 3505d5574e rtmp: Rename rtmp_calc_digest to ff_rtmp_calc_digest and make it global
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-23 16:32:03 +03:00
Samuel Pitoiset 86991ce2dd RTMPTS protocol support
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-17 14:02:55 +03:00