GETCH - return always -1 on error, not -1 when read returned 0 and -2
if -1 - the actual value doesn't seem to be checked by any of caller.
CID 472180 should be perhaps fixed
- fixed a leak of s->devices (CID 472157)
- fix partial display_done (when eg. second device from 2 fail to init,
do not call the vidcap_done on this - assumes non-NULL)
- remove s!=NULL after assertion on that
This makes sure that pipewire always gets a steady stream of samples,
even when we're not receiving anything. This prevents the error count in
pw-top skyrocketing when the sender stops sending.
Even if no devices were found, print the help and empty list of
devices. Without that, it would be missleading because the help shows
nothing.
Print the empty list ("Available deviviecs:" with nothing) also for
acap/jack to make clear that there are actually no devices.
improves 8597f39b
see the previous commit
This changes the manual handling introduced by the commit 925db63e. Also
$FEATURES are not passed explicitly as added in the commit 9eb29225.
Fix leaked frame when decode failed - this is a dumb regression introduced
with the commit b52bf7b9 (2024-09-23) by inverting the condition.
also CID 152946
Frame type (I/P/B) is already printed in debug so add also frame flags
which may be useful (eg. for the recent x265 intra-refresh decode
fix 6d2ab24b - flag indicates corrupted frame all the time, which
may or may not be an incorrect behavior from hevc decoder; but doesn't
matter for us, anyways).
Also use MSG(), which also has a advantage that if log_level not met,
it is not evaluated.
linux/videodev2.h is part of kernel headers and is usually present
But if it isn't, do not compile the stuff - there are defined the macros
that are required to compile.
The aggregate packets with less than 2 aggregation units are prohibited
by the RFC 6184/7798 and since we must receive the whole UDP packets,
this should not happen (unless UDPlite would be used). But we could
perhaps expect broken encoder (this is std transmission).
Retestd with MJPEG, VP9, AV1 and HEVC and except the first one all
(AV1 is indecisive) seem to produce better results. Tested with:
```
tc qdisc replace dev lo root netem loss 0.1%
uv -t testcard:patt=text:s=1280x720 -c lavc:c=CODEC -d gl
```
and with `--param lavd-accept-corrupted[=no]`
Namely HEVC seem to produce significantly better results (often avoiding
the intra refresh wave).
This may be revided later (HW decoders, disabled intra refresh with
H.265 and so).