For ostreams, the stream macros are prefered both over raw escape
sequence macros (guarantee style/color termination) and function-like
ones in form T<PROP>(), because it allows also different argument than
C string literal.
Fixed some of (easy) newly detected Coverity bugs. Those are mostly
innocent ones (performance) and not new (detected because of new release
of Coverity).
Removed indirect dependency on rang.hpp through color_out.h. Now only
remaining dependencies on rang.hpp are direct.
+ fixed escape sequence for foreground magenta
- document return code (non-intuitive)
- set cuda devices even if GPUJPEG is not compiled in. The code is used
to enumerate CUDA devices but now not only GPUJPEG uses the value, it
is eg. used to identify GPU for NVENC
- restructuralize (exit in help block) + return EXIT_FAILURE instead of
EXIT_FAIL_USAGE if GPUJPEG not compiled in (perhaps more eligible --
the usage is actually correct, just GJ is not compiled in)
Use inline ANSI escape sequences instead of modifiers.
This allows more convenient formatting without the need to use multiple
calls (possibly interleaving).
ANSI escape sequences are nowadays supported also in Windows terminals
(PS, cmd).
Added a rate limiter that occasionally allows excessive frames.
It permits using 1.5x frame time for frame 2x bigger that moving
average if 4 normal frames (using .75x frame time) were emitted
inbetween.
This mode is now default (for video, audio doesn't use rate limiter).
The parsing was done early before dynamic modules that export own
parameters were loaded.
Now, the parsing is done in 2 steps -- first scan only for already known
parameters (output buffer settings is needed for preinit), ignore
"help".
The second step is to do the full parse (in main), when there are all
modules loaded (latter in common_preinit()).
Fixes#237.
The regression was introduced by 1dc89920.
setvbuf() should be called on a stream prior to any operation with the
stream. Previously it was to late -- it was even after configuration
summary was printed to stdout.
Point clog to cout instead of default cerr. Unit of log is almost always
a line so it is pointless to flush it after each write (as stderr is set
by default not to buffer /see previous commit/) -- those would make
every '<<' operator a flush point (or in C code multiple calls of
console_out is done).
This slightly modifies commit c25a362c that brought a regression if
sending&receiving video but no audio -- TX port was set to base (or +2)
but RX was kept 0 resulting port inequality and thus Jumbo frames were
not chosen.
Ref 84861d6
It was perhaps rather a workaround for low-resolution Windows timeval
compat. On the other hand it enforced C++ API and makes things a bit
complicated. It had also broken some invariants, namely that the timeval
values had been wallclock time.
Do not show hint to use NAT traversal if user uses private or loopback
address as a peer address.
This avoids misleading displaying in otherwise legitimate cases -
transmissions over loopback or behind NAT but just inside LAN.