Commit Graph

638 Commits

Author SHA1 Message Date
Ganesh Ajjanagadde 90409b6da8 avformat/rtsp: free opts dictionary on failure of getnameinfo
Fixes: CID 1341579.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-06 08:11:47 -05:00
Clément Bœsch 43ecec0f03 avformat: use AV_OPT_TYPE_BOOL in a bunch of places 2015-12-04 15:43:33 +01:00
Hendrik Leppkes f62fe535d5 Merge commit '2c17fb61ced2059034856a6c6cd303014aed01fe'
* commit '2c17fb61ced2059034856a6c6cd303014aed01fe':
  rtsp: Log getaddrinfo failures

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-29 16:13:24 +01:00
Hendrik Leppkes aaa4abfdb8 Merge commit '98063bcf15eb1e9bf9c8758c83c88d51cbb7ace7'
* commit '98063bcf15eb1e9bf9c8758c83c88d51cbb7ace7':
  rtsp: Do not assume getnameinfo cannot fail

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-29 16:09:58 +01:00
Luca Barbato 2c17fb61ce rtsp: Log getaddrinfo failures
And forward the logging contexts when needed.
2015-11-25 09:01:25 +01:00
Luca Barbato 98063bcf15 rtsp: Do not assume getnameinfo cannot fail
And properly report the error when it happens.
2015-11-25 09:01:25 +01:00
Hendrik Leppkes 12e95d156a Merge commit 'e02dcdf6bb6835ef4b49986b85a67efcb3495a7f'
* commit 'e02dcdf6bb6835ef4b49986b85a67efcb3495a7f':
  rtsp: Allow $ as interleaved packet indicator before a complete response header

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 12:41:37 +01:00
Martin Storsjö e02dcdf6bb rtsp: Allow $ as interleaved packet indicator before a complete response header
Some RTSP servers ("HiIpcam/V100R003 VodServer/1.0.0") respond to
our keepalive GET_PARAMETER request by a truncated RTSP header
(lacking the final empty line to indicate a complete response
header). Prior to 764ec70149, this worked just fine since we
reacted to the $ as interleaved packet indicator anywhere.

Since $ is a valid character within the response header lines,
764ec70149 changed it to be ignored there. But to keep
compatibility with such broken servers, we need to at least
allow reacting to it at the start of lines.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-10-23 10:31:55 +03:00
Hendrik Leppkes 78af3ffaa9 Merge commit '1ec611a10228945d2ec8a9cf6c5531dee6b7ee56'
* commit '1ec611a10228945d2ec8a9cf6c5531dee6b7ee56':
  rtsp: warning when max_delay reached

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-16 14:11:24 +02:00
Eloi BAIL 1ec611a102 rtsp: warning when max_delay reached
packets are queued due to packet reordering until the queue reach its
maximal size or max delay is reached.
This commit adds a warning trace when max delay is reached.

Signed-off-by: Eloi BAIL <eloi.bail@savoirfairelinux.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-09-16 09:58:12 +03:00
Michael Niedermayer bc4bdc6d61 Merge commit '764ec70149728be82304c163ccc4e280f1629201'
* commit '764ec70149728be82304c163ccc4e280f1629201':
  rtsp: Only interpret $ as interleaved packet indicator at the start of replies

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-30 18:37:37 +02:00
Martin Storsjö 764ec70149 rtsp: Only interpret $ as interleaved packet indicator at the start of replies
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>
2015-07-30 16:59:36 +03:00
Michael Niedermayer e6ec65d2d3 avformat/rtsp: print a debug level note if time parsing fails
Fixes CID733718 again

This partly reverts commit eb7ddb5066.
2015-05-15 20:21:37 +02:00
Michael Niedermayer 10a28e8a08 Merge commit 'b90adb0aba073f9c1b4abca852119947393ced4c'
* commit 'b90adb0aba073f9c1b4abca852119947393ced4c':
  rtsp: Make sure we don't write too many transport entries into a fixed-size array

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-24 20:37:51 +02:00
Martin Storsjö b90adb0aba rtsp: Make sure we don't write too many transport entries into a fixed-size array
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-04-24 16:07:14 +03:00
Michael Niedermayer f8951d36df Merge commit 'eb7ddb5066843ab16caf33b05eafb2576648b797'
* commit 'eb7ddb5066843ab16caf33b05eafb2576648b797':
  rtsp: Don't warn about unparsed time ranges

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-24 03:00:37 +02:00
Martin Storsjö eb7ddb5066 rtsp: Don't warn about unparsed time ranges
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>
2015-04-23 23:20:02 +03:00
Michael Niedermayer 40d552dae6 Merge commit '1a3eb042c704dea190c644def5b32c9cee8832b8'
* commit '1a3eb042c704dea190c644def5b32c9cee8832b8':
  Replace av_dlog with normal av_log at trace level

