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
Some encoders use `colorspace` and `color_range` from AVFrame,
eg. _hevc_videotoolbox_:
uv -t testcard -c libavcodec:encoder=hevc_videotoolbox
(defaults to bgra, because other foramts don't keep 4:2:2 subsampling,
supported at the time: videotoolbox_vld nv12 yuv420p bgra p010le).
Fixed error was producing this message:
````
[lavc hevc_videotoolbox @ 0x12fc04190] Could not get pixel format for color format 'bgra' range 'unknown'.
[lavc hevc_videotoolbox @ 0x12fc04190] Error: Cannot convert format 28 color_range 0: -22
```
1. really check non-negativity - until now, the parsed string was
dirrectly assigned to ushort, effectively disabling the check ((short)-1
== 65535)
2. check also upper bound to be less than USHRT_MAX
3. **allow** 0 as a port - supposedly this is a relict when atoi() was
used to parse the port, so that it was supposed to be error in
conversion. There may be, however, legitimate reasons to use 0 as a port
to bind random port (although UG doesn't print it so the user would need
to obtain its value eg. with iproute2 if required). Just print a warn.
Process exceptions as with:
hd-rum-transcode 5004 -P 6004 localhost
where buffer size is omitted - `-P` is parsed as buffer number producing
invalid argument exeption.
Converted the expected invalid_argument exceptions to ug_runtime_error
that is catched in main().
Until now, if called without argument, help was printed but without the
error message. Since arguments are mandatory and to query help, rather
'-h' should be used, rather print error in this case. This also correspons
with the exit with non-zero return code.
Previously it cleared the preferences and exitted if no options followed
but starts grabbing otherwise, which is inconsistent. If user wants just
clearing preferences, Ctrl-c may be pressed immediately to exit.
- don't print help on incorrect param - the help actually takes almost
exaxtly the size of default Windows Terminal size and the error message
is printed prior to the usage, so it is hard to find/not obvious at
first glance
- renamed functions modifying window register to contain it in name
Since all preferences are written to (user) registry, it becomes
persistent. Instead of the hassle of storing/restoring previous value,
we let it for now saved but added this option to remove all prefs.
For uninit, screen-capture-recorder-x86.dll calls CoInitialize(0) and
fails because it fails.
Curiously this doesn't occur for register, which should be equivalent.