Commit Graph

325 Commits

Author SHA1 Message Date
Martin Pulec
cb0f7feafc parse_port: fixed Coverity complaint
CID 407267

handle correctly vicious inputs like "-P :" or "-P 1:"
2023-05-10 08:52:02 +02:00
Martin Pulec
64688bb4c7 hd-rum-transcode: share signal callbacks with UG
The crash and freeze signal handlers may be useful also for the
reflector.
2023-04-28 13:12:35 +02:00
Martin Pulec
c9ba1d2260 main: fail if multiple displays given
UltraGrid cannot handle multiple displays anyways and since only the
last one is used, it is perhaps better to notice user on this error.

Also, user might have given something like '-d decklink:device=2' and
then '-d decklink', supposing that the second is correct but decklink
would use device #2, although it was given in first decklink setting
(opts are not overriden by the second decklink specification).
2023-04-28 10:15:11 +02:00
Martin Pulec
dc9f3f910a RTSP/SDP: disable interlaced dct for H.264 stream 2023-04-27 15:21:18 +02:00
Martin Pulec
d330520d59 SDP: refactor - use global state
Until now, `uv -s testcard --protocol sdp` didn't generate the SDP file
(nor output) because the all SDP state initialization was handled in
video_rxtx/h264_sdp.
2023-04-27 15:21:16 +02:00
Martin Pulec
48219758ea use Opus, not OPUS
For audio codecs, we respect its native capitalization of letters, eg.
AAC, speex. So do it also for Opus. This should not affect existing
applications since the Opus name is parsed case-insensitively.

Only exception is SDP (rtpmap) where is usually used lower-case (at
least in rfc7587).
2023-04-26 09:53:10 +02:00
Martin Pulec
1ed549df4a separated some common root mod handling to host.cpp
The management of should_exit events should be also be shared with the
transcoding reflector that uses some parts that may depend upon this
functionality.

This is not purely a refactorization but slightly changes behavior,
namely the shared state cleanup is done in a destructor, not by
`uv.stop()` as it used to be.

see GH-307
2023-04-12 16:35:55 +02:00
Martin Pulec
737a27270e FEC help: excess second %
perhaps a relict from printf printout
2023-04-04 16:33:07 +02:00
Martin Pulec
811938ed8c main: call regiesterd should_exit callback if exit
If registering a should_exit callback but should_exit has already been
broadcasted, it wasn't ever run, leading likely to a freeze.

Steps to reproduce the fixed problem:

    uv -t swmix:512:512:2 -t invalid

Fixed by immediately calling the registered callback if should_exit has
been already issued.
2023-03-31 14:16:47 +02:00
Martin Pulec
2317819400 CUDA: do not use gpujpeg for dev list
Query directly, without help from GPUJPEG (although the code is actually
borrowed from there).

This enables device listing also if GPUJPEG is not compiled in and it
simplifies main.
2023-03-30 14:01:10 +02:00
Martin Pulec
a3daa89ef6 displays: changed api for mainloop
- removed `needs_mainloop` attribute and deduce if mainloop is needed
  from the presence of _run callback (the information is now redundant
  only displays needing/running mainloop should announce _run callback)

- run the custom mainloop (currently only Syphon!) only when display
  doesn't run its mainloop. This allows running Syphon and GL/SDL
  display because it connects to the display mainloop.
2023-03-29 13:39:48 +02:00
Martin Pulec
449251ac3e get rid of global should exit variable 2023-03-24 14:06:50 +01:00
Martin Pulec
03c7d5043f parse_bitrate: fixed parsing of spec vals
fixes 03f70eade

closes GH-300
2023-03-07 08:27:15 +01:00
Martin Pulec
de91c41a14 optstring: added missing letter 'F' (capture filter) 2023-02-28 16:17:36 +01:00
Martin Pulec
d04fff8c9e main: catch stoi exceptions
Using short getopt options, a user may make a mistake in parameter name
resulting in passing a non-numeric string to stoi, which leads to crash
on not-nice uncaught exception crash.

+ remove try/catch from parse_port (no longer needed due the above)
2023-02-28 16:17:36 +01:00
Martin Pulec
0f12915298 main.cpp: unnecessary TTL check
the RTP library does the check as well
2023-02-27 10:40:17 +01:00
Martin Pulec
98805677eb --conv-policy help - improvements 2023-02-23 09:06:49 +01:00
Martin Pulec
fa062a3fee port parsing: be more user friendly
- catch stoi invalid_argument exceptions for non-numeric input
- on 'help' redirect user to UG main --fullhelp
2023-02-17 11:09:29 +01:00
Martin Pulec
24b8b8c186 main: short opt 'F' for capture filter 2023-02-17 11:09:28 +01:00
Martin Pulec
927842cf43 added pixfmt conversion policy opt
+ changed the default policy to keep bit-depth over color-space

