This only takes care of decrypting incoming packets; the outgoing
RTCP packets are not encrypted. This is enough for some use cases,
and signalling crypto keys for use with outgoing RTCP packets
doesn't fit as simply into the API. If the SDP demuxer is hooked
up with custom IO, the return packets can be encrypted e.g. via the
SRTP protocol.
If the SRTP keys aren't available within the SDP, the decryption
can be handled externally as well (when using custom IO).
Signed-off-by: Martin Storsjö <martin@martin.st>
This makes the behaviour defined when they wrap around. The value
assigned to expected_prior was a uint32_t already.
Signed-off-by: Martin Storsjö <martin@martin.st>
Previously, we always signalled a zero time since the last RTCP
SR, which is dubious.
The code also suggested that this would be the difference in
RTP NTP time units (32.32 fixed point), while it actually is
in in 1/65536 second units. (RFC 3550 section 6.4.1)
Signed-off-by: Martin Storsjö <martin@martin.st>
This sends NACK for missed packets and PLI (picture loss indication)
if a depacketizer indicates that it needs a new keyframe, according
to RFC 4585.
This is only enabled if the SDP indicated that feedback is supported
(via the AVPF or SAVPF profile names).
The feedback packets are throttled to a certain maximum interval
(currently 250 ms) to make sure the feedback packets don't eat up
too much bandwidth (which might be counterproductive). The RFC
specifies a more elaborate feedback packet scheduling.
The feedback packets are currently sent independently from normal
RTCP RR packets, which is not totally spec compliant, but works
fine in the environments I've tested it in. (RFC 5506 allows this,
but requires a SDP attribute for enabling it.)
Signed-off-by: Martin Storsjö <martin@martin.st>
To use this, set sdpflags=custom_io to the sdp demuxer. During
the avformat_open_input call, the SDP is read from the AVFormatContext
AVIOContext (ctx->pb) - after the avformat_open_input call,
during the av_read_frame() calls, the same ctx->pb is used for reading
packets (and sending back RTCP RR packets).
Normally, one would use this with a read-only AVIOContext for the
SDP during the avformat_open_input call, then close that one and
replace it with a read-write one for the packets after the
avformat_open_input call has returned.
This allows using the RTP depacketizers as "pure" demuxers, without
having them tied to the libavformat network IO.
Signed-off-by: Martin Storsjö <martin@martin.st>
Emitted timestamps in each stream start from 0, for the first received
RTP packet. Once an RTCP packet is received, that one is used for
sync, emitting timestamps that fit seamlessly into the earlier ones.
Originally committed as revision 26187 to svn://svn.ffmpeg.org/ffmpeg/trunk
Do the same change for ff_rdt_parse_packet, too, to keep the interfaces
similar.
Originally committed as revision 25289 to svn://svn.ffmpeg.org/ffmpeg/trunk
This will be used for cleaning up code that is common among RTP depacketizers.
Patch by Josh Allmann, joshua dot allmann at gmail
Originally committed as revision 23847 to svn://svn.ffmpeg.org/ffmpeg/trunk
If these aren't reset, the timestamps make a huge jump when the next RTCP
is received.
Originally committed as revision 22918 to svn://svn.ffmpeg.org/ffmpeg/trunk
In order to sync RTP streams that get their initial RTCP timestamp at
different times, propagate the NTP timestamp of the first RTCP packet
to all other streams.
This makes the timestamps of returned packets start at (near) zero instead
of at any random offset.
Originally committed as revision 22917 to svn://svn.ffmpeg.org/ffmpeg/trunk
but doesn't actually do that. What's worse, it creates timestamp adjustments
that are different per stream within a session, leading to a/v sync issues.
See discussion in thread "[FFmpeg-devel] rtp streaming x264+audio issues (and
some ideas to fix them)". Patch suggested by Luca Abeni <lucabe72 email it>.
Originally committed as revision 21857 to svn://svn.ffmpeg.org/ffmpeg/trunk
what e.g. RealPlayer does. This allows proper port forwarding setup in NAT-
based environments.
Patch by Martin Storsjö <$firstname at $firstname dot st>.
Originally committed as revision 21856 to svn://svn.ffmpeg.org/ffmpeg/trunk