Add a new option 'rtmp_flush_interval' that allows specifying the
number of packets to write before sending it off as a HTTP request.
This is mostly relevant for RTMPT - for plain RTMP, it only controls
how often we check the socket for incoming packets, which shouldn't
affect the performance in any noticeable way.
Signed-off-by: Martin Storsjö <martin@martin.st>
This seems to be the correct mode to send, according to the
original RTSP RFC, and matches the method RECORD which is
sent later when starting to send data.
Darwin Streaming Server works fine with either of them.
Signed-off-by: Martin Storsjö <martin@martin.st>
This requires all NAL units to fit within single RTP packets. It
doesn't change the actual packetization for packets that fit, but
errors out and gives a helpful hint if the NAL units would have to
be split, and signals the right packetization mode in the SDP.
Signed-off-by: Martin Storsjö <martin@martin.st>
This adds two protocols, but one of them is an internal implementation
detail just used as an abstraction layer/generalization in the code. The
RTMPT protocol implementation uses rtmphttp:// 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>
This can happen if doing a new request using the same socket,
but the new request failed, which clears the urlcontext.
Signed-off-by: Martin Storsjö <martin@martin.st>
Add spaces around operators, fix brace placement and whitespace to
match K&R style, vertically align code, remove redundant != 0 and
convert x == 0 into !x, drop useless braces.
Signed-off-by: Martin Storsjö <martin@martin.st>
This can easily happen when the caller is using a custom AVIOContext.
Behave as if the filename was an empty string in this case.
CC: libav-stable@libav.org
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>
While there is no reason for starting a frame with anything else
than a Mode A packet, some senders seem to consistently use Mode B
packets for everything. This fixes depacketization of such streams.
Signed-off-by: Martin Storsjö <martin@martin.st>
This factorizes existing code into a new function gen_buffer_time(),
which generates the client buffer time message and sends it to the
server.
Signed-off-by: Martin Storsjö <martin@martin.st>
Fixes infinite loop in FLAC decoding in case of a truncated bitstream due to
the safe bitstream reader returning 0's at the end.
Fixes Bug 310.
CC:libav-stable@libav.org