Commit Graph

7357 Commits

Author SHA1 Message Date
Martin Pulec
11fe526619 from_lavc_vid_conv.c: memcpy_data can be unused 2023-02-21 10:28:04 +01:00
Martin Pulec
edf00eca5f lavd: removed no longer needed code 2023-02-21 10:28:04 +01:00
Martin Pulec
f943807b66 lavd: also check if we are not degrading
Similarly to lavc, print warning if we are degrading format somewhere in
chain.
2023-02-21 10:28:04 +01:00
Martin Pulec
e720acba5e lavc: print a warning if there is quality degradation 2023-02-21 10:28:04 +01:00
Martin Pulec
e9d91e778f to_lavc_vid_comp: improved av pixfmt comparison
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).
2023-02-21 10:28:04 +01:00
Martin Pulec
014279af62 pixfmt_desc + compare_pixdesc: removed identity
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.
2023-02-21 10:28:04 +01:00
Martin Pulec
c0142b88a5 lavc: if configure fails, don't set params
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.
2023-02-21 10:28:04 +01:00
Martin Pulec
f7a070f899 to_lavc_vid_conv: small improvements
- renamed in_frame - now it is actually out_frame from our perspective
- same_linesizes - exit early + doxy documentation
- other docuementation improvements
2023-02-21 10:28:04 +01:00
Martin Pulec
c4c3ffd5dc lavc: fixed test
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)
2023-02-21 10:28:04 +01:00
Martin Pulec
bd994f4bfd lavc: encapsulate input conversion
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)
2023-02-21 10:28:04 +01:00
Martin Pulec
a8425dbed6 lavc: do not juggle with AVPixelFormat
selected pixfmt can be written directly to
state_video_compress_libav::selected_format
2023-02-21 10:28:03 +01:00
Martin Pulec
494076ca0d lavc: small updates
- 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)
2023-02-21 10:28:03 +01:00
Martin Pulec
67e6326434 simplify get_av_pixfmt_details
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.
2023-02-21 10:28:03 +01:00
Martin Pulec
63f716c7ef lavc: alloc dummy frame once
alloc the one frame that is only envelope for input buffer only once
2023-02-21 10:28:03 +01:00
Martin Pulec
710c667f88 to_lavc_vid_conv.c: removed no longer used func 2023-02-21 10:27:47 +01:00
Martin Pulec
1b0a28cd09 lavc: refactor
- moved conversion related functions to to_lavd_vid_conv.c
- removed struct uv_to_av_conversion from to_lavd_vid_conv API
2023-02-21 10:07:04 +01:00
Martin Pulec
a3a872bc33 screen_linux: print compiled modules 2023-02-21 10:06:53 +01:00
Martin Pulec
5339ef2d93 RTP: attempt also other ports on error
We want perhaps attempt another ports even though there is another error
from udp_port_pair_is_free() than the port is taken. This error is on
hand unpredicted but by no means fatal.

Fixes:

    https://github.com/CESNET/UltraGrid/actions/runs/4225115209/jobs/7336964502
2023-02-21 09:53:16 +01:00
Martin Pulec
702220f650 udp_port_pair_is_free: print port number
+ use the even port for getaddrinfo
2023-02-21 09:53:14 +01:00
Martin Pulec
27dc4c6a92 macOS warning fixes 2023-02-21 09:52:58 +01:00
Martin Pulec
da3a55f3df screen_pw: remove rang.hpp dependency 2023-02-21 08:59:44 +01:00
Martin Pulec
d7ae5c41f1 screen_pw: fixed hang when declined record
Fixed hanging on thread::join if user disallows screen recording (wrong
command order).
2023-02-21 08:59:44 +01:00
Martin Pulec
f2566fabce added screen_linux abstraction
User can still select `-t screen` and screen capture will be intialized
according to environment variables (if both pipewire and X11 is
present).
2023-02-21 08:59:41 +01:00
Martin Pulec
dd60dd2540 screen_pw: replaced moodycamel with synchronized_queue
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).
2023-02-21 08:55:48 +01:00
Martin Pulec
350489d8e1 CI: require screen capture module
but require only X11 capture in Linux for now (Ubuntu 18.04 is difficult
to compile required PipeWire version).
2023-02-21 08:55:48 +01:00
Martin Pulec
ca0b1c32f4 configure: fixed gio pkg-config name 2023-02-21 08:55:48 +01:00
Martin Pulec
eef7170d01 Linux screen cap. compile fixes
+ mark the original X11 as such (alongside with PipeWire)
2023-02-21 08:55:48 +01:00
Martin Pulec
183cb3298a Merge branch 'screen_pw_rebased' of https://github.com/MatejHrica/UltraGrid.git 2023-02-21 08:53:52 +01:00
Martin Pulec
4e43d566fd CI: fix Windows build upload workaround
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.
2023-02-20 16:58:00 +01:00
Martin Pulec
240f512b7e from_lavc_vid_conv: removed unneeded memsets
The relevant members are already empty-initialized by the caller.

