Commit Graph

337 Commits

Author SHA1 Message Date
Luca Barbato f81c7ac70a 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
2011-01-28 15:45:19 +01:00
Luca Barbato a8475bbdb6 os: replace select with poll
Select has limitations on the fd values it could accept and silently
breaks when it is reached.
2011-01-28 15:45:19 +01:00
Diego Elio Pettenò c6610a216e 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.
2011-01-26 22:10:09 +00:00
Diego Elio Pettenò 57c4d01ec9 Make ff_rtsp_send_cmd_with_content_async static to rtsp.c.
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-01-25 22:10:36 +01:00
Martin Storsjö 2762a7a28b rtspdec: Retry with TCP if UDP failed
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-01-24 22:49:36 +01:00
Martin Storsjo aeb2de1c82 rtsp: Use ff_rtsp_undo_setup in the cleanup code in ff_rtsp_make_request
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-01-24 22:46:43 +01:00
Martin Storsjo 93e7490ee0 rtsp: Split out a function undoing the setup made by ff_rtsp_make_setup_request
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-01-24 22:46:39 +01:00
Martin Storsjo fef5649a82 rtsp: Make make_setup_request a nonstatic function
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-01-24 22:46:36 +01:00
Martin Storsjö a3b058b7ba rtsp: Properly fail if unable to open an input RTP port
Originally committed as revision 26285 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-09 10:47:53 +00:00
Martin Storsjö a92c30d76e 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.
While receiving this stream, send another stream to the same port:
ffmpeg -re -i <whatever> -vcodec mpeg4 -an -f rtp
rtp://127.0.0.1:5000?localport=1234
Normally, the RTSP playback reports lots of errors at this point.

If the RTSP stream has the ?filter_src option enabled, these
interferring packets are ignored.

Originally committed as revision 26246 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-06 15:22:58 +00:00
Martin Storsjö 29db7c3af4 rtsp: Parse RTP-Info headers
Originally committed as revision 26236 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-05 21:23:42 +00:00
Martin Storsjö d2995eb910 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://svn.ffmpeg.org/ffmpeg/trunk
2011-01-02 10:11:12 +00:00
Martin Storsjö 77223c5388 rtsp: Pass the method name to ff_rtsp_parse_line
Originally committed as revision 26191 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-02 10:10:12 +00:00
Martin Storsjö acc9ed1450 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://svn.ffmpeg.org/ffmpeg/trunk
2011-01-02 10:07:56 +00:00
Martin Storsjö 3df54c6bf2 rtsp: Add a method parameter to ff_rtsp_read_reply
Originally committed as revision 26189 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-02 10:06:21 +00:00
Martin Storsjö 3a1cdcc798 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.

Originally committed as revision 26187 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-01 22:27:16 +00:00
Martin Storsjö 9e99f84f7d 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://svn.ffmpeg.org/ffmpeg/trunk
2010-12-27 09:56:19 +00:00
Martin Storsjö 8c579c1c60 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
one requested.

Originally committed as revision 26077 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-23 15:05:24 +00:00
Martin Storsjö bbd8f5477d 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.

Originally committed as revision 26022 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-15 21:06:25 +00:00
Martin Storsjö 86b6e387cc 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
rtpmap field in the SDP, but later overridden by an a=SampleRate field).

Additionally, this makes the code actually use the stream time base set
in rtpmap for video codecs, instead of hardcoding it to always be 90 kHz.

