Andreas Rheinhardt
1ea3650823
Replace all occurences of av_mallocz_array() by av_calloc()
...
They do the same.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years ago
Andreas Rheinhardt
bc70684e74
avformat: Constify all muxer/demuxers
...
This is possible now that the next-API is gone.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years ago
Aman Karmani
98b76bb11f
avformat/rtsp: add support for satip://
...
The SAT>IP protocol[1] is similar to RTSP. However SAT>IP servers
are assumed to speak only MP2T, so DESCRIBE is not used in the same
way. When no streams are active, DESCRIBE will return 404 according
to the spec (see section 3.5.7). When streams are active, DESCRIBE
will return a list of all current streams along with information
about their signal strengths.
Previously, attemping to use ffmpeg with a rtsp:// url that points
to a SAT>IP server would work with some devices, but fail due to 404
response on others. Further, if the SAT>IP server was already
streaming, ffmpeg would incorrectly consume the DESCRIBE SDP response
and join an existing tuner instead of requesting a new session with
the URL provided by the user. These issues have been noted by many
users across the internet[2][3][4].
This commit adds proper spec-compliant support for SAT>IP, including:
- support for the satip:// psuedo-protocol[5]
- avoiding the use of DESCRIBE
- parsing and consuming the com.ses.streamID response header
- using "Transport: RTP/AVP;unicast" because the optional "/UDP"
suffix confuses some servers
This patch has been validated against multiple SAT>IP vendor devices:
- Telestar Digibit R2
(https://telestar.de/en/produkt/digibit-r1-2/ )
- Kathrein EXIP 418
(https://www.kathrein-ds.com/en/produkte/sat-zf-verteiltechnik/sat-ip/227/exip-418 )
- Kathrein EXIP 4124
(https://www.kathrein-ds.com/en/products/sat-if-signal-distribution/sat-ip/226/exip-4124 )
- Megasat MEG-8000
(https://www.megasat.tv/produkt/sat-ip-server-3/ )
- Megasat Twin
(https://www.megasat.tv/en/produkt/sat-ip-server-twin/ )
- Triax TSS 400
(https://www.conrad.com/p/triax-tss-400-mkii-sat-ip-server-595256 )
[1] https://www.satip.info/sites/satip/files/resource/satip_specification_version_1_2_2.pdf
[2] https://stackoverflow.com/questions/61194344/does-ffmpeg-violate-the-satip-specification-describe-syntax
[3] https://github.com/kodi-pvr/pvr.iptvsimple/issues/196
[4] https://forum.kodi.tv/showthread.php?tid=359072&pid=2995884#pid2995884
[5] https://www.satip.info/resources/channel-lists/
4 years ago
Limin Wang
95d12da559
avformat/rtsp: prefer to use MAX_URL_SIZE for url and command buffer
...
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years ago
Andriy Gelman
f3891430fc
avformat/rtspdec: fix potential mem leak in listen mode
...
Currently a repeating setup request (with the same stream id) will
simply overwrite rtp_handle/transport_priv without freeing the
resources first. This is fixed by closing the previous setup request.
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years ago
Andriy Gelman
b0019b909b
avformat/rtspdec: show method request in log
...
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years ago
Andriy Gelman
9a70b6f5b8
avformat/rtspdec: cosmetics
...
Make error check style consistent with rest of function.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years ago
Andriy Gelman
122fcf1f40
avformat/rtspdec: fix mem leaks in connect mode if init fails
...
Fixes #6334
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years ago
Andriy Gelman
38bc4ba142
avformat/rtspdec: fix mem leaks in listen mode if init fails
...
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years ago
Andriy Gelman
423d06e0e2
avformat/rtspdec: add network init to listen mode
...
As per the docs network initialization is required before ff_url_join().
Furthermore, because the ff_network_init() was skipped, this makes
one additional call to ff_network_close() if the stream exits without
errors.
The was forgotten in the origin commit of the listen mode:
a8ad6ffafe
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years ago
Limin Wang
89429cf2f2
avformat/rtspdec: return proper error code
...
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years ago
Limin Wang
9e2872bc67
avformat/rtspdec: use SDP_MAX_SIZE for sdp array
...
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years ago
Andriy Gelman
b4103e0eb6
avformat/rtspdec: add newline in log message
...
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years ago
Limin Wang
cb14c6ff8f
avformat/rtspdec: av_dict_set() -> av_dict_set_int()
...
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
5 years ago
Carl Eugen Hoyos
4d8875ec23
lavf: Constify the probe function argument.
...
Reviewed-by: Lauri Kasanen
Reviewed-by: Tomas Härdin
6 years ago
Marton Balint
18ac642359
avformat: migrate to AVFormatContext->url
...
Signed-off-by: Marton Balint <cus@passwd.hu>
7 years ago
Derek Buitenhuis
5ca063799c
rtspdec: Fix return error
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
8 years ago
Diego Biurrun
67351924fa
Drop unreachable break and return statements
8 years ago
Martin Storsjö
fab8156b2f
avio: Copy URLContext generic options into child URLContexts
...
Since all URLContexts have the same AVOptions, such AVOptions
will be applied on the outermost context only and removed from the
dict, while they probably make sense on all contexts.
This makes sure that rw_timeout gets propagated to the innermost
URLContext (to make sure it gets passed to the tcp protocol, when
opening a http connection for instance).
Alternatively, such matching options would be kept in the dict
and only removed after the ffurl_connect call.
Signed-off-by: Martin Storsjö <martin@martin.st>
9 years ago
Derek Buitenhuis
93629735d7
avformat: Add a protocol blacklisting API
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
9 years ago
Anton Khirnov
ec4c483976
lavf: add a protocol whitelist/blacklist for file opened internally
...
Should make the default behaviour safer for careless callers that open
random untrusted files.
Bug-Id: CVE-2016-1897
Bug-Id: CVE-2016-1898
9 years ago
Anton Khirnov
8c0ceafb0f
urlprotocol: receive a list of protocols from the caller
...
This way, the decisions about which protocols are available for use in
any given situations can be delegated to the caller.
9 years ago
Michael Niedermayer
fe3fed0b14
Update demuxers and protocols for protocol whitelist support
...
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Luca Barbato
2c17fb61ce
rtsp: Log getaddrinfo failures
...
And forward the logging contexts when needed.
9 years ago
wm4
4a006b9eb7
lavf: split tls.c
...
Move the OpenSSL and GnuTLS implementations to their own files. Other
than the connection code (including options) and some boilerplate, no
code is actually shared.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
wm4
d8ffb2055f
lavf: split tls.c
...
Move the OpenSSL and GnuTLS implementations to their own files. Other
than the connection code (including options) and some boilerplate, no
code is actually shared.
Signed-off-by: Martin Storsjö <martin@martin.st>
10 years ago
Vittorio Giovara
1a3eb042c7
Replace av_dlog with normal av_log at trace level
...
This applies to every library where performance is not critical.
10 years ago
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>
10 years ago
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>
10 years ago
Gilles Chanteperdrix
22bb5bd7a3
avformat/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 after each PLAY command to cause the router to
restart the port redirection in that case.
Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Martin Storsjö
9108967513
rtspdec: Consistently use rtsp_hd_out for writing
...
Signed-off-by: Martin Storsjö <martin@martin.st>
10 years ago
Martin Storsjö
6df9d9b55d
lavf: Use av_gettime_relative
...
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>
10 years ago
Andrey Utkin
282c9354f1
avformat/rtsp: Use ff_rtsp_averror()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Luca Barbato
3df8d52fcd
rtsp: Add rtsps to the probe
10 years ago
Luca Barbato
c839b0439f
rtsp: Support tls when in listen mode
10 years ago
Luca Barbato
c27328e749
rtsp: Check for command strings without spaces
...
Prevent a NULL-pointer dereference.
CC: libav-stable@libav.org
10 years ago
Gabriel Dume
f929ab0569
cosmetics: Write NULL pointer equality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Michael Niedermayer
5be8c27694
avformat/rtspdec: Use av_mallocz_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Reimar Döffinger
a0568ed254
rtspdec: check for strchr returning NULL.
...
Fixes CID 732244.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
11 years ago
Rumin Sam
70e981cf5d
rtspdec: Fix keep-alive request for ACTi cameras
...
Some ACTi cameras fail if "*" is passed as the URI.
Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net>
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Martin Storsjö
50aef03b24
rtspenc: Make sure BYE packets are sent before TEARDOWN
...
Also make sure the BYE packets are sent at all when using
TCP interleaved transport.
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Martin Storsjö
b7e6da988b
rtpproto: Move rtpproto specific function declarations to a separate header
...
Mixing these with the rtp depacketizer functions in rtpdec.h is
no good.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Carl Eugen Hoyos
0fff7f039c
Supply a User-Agent header when opening rtsp streams.
...
Some rtsp servers like the IP Cam IcyBox IB-CAM2002 need it.
Fixes ticket #2761 .
Reported, analyzed and tested by trac user imavra.
12 years ago
Martin Storsjö
5a2cb78219
rtspdec: Set the default port for listen mode, if none is specified
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Michael Niedermayer
eae35eadc0
rtspdec: Fix use of uninitialized byte
...
ffurl_read_complete can return 0 as well as negative error codes.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Michael Niedermayer
0c6b9b9fe5
rtspdec:read_line: fix use of uninitialized byte
...
Fixes CID732301
Fixes CID723300
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Janne Grunau
d5ef9354ce
rtspdec: use av_strlcpy for writing into fixed size buffer
...
Fixes CID231347.
12 years ago
Diego Biurrun
6774247a9d
avformat: Drop pointless "format" from container long names
13 years ago
Anton Khirnov
c4ef6a3e4b
Add missing libavutil/time.h includes.
13 years ago
Jordi Ortiz
a8ad6ffafe
rtsp: Add listen mode
...
This makes the RTSP demuxer act as a server, listening for an
incoming connection.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago