Improved/fixed AV pixfmt comparison algorighm (get_available_pix_fmts).
If UV->UV->AV is involved, the lower bound of properties (bitrate,
subsampling) is used for the comparison. This would prevent eg.
conversion chain v210->UYVY->10b to be incorrectly treated as 10 bit
(because there is 8 bit format in the chain).
removed .id member from struct pixfmt_desc and the comparator
compare_pixfmt is not usually used directly as a comparator itself but
called from within another comparator. If 2 pixels format have the same
properties, the caller should rather decide by itself if there is some
other metrics to conside or just compare according to identity in the
end.
Set params at the end of configure, otherwise subsequent
libavcodec_compress_tile() calls would think that encoder is configured,
which is not true, and it would probably crash.
- renamed in_frame - now it is actually out_frame from our perspective
- same_linesizes - exit early + doxy documentation
- other docuementation improvements
changed prototype of some functions:
- to_lavc_vid_conv - accept (char *) instead of (struct video_frame)
- get_av_pixfmt_details - (enum AVPixelFormat) instead of int
+ make to_lavc_vid_conv.c partially C++ compatible (I attempted first to
include it as was it libavcodec.cpp), so leave it (just in case)
Handle conversion to codec supported input pixel format entirely in
to_lavc_vid_conv.
+ removed AVPixelFormats (both codec input and sws input) from struct
(no longer needed)
+ cleanup - set sws pointer to NULL (prevent potential double free)
- free frame parts with av_frame_free
- remove very old compat guard (LIBAVCODEC_VERSION_MAJOR < 53)
- increment AVFrame::pts for the final AVFrame
(state_video_compress_libav::in_in frame may not be passed to enc)
YUV is always limited rante BT.709, RGB full range. Thus it doesn't need
to be in the conversion table for every one pixfmt. Also UG pixfmt was
actually useless in the prototype.
There doesn't seem to be any significant advantage of using the
readerwriterqueue so replace it with a generic UG one.
If needed, this change can be easily reverted (the API is similar).
Used msys/curl instead of clang64/mingw-w64-clang-x86_64-curl for the
upload.
For whatever reason, the other curl variant ceased to collaborate with
GitHub, see failed run (and subsequent ones):
https://github.com/CESNET/UltraGrid/actions/runs/4223917061/jobs/7334218587
I didn't manage to reproduce it on a local Windows machine so there is
perhaps some hidden factor present.
This change is just a workaround and should be removed when not needed.
* moved complex condition to macro - although it is inherently simple
(just checking constraints if given, it is quite long, which hurts
readibility)
* function prototype - signalize that expecting array of AV_PIX_FMT_NB
members (better would be 'static AV_PIX_FMT_NB', but it's C only)
* improve comments
- accept bg/fg options without need to alter (default) text
- print error on wrong option
- use #CC00CC (pink) - although looking less decent, the subsampling
artifacts should be more observalble with this color