Commit Graph

5901 Commits

Author SHA1 Message Date
Martin Pulec
2c8dd6743e transmit: moved stat reporting after send loop
it simplifies the code and facilites eventual refactor
2023-09-20 09:24:47 +02:00
Martin Pulec
b5250a5a8e removed rang.hpp 2023-09-19 16:33:30 +02:00
Martin Pulec
a4fc9bd139 AJA: removed rang.hpp usage 2023-09-19 16:33:28 +02:00
Martin Pulec
4734c9e983 removed few next rang.hpp uses 2023-09-19 13:47:11 +02:00
Martin Pulec
afd0f217de signal_handler: ignore next SIGPIPE signals
We will end anyways and do not produce additional SIGPIPE on eventual output.
2023-09-19 13:34:11 +02:00
Martin Pulec
b28feb62fe vidcap testcard: options parse improvement
* renamed 's=' option to 'strip=' (it is currently defunct, anyways)
* parse 'strip=' after 'size=', effectivelly allowing '-t testcard:s=VGA'
('s=' shortcutting size, not strip)
2023-09-19 11:53:49 +02:00
Martin Pulec
c4fbc0900f vidcap testcard: busy-wait in _grab
Fixes potential problems (not always reproducible) when running:

    uv -sembedded -tswitcher:fallback -ttestcard -ttestcard:m=VGA -c lavc

Because the fallback mode calculates expected frame time - there is a race
condition when testcard's grab doesn't yet returns a frame but subsequent
check in switcher determines that the frame time already passed.
2023-09-19 11:14:28 +02:00
Martin Pulec
a2ec0374c1 lavc audio: unref av_frame in cleanup
fixes GH-338
2023-09-19 11:14:28 +02:00
Martin Pulec
ebca9c7daf lavc audio: early return + reformat 2023-09-19 11:14:28 +02:00
Martin Pulec
d04b1def74 debug.h: added shortcut macro
to save needed characters typed, instead of

`log_msg(LOG_LEVEL_ERROR, MOD_NAME "This is an error!");`

type just

`MSG(ERROR, "This is an error!")`
2023-09-19 11:14:26 +02:00
Martin Pulec
e006cb411f switcher: print when fallback device used 2023-09-18 15:37:01 +02:00
Martin Pulec
996d8762c4 vidcap testcard: option to restrict number of cap vframes 2023-09-18 15:37:01 +02:00
Martin Pulec
bcad73d983 vidcap testcard audio: support for arbitrary BPS 2023-09-18 15:37:01 +02:00
Martin Pulec
241840480d audio utils: get rid of rare functions 2023-09-18 15:36:57 +02:00
Martin Pulec
586c3fc585 audio: simplified samples storing/loading 2023-09-18 14:27:42 +02:00
Martin Pulec
c1a30ddaa5 vidcap testcard audio: print warn on unsupp conf
Issue a warning if unsupported audio parameters were requested.
2023-09-18 12:39:42 +02:00
Martin Pulec
7ff196e6ae vidcap testcard audio: support for >1 channels 2023-09-18 12:39:42 +02:00
Martin Pulec
bdcb25875c switcher: pretty-print 2023-09-18 12:39:42 +02:00
Martin Pulec
f534c30730 vidcap file: print audio format 2023-09-18 12:39:41 +02:00
Martin Pulec
d492a9a4e3 some include optimization 2023-09-18 07:54:10 +02:00
Martin Pulec
77bc6d5fd1 lavc: allow cmdline shortcuts
* optionally allow 'lavc' instead of 'libavcodec'
* allow shortcuts of frequent options, eg. `-c lavc:c=H.264`
2023-09-18 07:49:15 +02:00
Martin Pulec
a2d3eb8c2b fixed swittcher when :excl_init is used
\+ fixed device names not being stored except first device with excl_init

see also commit a24e194d fixing the issue without that option

refers to GH-336
2023-09-15 15:58:27 +02:00
Martin Pulec
84ba09f4f7 lavc: wrap codec lines 2023-09-15 15:36:43 +02:00
Martin Pulec
2f995895c8 rename indent_paragraph to wrap_paragraph
More suitable name - the function doesn't indent but just wraps long
lines.
2023-09-15 15:36:41 +02:00
Martin Piatka
cdbb15baa8 holepunch: Don't bind any particular address 2023-09-15 12:51:41 +02:00
Martin Piatka
939d1feaa4 holepunch: Send disconnect message 2023-09-14 13:56:49 +02:00
Martin Pulec
e3026d3573 display file: better resource handling
- use just one AVPacket
- free audio encoder context

\+ NOLINT(clang-analyzer-core.NullDereference) - this cannot happen -
either audio is enabled and then tmp_frm cannot be NULL here or this
branch wouldn't be entered (display_file_put_audio_frame() is never called)
2023-09-11 14:53:02 +02:00
Martin Pulec
7495a0f857 display file: added max_av_diff option
allows user to fiddle max allowed A/V desync interval before frame drop/dup

