| Branch: | Revision:

ffmpeg / libavformat / rtsp.c @ c07c6f81

History | View | Annotate | Download (65.8 KB)

# Date Author Comment
c07c6f81 03/15/2010 02:20 PM Martin Storsjö

RTSP: Synchronize the start time of the chained RTP muxers

This makes sure that the streams get correctly synchronized when viewed,
previously the streams were out of sync by as much time as it took
between the initialization of the individual muxers.

Originally committed as revision 22545 to svn://

e4a9e3cc 03/14/2010 11:59 PM Aurelien Jacobs

move ff_url_split() and ff_url_join() declarations to internal.h
those functions are not part of the public API

Originally committed as revision 22534 to svn://

5c7fd910 03/11/2010 08:33 AM Martin Storsjö

Cosmetics, break a long line, fix brace placement

Originally committed as revision 22465 to svn://

26cb700c 03/11/2010 08:24 AM Martin Storsjö

RTSP muxer: Create the SDP with the numerical IP of the peer
instead of using the original host name

Originally committed as revision 22464 to svn://

cbfa66d0 03/10/2010 07:44 AM Dave Yeo

Include os_support.h which has a fallback declaration of socklen_t

This fixes compilation on some OSes

Patch by Dave Yeo, daveryeo at telus dot net

Originally committed as revision 22426 to svn://

db76ca7f 03/09/2010 04:04 PM Martin Storsjö

Use rt->control_uri consequently instead of s->filename in all RTSP commands

Originally committed as revision 22403 to svn://

03f8fc08 03/09/2010 02:59 PM Martin Storsjö

RTSP: Resolve and use the actual IP address of the peer we're connected to,
instead of using the original host name, since the RTP (and UDP) protocols
may choose another IP address if the host name resolves into several different

Originally committed as revision 22398 to svn://

f984dcf6 03/08/2010 09:05 AM Martin Storsjö


Originally committed as revision 22322 to svn://

c5c6e67c 03/08/2010 09:03 AM Martin Storsjö

Rename url_split to ff_url_split

Since this function isn't in the public API, it should have an ff_ prefix.

Originally committed as revision 22321 to svn://

ac11d562 03/07/2010 07:48 PM David Conrad

Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c

Originally committed as revision 22284 to svn://

57b5555c 03/05/2010 10:35 PM Martin Storsjö

Use ff_url_join for assembling URLs, instead of snprintf

This ensures proper escaping of numerical IPv6 addresses.

The RTSP (de)muxer needs its own network initialization, since it isn't
a protocol and url_open hasn't been called yet.

Originally committed as revision 22226 to svn://

f65919af 02/28/2010 11:03 AM Martin Storsjö

Rename RTP depacketizer files from rtp_* to rtpdec_*

Originally committed as revision 22109 to svn://

93993933 02/23/2010 11:05 AM Martin Storsjö

Cosmetics: reindent

Originally committed as revision 21995 to svn://

3307e6ea 02/23/2010 12:35 AM Ronald S. Bultje

Prefix non-static RTSP functions with ff_.

Originally committed as revision 21974 to svn://

6f5a3d0a 02/22/2010 09:28 PM Martin Storsjö

Add an RTSP muxer

Originally committed as revision 21971 to svn://

f86f6656 02/22/2010 09:20 PM Martin Storsjö

Free metadata in chained RTP muxers in the RTSP muxer

This fixes a minor memory leak

Originally committed as revision 21970 to svn://

af037f80 02/22/2010 07:47 PM Martin Storsjö

Cosmetics: reindent

Originally committed as revision 21969 to svn://

15ba2315 02/22/2010 07:44 PM Martin Storsjö

Add declarations and doxygen documentation of generic rtsp support functions
to rtsp.h, and make the functions non-static

Originally committed as revision 21968 to svn://

2efc97c2 02/22/2010 04:11 PM Martin Storsjö

Cosmetics: reindent after applying patches

Originally committed as revision 21967 to svn://

35cfd646 02/22/2010 03:57 PM Martin Storsjö

Don't follow RTSP redirects when used as a muxer

Originally committed as revision 21966 to svn://