Originally committed as revision 25908 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-07 13:29:44 +00:00
Martin Storsjö bb776f3b00 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://svn.ffmpeg.org/ffmpeg/trunk
2010-12-07 13:28:45 +00:00
Martin Storsjö 6a7e31a901 rtsp: Look for RTP payload handlers for static payload types, too
Originally committed as revision 25893 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-05 19:41:44 +00:00
Martin Storsjö 003eb64217 rtsp: Factorize code for initializing the rtp payload handler
Originally committed as revision 25892 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-05 19:41:09 +00:00
Martin Storsjö 0b6a7ff4b4 rtsp: Do a forgotten reindenting
Originally committed as revision 25839 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-28 21:17:39 +00:00
Martin Storsjö dd22cfb101 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://svn.ffmpeg.org/ffmpeg/trunk
2010-11-15 15:08:53 +00:00
Martin Storsjö 0526c6f7c7 rtsp: Split out the RTSP demuxer functions to a separate, new file
Originally committed as revision 25601 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-29 08:43:57 +00:00
Martin Storsjö c2688f3ac8 rtsp: Move rtsp_setup_output_streams into rtspenc.c
Originally committed as revision 25600 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-29 08:41:49 +00:00
Martin Storsjö 47bfe49c64 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://svn.ffmpeg.org/ffmpeg/trunk
2010-10-27 00:42:35 +00:00
Aurelien Jacobs a5cea13202 drop rtsp_default_protocols which is not part of public API and not used anymore
Originally committed as revision 25557 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-23 16:22:36 +00:00
Aurelien Jacobs 67f34aaa97 use rtp_get_local_rtp_port() instead of the deprecated rtp_get_local_port()
Originally committed as revision 25554 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-23 16:19:53 +00:00
Martin Storsjö eced8fa02e 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://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 12:25:12 +00:00
Martin Storsjö 44b70ce563 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://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 12:18:48 +00:00
Martin Storsjö 8bf0f96954 rtsp: Reorder functions
Originally committed as revision 25534 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-21 12:13:02 +00:00
Martin Storsjö 44594cc798 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://svn.ffmpeg.org/ffmpeg/trunk
2010-10-19 07:38:53 +00:00
Martin Storsjö a493f80a2c 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://svn.ffmpeg.org/ffmpeg/trunk
2010-10-08 08:54:53 +00:00
Martin Storsjö 3d74223025 rtsp: Make rtsp_rtp_mux_open reusable
Originally committed as revision 25409 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-08 08:51:05 +00:00
Martin Storsjö 9e6acc7884 rtsp: Remove the start_time field from RTSPState, use AVFormatContext->start_time_realtime instead
Originally committed as revision 25408 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-08 08:50:29 +00:00
Martin Storsjö 5fe8021a6a 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://svn.ffmpeg.org/ffmpeg/trunk
2010-10-05 19:46:25 +00:00
Diego Biurrun a44da176ac 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://svn.ffmpeg.org/ffmpeg/trunk
2010-10-05 11:06:32 +00:00
Diego Biurrun 2e802e3855 Add some #endif comments to ease understanding.
Originally committed as revision 25342 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-05 11:03:48 +00:00
Martin Storsjö d7810f4541 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://svn.ffmpeg.org/ffmpeg/trunk
2010-10-03 11:56:38 +00:00
Martin Storsjö 6ecd741713 rtsp: Show the received SDP
Originally committed as revision 25322 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-03 11:55:16 +00:00
Martin Storsjö 321259c1ab rtsp: Return a queued packet if it has been in the queue for longer than max_delay
Originally committed as revision 25295 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-01 17:52:26 +00:00
Martin Storsjö 58ee09911e 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://svn.ffmpeg.org/ffmpeg/trunk
2010-10-01 17:50:24 +00:00
Martin Storsjö c690fa97e5 Reindent/rewrap
Originally committed as revision 25291 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-01 17:44:53 +00:00
Martin Storsjö 38f8c80b62 rtsp: Reorganize if statements in rtsp_read_play
Originally committed as revision 25290 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-01 17:44:18 +00:00
Martin Storsjö ad4ad27fb6 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
similar.

Originally committed as revision 25289 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-01 17:43:27 +00:00
Martin Storsjö 96a7c9753e rtsp: Use a dynamically allocated receive buffer
Originally committed as revision 25288 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-01 17:41:31 +00:00
Martin Storsjö 160918d588 rtsp: Handle standard assigned codec names for private payload types, too
Originally committed as revision 25126 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-15 17:39:25 +00:00
Ronald S. Bultje 7bac991fd9 Reindent after r25032.
Originally committed as revision 25033 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-03 19:26:27 +00:00