| Branch: | Revision:

ffmpeg / libavformat / rtsp.c @ d9c0510e

History | View | Annotate | Download (67.4 KB)

# Date Author Comment
d9c0510e 02/02/2011 11:49 PM Martin Storsjö

rtsp: Don't store RTSPStream in AVStream->priv_data

For mpegts in RTP, there isn't a direct mapping between RTSPStreams
and AVStreams, and the RTSPStream isn't ever stored in
AVStream->priv_data, which was earlier leaked. The fix for this
leak, in ea7f080749d68a431226ce196014da38761a0d82, lead to...

ea7f0807 02/01/2011 07:40 PM Luca Barbato

Free the RTSPStreams in ff_rtsp_close_streams

This plugs a small memory leak

Signed-off-by: Janne Grunau <>

dfd2a005 01/29/2011 10:55 PM Luca Barbato

Replace dprintf with av_dlog

dprintf clashes with POSIX.1-2008

f81c7ac7 01/28/2011 02:45 PM Luca Barbato

rtsp: make ff_sdp_parse return value forwarded

the sdp demuxer did not forward it at all while the rtsp demuxer assumed
a single kind of error

a8475bbd 01/28/2011 02:45 PM Luca Barbato

os: replace select with poll

Select has limitations on the fd values it could accept and silently
breaks when it is reached.

c6610a21 01/26/2011 10:10 PM Diego Elio Pettenò

Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.

This also lists the objects from those two libraries as internal (by adding
the ff_ prefix) so that they can then be hidden via linker scripts.

57c4d01e 01/25/2011 09:10 PM Diego Elio Pettenò

Make ff_rtsp_send_cmd_with_content_async static to rtsp.c.

Signed-off-by: Janne Grunau <>

2762a7a2 01/24/2011 09:49 PM Martin Storsjö

rtspdec: Retry with TCP if UDP failed

Signed-off-by: Janne Grunau <>

aeb2de1c 01/24/2011 09:46 PM Martin Storsjo

rtsp: Use ff_rtsp_undo_setup in the cleanup code in ff_rtsp_make_request

Signed-off-by: Janne Grunau <>

93e7490e 01/24/2011 09:46 PM Martin Storsjo

rtsp: Split out a function undoing the setup made by ff_rtsp_make_setup_request

Signed-off-by: Janne Grunau <>

fef5649a 01/24/2011 09:46 PM Martin Storsjo

rtsp: Make make_setup_request a nonstatic function

Signed-off-by: Janne Grunau <>

a3b058b7 01/09/2011 10:47 AM Martin Storsjö

rtsp: Properly fail if unable to open an input RTP port

Originally committed as revision 26285 to svn://

a92c30d7 01/06/2011 03:22 PM Martin Storsjö

rtsp: Allow requesting of filtering of source packets

If filtered, only packets from the right source address and port
are received.

To test, play back e.g. some mpeg4 video RTSP stream (where the
video stream is the first stream in the presentation) over UDP....

29db7c3a 01/05/2011 09:23 PM Martin Storsjö

rtsp: Parse RTP-Info headers

Originally committed as revision 26236 to svn://

d2995eb9 01/02/2011 10:11 AM Martin Storsjö

rtsp: Store the Content-Base header value straight to the target

This avoids having a large temporary buffer in the struct used for
storing the rtsp reply headers.

Originally committed as revision 26192 to svn://

77223c53 01/02/2011 10:10 AM Martin Storsjö

rtsp: Pass the method name to ff_rtsp_parse_line

Originally committed as revision 26191 to svn://

acc9ed14 01/02/2011 10:07 AM Martin Storsjö

rtsp: Pass RTSPState to ff_rtsp_parse_line, instead of HTTPAuthState

This allows ff_rtsp_parse_line to do more changes directly in RTSPState
when parsing the reply, instead of having to store large amounts of
temporary data in RTSPMessageHeader.

Originally committed as revision 26190 to svn://

3df54c6b 01/02/2011 10:06 AM Martin Storsjö

rtsp: Add a method parameter to ff_rtsp_read_reply

Originally committed as revision 26189 to svn://

3a1cdcc7 01/01/2011 10:27 PM Martin Storsjö

rtpdec: Emit timestamps for packets before the first RTCP packet, too

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....

9e99f84f 12/27/2010 09:56 AM Martin Storsjö