3e24c770 02/22/2010 03:56 PM Martin Storsjö

Add a function rtsp_setup_output_streams for announcing the SDP
and setting up the internal RTSPStream data structures when using
the RTSP code in muxer mode.

Originally committed as revision 21965 to svn://

fd450a51 02/22/2010 03:46 PM Martin Storsjö

Create AVFormatContext objects as private transport for output RTSP sessions

Originally committed as revision 21964 to svn://

4280f9bb 02/19/2010 11:23 PM Martin Storsjö

Split rtsp_read_header() into two functions, so that the main part (now also
known as rtsp_connect()) can be used in the RTSP muxer.

Patch by Martin Storsjö <$firstname $firstname st>.

Originally committed as revision 21915 to svn://

e23d195d 02/19/2010 11:21 PM Martin Storsjö

Split out input-specific parts of rtsp_read_header() into its own, new,
function (rtsp_setup_input_streams()), as preparation for the upcoming
RTSP muxer.

Patch by Martin Storsjö <$firstname $firstname st>.

Originally committed as revision 21914 to svn://

30ff7c5c 02/19/2010 11:13 PM Martin Storsjö

Only send out NAT-punching RTP/RTCP packets when we're in demuxer mode, i.e.
don't send them when acting as a RTSP muxer.

Patch by Martin Storsjö <$firstname $firstname st>.

Originally committed as revision 21913 to svn://

69adcc4f 02/19/2010 11:11 PM Martin Storsjö

Use mode=receive instead of mode=play if in RTSP muxer (instead of demuxer)

Patch by Martin Storsjö <$firstname $firstname st>.

Originally committed as revision 21912 to svn://

52aa4338 02/19/2010 11:10 PM Martin Storsjö

Make rtsp_close_streams() take a AVFormatContext instead of a RTSPState
argument, so we can use AVFormatContext->* here in the future.

Patch by Martin Storsjö <$firstname $firstname st>.

Originally committed as revision 21911 to svn://

c02fd3d2 02/19/2010 04:26 PM Martin Storsjö

Rename RTSP_STATE_PLAYING to _STREAMING, since that better covers the
future use of the rtsp* codebase for RTSP muxing.

Patch by Martin Storsjö <$firstname $firstname st>.

Originally committed as revision 21896 to svn://

dfd017bf 02/17/2010 07:24 PM Martin Storsjö

