This simplifies testing arbitrary code fragments within a function
body.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Currently, --enable-small turns av_always_inline into plain inline,
which is more or less ignored by the compiler. While the intent of
this is probably to reduce code size by avoiding some inlining, it
has more far-reaching effects.
We use av_always_inline in two situations:
1. The body of a function is smaller than the call overhead.
Instances of these are abundant in libavutil, the bswap.h
functions being good examples.
2. The function is a template relying on constant propagation
through inlined calls for sane code generation. These are
often found in motion compensation code.
Both of these types of functions should be inlined even if targeting
small code size.
Although GCC has heuristics for detecting the first of these types,
it is not always reliable, especially when the function uses inline
assembler, which is often the reason for having those functions in
the first place, so making it explicit is generally a good idea.
The size increase from inlining template-type functions is usually
much smaller than it seems due to different branches being mutually
exclusive between the different invocations. The dead branches can,
however, only be removed after inlining and constant propagation have
been performed, which means the initial cost estimate for inlining
these is much higher than is actually the case, resulting in GCC
often making bad choices if left to its own devices.
Furthermore, the GCC inliner limits how much it allows a function to
grow due to automatic inlining of calls, and this appears to not take
call overhead into account. When nested inlining is used, the limit
may be hit before the innermost level is reached. In some cases, this
has prevented inlining of type 1 functions as defined above, resulting
in significant performance loss.
Signed-off-by: Mans Rullgard <mans@mansr.com>
We need to include winsock2.h here, to make sure we have the
real pollfd struct definition, if one exists, before defining the
fallback poll function.
Signed-off-by: Martin Storsjö <martin@martin.st>
It is included for the open/read/write/close functions. On
MSVC, where this header does not exist, the same functions
are provided by io.h, which is already included.
On windows, these functions are provided by io.h. Make sure
io.h is included if it exists, regardless of the setmode
function.
Signed-off-by: Martin Storsjö <martin@martin.st>
Apparently, some build environments require dxva.h even for dxva2,
while others lack this header entirely. Including it conditionally
allows building in both cases.
Signed-off-by: Martin Storsjö <martin@martin.st>
This adds a fallback for cbrtf() using powf(x, 1/3). Since
powf() with a non-integer exponent requires a non-negative
base, special handling of negative inputs is needed.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Apparently this include is needed on some systems for building the
poll fallback (for the timeval struct for select?), but it isn't
available on all systems. Thus only include it if it exists.
Signed-off-by: Martin Storsjö <martin@martin.st>
This function implements a delay using the first available
of the following functions:
- nanosleep()
- usleep()
- Sleep() (Windows)
The conditional #includes in time.c are simplified by including
unistd.h and windows.h whenever they are available rather than
having these lines triggered by specific functions.
Signed-off-by: Mans Rullgard <mans@mansr.com>
The check uses check_func_header, since this function is
conditionally available depending on the targeted MSVCRT
version.
Signed-off-by: Martin Storsjö <martin@martin.st>
This adds two protocols, but one of them is an internal implementation
detail just used as an abstraction layer/generalization in the code. The
RTMPT protocol implementation uses rtmphttp:// as an alternative to the
tcp:// protocol. This allows moving most of the lower level logic out
from the higher level generic rtmp code.
Signed-off-by: Martin Storsjö <martin@martin.st>
This adds the avoption mpegts_flags and converts the existing
resend_headers option into a flag, keeping the old option as
fallback for now.
Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
This removes the dependency on adts.c internals, and simplifies
adding other packetization formats.
Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
FATE_SAMPLES is now used directly by the Makefiles, which induces the test
system to run a test with the value of the environment variable as name.
Renaming the environment variable to LIBAV_SAMPLES avoids this problem.
This disables the warning "external declaration in primary source file"
which is issued when a prototype for an extern function is found in a
.c file rather than a header file. We have such prototypes for asm
functions where a separate header file would be pointless.
Signed-off-by: Mans Rullgard <mans@mansr.com>
The fields in config.fate are colon-separated so any colons
within the fields should be escaped to prevent confusion.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Since the mandatory memcpy in vsrc_buffer has been eliminated, there
shouldn't be any significant reason to build without lavfi anymore.
This will make upcoming support for complex filtergraphs easier to do.