rtsp: Check if the rtp stream actually has an RTPDemuxContext

For example MS-RTSP doesn't have RTPDemuxContexts for all streams.

This fixes issue 2448.

Originally committed as revision 26107 to svn://

8c579c1c 12/23/2010 03:05 PM Martin Storsjö

rtsp: Require the transport reply from the server to match the request

This fixes a crash if we requested TCP interleaved transport, but the
server replies with transport data for UDP. According to the RFC, the
server isn't allowed to respond with another transport type than the...

bbd8f547 12/15/2010 09:06 PM Martin Storsjö

rtsp: Don't set the RTP time base from the sample rate if no sample rate is set

This also reverts SVN rev 26016, which incorrectly overwrote the time base
with 90 kHz for all streams, regardless of what was set by the SDP parsing.

The stream that triggered the fix in 26016 still works after this commit....

86b6e387 12/07/2010 01:29 PM Martin Storsjö

rtsp/rtpdec: Set the AVStream time_base directly in rtsp when it is known

This fixes cases where the RTP time base and the sample rate of the stream
differ. Previously, the AVStream time_base was unconditionally set to
the sample rate (which initially was set to one value when parsing the...

bb776f3b 12/07/2010 01:28 PM Martin Storsjö

rtsp: Parse RealRTSP sample rate declarations from the SDP

The RTP time base can be different from the actual content sample rate.

Originally committed as revision 25907 to svn://

6a7e31a9 12/05/2010 07:41 PM Martin Storsjö

rtsp: Look for RTP payload handlers for static payload types, too

Originally committed as revision 25893 to svn://

003eb642 12/05/2010 07:41 PM Martin Storsjö

rtsp: Factorize code for initializing the rtp payload handler

Originally committed as revision 25892 to svn://

0b6a7ff4 11/28/2010 09:17 PM Martin Storsjö

rtsp: Do a forgotten reindenting

Originally committed as revision 25839 to svn://

dd22cfb1 11/15/2010 03:08 PM Martin Storsjö

rtsp: Parse and use the Content-Base reply header, if present

This fixes playing RTSP urls with query parameters.

Originally committed as revision 25755 to svn://

0526c6f7 10/29/2010 08:43 AM Martin Storsjö

rtsp: Split out the RTSP demuxer functions to a separate, new file

Originally committed as revision 25601 to svn://

c2688f3a 10/29/2010 08:41 AM Martin Storsjö

rtsp: Move rtsp_setup_output_streams into rtspenc.c

Originally committed as revision 25600 to svn://

47bfe49c 10/27/2010 12:42 AM Martin Storsjö

rtsp: Add stub declarations of the setup_in/output_streams functions

This may be needed to avoid calls to implicitly defined functions
(that will be removed by dead code elimination later anyway).

Originally committed as revision 25585 to svn://

a5cea132 10/23/2010 04:22 PM Aurelien Jacobs

drop rtsp_default_protocols which is not part of public API and not used anymore

Originally committed as revision 25557 to svn://

67f34aaa 10/23/2010 04:19 PM Aurelien Jacobs

use rtp_get_local_rtp_port() instead of the deprecated rtp_get_local_port()

Originally committed as revision 25554 to svn://

eced8fa0 10/21/2010 12:25 PM Martin Storsjö

rtsp: Move the rtsp_probe function to the demuxer code block

This function is only used by the RTSP demuxer.

Originally committed as revision 25537 to svn://

44b70ce5 10/21/2010 12:18 PM Martin Storsjö

rtsp: Untangle the dependencies between the RTSP/SDP demuxers and RTSP muxer

This allows compilation of one of them without requiring the others'
dependencies to be present.

Originally committed as revision 25535 to svn://

8bf0f969 10/21/2010 12:13 PM Martin Storsjö

rtsp: Reorder functions

Originally committed as revision 25534 to svn://

44594cc7 10/19/2010 07:38 AM Martin Storsjö

Add a demuxer for receiving raw rtp:// URLs without an SDP description

The demuxer inspects the payload type of a received RTP packet and
handles the cases where the content is fully described by the payload type.

Originally committed as revision 25527 to svn://

a493f80a 10/08/2010 08:54 AM Martin Storsjö

rtsp: Factorize out code for opening a chained RTP muxer

The new object file is added to the SDP demuxer in the makefile, since it
is needed in both the RTSP muxer and demuxer and in the SDP demuxer, due
to the current code coupling.

Originally committed as revision 25410 to svn://

3d742230 10/08/2010 08:51 AM Martin Storsjö

rtsp: Make rtsp_rtp_mux_open reusable

Originally committed as revision 25409 to svn://

9e6acc78 10/08/2010 08:50 AM Martin Storsjö

rtsp: Remove the start_time field from RTSPState, use AVFormatContext->start_time_realtime instead

Originally committed as revision 25408 to svn://

5fe8021a 10/05/2010 07:46 PM Martin Storsjö

rtsp/sdp: Move code into correct ifdefs

This makes the code dependencies correct. Previously, the SDP demuxer
wasn't buildable on its own.

This also reverts rev 25343.

Originally committed as revision 25354 to svn://

a44da176 10/05/2010 11:06 AM Diego Biurrun

Remove some pointless CONFIG_RTSP_DEMUXER #ifdefs.
They reside within a large CONFIG_RTSP_DEMUXER block and are thus pointless.

Originally committed as revision 25343 to svn://

2e802e38 10/05/2010 11:03 AM Diego Biurrun

Add some #endif comments to ease understanding.

Originally committed as revision 25342 to svn://

d7810f45 10/03/2010 11:56 AM Martin Storsjö

rtsp: In the muxer, show the generated with verbose log level

It is only useful for debugging, so it doesn't have to be shown every time.

Originally committed as revision 25323 to svn://

6ecd7417 10/03/2010 11:55 AM Martin Storsjö

rtsp: Show the received SDP

Originally committed as revision 25322 to svn://

321259c1 10/01/2010 05:52 PM Martin Storsjö

rtsp: Return a queued packet if it has been in the queue for longer than max_delay

Originally committed as revision 25295 to svn://

58ee0991 10/01/2010 05:50 PM Martin Storsjö

rtpdec: Reorder received RTP packets according to the seq number

Reordering is enabled only when receiving over UDP.

Originally committed as revision 25294 to svn://

c690fa97 10/01/2010 05:44 PM Martin Storsjö


Originally committed as revision 25291 to svn://

38f8c80b 10/01/2010 05:44 PM Martin Storsjö

rtsp: Reorganize if statements in rtsp_read_play

Originally committed as revision 25290 to svn://

ad4ad27f 10/01/2010 05:43 PM Martin Storsjö

rtsp/rtpdec: Allow rtp_parse_packet to take ownership of the packet buffer

Do the same change for ff_rdt_parse_packet, too, to keep the interfaces

Originally committed as revision 25289 to svn://

96a7c975 10/01/2010 05:41 PM Martin Storsjö

rtsp: Use a dynamically allocated receive buffer

Originally committed as revision 25288 to svn://

160918d5 09/15/2010 05:39 PM Martin Storsjö

rtsp: Handle standard assigned codec names for private payload types, too

Originally committed as revision 25126 to svn://

7bac991f 09/03/2010 07:26 PM Ronald S. Bultje

Reindent after r25032.

Originally committed as revision 25033 to svn://

619298a8 09/03/2010 07:25 PM John Wimer

Send NAT punching messages to the address specified in the Transport:
message, if available (RFC 2326, section 12.39), fixes issue 2212.

Patch by John Wimer <john at god vtic net>.

Originally committed as revision 25032 to svn://

744a882f 09/03/2010 07:10 AM Martin Storsjö

rtsp: 10l, try to update the correct rtp stream

This fixes a bug from rev 22917. Now RTSP streams where the individual RTCP
sender reports aren't sent at the same time actually are synced properly.

Originally committed as revision 25029 to svn://

b20359f5 08/29/2010 10:25 AM Josh Allmann

rtsp: Return AVERROR_EOF when all streams have received an RTCP BYE packet

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 24965 to svn://

a1ba71aa 08/29/2010 10:16 AM Josh Allmann

rtsp: Check the RTCP file handle for new packets, too

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 24962 to svn://

7934b15d 08/25/2010 03:32 PM Martin Storsjö

Handle IPv6 in the RTSP code

Originally committed as revision 24925 to svn://

3fbd12d1 08/25/2010 03:32 PM Martin Storsjö

Handle IPv6 in the SDP demuxer

Originally committed as revision 24924 to svn://

2401660d 08/25/2010 01:42 PM Martin Storsjö

rtsp: Return EOF if the TCP control channel is closed

Originally committed as revision 24920 to svn://

27014bf5 08/12/2010 01:39 PM Ronald S. Bultje

Send OPTIONS request at a regular basis to standard RTSP servers as well,
this prevents a time-out which closes the TCP connection and kills our

see "Re: [FFmpeg-devel] [PATCH] rtsp.c: keep-alive" thread on mailinglist.

Originally committed as revision 24785 to svn://

be73ba2f 08/09/2010 11:00 PM Aurelien Jacobs

get rid of MAX_STREAMS limit in RTSP

Originally committed as revision 24752 to svn://

2901cc9a 08/07/2010 02:11 PM Reinhard Tartler

Fix spelling in comment(s)

Originally committed as revision 24737 to svn://

91af5601 08/07/2010 11:16 AM Josh Allmann

Add RTP packetization of Theora and Vorbis

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 24735 to svn://

d93fdcbf 08/06/2010 10:26 AM Luca Barbato

Preserve status reason

It is used to provide meaningful error messages.

Originally committed as revision 24714 to svn://

965a3ddb 07/30/2010 12:04 PM Martin Storsjö

Remove mostly unnecessary rtpdec_*.h files, store the declarations in one file

Originally committed as revision 24596 to svn://

28450066 07/28/2010 09:26 AM Martin Storsjö

rtsp: Move the definition of SDP_MAX_SIZE up, use it in the RTSP muxer, too

Originally committed as revision 24571 to svn://

354b7573 07/21/2010 05:27 PM Axel Holzinger

Zero-initialize structs/arrays with {0} instead of {}, which isn't proper C99

Patch by Axel Holzinger, aholzinger at gmx dot de

Originally committed as revision 24391 to svn://

bf55cf19 07/12/2010 10:17 AM Luca Barbato

Report when a method gets an error status code

That makes easier understand what went wrong.
In debug mode the whole reply gets printed.

Originally committed as revision 24212 to svn://

f3bfe388 06/27/2010 02:16 PM Måns Rullgård

Make ff_url_split() public

ff_url_split() is retained as an alias, as it was used by ffserver,
to avoid breaking ABI compatibility with it.

Originally committed as revision 23822 to svn://

ca937a55 06/25/2010 08:02 AM Josh Allmann

RTSP, rtpdec: Move RTPPayloadData into rtpdec_mpeg4 and remove all references to rtp_payload_data in rtpdec and rtsp

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 23772 to svn://

7fc8ac7f 06/25/2010 08:00 AM Josh Allmann

RTSP: Move more SDP/FMTP stuff from rtsp.c to rtpdec_mpeg4.c

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 23770 to svn://

9b3788ef 06/25/2010 07:58 AM Josh Allmann

RTSP: Decouple MPEG-4 and AAC specific parts from rtsp.c

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 23769 to svn://

30619e6e 06/25/2010 07:56 AM Josh Allmann

RTSP: Remove skip_spaces in favor of strspn

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 23768 to svn://

9290f15d 06/22/2010 02:15 PM Martin Storsjö

Make the http protocol open the connection immediately in http_open again

Also make the RTSP protocol use url_alloc and url_connect instead of relying
on the delay open behaviour.

Originally committed as revision 23710 to svn://

a8ead332 06/21/2010 07:41 PM Martin Storsjö

RTSP: Use the same authentication for the HTTP POST session as for the GET

Originally committed as revision 23686 to svn://

10ed37b5 06/19/2010 09:57 PM Martin Storsjö

RTSP: Add the auth credentials to the HTTP tunnel URL, too

Originally committed as revision 23651 to svn://

6217b645 06/19/2010 09:46 PM Martin Storsjö

RTSP: Set the connection handles to null after closing them

This fixes a potential issue when doing redirects.

Originally committed as revision 23649 to svn://

00e4a1f4 06/19/2010 09:36 PM Josh Allmann

RTSP: Don't store the connection handles in local variables

This removes some useless copying of handles, and simplifies error handling.

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 23648 to svn://

d3f84dfc 06/18/2010 05:54 PM Martin Storsjö

RTSP: Clean up rtsp_hd on failure

Since rtsp_hd isn't assigned to rt->rtsp_hd until after the setup phase,
the initialized URLContext could be leaked on failures.

Originally committed as revision 23643 to svn://

48e77473 06/14/2010 09:09 AM Martin Storsjö

Cosmetics: Change connexion to connection in code comments

Originally committed as revision 23601 to svn://

afcea58c 06/14/2010 08:23 AM Josh Allmann

RTSP: Shrink SDP fmtp parsing buffer size

Since the parsing of Vorbis/Theora fmtp headers is handled by the
parse_sdp_a_line function pointer now, the buffer in sdp_parse_fmtp
doesn't need to be this large any longer.

Patch by Josh Allmann, joshua dot allmann at gmail...

41874d0a 06/14/2010 08:12 AM Josh Allmann


Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 23598 to svn://

f5d33f52 06/08/2010 12:40 PM Josh Allmann

Add RTSP tunneling over HTTP

Patch by Josh Allmann, joshua dot allmann at gmail dot com

Originally committed as revision 23536 to svn://

fc490fcf 06/05/2010 07:49 PM Martin Storsjö

Cosmetics: Reindent/align/wrap

Originally committed as revision 23498 to svn://

d0382374 06/05/2010 07:45 PM Josh Allmann

RTSP: Propagate errors up from ff_rtsp_send_cmd*

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 23497 to svn://

c453d1bb 06/05/2010 07:43 PM Martin Storsjö

Remove unused local variables

Originally committed as revision 23496 to svn://

b8c2c41d 06/05/2010 07:41 PM Josh Allmann

RTSP: Add a second URLContext for outgoing messages

Done in preparation for RTSP over HTTP.
Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 23494 to svn://

8d168a92 05/19/2010 09:46 AM Martin Storsjö

Fix a crash when opening WMS RTSP streams
Fixes issue 1948

Originally committed as revision 23181 to svn://

2ef6c124 04/25/2010 02:27 PM Stefano Sabatini

Mark av_metadata_set() as deprecated, and use av_metadata_set2()
in its place.

av_metadata_set() is going to be dropped at the next major bump.

Originally committed as revision 22961 to svn://

5948f822 04/20/2010 07:38 AM Martin Storsjö

Reset RTCP timestamps after seeking, add range start offset to the packets timestamps

If these aren't reset, the timestamps make a huge jump when the next RTCP
is received.

Originally committed as revision 22918 to svn://

2cab6b48 04/20/2010 07:34 AM Martin Storsjö

Revert svn rev 21857, readd first_rtcp_ntp_time in RTPDemuxContext

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...

adef229e 04/16/2010 12:20 AM Ramiro Polla

FF_NETERROR is implicitly an AVERROR.

Originally committed as revision 22888 to svn://

4aecee7f 04/15/2010 06:27 PM Ronald S. Bultje

Fix compile error on mingw where ETIMEDOUT is missing (because it's a WSA error).
This patch also changes FF_NETERROR() to be an AVERROR, i.e. it is always
negative, whereas it was previously positive.

Originally committed as revision 22887 to svn://

3370289a 04/04/2010 09:59 PM Martin Storsjö

Zero-initialize the reply struct

The status_code field is read in the fail codepath, where it could be
read uninitialized earlier. Found by clang.

Originally committed as revision 22801 to svn://

0e642188 04/03/2010 12:16 PM Martin Storsjö

Remove a redundant assignment, found by clang

Originally committed as revision 22790 to svn://

f3c68c5b 04/02/2010 08:14 PM Sam Gerstein

ETIME -> ETIMEDOUT. Patch by Sam Gerstein <sgerstein bluefinlab com>.

Originally committed as revision 22785 to svn://

339f5f39 04/01/2010 09:43 PM Josh Allmann

Merge Vorbis / Theora depayloaders.

Patch by Josh Allmann <joshua DOT allmann AT gmail DOT com>.

Originally committed as revision 22768 to svn://

72415b2a 03/30/2010 11:30 PM Stefano Sabatini

Define AVMediaType enum, and use it instead of enum CodecType, which
is deprecated and will be dropped at the next major bump.

Originally committed as revision 22735 to svn://

32e543f8 03/30/2010 03:50 PM Benoit Fouet

Replace @returns by @return.

Originally committed as revision 22729 to svn://