Add functions to send RTSP commands with content attached to them. This will
be used eventually in the RTSP muxer (see thread "[PATCH] RTSP muxer, round
3" on mailinglist).

Patch by Martin Storsjö <$firstname $firstname st>.

Originally committed as revision 21862 to svn://

9c8fa20d 02/16/2010 10:50 PM Martin Storsjö

When using RTP-over-UDP, send dummy packets during stream setup, similar to
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://

7515ed0c 02/10/2010 06:31 PM Ronald S. Bultje

Reindent after r21741.

Originally committed as revision 21742 to svn://

170870b7 02/10/2010 06:30 PM Ronald S. Bultje

Don't forget to set known audio parameters (samplerate, etc.) if the codec is
not supported in FFmpeg. This will cause crashes later because the samplerate
is used to initialize the timebase.

Originally committed as revision 21741 to svn://

27000636 01/26/2010 03:51 PM Jeremy Morton

Don't use tcp_fd if we're not using TCP-based connections (e.g. when
reading direct SDP files to set up UDP-based RTP-streams). Fixes
issue 1713. Patch by Jeremy Morton <ffmpeg game-point net>.

Originally committed as revision 21461 to svn://

00eb13e0 01/22/2010 04:04 PM Alan Steremberg

Use the control URI from the SDP (if present) rather than the input filename,
if present. This fixes playback of a number of MS-RTSP streams, mostly these
for which playback contains a session key in the URI. Fixes issue 1697.
Patch by Alan Steremberg <$firstname dot $lastname () gmail com>....

2e13ecfe 01/21/2010 08:04 PM Ronald S. Bultje

Remove reply and content_ptr arguments from rtsp_send_cmd_async(), since
they are unused.

Originally committed as revision 21371 to svn://

f8c08733 01/21/2010 08:01 PM Ronald S. Bultje

Change on rtsp_send_cmd() to the _async() version since we don't use the
response anyway.

Originally committed as revision 21370 to svn://

7eaa646f 01/21/2010 07:50 PM Ronald S. Bultje

Reindent after r21368.

Originally committed as revision 21369 to svn://

8b9457de 01/21/2010 07:48 PM Ronald S. Bultje

Pretty embarassing bug; we shouldn't use av_strlcatf() on an uninitialized
buffer, that is doomed to not work at some point.

Originally committed as revision 21368 to svn://

9d50d396 01/13/2010 03:55 PM Ronald S. Bultje

Fix issue1658 (trailing space in rtpmap descriptor).

Originally committed as revision 21187 to svn://

8f3c87f3 01/07/2010 10:44 PM Ronald S. Bultje

Add correct log context to av_log() calls in parse_rtpmap().

Originally committed as revision 21072 to svn://

c8965800 01/07/2010 10:41 PM Ronald S. Bultje

Re-indent to more closely follow general coding standards used in other
parts of FFmpeg. Also change a starting condition; while (condition) {
... bla = bla->next; } loop into a proper for() loop.

Originally committed as revision 21071 to svn://

0e59034e 01/04/2010 07:55 PM Ronald S. Bultje

Remove forward declarations.

Originally committed as revision 21020 to svn://

debe86bf 01/01/2010 12:29 PM Stefano Sabatini

Fix typo.

Originally committed as revision 20990 to svn://

702d0a9e 01/01/2010 12:28 PM Stefano Sabatini

Remove residual use of the doxygen markup which is deprecated,
consistent with r19122.

Originally committed as revision 20989 to svn://

d7250724 12/30/2009 04:19 PM Luca Barbato

Rename internal function
sdp_read_packet -> rtsp_fetch_packet

This way describes slightly better what it does.

Originally committed as revision 20982 to svn://

103dfbe2 11/13/2009 10:19 AM Luca Abeni

Add some "#if"s to avoid compiling the RTSP code when the RTSP demuxer
is disabled, and remove a useless "#if CONFIG_SDP_DEMUXER"

Originally committed as revision 20530 to svn://

98713182 11/12/2009 03:34 PM Luca Abeni

Split the sdp_read_packet() function out of rtsp_read_packet().
This allows to avoid compiling RTSP code when not needed.

Originally committed as revision 20526 to svn://

1ced9da3 11/12/2009 10:31 AM Luca Abeni

Move some some functions around, so that splitting the SDP code out of
rtsp_read_packet() is simpler.

Originally committed as revision 20525 to svn://

7549632b 10/25/2009 12:41 AM Luca Barbato

rtsp_close_streams frees the auth_b64 line already

Originally committed as revision 20370 to svn://

d243ba30 10/25/2009 12:06 AM Luca Barbato

Support 3xx redirection in rtsp

All the error codes 3xx got managed the same way.
After setup/early play redirection will not be managed
REDIRECT method is yet to be supported (if somebody knows a server implementing
it please contact me)

Originally committed as revision 20369 to svn://

921da217 10/24/2009 04:53 PM Luca Barbato

Just remove params understood by the demuxer

This should unbreak certain urls.

Originally committed as revision 20364 to svn://

7541f32e 10/24/2009 03:18 PM Luca Barbato

Suppress ?params in the rtsp uri

Right now rtsp demuxer receives it's ffmpeg specific params encoded in the url
That made the server receiving requests with the url ending with "?udp",
"?multicast" and "?tcp". That may or may not cause problems to servers with...

224b4495 10/24/2009 03:10 PM Luca Barbato

Use sdp c= line if the rtsp Transport line doesn't have a destination

Transport:destination in rtsp is optional, c= line in sdp is compulsory

Patch from Armand Bendanan (name.surnameATfreeDOTfr)

Originally committed as revision 20362 to svn://

76e6e9c3 10/24/2009 12:44 PM Diego Biurrun

Remove ancient redir demuxer.
HTTP supports redirection just fine without it.

Originally committed as revision 20361 to svn://

ba93ea6d 09/18/2009 01:18 PM Ronald S. Bultje

Unscrewup indentation (pointed out by Diego).

Originally committed as revision 19910 to svn://

f9337897 09/17/2009 09:47 PM Ronald S. Bultje

RTSP basic authentication, patch originally by Philip Coombes
(philip coombes zoneminder com), see "[PATCH]RTSP Basic Authentication"
thread on mailinglist.

Originally committed as revision 19905 to svn://

fccb1770 07/27/2009 02:03 PM Ronald S. Bultje

Implement support for EOS as used by WMS and other RTSP servers that do not
implement RTCP/bye. See "[PATCH] rtsp.c: EOS support" thread from a few
months back.

Originally committed as revision 19517 to svn://

ec606b36 06/10/2009 03:08 PM Luca Barbato

Support seeking as defined by the rfc

a PLAY with Range alone while in PLAY status should be interpreted
as an enqueue
a PAUSE followed by a PLAY with Range is the proper way to ask to
seek to a point.

See rfc2326

Originally committed as revision 19143 to svn://

0e848977 06/04/2009 06:25 AM Kostya Shishkov

Move function for reading whole specified amount of data from RTSP
demuxer into more common place.

Originally committed as revision 19087 to svn://

67c9cd69 05/31/2009 04:32 AM Baptiste Coudurier

fix compilation with DEBUG defined

Originally committed as revision 19016 to svn://

46ff7a5f 04/20/2009 08:06 PM Luca Abeni

Fix crash when receiving from SDP

Originally committed as revision 18635 to svn://

30e79845 04/15/2009 01:04 PM Ronald S. Bultje

Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
Real wants OPTIONS) while the connection is idle, otherwise it will
be aborted after a short period (usually a minute). See the thread
"[PATCH] rtsp.c: keep-alive" on the mailinglist.