Conflicts:
	ffplay.c
	libavdevice/fbdev_dec.c
	libavfilter/avfilter.c
	libavfilter/internal.h
	libavfilter/setpts.c
	libavfilter/src_movie.c
	libavfilter/vf_crop.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fieldorder.c
	libavformat/assdec.c
	libavformat/avidec.c
	libavformat/flvdec.c
	libavformat/http.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/mov.c
	libavformat/mpegenc.c
	libavformat/mpegts.c
	libavformat/mpegtsenc.c
	libavformat/mux.c
	libavformat/mxfdec.c
	libavformat/nsvdec.c
	libavformat/oggdec.c
	libavformat/r3d.c
	libavformat/rtspdec.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 03:19:47 +02:00
Vittorio Giovara 1a3eb042c7 Replace av_dlog with normal av_log at trace level
This applies to every library where performance is not critical.
2015-04-19 12:41:59 +01:00
Himangi Saraogi f03dfe118b avformat/rtsp: Fix dereference after null check
This fixes CID 732219

Reviewed-by: Thomas Volkert <silvo@gmx.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-12 23:31:55 +02:00
Himangi Saraogi 4e54432164 rtsp: Fix unchecked return value
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-04-12 23:08:14 +03:00
Himangi Saraogi 0b72a47f55 rtsp: Check a malloc return value
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-04-12 23:08:13 +03:00
Himangi Saraogi aae9f52c4e avformat/rtsp: Fix unchecked return value
Reviewed-by: Thomas Volkert <silvo@gmx.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-10 14:18:11 +02:00
Himangi Saraogi 4b03002527 avformat/rtsp: Fix null pointer dereference
This fixes CID 1257827.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 13:38:34 +02:00
Michael Niedermayer 53bf6b155c Merge commit 'e3ec6fe7bb2a622a863e3912181717a659eb1bad'
* commit 'e3ec6fe7bb2a622a863e3912181717a659eb1bad':
  rtsp: Add a buffer_size option

Conflicts:
	libavformat/rtsp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-01 21:34:20 +02:00
Luca Barbato e3ec6fe7bb rtsp: Add a buffer_size option
And forward it to rtp and udp.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-04-01 14:26:35 +02:00
Michael Niedermayer b425b81fd2 avformat/rtsp: Fix potential pointer overflow in sdp_probe()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-16 22:40:36 +01:00
Gilles Chanteperdrix 071f3e1c6e Revert "rtsp: Interpret the text media type as AVMEDIA_TYPE_DATA"
This reverts commit 26524e3581.

If we want the T.140 codec to have the AV_CODEC_ID_TEXT codec id,
its type needs to be AVMEDIA_TYPE_SUBTITLE, so, keep interpreting
the text media type as AVMEDIA_TYPE_SUBTITLE.

Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-01 03:40:20 +01:00
Michael Niedermayer 3130e5be92 Merge commit 'd594dbecce5f3af7f80bbf5bb1b516d740b69ccd'
* commit 'd594dbecce5f3af7f80bbf5bb1b516d740b69ccd':
  rtpdec: Rename the free method to close

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:58:39 +01:00
Michael Niedermayer 7f03f75ce7 Merge commit '8e32b1f0963d01d4f5d4803eb721f162e0d58d9a'
* commit '8e32b1f0963d01d4f5d4803eb721f162e0d58d9a':
  libavformat: Use ffio_free_dyn_buf where applicable

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:48:50 +01:00
Michael Niedermayer 79052cd4ce Merge commit '078d43e23a7a3d64aafee8a58b380d3e139b3020'
* commit '078d43e23a7a3d64aafee8a58b380d3e139b3020':
  rtpdec: Free depacketizers if the init function failed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:32:06 +01:00
