summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
Commit message (Collapse)AuthorAge
* rtsp: Only interpret $ as interleaved packet indicator at the start of repliesMartin Storsjö2015-07-30
| | | | | | | | | | | | Allow $ as character anywhere within normal RTSP replies - both within the lines, and as the first character of RTSP header lines. (The existing old comment indicated that an inline packet could start at any line within a RTSP reply header, but that doesn't sound valid to me, and I'm not sure if the existing code handled that correctly either.) CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Make sure we don't write too many transport entries into a fixed-size ↵Martin Storsjö2015-04-24
| | | | | | | array CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Don't warn about unparsed time rangesMartin Storsjö2015-04-23
| | | | | | | | | | | | | | | | | | | This removes the error logging added in 4e54432164. This avoids warnings about "Invalid interval start specification 'now'" for live rtsp streams. We only try to parse some of the many valid values for time ranges in RTSP - the other ones are fully valid but not interesting for the use case in rtsp.c, so we shouldn't warn about them. (Parsing the time ranges is needed to allow seeking, but e.g. setting the current realtime clock for the start time doesn't make sense. av_parse_time has got a different mode for parsing absolute times as well, which can handle the special case "now", but that doesn't make much sense for this particular use in rtsp.c.) Signed-off-by: Martin Storsjö <martin@martin.st>
* Replace av_dlog with normal av_log at trace levelVittorio Giovara2015-04-19
| | | | This applies to every library where performance is not critical.
* rtsp: Fix unchecked return valueHimangi Saraogi2015-04-12
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Check a malloc return valueHimangi Saraogi2015-04-12
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Add a buffer_size optionLuca Barbato2015-04-01
| | | | | | And forward it to rtp and udp. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* rtpdec: Rename the free method to closeMartin Storsjö2015-02-24
| | | | | | | | | Many of these functions were named foo_free_context, and since the functions no longer should free the context itself, only allocated elements within it, the previous naming was slightly misleading. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Use ffio_free_dyn_buf where applicableMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Free depacketizers if the init function failedMartin Storsjö2015-02-24
| | | | | | | | | | | | | | This is different from how it is handled in codecs/demuxers/muxers though (where the close function isn't called if the open function failed), but since the number of depacketizers that have an .init function is quite limited, this is easy to change. The main point is that if the init function failed, we shouldn't try to use that depacketizer at all - this makes sure that the parse function doesn't need to check for the things that were initialized in the init function. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Don't free the payload context in the .free functionMartin Storsjö2015-02-24
| | | | | | | | | | | | | | This makes it more consistent with depacketizers that don't have any .free function at all, where the payload context is freed by the surrounding framework. Always free the context in the surrounding framework, having the individual depacketizers only free any data they've specifically allocated themselves. This is similar to how this works for demuxer/muxers/codecs - a component shouldn't free the priv_data that the framework has allocated for it. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Remove the now unused .alloc fieldMartin Storsjö2015-02-24
| | | | | | Always use the .priv_data_size field instead. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Allow allocating and freeing the private data without explicit functionsMartin Storsjö2015-02-24
| | | | | | This can reduce the amount of boilerplate in simple depacketizers. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Allow setting the need_parsing field in RTPDynamicProtocolHandlerMartin Storsjö2015-02-24
| | | | | | | | | | This allows getting rid of quite a bit of boilerplate in depacketizers. The default value (initializing need_parsing to 0, aka AVSTREAM_PARSE_NONE) is the same as it is initialized to by default in AVStream. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Fix the indentation of a linewrapped statementMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Interpret the text media type as AVMEDIA_TYPE_DATAMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: punch holes again after pauseGilles Chanteperdrix2015-02-23
| | | | | | | | | | | | When a client behind a NAT issues a pause command, and stay paused for a long time, the router may stop the RTP/RTCP port redirection. Resend the hole punching packets before each PLAY command to cause the router to restart the port redirection in that case. Move the existing code for sending the packets from the SETUP phase to the PLAY phase. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: parse lang attribute in SDPGilles Chanteperdrix2015-02-21
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: check ffurl_get_file_handle() return valueVittorio Giovara2014-12-18
| | | | | CC: libav-stable@libav.org Bug-Id: CID 717844
* rtsp: move the CONFIG_ macros to the beginning of the checkVittorio Giovara2014-12-02
| | | | | With --disable-optimizations, the DCE of some compilers does not remove such unused code, causing linking failure.
* lavf: Use av_gettime_relativeMartin Storsjö2014-10-24
| | | | | | | | | The ones left using av_gettime are NTP timestamps (for RTCP, which is specified to send the actual current realtime clock in RTCP SR packets), and the NUT muxer timestamper, which is documented as using wallclock time. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Check a memory allocationMichael Lynch2014-10-16
| | | | | CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Support tls-encapsulated RTSPLuca Barbato2014-10-10
|
* rtsp: Clear the session id on redirectsMartin Storsjö2014-09-24
| | | | | | | This fixes handling redirects in case the server provided a session id within the redirect reply. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Support misordered fmtp rtpmapJoshua Kordani2014-06-18
| | | | Issue present in Avigilon IP cameras.
* rtsp: Factor out fmtp parsingLuca Barbato2014-06-18
|
* rtpenc_chain: Don't copy the time base to the source stream by defaultMartin Storsjö2014-05-31
| | | | | | | | | | | | | | | Only copy it manually in the muxers where it makes sense (rtspenc, sapenc). Don't touch the original AVStream in movenchint, where the original AVStream should be kept untouched. This fixes the normal tracks in RTP hinted files after abb810db - the hint tracks were ok while the normal media tracks were broken, noticed by Michael Niedermayer. This reverts abb810db but achieves the same effect for the other muxers. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: suppress a incompatible pointer types warningVittorio Giovara2013-12-12
|
* rtspenc: Make sure BYE packets are sent before TEARDOWNMartin Storsjö2013-11-01
| | | | | | | Also make sure the BYE packets are sent at all when using TCP interleaved transport. Signed-off-by: Martin Storsjö <martin@martin.st>
* sdp: Add an option for sending RTCP packets to the source of the last packetsMartin Storsjö2013-08-14
| | | | | | | | | | | | | | | | | | | 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>
* rtsp: Don't include the listen flag in the SDP demuxer flagsMartin Storsjö2013-08-07
| | | | | | | 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>
* rtsp: Simplify code for forming the remote peer urlMartin Storsjö2013-08-01
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpproto: Move rtpproto specific function declarations to a separate headerMartin Storsjö2013-07-31
| | | | | | | Mixing these with the rtp depacketizer functions in rtpdec.h is no good. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Support RFC4570 (source specific multicast) more properly.Ed Torbett2013-07-29
| | | | | | | 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>
* rtsp: Support multicast source filters (RFC 4570)Ed Torbett2013-07-19
| | | | | | | | | | 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>
* rtsp: Include an User-Agent header field in all requestsMartin Storsjö2013-07-14
| | | | | | | | 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>
* Remove commented-out debug #define cruftDiego Biurrun2013-05-16
|
* avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriateDiego Biurrun2013-05-04
|
* avformat: Drop unnecessary ff_ name prefixes from static functionsDiego Biurrun2013-04-30
|
* lavf: Use RTP_MAX_PACKET_LENGTH instead of 1500Andrew Van Til2013-04-09
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Split mpegts parsing to a normal depacketizerMartin Storsjö2013-01-20
| | | | | | | This gets rid of a number of special cases from the common rtpdec code. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Support decryption of SRTP signalled via RFC 4568 (SDES)Martin Storsjö2013-01-15
| | | | | | | | | | | | | | 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>
* rtsp: Remove an outdated commentMartin Storsjö2013-01-12
| | | | | | | | 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>
* rtsp: Remove references to weirdly named variables in other filesMartin Storsjö2013-01-12
| | | | | | | | 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>
* rtpdec: Support sending RTCP feedback packetsMartin Storsjö2013-01-08
| | | | | | | | | | | | | | | | | | | | | 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>
* rtsp: Respect max_delay for the reordering queue when using custom IOMartin Storsjö2013-01-08
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Recheck the reordering queue if getting a new packetMartin Storsjö2013-01-08
| | | | | | | | | | 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>
* rtsp: Add support for depacketizing RTP data via custom IOMartin Storsjö2013-01-03
| | | | | | | | | | | | | | | | | | 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>
* rtpdec: Move the URLContext used for RTCP RR out from the context, to a ↵Martin Storsjö2013-01-03
| | | | | | parameter Signed-off-by: Martin Storsjö <martin@martin.st>
* rtp: set the payload type as stream idLuca Barbato2012-11-14
| | | | | | | Support multiple video/audio streams with different format in the same session. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>