Originally committed as revision 18525 to svn://

e6327fba 04/14/2009 03:01 PM Ronald S. Bultje

Add a Vorbis payload parser. Implemented by Colin McQuillan as a GSoC
qualification task, see "RTP/Vorbis payload implementation (GSoC qual
task)" thread on mailinglist.

Originally committed as revision 18509 to svn://

373afbaf 04/14/2009 01:22 PM Ronald S. Bultje

Increase the SDP buffer size (again!) and also increase the temporary
buffer size of the fmtp parameter buffer. For Vorbis RTP, these
contain full Vorbis headers, which can be up to 12kb each, formatted
in base64, so 16kb total. Patch required for proper Vorbis/RTP playback,...

da1e126e 03/24/2009 03:24 AM Ronald S. Bultje

strchr(string, '\0') returns non-NULL, and is thus not suited for use in
redir_isspace(char) to check if '\0' is a space or not. Therefore, we now
use memchr(), since then we can give the length of the string (i.e. the
length excluding the terminating '\0'). Fixes issue 919, see also the...

cc9aced3 03/21/2009 09:02 PM Ronald S. Bultje

Remove slash-skipping code because the function called right after that
statement (get_word_sep()) already does that all by itself. See summary in
"[PATCH] rtsp.c small cleanups" thread on mailinglist.

Originally committed as revision 18128 to svn://

78f731de 03/21/2009 09:00 PM Ronald S. Bultje

