Commit Graph

11036 Commits

Author SHA1 Message Date
Sven Dueking 90b15f60bf srt: Set srto_sender flag to sender srt socket
SRT API Documentation:
This flag is superfluous if both parties are at least version 1.3.0
(this shall be enforced by setting this value to SRTO_MINVERSION if
you expect that it be true) and therefore support HSv5 handshake,
where the SRT extended handshake is done with the overall handshake
process.

This flag is however obligatory if at least one party may be using
SRT below version 1.3.0 and does not support HSv5.
2019-02-12 11:59:29 +01:00
Martin Storsjö 8c76bfacf6 tcp: Use ff_connect_parallel for RFC 8305 style connecting
Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-31 12:26:52 +03:00
Martin Storsjö 9b4c3f5aad network: Add RFC 8305 style "Happy Eyeballs"/"Fast Fallback" helper function
For cases with dual stack (IPv4 + IPv6) connectivity, but where one
stack potentially is less reliable, strive to trying to connect over
both protocols in parallel, using whichever address connected first.

In cases with a hostname resolving to multiple IPv4 and IPv6
addresses, the current connection mechanism would try all addresses
in the order returned by getaddrinfo (with all IPv6 addresses ordered
before the IPv4 addresses normally). If connection attempts to the
IPv6 addresses return quickly with an error, this was no problem, but
if they were unsuccessful leading up to timeouts, the connection process
would have to wait for timeouts on all IPv6 target addresses before
attempting any IPv4 address.

Similar to what RFC 8305 suggests, reorder the list of addresses to
try connecting to, interleaving address families. After starting one
connection attempt, start another one in parallel after a small delay
(200 ms as suggested by the RFC).

For cases with unreliable IPv6 but reliable IPv4, this should make
connection attempts work as reliably as with plain IPv4, with only an
extra 200 ms of connection delay.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-31 12:26:51 +03:00
Martin Storsjö 6a9c00c09d tls_openssl: Fix checks for SSL_ERROR_WANT_WRITE in nonblocking operation
This was a typo in 0671eb2346, spotted by Chris Carroux.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-17 13:08:28 +03:00
Martin Storsjö 22f98ac19c network: Check for EINTR in ff_poll_interrupt
Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-14 22:30:33 +03:00
Simon Thelen c194b9ad6d network: Use ff_neterrno instead of AVERROR(errno) for poll errors
This makes sure to pick up the actual error codes on windows.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-14 22:30:29 +03:00
Andrey Utkin 5d01bd181b http: pass return code from http_open_cnx_internal() on its failure
Previously, AVERROR(EIO) was returned on failure of
http_open_cnx_internal(). Now the value is passed to upper level, thus
it is possible to distinguish ECONNREFUSED, ETIMEDOUT, ENETUNREACH etc.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-08-14 22:30:23 +03:00
Sven Dueking f25117a428 libsrt: Pass the correct pointer for the passphrase
The passphrase field is a pointer already.

