Commit Graph

274 Commits

Author SHA1 Message Date
Martin Pulec
543cfcfd19 video display FPS indicator: make it bold
It looks better and is consistent with video capture indicator.
2022-09-23 11:10:31 +02:00
Martin Pulec
7737a4f878 replace some color_out macros with stream-oriented
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.
2022-08-24 16:12:36 +02:00
Martin Pulec
b1f0e004f4 fixed new Coverity bugs
Fixed some of (easy) newly detected Coverity bugs. Those are mostly
innocent ones (performance) and not new (detected because of new release
of Coverity).
2022-08-22 09:57:16 +02:00
Martin Pulec
65557d112d get rid of rang.hpp dependency through color_out.h
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
2022-08-17 17:24:34 +02:00
Martin Pulec
53caa93976 restore old tio in crash_signal_handler
In case of crash, atexit callbacks are not called, thus terminal state
is not restored (if modified by keyboard control).
2022-08-04 14:07:46 +02:00
Martin Pulec
f7746f97a7 parse_cuda_device: updates
- 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)
2022-07-29 08:09:04 +02:00
Martin Pulec
1bdf147a20 main.cpp: moved --cuda-device code to sep. func 2022-07-29 08:09:04 +02:00
Martin Pulec
9e10a385b6 color_out: new API
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).
2022-07-27 09:05:55 +02:00
Martin Pulec
e859bc7b35 Rate limited usage: reduce indention lvl for help 2022-07-20 11:07:40 +02:00
Martin Pulec
cbc548d384 Added+use dynamic rate limiter
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).
2022-07-20 11:05:40 +02:00
Martin Pulec
03f70eadef parse_bitrate: use map for special vals 2022-07-19 09:51:14 +02:00
Martin Pulec
e561e45933 Fixed "--param" handling
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.
2022-07-18 10:32:43 +02:00
Martin Pulec
1dc899209d set output buffering early
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.
2022-07-01 14:49:32 +02:00
Martin Pulec
a50f443095 main: point clog to cout
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).
2022-06-30 16:41:40 +02:00
Martin Pulec
a40d1d7c18 highlight video capture module name 2022-06-30 16:41:36 +02:00
Martin Pulec
4569fdbb49 main.cpp: adjust_params RX/TX 0 if no traffic
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.
2022-06-28 15:27:02 +02:00
Martin Pulec
c25a362c70 main.cpp: even if not sending use non-zero ports
The send/recv port equality is then used to determine if it is safe to
use Jumbo frames over localhost.
2022-06-22 12:40:07 +02:00
Martin Pulec
46a7a31b9a fixed wrong condition in commit 21374830
Fixed copy&paste error.

Fixes CID 395236.
2022-06-21 10:21:33 +02:00
Martin Pulec
213748300c main.cpp: use dynamic ports for UDP loopback
Use dynammic ports if using both send and receive and sending over
loopback.
2022-06-16 14:40:31 +02:00
Martin Pulec
6729a8a1ad audio: use const audio_frame 2022-05-25 17:09:42 +02:00
Martin Pulec
635b0b204b RTSP: make H.264 implicit again
The implicit H.264 setting was done only for SDP, not RTSP.
2022-03-25 16:58:27 +01:00
Martin Piatka
e81af5423f Add audio capture filter infrastructure 2022-03-18 14:15:30 +01:00
Martin Pulec
b5f1fd3735 Replaced chrono clocks with integer nanoseconds
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.
2022-03-18 08:52:29 +01:00
Martin Pulec
b144ced5e5 main: use set_audio_delay to git show 2022-03-04 16:28:58 +01:00
Martin Piatka
a779d9bdc7 video_display: Split display_run() into blocking and non-blocking ver 2022-02-21 13:22:36 +01:00
Martin Pulec
5772512dd7 main.cpp: fixed warnings 2022-01-12 13:48:00 +01:00
Martin Piatka
cbab1306aa holepunch: Fix building as plugin 2022-01-12 11:50:16 +01:00
Martin Piatka
f7d7c9cb09 main: Fix dangling pointer to holepunched host 2022-01-11 12:48:55 +01:00
Martin Piatka
96033da66f main: Add echo canceller to help 2022-01-10 15:46:29 +01:00
Martin Piatka
a834e19180 holepunch: send keep-alive traffic from receiver 2022-01-07 12:17:14 +01:00
Martin Piatka
fc4780acb2 holepunch: Add usage help 2022-01-07 12:17:13 +01:00
Martin Piatka
b58f8e5b5e holepunch: use hostname if client name is not given 2022-01-07 12:17:13 +01:00
Martin Piatka
3f3002b5ae holepunch: allow passing both servers as single argument 2022-01-07 12:17:12 +01:00
Martin Piatka
0abae42282 holepunch: punch also audio ports 2022-01-07 12:17:12 +01:00
Martin Piatka
63325461b0 holepunch: initial implementation 2022-01-07 12:17:10 +01:00
Martin Pulec
237f2becfe moved parse_audio_capture_format() to host.cpp 2022-01-06 13:56:48 +01:00
Martin Pulec
e28c79f717 Fixed some warnings 2021-11-25 15:49:19 +01:00
Martin Pulec
09426b2a7c print rather err msg on wrong unit_evaluate(_dbl) val
Use an user-friendlier error message than assert.
2021-10-05 10:26:48 +02:00
Martin Pulec
ba5763ef1a NAT: don't show NAT traversal hint for priv addr
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.
2021-10-04 11:24:15 +02:00
Martin Pulec
83ede03194 Set crash_signal_handler early
To allow generating stacktrace of crashes occuring during init.
2021-08-24 18:54:49 +02:00
Martin Pulec
9eadbe2465 ug_options: fixed wrong variable used 2021-07-09 10:20:13 +02:00
Martin Pulec
1f3e266478 Sender mode: client - send keep-alive only 1/s 2021-07-09 10:20:13 +02:00
Martin Pulec
49208387da main: moved getopt parsing to a separate function 2021-07-09 10:20:13 +02:00
Martin Pulec
3b6a1dd160 main: decouple verbosity parsing to host.cpp 2021-07-09 10:20:13 +02:00
Martin Pulec
8e5855e109 main: moved some logic to adjust_params 2021-07-09 10:20:12 +02:00
Martin Pulec
785405f885 main: options to separate struct
To allow a refactor.

+ ditto for audio init
2021-07-09 10:20:12 +02:00
Martin Pulec
941fdf6961 Server mode: start dummy/testcard cap/disp only if necessary 2021-06-29 14:33:10 +02:00
Martin Pulec
df7958487a Server mode: support audio 2021-06-29 14:06:47 +02:00
Martin Pulec
b023e8e608 Added server/client mode
Allows NAT traversal when server (sender) is outside the NAT.
2021-06-29 08:59:29 +02:00
Martin Pulec
120a7b4ff6 Changed some messages verbosity
- signal handler - verbose
- frame incomplete - debug (usually quite chatty)
2021-04-14 13:55:57 +02:00