Reindent something where a if () --> { <-- is on a newline rather than on the
same line as the if. See summary in "[PATCH] rtsp.c small cleanups" thread on

Originally committed as revision 18127 to svn://

7d09a993 03/21/2009 08:59 PM Ronald S. Bultje

Free metadata if already allocated; fixes a memleak if the header occurs twice
in a stream (e.g. malicious input, broken file, etc.). See summary in "[PATCH]
rtsp.c small cleanups" thread on mailinglist.

Originally committed as revision 18126 to svn://

6a8c8b36 03/21/2009 08:58 PM Ronald S. Bultje

Fix silly bug in hex_to_data() where it compares a string pointer for whether
it is '\0' rather than its content (char *p; if (p '\0') instead of if
(*p '\0')). See summary in "[PATCH] rtsp.c small cleanups" thread on

Originally committed as revision 18125 to svn://

64917dd3 03/21/2009 08:56 PM Ronald S. Bultje

Remove useless comment about something that is deprecated. See summary in
"[PATCH] rtsp.c small cleanups" thread on mailinglist.

Originally committed as revision 18124 to svn://

36aa7bc2 03/21/2009 08:55 PM Ronald S. Bultje

Use skip_spaces() in the "redir" demuxer instead of "while (isspace(&p)) p++".
See summary in "[PATCH] rtsp.c small cleanups" thread on mailinglist.

Originally committed as revision 18123 to svn://

1ef36a70 03/21/2009 08:54 PM Ronald S. Bultje

Merge functional code from get_word() and get_word_sep() into a single
function, since they both do approximately the same thing. At the same time,
remove redir_isspace() altogether since code elsewhere (including
get_word_sep()) uses strchr() for the same purpose. See summary in "[PATCH]...

7e726132 03/21/2009 08:46 PM Ronald S. Bultje

Allow (and parse) incoming server messages (notices) interleaved with TCP
data packets or in addition to UDP data packets, over the RTSP/TCP connection.
See discussion in [PATCH] rtsp.c: read TCP server notifications/messages"
thread on mailinglist.

Originally committed as revision 18121 to svn://

c4a3d032 03/17/2009 12:35 PM Ronald S. Bultje

Reindent after r18023.

Originally committed as revision 18024 to svn://

1a30d541 03/17/2009 12:34 PM Ronald S. Bultje

Add RTP/ASF header parsing, which is part of the SDP of these streams. See
patch discussion in "[PATCH] RTSP-MS 10/15: ASF header parsing" thread.

Originally committed as revision 18023 to svn://

743b3890 03/07/2009 03:20 PM Ronald S. Bultje

rtpmap is case-insensitive, see comment from Luca in "[PATCH] rtsp.c:
keep-alive" thread.

Originally committed as revision 17862 to svn://

57f94f54 03/06/2009 03:12 AM Ronald S. Bultje

Oops, very silly typo.

Originally committed as revision 17853 to svn://

29b9f58b 03/04/2009 12:57 AM Ronald S. Bultje

Split rtsp_send_cmd() into two functions, one for the actual sending of the
command and a second, new function to read the reply to this command. This
will make it possible to read server notices that are not in response to a
command in future versions, such as EOS or interrupt notices. See "[PATCH]...

bc8763cd 03/03/2009 05:06 PM Ronald S. Bultje

Rename "fd1" variable ro "fd". There were previously two variables (fd1 and
fd2) and one was just removed, so naming the other "fd1" is counter-intuitive.
See "[RFC] rtsp.c EOF support" thread.

Originally committed as revision 17780 to svn://

f0a80394 03/03/2009 05:04 PM Ronald S. Bultje

Add url_get_file_handle(), which is used to get the file descriptor
associated with the I/O handle (e.g. the fd returned by open()). See
"[RFC] rtsp.c EOF support" thread.

There were previously some URI-specific implementations of the same idea,
e.g. rtp_get_file_handles() and udp_get_file_handle(). All of these are...

2fea9650 03/03/2009 04:53 PM Ronald S. Bultje

Reindent after r17777.

Originally committed as revision 17778 to svn://

f830c9a4 03/03/2009 04:52 PM Ronald S. Bultje

Make RTSP-MS-over-UDP negotiation work. See "[PATCH] RTSP-MS 8/15: fix
RTSP-MS UDP" thread on mailinglist.

Basically, UDP setup needs to be done in a particular order (first rtx
on two UDP ports (one for RTP, one for RTCP), then the other streams over
one, single port for all of them together). Not doing this correctly results...

090438cc 03/03/2009 04:48 PM Ronald S. Bultje

Recognize the "application" data type, which is required for WMS/UDP

This type is used in RTP/ASF (served by WMS servers), and is required to
make UDP sessions work, but breaks TCP sessions. Therefore, we disable setup
for application streams in TCP/WMS streams....

a9e534d5 02/21/2009 10:26 PM Ronald S. Bultje

Rename RTSPHeader to RTSPMessageHeader to reflect more clearly what the
structure is meant to represent. See "[PATCH] rtsp.[ch]: RTSPHeader ->
RTSPServerResponse" and "[PATCH] document rtsp.h" threads on ML.

Originally committed as revision 17504 to svn://

d541a7d2 02/21/2009 02:40 PM Ronald S. Bultje

Change sizeof(struct_type) to sizeof(variable).

Originally committed as revision 17474 to svn://

bf6d9818 02/17/2009 08:12 AM Luca Abeni

Remame rtp_get_codec_info() to ff_rtp_get_codec_info(), as it is not
a static function

Originally committed as revision 17390 to svn://

2a1d51c5 02/16/2009 04:27 PM Ronald S. Bultje

Rename RTSP_*_LAST to RTSP_*_NB in line with PIX_FMT_* in lavc. See "[PATCH]
document rtsp.h" mailinglist thread.

Originally committed as revision 17381 to svn://

302879cb 02/06/2009 10:35 AM Luca Abeni

Split rtp.h in rtp.h, rtpdec.h, and rtpenc.h

Originally committed as revision 17016 to svn://

0a861b6f 02/05/2009 10:34 PM Ronald S. Bultje

Rename "tx_ctx" and "cur_tx" variables to "transport_priv" and
"cur_transport_priv", as discussed in the "[PATCH] rtsp.h: rename tx
variables" thread.

Originally committed as revision 17012 to svn://

da61e413 02/02/2009 11:09 PM Aurelien Jacobs

use new metadata API in rtsp demuxer

Originally committed as revision 16961 to svn://

d1c6e47c 02/01/2009 01:37 PM Ronald S. Bultje

Fix the Transport: line in the SETUP request so that it works with WMS
servers when trying to set up a session over TCP:
- add the interleave property
- add unicast, only for WMS (since it is normally only UDP, but WMS expects it
for UDP and TCP)
- add mode=play...

20631a9c 01/27/2009 12:23 PM Luca Abeni

Merge rtp_internal.h in rtp.h, and remove rtp_internal.h

Originally committed as revision 16817 to svn://

cb760a47 01/24/2009 04:56 AM Ronald S. Bultje

Skip m= blocks in the SDP if the media type is unknown. This prevents
subsequent a= lines from the m= block to be applied to the previous
m= line, thus breaking otherwise functional RTP streams. See discussion in
[PATCH] RTSP-MS 7/15: parse and allow unknown m= line codes" thread on...

406792e7 01/19/2009 03:46 PM Diego Biurrun

cosmetics: Remove pointless period after copyright statement non-sentences.

Originally committed as revision 16684 to svn://

b250f9c6 01/13/2009 11:44 PM Aurelien Jacobs

Change semantic of CONFIG_*, HAVE_* and ARCH_*.
They are now always defined to either 0 or 1.

Originally committed as revision 16590 to svn://

6a5d31ac 01/11/2009 10:19 PM Diego Biurrun

Fix build: Add intreadwrite.h and bswap.h #includes where necessary.

Originally committed as revision 16556 to svn://

9211bcdd 01/09/2009 11:44 PM Ronald S. Bultje

Reindent to properly fit a 80 chars terminal.

Originally committed as revision 16511 to svn://

ff16f551 01/09/2009 11:36 PM Ronald S. Bultje

Reindent after r16509.

Originally committed as revision 16510 to svn://

83d14c85 01/09/2009 11:36 PM Ronald S. Bultje

Apply rtpmap: SDP lines to the last m= line only, since they generally just
come directly after each m= line if required. See "[PATCH] RTSP-MS 5-6/15:
parse only the last m= line stream per rtpmap line" thread on ML.

Originally committed as revision 16509 to svn://

e49906c3 01/09/2009 01:30 AM Ronald S. Bultje

Increase buffer size for RTP packet data because some ASF streams use a
manual, non-standard blocksize which is bigger than RTP_MAX_PACKET_LENGTH.
See "[PATCH] RTSP-MS 4/15: blocksize detection" thread on mailinglist.

Originally committed as revision 16502 to svn://