Commit Graph

561 Commits

Author SHA1 Message Date
Fred Rothganger
3f3229cd10 avformat: extracting NTP timestamp from RTCP
For muxing, it accepts
both 0 and AV_NOPTS_VALUE. For demuxing, it will present
AV_NOPTS_VALUE when start_time_realtime is unknown.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 13:33:14 +01:00
Andrey Utkin
bc764d786f Add "prefer_tcp" flag to "rtsp_flags"
If set, and if TCP is available as RTSP RTP transport, then TCP will be
tried first as RTP transport.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-04 22:54:13 +01:00
Stefano Sabatini
8c8c3ca91e doc/protocols/rtsp, lavf/rtsp: fix/extend options documentation 2014-01-01 12:57:15 +01:00
Michael Niedermayer
30aa9b727d Merge commit '46c0cbd5dc01196949105e49f2ded10aa85a6e39'
* commit '46c0cbd5dc01196949105e49f2ded10aa85a6e39':
  rtsp: suppress a incompatible pointer types warning

Conflicts:
	libavformat/rtsp.c

See: 0079232299
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-12 19:37:46 +01:00
Vittorio Giovara
46c0cbd5dc rtsp: suppress a incompatible pointer types warning 2013-12-12 16:10:14 +01:00
Michael Niedermayer
1295377f0a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtspenc: Make sure BYE packets are sent before TEARDOWN

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-01 19:40:20 +01:00
Martin Storsjö
50aef03b24 rtspenc: Make sure BYE packets are sent before TEARDOWN
Also make sure the BYE packets are sent at all when using
TCP interleaved transport.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-01 09:57:06 +02:00
Michael Niedermayer
20904518e9 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  sdp: Add an option for sending RTCP packets to the source of the last packets

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-14 12:42:44 +02:00
Martin Storsjö
b56fc18b20 sdp: Add an option for sending RTCP packets to the source of the last packets
An SDP description normally only contains the target IP address
and port for the packets. This means that we don't really have
any clue where to send the RTCP RR packets - previously they're
sent to the destination IP written in the SDP (at the same port),
which rarely is the actual peer. And if the source for the packets
is on a different port than the destination, it's never correct.

With a new option, we can choose to send the packets to the
address that the latest packet on each socket arrived from.
---
Some may even argue that this should be the default - perhaps,
but I'd rather keep it optional at first. Additionally, I'm not
sure if sending RTCP RR directly back to the source is
desireable for e.g. multicast.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-14 11:21:33 +03:00
Michael Niedermayer
eb02f0c6e8 Merge commit 'f4d371b9737c0405b3bc46d7ca0c856c0a8616b1'
* commit 'f4d371b9737c0405b3bc46d7ca0c856c0a8616b1':
  rtsp: Don't include the listen flag in the SDP demuxer flags

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-08 10:41:32 +02:00
Martin Storsjö
f4d371b973 rtsp: Don't include the listen flag in the SDP demuxer flags
It's only relevant for the RTSP demuxer. Similarly, the custom_io
flag is only present in the SDP demuxer options list.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-07 13:16:44 +03:00
Michael Niedermayer
ca1b029108 Merge commit 'fd8f91e3f44a2bdbefaaebead388133c5fdd3423'
* commit 'fd8f91e3f44a2bdbefaaebead388133c5fdd3423':
  rtsp: Simplify code for forming the remote peer url

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-02 10:39:46 +02:00
Michael Niedermayer
fcccb4c11d Merge commit 'b7e6da988bfd5def40ccf3476eb8ce2f98a969a5'
* commit 'b7e6da988bfd5def40ccf3476eb8ce2f98a969a5':
  rtpproto: Move rtpproto specific function declarations to a separate header

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-01 12:03:24 +02:00
Martin Storsjö
fd8f91e3f4 rtsp: Simplify code for forming the remote peer url
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-01 12:11:17 +03:00
Martin Storsjö
b7e6da988b rtpproto: Move rtpproto specific function declarations to a separate header
Mixing these with the rtp depacketizer functions in rtpdec.h is
no good.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-31 21:12:34 +03:00
Michael Niedermayer
870f506cfe Merge commit '1f57d60129b0e297cd197c6031c4439b30a6b503'
* commit '1f57d60129b0e297cd197c6031c4439b30a6b503':
  rtsp: Support RFC4570 (source specific multicast) more properly.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-30 11:57:43 +02:00
Ed Torbett
1f57d60129 rtsp: Support RFC4570 (source specific multicast) more properly.
Add support for domain names, for multiple source addresses,
for exclusions, and for session level specification of addresses.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-29 22:58:56 +03:00
Michael Niedermayer
4835332537 Merge commit '36fb0d02a1faa11eaee51de01fb4061ad6092af9'
* commit '36fb0d02a1faa11eaee51de01fb4061ad6092af9':
  rtsp: Support multicast source filters (RFC 4570)
  rtpproto: Check the source IP if one single source has been specified
  rtpproto: Support IGMPv3 source specific multicast inclusion

