ported changes from GPUJPEG, mostly cosmetic
For Win32 implementation, winsock2 is not used at all - Windows stdlib.h
contains _byteswap_* family so it is better to use these and not pull
the whole winsock2.h header struff (and also the winsock library but this
is irrelevannt for UG because we need to link with it unconditionally).
do not tackle with references - needlessly making this more complex
With returning the variable, no static variables needed, just the
references need to be explicitly const (which were previously as well,
although implicitly).
Mark the returned variables as constexpr. Having inline function that
returns reference (although const) to non-const static variable perhaps
disallow inlining. Some caller maight have issued const_cast<> to a
non-const reference and modify the value which may be allowed (the)
static value is non-const.
Setting the vars to non-const should solve the problem. Using constexpr
is just nicer (requires avoiding std::string). Returning the value
directy instead of reference should be OK as well.
Y416 was called UYVA16_422(_conv) which is incorrect, since the codec
subsampling is 4:4:4:4 (444 with alpha).
VUYA8 - added 4444 for the consistency (all YCbCr formats contain
subsampling).
The fix commit 8c19440a (2025-10-01) locked in flush_capture_data(),
which was ok when called from rewind_file(). But that function is
called also from vidcap_file_process_message() which is called with
mutex already held (CID 896223).
So moving the lock from flush_captured_data() up to rewind_file().
Also CID 896221 is fixed - subsequent s->new_msg was called seemingly
without lock (double lock + 1x unlock considered unlocked). Now in this
context one pair lock/unlock was removed which means that the lock is
still held.
fixes CID 896221, CID 896223, commit 8c19440a
The metadata array was actually positionally indexed, which was error prone.
Use rather switch - the advantage is that also a warning is issued if
some enum member not handled and also solves the above.
- s/Captured/Transmitted/ video format (has compressed codec)
- print the input codec in brackets
- do not parse the format from istringstream and print directly
moved from RTP - allows processing for all video_rxtx now
Note that (as just like previously), on the console if 'i' is pressed, the
compressed format is print, not Captured (as indicated by the message).