For some reason, this fixes the test crash:

     https://github.com/CESNET/UltraGrid/actions/runs/4220022764/jobs/7325933580
2023-02-20 14:34:23 +01:00
Martin Piatka
d991cfceaa CI: Fix libde265dec patch
AV_CODEC_CAP_AUTO_THREADS was removed in ffmpeg commit 10c9a08
It was replaced by AV_CODEC_CAP_OTHER_THREADS (same macro value)
2023-02-20 13:17:20 +01:00
Martin Piatka
c54313f6e5 file vidcap: print error insted of crashing on unavailable conversion
see GH-296
2023-02-20 12:26:00 +01:00
Martin Piatka
adf0c30ae2 file vidcap: Fix inverted condition
We don't want to use swscale if we have a valid conversion. Fixes GH-296
2023-02-20 12:21:53 +01:00
Martin Piatka
803d2c45a9 swmix: Fix possible leak 2023-02-20 10:39:49 +01:00
Martin Pulec
498605df74 macOS: replace altool with notarytool 2023-02-17 19:03:56 +01:00
Martin Pulec
e079acbeb4 CI macOS: add readline to PKG_CONFIG_PATH
brew port readline is no longer liked to system path by default.

Fixes failed build:

    https://github.com/MartinPulec/UltraGrid/actions/runs/4202715324/jobs/7291225396
2023-02-17 14:36:44 +01:00
Martin Pulec
bebdbadbf8 lavc QSV: set async_depth = 1
this setting has positive impact on latency

refer to GH-294
2023-02-17 14:36:44 +01:00
Martin Pulec
bf3a70b73e build sys: del srcdir_abs (realpath/python missing)
No longer used and on macOS there is now neither realpath nor python so
error printed.
2023-02-17 12:18:57 +01:00
Martin Pulec
fa062a3fee port parsing: be more user friendly
- catch stoi invalid_argument exceptions for non-numeric input
- on 'help' redirect user to UG main --fullhelp
2023-02-17 11:09:29 +01:00
Martin Pulec
24b8b8c186 main: short opt 'F' for capture filter 2023-02-17 11:09:28 +01:00
Martin Pulec
738efa12b9 added vc_copylineRGBAtoR12L
modified vc_copylineRGBtoR12L to work for both RGB and RGBA

+ data fetching as a macro
2023-02-17 11:09:27 +01:00
Martin Pulec
a843dd36c6 aggregate vicdap: fixed a leak 2023-02-14 10:51:48 +01:00
Martin Pulec
6fe06421d3 get_intermediate_codecs_from_uv_to_av: common comp
Use common sorting routine for get_intermediate_codecs_from_uv_to_av.
2023-02-14 09:49:50 +01:00
Martin Pulec
927842cf43 added pixfmt conversion policy opt
+ changed the default policy to keep bit-depth over color-space

pixfmt_conv_pref is defined in video_codec.c, otherwise tools/convert
won't compile.
2023-02-14 09:49:48 +01:00
Martin Pulec
93997ea810 get_available_pix_fmts: small refactor
* 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
2023-02-10 16:09:34 +01:00
Martin Pulec
8aae9caa2b lavc: rewritten sorting
use generic compare_pixdesc()

+ rewritten to C (get_available_pix_fmts() will eventually be moved to
  to_lavc_vid_conv.c)
2023-02-10 15:38:49 +01:00
Martin Pulec
0aaf9fff99 qsort_s compat: relax requirement to include first
If includer defines __STDC_WANT_LIB_EXT1__ to 1, it is no longer needed
to include this header first.
2023-02-10 15:13:17 +01:00
Martin Pulec
d9d7889598 lavc qsv: set nint_ref_cycle_size + scenario 2023-02-10 13:53:48 +01:00
Martin Pulec
86ae693117 text textcard pattern: updates
- 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
2023-02-10 11:52:40 +01:00
Martin Pulec
8e80a60889 lavc vid: only pixfmt is relevant for conv selection
Do not pass whole video_desc structure because other members don't
matter.
2023-02-10 11:22:15 +01:00