Conflicts:
	libavformat/rtpproto.c
	libavformat/rtsp.c
	libavformat/rtsp.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-20 10:39:53 +02:00
Ed Torbett
36fb0d02a1 rtsp: Support multicast source filters (RFC 4570)
This supports inclusion of one single IP address for now,
at the media level. Specifying the filter at the session level
(instead of at the media level), multiple source addresses,
exclusion, or using FQDNs instead of plain IP addresses is not
supported (yet at least).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-19 12:02:13 +03:00
Ed Torbett
7203dbde39 avformat/rt*p: Joining a SSM multicast group using an SDP (Issue #2171)
Passes Source-Specific Multicast parameters read from an sdp file through to the UDP socket code,
allowing source-specific multicast streams to be correctly received. As an integral part of this
change, additional checking (currently only enabled in the case of SSM streams, but probably
useful in similar scenarios) has been added to the RTP protocol handler to distinguish UDP packets
arriving from multiple sources to the same port and process only the expected packets
(those transmitted from the expected UDP source address). This resolves an issue identified
when multiple instances of FFmpeg subscribe to different Source-Specific Multicast streams
but with each sharing the same destination port.

Signed-off-by: Edward Torbett <ed.torbett@simulation-systems.co.uk>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-18 18:01:31 +02:00
Michael Niedermayer
2fe5e3e970 Merge commit '1dd1b2332ebbac710d8e0214cec7595e118f2105'
* commit '1dd1b2332ebbac710d8e0214cec7595e118f2105':
  rtsp: Include an User-Agent header field in all requests

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-15 12:38:24 +02:00
Martin Storsjö
1dd1b2332e rtsp: Include an User-Agent header field in all requests
Some rtsp servers like the IP Cam IcyBox IB-CAM2002 need it.

Based on a patch by Carl Eugen Hoyos.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-14 20:53:04 +03:00
Carl Eugen Hoyos
0fff7f039c Supply a User-Agent header when opening rtsp streams.
Some rtsp servers like the IP Cam IcyBox IB-CAM2002 need it.
Fixes ticket #2761.
Reported, analyzed and tested by trac user imavra.
2013-07-11 23:05:53 +02:00
Michael Niedermayer
efc08e00cc Merge commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110'
* commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110':
  vf_aspect: use the name 's' for the pointer to the private context
  Remove commented-out debug #define cruft

Conflicts:
	libavcodec/4xm.c
	libavcodec/dvdsubdec.c
	libavcodec/ituh263dec.c
	libavcodec/mpeg12.c
	libavfilter/avfilter.c
	libavfilter/vf_aspect.c
	libavfilter/vf_fieldorder.c
	libavformat/rtmpproto.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-16 09:56:43 +02:00
Diego Biurrun
2832ea26f3 Remove commented-out debug #define cruft 2013-05-16 00:23:30 +02:00
Michael Niedermayer
f083b4c338 Merge commit 'e0f8be6413b6a8d334d6052e610af32935c310af'
* commit 'e0f8be6413b6a8d334d6052e610af32935c310af':
  avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate

Conflicts:
	libavformat/ac3dec.c
	libavformat/avformat.h
	libavformat/avs.c
	libavformat/m4vdec.c
	libavformat/mov.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegvideodec.c
	libavformat/psxstr.c
	libavformat/pva.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-05 12:31:03 +02:00
Diego Biurrun
e0f8be6413 avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate 2013-05-04 21:43:06 +02:00
Michael Niedermayer
a5ba4e186b Merge commit 'e926b5ceb1962833f0c884a328382bc2eca67aff'
* commit 'e926b5ceb1962833f0c884a328382bc2eca67aff':
  avformat: Drop unnecessary ff_ name prefixes from static functions

Conflicts:
	libavformat/audiointerleave.c
	libavformat/mux.c
	libavformat/mxfenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-01 18:28:48 +02:00
Diego Biurrun
e926b5ceb1 avformat: Drop unnecessary ff_ name prefixes from static functions 2013-04-30 16:16:23 +02:00
Andrew Van Til
350ad50bf4 lavf: Use RTP_MAX_PACKET_LENGTH instead of 1500
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-04-09 10:36:43 +03:00
Michael Niedermayer
0678c388ba rtsp: add option to set the socket timeout of the lower protocol.
Fixes Ticket2294

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-08 17:45:13 +02:00
Andrew Van Til
5ed9eebc24 rtsp/rtp_read_header: Use RTP_MAX_PACKET_LENGTH instead of 1500
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-05 01:48:55 +02:00
Michael Niedermayer
950482bf58 Merge commit '2326558d5277ec87ba6d607a01ec6acfc51c694c'
* commit '2326558d5277ec87ba6d607a01ec6acfc51c694c':
  rtpdec: Split mpegts parsing to a normal depacketizer
  rtpdec: Reorder payload handler registration alphabetically

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 13:52:42 +01:00
Martin Storsjö
2326558d52 rtpdec: Split mpegts parsing to a normal depacketizer
This gets rid of a number of special cases from the common rtpdec
code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:17:17 +02:00
Michael Niedermayer
b52925d2cd Merge commit '2f3bada63e57345329c4f9b48e9b81b5cfc03d05'
* commit '2f3bada63e57345329c4f9b48e9b81b5cfc03d05':
  lavf: Add a protocol for SRTP encryption/decryption
  rtsp: Support decryption of SRTP signalled via RFC 4568 (SDES)

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-15 16:05:34 +01:00
Martin Storsjö
424da30830 rtsp: Support decryption of SRTP signalled via RFC 4568 (SDES)
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>
2013-01-15 11:54:40 +02:00
Michael Niedermayer
e730c3a2cb Merge commit '54cb096ee4558b3bfc28c2fcd6418ce82dc39fe1'
* commit '54cb096ee4558b3bfc28c2fcd6418ce82dc39fe1':
  rtsp: Remove an outdated comment
  rtsp: Remove references to weirdly named variables in other files

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-12 13:14:05 +01:00
Martin Storsjö
54cb096ee4 rtsp: Remove an outdated comment
It is unclear what the bug exactly was and if it ever was fixed,
and we don't even support decoding via faad any longer. The
comment has been present since d0deedcb in 2006.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-12 00:02:11 +02:00
Martin Storsjö
3900d53fb1 rtsp: Remove references to weirdly named variables in other files
One of them is renamed now, but mentioning it by name serves
no purpose here.  The other table mentioned ceased to exist
under that name in 4934884a1 in 2006.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-12 00:02:04 +02:00
Michael Niedermayer
34c1c08c66 Merge commit '86d9181cf41edc3382bf2481f95a2fb321058689'
* commit '86d9181cf41edc3382bf2481f95a2fb321058689':
  rtpdec: Support sending RTCP feedback packets

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-09 11:48:14 +01:00
Martin Storsjö
86d9181cf4 rtpdec: Support sending RTCP feedback packets
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>
2013-01-08 17:48:14 +02:00
Michael Niedermayer
315f15afe7 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtsp: Respect max_delay for the reordering queue when using custom IO

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-08 13:14:39 +01:00
Michael Niedermayer
48d30f6733 Merge commit '8729698d50739524665090e083d1bfdf28235724'
* commit '8729698d50739524665090e083d1bfdf28235724':
  rtsp: Recheck the reordering queue if getting a new packet
  lavr: log channel conversion description for any-to-any functions
  lavr: mix: reduce the mixing matrix when possible
  lavr: cosmetics: reindent

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-08 13:05:13 +01:00
Martin Storsjö
f811cd2d47 rtsp: Respect max_delay for the reordering queue when using custom IO
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-08 11:22:43 +02:00
Martin Storsjö
8729698d50 rtsp: Recheck the reordering queue if getting a new packet
If we timed out and consumed a packet from the reordering queue,
but didn't return a packet to the caller, recheck the queue status.
Otherwise, we could end up in an infinite loop, trying to consume
a queued packet that has already been consumed.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-08 11:22:37 +02:00
Michael Niedermayer
8d0b2aae71 Merge commit 'e96406eda4f143f101bd44372f7b2d542183000a'
* commit 'e96406eda4f143f101bd44372f7b2d542183000a':
  rtsp: Add support for depacketizing RTP data via custom IO

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-04 13:23:19 +01:00
Michael Niedermayer
ea96feddb7 Merge commit '3f95f0dda55fca74b646937095a02a8fa9776622'
* commit '3f95f0dda55fca74b646937095a02a8fa9776622':
  rtpdec: Move the URLContext used for RTCP RR out from the context, to a parameter

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-04 13:13:30 +01:00
Martin Storsjö
e96406eda4 rtsp: Add support for depacketizing RTP data via custom IO
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>
2013-01-03 15:15:27 +02:00
Martin Storsjö
3f95f0dda5 rtpdec: Move the URLContext used for RTCP RR out from the context, to a parameter
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-03 15:14:34 +02:00
Michael Niedermayer
a9b1536a01 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  bgmc: Fix av_malloc checks in ff_bgmc_init()
  rtp: set the payload type as stream id

Conflicts:
	libavformat/rtpenc_chain.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-15 11:31:13 +01:00