Bug-Id: https://github.com/Haivision/srt/issues/416
2018-07-13 18:36:11 +02:00
Sven Dueking a507af97ee avformat/libsrt: add latency options and deprecate tspbdelay
Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-06-04 18:47:48 +02:00
Sven Dueking ea8ae27a5e avformat/libsrt: add payload size option
Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-06-03 17:46:23 +02:00
Diego Biurrun e368b0cbfa tls_mbedtls: Use non-deprecated header file
/usr/include/mbedtls/net.h:29:2: warning: #warning "Deprecated header file: Superseded by mbedtls/net_sockets.h" [-Wcpp]
2018-04-26 11:27:08 +02:00
Thomas Volkert 4130e05ff4 libavformat: add mbedTLS based TLS
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-04-25 10:34:12 +02:00
Diego Biurrun 23be4eebf8 build: Group external library protocols separately 2018-04-20 12:00:10 +02:00
Sven Dueking a2fc8dbae8 Add Haivision SRT protocol
The protocol requires libsrt (https://github.com/Haivision/srt) to be
installed

Signed-off-by: Sven Dueking <sven.dueking@nablet.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-03-28 16:16:41 +02:00
Luca Barbato 44a1731011 ivf: Support VP9 and AV1 as well 2018-03-12 08:12:43 +01:00
Luca Barbato aeaa108baf hls: Add a discontinuity marker on recover
It seems to improve the compatibility with the js demuxers.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-03-06 20:59:40 +01:00
James Almer dc40e64adb hvcc: zero initialize the nal buffers past the last written byte
Bug-Id: 1116
Cc: libav-stable@libav.org

Signed-off-by: James Almer <jamrial@gmail.com>
2018-02-23 00:17:17 -03:00
Diego Biurrun 4cf84e254a Drop some unnecessary config.h #includes 2018-02-06 10:03:15 +01:00
Josh Allmann a2a9e4eea0 rtmp: Plug leak if sending bytes read report fails.
Signed-off-by: Martin Storsjö <martin@martin.st>
2018-01-24 07:16:06 +02:00
Tristan Matthews f6161fccf8 rtsp: only break on parse_rtsp_message on error
Fix suggested by Luca Barbato.

This was causing spurious EOFs when using -rtsp_transport udp, as
reported in https://bugzilla.libav.org/show_bug.cgi?id=1103

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-11-30 15:32:04 +01:00
Sean McGovern fbca6e7d16 matroskadec: allow RealAudio/Cook/Sipro streams of flavor 0
Regression since 569d18aa9d.

Bug-Id: 1055
Cc: libav-stable@libav.org
2017-11-06 17:30:05 -05:00
James Almer 55fe72a841 matroskadec: don't warn about unknown spherical medata when none is present
track->video.projection.type is set to 0 (a Matroska specific "No spherical
metadata present" value, with no related AVSphericalMapping) by default on
files without the element.

This removes bogus warnings on every single matroska file without Spherical
metadata.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-11-03 19:41:08 -03:00
Peter Große 91760a9340 dashenc: copy stream frame rate to output stream
Leads to setting of DefaultDuration in Matroska muxer based on frame rate instead of timebase.
Fixes playback in Chrome.

Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-10-27 19:52:48 +02:00
Anton Schubert 4723c6226a dashenc: fix bitrate estimation with correct scaling
Signed-off-by: Anton Schubert <ischluff@mailbox.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-10-27 19:52:48 +02:00
Jacek Jendrzej 9b1c091114 http: Reset compressed header flag when starting to read a request
This fixes redirects, where the original redirect response indicated
support for compression, while the actual redirected content didn't.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-09-26 13:36:21 +03:00
Michael Niedermayer ec683ed527 smacker: fix integer overflow with pts_inc
Bug-Id: 1073

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
2017-09-24 12:58:42 +02:00
Sean McGovern 9e36102278 smacker: return meaningful error codes on failure 2017-09-24 12:57:54 +02:00
James Almer ac6691ab99 avio: update avio_alloc_context() doxy
It must be freed using avio_context_free() starting with commit
99684f3ae7.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-09-14 09:53:31 +02:00
Martin Storsjö 585dc1aece flvdec: Check the avio_seek return value after reading a metadata packet
If the metadata packet is corrupted, flv_read_metabody can accidentally
read past the start of the next packet. If the start of the next packet
had been flushed out of the IO buffer, we would be unable to seek to
the right position (on a nonseekable stream).

Prefer to clearly error out instead of silently trying to read from a
desynced stream which will only be interpreted as garbage.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-09-04 09:42:51 +03:00
Martin Storsjö e41daa6246 Remove support for building for mingw32ce (Windows CE)
The toolchain for this target is unmaintained since many years.

While it has been continuously build tested on fate, it hasn't
actually been tested at runtime since many, many years (and back
then, only a few codecs in libavcodec were tested).

So far, keeping support for it has been mostly effortless, but
the compiler does seem to have issues with dllimported data symbols,
ending up as internal compiler errors in some cases. Instead of
jumping through further hoops to work around that, just remove the
target.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:21:08 +03:00
wm4 173b56218f lavf: make avio_read_partial() public
Main use-case is proxying avio through a foreign I/O layer and a custom
AVIO context, without losing latency and performance characteristics.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-08-30 14:29:14 +02:00
Mark Thompson b88da98b34 hevc: Improve stream constraint values in common header
Add comments to describe the sources of the constraint values expressed here,
and add some more related values which will be used in following patches.

Fix the incorrect values for SPS and PPS count (they are not the same as those
used for H.264), and remove HEVC_MAX_CU_SIZE because it is not used anywhere.
2017-08-05 23:54:35 +01:00
Sean McGovern defe307fb2 mov: move stsd finalization to an appropriate place
mov_finalize_stsd_codec() parses stream information from the ALAC extradata,
so run it after the extradata processing is completed in mov_read_stsd().

Fixes playback of 96kHz ALAC streams muxed by qaac or the reference alac encoder.

Adapted from an FFmpeg patch by Hendrik Leppkes <h.leppkes@gmail.com>

Bug-Id: 1072
2017-07-31 17:41:01 -04:00
Sean McGovern 3050dabaa9 mov: Do not set stsd_count if mov_read_stsd() fails
Based on an FFmpeg patch by Michael Niedermayer <michael@niedermayer.cc>
2017-07-31 17:41:01 -04:00
Sean McGovern d7bdab1ad7 mov: log and return early on non-positive stsd entry counts
Based on an FFmpeg patch by Michael Niedermayer <michael@niedermayer.cc>
2017-07-30 10:51:12 -04:00
Sean McGovern 80e919b174 rmdec: add missing brackets to compound statement
Accidentally left out of 95ce02b35d.
2017-07-25 19:19:20 -04:00
wm4 2b1324bd16 lavf: allow avformat_close_input() with NULL
This is consistent with how other destructors behave.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-07-22 09:30:56 +02:00
Anton Khirnov 48a5c35346 caf: add an Opus tag
CC: libav-stable@libav.org
2017-07-22 09:30:56 +02:00
Sean McGovern 95ce02b35d rmdec: don't ignore the return value of av_get_packet() 2017-07-17 07:08:13 -04:00
Diego Biurrun 825e463a17 build: Add feature test macros for glibc 2.19+
glibc introduced _DEFAULT_SOURCE in version 2.19 to replace _BSD_SOURCE and
_SVID_SOURCE, which were deprecated in version 2.20. Add _DEFAULT_SOURCE
where the latter two are used to be forwards-compatible and avoid warnings
about the use of deprecated definitions.
2017-07-10 10:22:56 +02:00
Martin Storsjö 4d330da006 os_support: Use HAVE_UWP instead of manually checking WINAPI_FAMILY
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-07-05 13:55:12 +03:00
Martin Storsjö 61f589e31e lavf: Remove codec_tag from dashenc and smoothstreamingenc
Currently, the tags enforced and set on the segmenter muxer level
mismatch what the mp4/ismv muxer uses (since 713efb2c0d).

Skip the codec_tag altogether here, to let the user (try to) set
whichever codec/tag is preferred; the individual chained muxer will
reject invalid codecs anyway.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-07-02 22:42:26 +03:00
Martin Storsjö eb061ad6fd tls_gnutls: Readd support for nonblocking operation
The rtmp protocol uses nonblocking reads, to poll for incoming
messages from the server while publishing a stream.

Prior to 94599a6de3 and
d13b124eaf, the tls protocol
handled the nonblocking flag, mostly as a side effect from not
using custom IO callbacks for reading from the socket. When custom
IO callbacks were taken into use in
d15eec4d6b, the handling of a nonblocking
socket wasn't necessary for the default blocking mode any longer.

The code was simplified, since it was overlooked that other code
within libavformat actually used the tls protocol in nonblocking mode.

This fixes publishing over rtmps, with the gnutls backend.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-06-20 23:55:52 +03:00
Martin Storsjö 0671eb2346 tls_openssl: Readd support for nonblocking operation
The rtmp protocol uses nonblocking reads, to poll for incoming
messages from the server while publishing a stream.

Prior to 94599a6de3 and
d13b124eaf, the tls protocol
handled the nonblocking flag, mostly as a side effect from not
using custom IO callbacks for reading from the socket. When custom
IO callbacks were taken into use in
d15eec4d6b, the handling of a nonblocking
socket wasn't necessary for the default blocking mode any longer.

The code was simplified, since it was overlooked that other code
within libavformat actually used the tls protocol in nonblocking mode.

This fixes publishing over rtmps, with the openssl backend.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-06-20 23:55:52 +03:00
John Stebbins 84ab1cc437 movenc: allow alternative hvc1 h.265 codec tag
If AVCodecParameters.codec_tag is 'hvc1' use it instead of 'hev1' for
h.265 streams. QuickTime (and other Apple software) requires 'hvc1'.
2017-06-20 08:08:38 -07:00
John Stebbins 1ea9b7fdf9 movenc: write correct format hvcc when tag is hvc1 2017-06-20 08:08:38 -07:00
John Stebbins 1c64bae648 movenc: move tags definitions to where they are used 2017-06-20 08:08:38 -07:00
John Stebbins f6f86f432f movenc: simplify codec_tag lookup
mux.c init_muxer() already sets codec_tag correctly in the cases
simplified here.

This also adds the capability to support alternative tags for the
same codec_id.
2017-06-20 08:08:38 -07:00
John Stebbins 713efb2c0d movenc: use correct tag list for AVOutputFormat.codec_tag
ff_mp4_obj_type contains the wrong type of tags for
AVOutputFormat.codec_tag. AVOutputFormat.codec_tag is used to
validate AVCodecParameters.codec_tag so needs to be the same
type of tag.

Creates new tag lists for mp4 and ismv.  New tag lists support
same list of codecs found in ff_mp4_obj_type. psp uses the same
tag list as mp4 since these both use mp4_get_codec_tag to look up tags.
2017-06-20 08:08:38 -07:00
Diego Biurrun 61cec5adaa tls: Hide backend implementation details from users
TLS is currently implemented over either OpenSSL or GnuTLS, with more
backends likely to appear in the future. Currently, those backend libraries
are part of the protocol names used during e.g. the configure stage of a
build. Hide those details behind a generically-named declaration for the
TLS protocol to avoid leaking those details into the configuration stage.
2017-06-02 10:41:52 +02:00