Michael Niedermayer fa80b76b11 Merge commit 'bb4a310bb85f43e62240145a656b1e5285b14239'
* commit 'bb4a310bb85f43e62240145a656b1e5285b14239':
  rtpdec: Don't free the payload context in the .free function

Conflicts:
	libavformat/rtpdec_latm.c
	libavformat/rtpdec_mpeg4.c
	libavformat/rtpdec_mpegts.c
	libavformat/rtpdec_xiph.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:25:12 +01:00
Michael Niedermayer 64f58d20b2 Merge commit 'f4b59334bd898c47c9ac30999a346176548630a8'
* commit 'f4b59334bd898c47c9ac30999a346176548630a8':
  rtpdec: Remove the now unused .alloc field

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:17:48 +01:00
Michael Niedermayer 48e3cd4fcd Merge commit 'e72605f80bf5cbe32053a554ccc137e0a99cf3dd'
* commit 'e72605f80bf5cbe32053a554ccc137e0a99cf3dd':
  rtpdec: Allow allocating and freeing the private data without explicit functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 22:42:04 +01:00
Michael Niedermayer 4c8a556a77 Merge commit 'b7a4c319fda22aa91ce29692d728ec6103b514f6'
* commit 'b7a4c319fda22aa91ce29692d728ec6103b514f6':
  rtpdec: Allow setting the need_parsing field in RTPDynamicProtocolHandler

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 22:33:49 +01:00
Martin Storsjö d594dbecce rtpdec: Rename the free method to close
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>
2015-02-24 23:07:50 +02:00
Martin Storsjö 8e32b1f096 libavformat: Use ffio_free_dyn_buf where applicable
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:47 +02:00
Martin Storsjö 078d43e23a rtpdec: Free depacketizers if the init function failed
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>
2015-02-24 23:07:39 +02:00
Martin Storsjö bb4a310bb8 rtpdec: Don't free the payload context in the .free function
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>
2015-02-24 23:07:35 +02:00
Martin Storsjö f4b59334bd rtpdec: Remove the now unused .alloc field
Always use the .priv_data_size field instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:32 +02:00
Michael Niedermayer eb24186b45 Merge commit '74d318f138f2a3f1b2fe81aea826d80d1e60f54c'
* commit '74d318f138f2a3f1b2fe81aea826d80d1e60f54c':
  rtsp: Fix the indentation of a linewrapped statement

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 22:03:57 +01:00
Michael Niedermayer c6792275f4 Merge commit '26524e358147aade6e9dd18fff42d61b966bbc70'
* commit '26524e358147aade6e9dd18fff42d61b966bbc70':
  rtsp: Interpret the text media type as AVMEDIA_TYPE_DATA

See: afb0e5a810
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 21:43:13 +01:00
Martin Storsjö e72605f80b rtpdec: Allow allocating and freeing the private data without explicit functions
This can reduce the amount of boilerplate in simple depacketizers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 16:23:37 +02:00
Martin Storsjö b7a4c319fd rtpdec: Allow setting the need_parsing field in RTPDynamicProtocolHandler
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>
2015-02-24 16:22:21 +02:00
Martin Storsjö 74d318f138 rtsp: Fix the indentation of a linewrapped statement
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 16:20:10 +02:00
Martin Storsjö 26524e3581 rtsp: Interpret the text media type as AVMEDIA_TYPE_DATA
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 16:19:37 +02:00
Michael Niedermayer 83f18410bd Merge commit 'cdcc370293a159c321e41af7f0eef141c62d698d'
* commit 'cdcc370293a159c321e41af7f0eef141c62d698d':
  rtsp: punch holes again after pause

See: 22bb5bd7a3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-23 21:43:18 +01:00
Gilles Chanteperdrix cdcc370293 rtsp: punch holes again after pause
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>
2015-02-23 16:55:56 +02:00
Gilles Chanteperdrix 4438d1c6ed rtsp: parse lang attribute in SDP
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-21 23:37:24 +02:00
Gilles Chanteperdrix c7ad1f562b avformat/rtsp: parse lang attribute in SDP
Reviewed-by: Thomas Volkert <silvo@gmx.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-13 00:49:08 +01:00