summaryrefslogtreecommitdiff
path: root/libavformat/rtmpproto.c
Commit message (Collapse)AuthorAge
* lavf: Reset the entry count and allocation size variables on av_reallocp ↵Martin Storsjö2013-09-26
| | | | | | | | | | | | | | failures When av_reallocp fails, the associated variables that keep track of the number of elements in the array (and in some cases, the separate number of allocated elements) need to be reset. Not all of these might technically be needed, but it's better to reset them if in doubt, to make sure variables don't end up conflicting. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Replace a magic number with a macroLuca Barbato2013-09-22
| | | | 11 is the RTMP header size.
* rtmp: Rewrite embedded flv handlingLuca Barbato2013-09-22
| | | | | | Use update_offset() as done for rtmp audio, video and notifications and read update and write the fields instead of replacing them in the rtmp packet and then memcpying it to the output buffer.
* rtmp: Refactor get_packetLuca Barbato2013-09-22
|
* rtmp: Unbreak get_packetLuca Barbato2013-09-20
| | | | Commit 5626f994f273af80fb100d4743b963304de9e05c broke it.
* rtmpproto: Add a comment explaining the logic in handle_notifyMartin Storsjö2013-09-20
| | | | | | | This explains why the cleanup in 5626f994f was wrong and why ae0f316a was needed. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Unbreak handle_notifyLuca Barbato2013-09-19
| | | | Commit 5626f994f273af80fb100d4743b963304de9e05c broke it.
* avformat: Use av_reallocp() where suitableAlexandra Khirnova2013-09-18
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* 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>
* rtmpproto: Extend a comment to explain the prev_pkt arrays rolesMartin Storsjö2013-09-17
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Consistently use the right prev_pkt arrayMartin Storsjö2013-09-17
| | | | | | | prev_pkt[0] is used for input packets, while prev_pkt[1] is used for output. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Check for the right return codeMartin Storsjö2013-09-17
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: rename main_channel_id to stream_id.Josh Allmann2013-09-17
| | | | | | | This more closely corresponds to the usage of the field. Its usage here is unrelated to the channel ID. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Follow Flash player numbering for channels.Josh Allmann2013-09-17
| | | | | | | | | | | Channel 4 is typically used by the Flash player to transmit audio, channel 6 for video, and various stream-specific invokes get sent over channel 8, which is designated the source channel. This more closely matches the behavior of the Flash player, including the transmission of play requests over channel 8. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Send video on a separate channel.Josh Allmann2013-09-17
| | | | | | | | | | | Sending non-monotonic packets (e.g. when the audio and video streams are monotonic within themselves but not muxed monotonically) will lead to negative values the RTMP timestamp field (where timestamps are transmitted only as deltas for each channel), and this delta can end up being incorrectly written as a large unsigned number. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Store all the notify messagesLuca Barbato2013-09-16
| | | | The onTextData is used to implement text data streams in flv.
* rtmp: Do not send the first field twice within the handshakeLuca Barbato2013-09-16
|
* rtmp: Drop an unneeded warningLuca Barbato2013-09-16
| | | | | Apparently a widely used streaming server requires that the second field always presents a version during C1 phase.
* rtmp: Support play method in listen modeLuca Barbato2013-09-16
|
* rtmp: Factor out publish specific codeLuca Barbato2013-09-16
| | | | Will be reused for supporting play.
* rtmpproto: Fix limelight authentication with abbreviated app namesMartin Storsjö2013-08-28
| | | | | | | | | When streaming to limelight, the app name is either a full "appname/subaccount" or "appname/_definst_". In the latter case, the app name can be simplified into simply "appname", but the authentication hashing assumes the /_definst_ still to be present. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Do not misuse memcmpLuca Barbato2013-08-11
| | | | CC: libav-stable@libav.org
* rtmp: Detect and warn if the user tries to pass librtmp style parametersMartin Storsjö2013-08-10
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: rename data_size to sizeLuca Barbato2013-08-10
|
* rtmp: Use PRId64 when needed.Luca Barbato2013-08-10
|
* rtmp: Add seek supportGavriloaie Eugen-Andrei2013-08-02
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* use my full first name instead of short one in copyrightsKostya Shishkov2013-06-01
|
* Remove commented-out debug #define cruftDiego Biurrun2013-05-16
|
* rtmp: Pass the parameters to do_adobe_auth in the right orderMartin Storsjö2013-03-20
| | | | | | | | | | | 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>
* rtmpproto: Fix assignments in if()Michael Niedermayer2013-01-14
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Add support for limelight authenticationMartin Storsjö2012-12-31
| | | | | | | | | 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>
* rtmp: Add support for adobe authenticationMartin Storsjö2012-12-31
| | | | | | | | | | | | | | 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>
* rtmp: Return a proper error code in handle_invoke_errorMartin Storsjö2012-12-31
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Use av_strlcat instead of strncatMartin Storsjö2012-11-05
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Fix an out of array writeMichael Niedermayer2012-10-12
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* Use the new aes/md5/sha/tree allocation functionsMartin Storsjö2012-10-11
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union memberMartin Storsjö2012-09-04
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union memberMartin Storsjö2012-09-04
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: support strict rtmp serversSamuel Pitoiset2012-08-22
| | | | | | | | 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>
* rtmp: Use int instead of ssize_tMartin Storsjö2012-08-16
| | | | | | | 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>
* rtmp: Add support for receiving incoming streamsJordi Ortiz2012-08-16
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Automatically compute the hash for SWFVerificationSamuel Pitoiset2012-08-15
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Add support for SWFVerificationSamuel Pitoiset2012-08-15
| | | | | | | | | 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>
* rtmp: Gracefully ignore _checkbw errors by tracking themSamuel Pitoiset2012-08-14
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Do not send _checkbw calls as notificationsSamuel Pitoiset2012-08-14
| | | | | | | | | | | | | | | | | | | | 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>
* rtmp: handle bytes read reportsLuca Barbato2012-08-13
| | | | | 0x03 (bytes read report) is a known type and should be safely ignored beside in debug situations.
* rtmp: split chunk_size var into in_chunk_size and out_chunk_sizeJordi Ortiz2012-08-11
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Factorize the code by adding find_tracked_methodSamuel Pitoiset2012-08-11
| | | | | | | Also fix the bytestream reader size parameter to take the offset into account. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Factorize the code by adding handle_invoke_errorSamuel Pitoiset2012-08-09
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* rtmp: Factorize the code by adding handle_invoke_statusSamuel Pitoiset2012-08-09
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>