\+ moved parsing to a separate function
\+ destroy pthread-related things only if thread started (initialized)
2023-09-11 14:43:12 +02:00
Martin Pulec
c44d4bd78d file: old channel_layout API format
added compatibility with older FFmpeg libraries

see also
<7544fcb525 (r126660408)>
2023-09-11 10:54:45 +02:00
Martin Pulec
d621284222 interleaved2noninterleaved_float: handle BPS 1
handle 1 byte case, which is unsigned and thus mus be handled separately

\+ divide the other cases with -INT32_MIN instead of INT32_MAX, to avoid
value < -1.0 if the sample value is INT32_MIN (but as the computation is
done in floats, both values will likely to be rounded to the same number)
2023-09-08 16:15:05 +02:00
Martin Pulec
bd5de92a71 display file: prefer s16[p] over fltp
We advertise support for 16-bit audio only (DISPLAY_PROPERTY_AUDIO_FORMAT),
so it is better to use it directly without short->float conversion if possible.
2023-09-08 15:25:35 +02:00
Martin Pulec
5d71448f08 display file: few improvements
- if init fails, call exit_uv() rather than trying to reconfigure
- print error instead of assert if encoder is not found (eg. Theora for OGG)
2023-09-08 15:25:35 +02:00
Martin Pulec
ab0585e1de vidcap file: accept name= prefixing file name
Currently, the first parameter is taken positionally, which is not
consistent with file display (and key/val parameters are preferred over
positional ones) so accept also "name=" for file name.
2023-09-08 15:25:35 +02:00
Martin Pulec
405751d401 display file: rename name option
Although "file=" is common option name (eg. for testcard), advise rather
"name", because "-d file:file=<name>" looks a bit weird (but accept both).
2023-09-08 15:25:34 +02:00
Martin Pulec
356be2d0e5 audio: small improvements 2023-09-08 15:25:25 +02:00
Martin Pulec
c28a0d2710 audio: mixer segfault fix
Broken since 2021-05-25 (commit 1d47a5f0), which put the initialization
of rtp socket after passing to the mixer.
2023-09-08 08:45:32 +02:00
Martin Pulec
89362ccf38 display file: use av_channel_layout_default
Pick channel layout for compressed codecs by av_channel_layout_default()
call (returns mono for 1, stereo for 2 and so on).
2023-09-07 16:09:02 +02:00
Martin Pulec
3bbac6451d display file: use native audio compression
Use audio compression default to output container file.
2023-09-07 16:09:02 +02:00
Martin Pulec
fa60441fde display file: make other audio compress working
Make working compressions other than Opus, taking sample format other
than S16 (interleaved).

Accept also S16P and FLTP (needed for AAC, MP3, Vorbis).

\+ also process stereo input (as currently only mono are accepted)
2023-09-07 16:07:44 +02:00
Martin Pulec
1478f684e8 display file: moved video config to own function 2023-09-07 16:05:06 +02:00
Martin Pulec
2cbb03006a display file: defaults for VP9
make it as fast as possible (similarly to ultrafast preset for H.264/5)
2023-09-07 16:05:06 +02:00
Martin Pulec
51c57d1fc6 display file: compress exactly frame_sized frm
If codec doesn't specify AV_CODEC_CAP_VARIABLE_FRAME_SIZE, all frames
(except the last one) passed should equal exactly the codec-specified
frame_size. That flag doesn't specify almost none compression, except PCM.
2023-09-07 13:29:43 +02:00
Martin Pulec
9449c6614f display file: enable global header flag
otherwise Matroska with default video codec won't work
2023-09-07 09:02:46 +02:00
Martin Pulec
e64acc3cea display file: really discard the frame 2023-09-06 14:55:02 +02:00
Martin Pulec
fd3c7afe8f removed short_int2float
- not used
- in documentation there was incorrectly stated that in and out can
overlap; perhaps a C&P from int2float doc because it doesn' seem to be
true - first written float overrides second read short so on
2023-09-06 14:39:49 +02:00
Martin Pulec
4732fb7724 display file: accept v210, R10k and R12L for NUT
convert the above pixel formats to respective FFmpeg pixfmts
2023-09-06 14:39:49 +02:00
Martin Pulec
65883eaab0 display file: fixed supp. codecs for NUT probe
AV_PIX_FMT_NONE is -1, so that all UG codecs were incorrectly added.
2023-09-06 14:39:49 +02:00
Martin Pulec
894be23494 display file: keep A/V sync
Keeping A/V sync may be important - not only because A/V clock drift
but also due to dropped frames, that would cause A/V desync.

+ renamed cur_pts to next_pts (consistent with mux.c)
2023-09-06 14:39:49 +02:00
Martin Pulec
37fbe2e66b file disp.: use Opus for container other than NUT 2023-09-06 14:39:49 +02:00
Martin Pulec
435c712acf display file: don't write uncompressed by default
Write uncompressed output only if user explicitly specifies NUT container
to avoid unexpected results when `-d file` is writing overwhelming amount
of data.
2023-09-06 14:39:40 +02:00