pixfmt_conv_pref is defined in video_codec.c, otherwise tools/convert
won't compile.
2023-02-14 09:49:48 +01:00
Martin Pulec
cac1d11190 updated copyrights of files changed in 2023 2023-02-09 09:19:50 +01:00
Martin Pulec
e531f8f682 run keyboard control and control socket later
It is perhaps unnecessary to run this early now. Also it won't
spoil the output of '-c libavcodec:help' with unrelated message that
control socket was started.
2023-02-01 12:15:50 +01:00
Martin Piatka
cd6e2dbbf3 capabilities: Added "noprobe" option 2023-01-30 12:41:12 +01:00
Martin Piatka
9d5bee7255 main/capabilities: Remove no longer valid comment 2023-01-23 14:18:06 +01:00
Martin Piatka
6b08932038 capabilities: Remove old unused preset reporting 2023-01-13 13:12:22 +01:00
Martin Piatka
c6f9c44b5c fps indicator color fix
Fixes 5433765b4
2022-12-14 13:27:35 +01:00
Martin Pulec
19aaeeb3c8 fixed a crash of vidcaps with own FPS indicator 2022-12-06 15:00:55 +01:00
Martin Pulec
f93776e7be main: help: hide also some other options
Hidden port, cuda-device and rate limiter in basic view. Those are not
more important than many of already hidden.

- cuda device - slightly changed description 's/CUDA device/GPU' - it
  actually selects a card also for NVENC, in the end
2022-11-30 12:27:16 +01:00
Martin Piatka
2f0b933fce help: print echo-cancellation only in fullhelp 2022-11-29 12:53:24 +01:00
Martin Piatka
49be3e7619 fullhelp: add audio-filter help 2022-11-29 12:53:24 +01:00
Martin Pulec
5433765b41 display FPS indicator bg color fix
Since display FPS indicator has set background color, using something
like "[Decklink display] " caused also the trailing space background to
be colored, which doesn't look nice.
2022-11-14 15:39:39 +01:00
Martin Pulec
91691bcfd5 vidcap: renamed vidcap_generic_fps
used better descriptive name
2022-11-14 14:55:51 +01:00
Martin Piatka
344ddd5117 string_view_utils: Add sv_contains() 2022-11-10 12:04:41 +01:00
Martin Pulec
8ed0755f5f solve the same thing as prev commit
But keeping tx_ports (A/V) 0 if not sending to allow RTCP RR to be send
back.
2022-11-08 14:58:07 +01:00
Martin Pulec
4cf4989cc6 Revert "main.cpp: even if not sending use non-zero ports"
This reverts commit c25a362c70.
2022-11-08 14:58:05 +01:00
Martin Pulec
168f282536 main: do not show help on '-d gl:help'
Processing arguments actually "wipes" help from argv (optarg is split by
'\0' to a driver name and its arguments). Thus evaluate help before option
parsing.
2022-10-24 15:06:53 +02:00
Martin Piatka
95b9157134 holepunch: simplify config parsing
Now it doesn't modify argv
2022-10-19 14:55:40 +02:00
Martin Piatka
9f3b891309 holepunch: pass addresses as buffers in config 2022-10-19 14:06:26 +02:00
Martin Pulec
1e50d51e11 replaced unqualified move with std::move
to avoid this clang warning: https://reviews.llvm.org/D119670
2022-10-18 09:21:50 +02:00
Martin Pulec
5dda4c3778 host: documented --capabilities vidcap 2022-10-18 08:24:17 +02:00
Martin Pulec
7d47e27a02 main.cpp: print UG summary first again
This partially reverts b1537dd7c by checking whether help should or
should not be shown.
2022-10-18 08:23:20 +02:00
Martin Pulec
5be4e17880 main: start audio later
moved audio initialization after printing summary and printing
capabilities:
- messages from audio don't interleaved with the UG summary
- when printing capabilities, it is not needed to start audio (which
  would do nothing)
2022-10-18 08:23:19 +02:00
Martin Pulec
762216f579 split setting audio capture format from parsing
Since it was seting global variables, the advantage is also that
set_audio_capture_format is now simplier.
2022-10-18 08:23:19 +02:00
Martin Pulec
b07ce59da7 don't return failure on '--audio-capture-format help' 2022-10-18 08:23:19 +02:00
Martin Pulec
aeadbe0b62 main parse options: return 0 on success
follow common pattern: 0 - success; >1 also success (but something
different); -1 error (here (-error) that should be returned from main)
2022-10-18 08:23:19 +02:00
Martin Pulec
d254b22b1b main: parsing options simplified
moved some huge branches to function
2022-10-12 13:11:27 +02:00
Martin Pulec
e6f7af5b1b main: option parsing - simplify '-c'
Do not handle help, already handled in module and UG summary is no
longer displayed prior to it (see 9e39ce04).
2022-10-12 13:11:27 +02:00
Martin Pulec
b1537dd7c0 main.cpp: print configuration summary later
This allows showing modules help without the summary being needlessly shown.
2022-10-12 13:11:27 +02:00
Martin Pulec
0ccfba3f39 turn some initialization messages to debug
Those messages have nearly no information value (RTP session ID) or are
redundant (display/vidcap name; perhaps only to notice initialization
success). May be perhaps removed in future.
2022-10-12 13:11:26 +02:00
Martin Pulec
cd60f1828c audio: improved init prototype
- return int to signalize if error or help was displayed
- rename audio_cfg_init to audio_init
2022-10-11 15:04:45 +02:00