Previously, if eg. multiple worker crashed, backtraces were interleaved
- use temporary file to print it. It seems that the new implementation
prints backtrace just from one thread, which shouldn't matter, anyways,
because it is improbable that there are two different crashes at the
same time.
\+ document
\+ remove inclusion of config*.h (in worker.h as well; fixed a guard
macro there as well)
\+ ptrdiff_t for iteration to compute in wider type (clang-tidy
bugprone-implicit-widening-of-multiplication-result)
Actually no error is handled except of wrong usage (passing NULL in/out
pointers). As the functions are used just from one place, the caller
should take responsibility that this won't happen.
\+ added some direct pixfmt_conv.h includes (in attempt to remove its
inclusion from video_codec.h, which finally didn't take place but still
it is better to include this directly)
- report if no signal was detected (perhaps no server)
- rate limit to 100 ms because the ReceiveImage() returns immediately
false, effectively busy waiting
Spout module init is very silent and when it succeeds but there is no
Spout server, it prints nothing while waiting for signal, which may be
confusing if it is really working. So print at least that init succeeded
and waiting for signal.
Since HW_VDPAU is unconditionally in codec_t, we may ask for metadata
eg. when iterating over all codecs to get pixfmts only. HW_VDPAU doesn't
match but not having metadata defined causes that is_codec_opaque()
returns false, so it is included.
Do not crash with out_of_range exception if trying to output empty log
(`LOG(LOG_LEVEL_INFO) << "";`) - either intentionally or by mistake.
Check if output has really size >0 before comparing last char with '\n'.
Rewritten a bit, but only functional change is the above. Eg. it was
slightly counterintuitive comparing msg[msg.size() - sizeof TERM_RESET]
to '\n'. This actually caused the crash on empty string, even though
TERM_RESET was appended. It is because `sizeof TERM_RESET` counts
'\0', which is not counted in C++ string. Semantically better would
have been `strlen(TERM_RESET) - 1`, from which is obvious it will fail
if output string was originally empty.
Since the libraries should be bundled, treat the dlopen errors rather
as errors and issue warning. This also occurs eg. on bare debootstraped
Ubuntu system, where basic libraries like libasound2, libdrm and libgl1
are missing but are among those excluded from AppImages.
Splitting the error to
```
[DeckLink display] Unable to switch audio output for channels 3 or above although
card shall support it: Not implemented (0x80000001)
Check if it is ok. Continuing anyway.
```
actually doesn't help readibility.
If not, it may later fail (see GH-354) in
display_decklink_reconfigure_audio() depending what the actual value is
and what will be negotiated, it would certainly fail for < 2.
refers to GH-354
It seems that if the query fails, it sets some undefined or invalid
value to the output variable.
\+ print actual used maximal value in verbose mode
\+ print also error message
print the connection directly from the display flag and then we can return
if audio is required to be embedded (no need to set AESEBU/analog switch).
\+ use more defensive msg about audio output (we actually may not set anything)
If cannot switch to AESEBU/analog, warn at least in verbose mode
(shouldn't be an issue in most cases, since this is usually needed only
for more than 2 channels).
If the buffer is full, flush the output even if there is no NL at the
end and issue a warning (should be handled - either some error or some
module produces unexpectedly long output).
do not prefix messages not starting on new line by timestamps, eg.:
$ uv -s embedded -t testcard -d file:n=/dev/null -V
[1698853041.393] [lavc] Stream #0:0[1698853041.393] : Video: rawvideo, 1 reference frame (UYVY / 0x59565955), uyvy422, 1920x1080 (0x0), q=2-31, 829440 kb/s[1698853041.393] , [1698853041.393] 25 tbn[1698853041.393]
Flush the output only on NL and before it store it in internal
thread-local buffer.
Locking was removed as static data are now thread-local.
this improves 808b3de3
not necessary, but better; also makes UG behavior deterministic, eg.:
uv -s embedded -t testcard -d file:n=/dev/null [-c libavcodec] -V
produce different output for file depending if libavcodec is on or off
(AV messages prefixed by UG logger).
Set metadata to out_frame only and copy it to tmp_frame (not to repeat
every assignment and potentially forgotting something).
\+ check tmp_frame afor allocation failure