Commit Graph

7461 Commits

Author SHA1 Message Date
Martin Pulec
84db4767bb rewritten all remaining tests without cppunit 2023-03-07 15:45:45 +01:00
Martin Pulec
8b61de68d9 adapted test/ff_codec_conversions_test to new API 2023-03-07 15:45:45 +01:00
Martin Pulec
33222ed79b unit tests: begin removing cppunit 2023-03-07 15:45:45 +01:00
Martin Pulec
1680fc858e CI Linux FFmpeg: patch SVT-VP9 patch 2023-03-07 15:45:35 +01:00
Martin Pulec
43d9c936b8 video_codec: removed attribute "slow" for convs
The concept of fast/slow decoders was obsolete and not a supported way -
the preferred way nowadays is to use the generic comparator and
alternatively let user selecting a policy. Also, it was error prone
whether or not mark the conversion as slow or fast. Also the order in
the array was important.

Subsequently replaced get_fastest_decoder_from() with
get_best_decoder_from() calls - in the occurences where it was used,
both calls will likely to end up with the same result, anyways
(candidate set is usually something like RGB,RGBA and UYVY).
2023-03-07 08:28:24 +01:00
Martin Pulec
3ec7d9fd88 comparators: fix descending last-resort sorting
As a last resort sort tie-break, codec_t value was used but the sorting
was actually descending. It is perhaps more natural to have it ascending
(although not so important).
2023-03-07 08:28:24 +01:00
Martin Pulec
b5dc72902e video_codec: best_decoder_cmp - use common comparator 2023-03-07 08:28:24 +01:00
Martin Pulec
f760123146 get_best_decoder_from: removed include_slow param
was always set to true, anyways
2023-03-07 08:28:24 +01:00
Martin Pulec
483e54e8a8 RTP: mem safety imrovement
The handling of source::sr is MT-Unsafe when the library is used from
within 2 threads. Typically when running `uv -t testcard -d dummy` (with
-DDEBUG), check_database() is run from sender thread while process_rtcp_sr
from receiver thread leading to a crash on line 589 using the old
structure data that has been freed and overwritten by some new data.

The above mentioned crash doesn't usually occur since check_database()
is run only if DEBUG is defined. However, in theory it may happen that
both threads accidentaly run process_rtcp_sr() (alhough not observed). In
that case either double-free or a leak could occur if the runs of
process_rtcp_sr() is interleaved in a wrong way. Unfortunately, as the
RTP library is originally mt-unsafe, there can be plenty of similar
undiscovered problems.

(Note: to test the check_database() crash, running in GDB seems to
increase the likelihood that it crashes. This change on the other hand
seems to retuce that, but clearly doesn't eliminate that because the
content of the struct is read while it may be freed by the other thread.)
2023-03-07 08:28:24 +01:00
Martin Pulec
ea85cb4bf4 fixed clang warnings 2023-03-07 08:28:24 +01:00
Martin Pulec
e5d1c39c84 lavd: delay HEVC decoding up to first VPS
Begin decoding of HEVC stream after a frame starting with VPS NALU has
been seen. This improves the behavior in a sense that there is not an
initial flood of decoding errors until first IDR frame is received.

This change is analogous to the one that is already present for H.264
(using SPS NALU).

In case of problems, check if it holds that VPS NAL is always first
(seems to be the case but not sure if it is mandatory; but similarly
this presumption holds for H.264 and there has not be any counterexample
until now).
2023-03-07 08:28:24 +01:00
Martin Pulec
03c7d5043f parse_bitrate: fixed parsing of spec vals
fixes 03f70eade

closes GH-300
2023-03-07 08:27:15 +01:00
Martin Pulec
a43168ee06 lavc: added option to keep original pixel format
refer to GH-295
2023-03-03 16:30:33 +01:00
Martin Pulec
99b89ea9dc lavd: correct type for AV pixfmt
just to be less error-prone and better readable
2023-03-03 15:33:10 +01:00
Martin Pulec
1a15f69879 check_first_h264_sps: do not accept SEI
It looks like with the current version of libx264 (164 r3095) the first
NALU in non-IDR frames is SEI, so it effectively skipped the workaround.

As verified, both libx264, nvenc and QSV (on ALD-P) produce SPS first,
so we can ignore SEI-beginning frames as non-IDR.
2023-03-03 10:49:38 +01:00
Martin Pulec
0a991aa0c5 lavc audio: use logger instead of fprintf 2023-03-02 12:35:35 +01:00
Martin Pulec
88621797cc lavc audio: reduce repeating allocations
Keep allocated temporary buffer for further use instead of repeatingly
reallocating it.
2023-03-02 12:35:35 +01:00
Martin Pulec
fa649b651e lavc audio: suppress a warning
suppress missing-field-initializers warning when assigning
AVChannelLayout to AVCodecContext::ch_layout. This is C++ specific, the
construction is entirely fine in C (empty-initializes remaining
members).

Rewritten to C - it seems to be a bit invasive, because the rewrite is
quite huge. On the other hand, it cleans the code a bit and also
removes some inefficiencies that there have been (now not possible
because the absence of RAII).
2023-03-02 12:35:30 +01:00
Martin Pulec
602d75e9cd from_lavc_vid_conv: fixed inverted operator 2023-03-02 11:13:59 +01:00
Martin Pulec
07550e5834 lavd: set internal_prop from AVCodecContext::pix_fmt
There is no need to store this separately. Also, if the codec doesn't call
get_format callback, no special handling is needed.
2023-03-02 11:08:51 +01:00
Martin Pulec
99d3a98c58 lavd: fixed setting of internal_prop 2023-03-02 10:28:24 +01:00
Martin Pulec
cf00c419fa fixed bitmap_font.h gen comment
perhaps not a big deal but 'printf \xXX' is a non-standard shell extension
2023-03-02 09:41:48 +01:00
Martin Pulec
ed60bf3765 portaudio: grey out unuable devices in listing
Some of devices cannot be used in either input or output (or none)
direction. Those are usually hidden but are shown if in verbose mode.
If so, use different color to highlight that those cannot be used.
2023-03-01 15:44:32 +01:00
Martin Pulec
55cbdb88e9 portaudio: option to select devices by name 2023-03-01 15:44:28 +01:00
Martin Pulec
7079a057e1 portaudio cap/play: refactor a bit
do not assume that given configuration string may be a NULL-pointer

- [cap] rather zero-initialize the struct (doesn't seem to be a problem
  now but it is more convenient to have the value somehow defined)
- [cap] removed some misleading comment (probably even from the times
  when PortAudio was not modularized and was part of audio conglomerate
  module)
2023-03-01 13:30:40 +01:00
Martin Pulec
f29aed670c portaudio cap.: use default ch_count if undef
Maximal number of channels was chosen instead of
DEFAULT_AUDIO_CAPTURE_CHANNELS. This was noticable especially for
Pulseaudio plugin, which has 64 channels.

fixes commit 89747981
2023-03-01 12:19:02 +01:00
Martin Pulec
0264c02db7 portaudio cap.: use logger 2023-03-01 11:36:57 +01:00
Martin Pulec
83da4925b7 portaudio play.: use logger 2023-03-01 11:17:27 +01:00
Martin Pulec
012b5d0b62 portaudio cap/play: improved default device printout
- use LOG_LEVEL_NOTICE - when using default device, this information may
  be quite important
- fixed spacing (missing spaces because it was a bit tricky when printed
  in multiple steps)
2023-03-01 10:52:19 +01:00
Martin Pulec
acc99f1b1d portaudio cap/play: fixed default device selection
Passed configuration string is empty ("") if no configuration given by
user. Which evaluates incorrectly as 0 if parsed with atoi.
2023-03-01 10:20:03 +01:00
Martin Pulec
51cd87a62d audio/playback/portaudio: use time_ns_t instead chrono
+ use MOD_NAME instead of MODULE_NAME for convenience
2023-03-01 10:07:02 +01:00
Martin Pulec
26a532d7a3 portaudio_common: removed rang.hpp dependency
+ use MOD_NAME instead of MODULE_NAME for convenience
2023-03-01 10:06:17 +01:00
Martin Pulec
20870005bb regenerated manpages 2023-03-01 09:14:07 +01:00
Martin Pulec
59576a6c4e data/make_man.sh: fixed wrong var name in help
used path is actually $UV_PATH not $UG_PATH
2023-03-01 09:13:02 +01:00
Martin Pulec
8dfec2f9ac README.md: replaced PNG with SVG logo
This is actually the original logo, the former one has used a different
font (Muli).
2023-02-28 16:44:47 +01:00
Martin Pulec
2851104c37 cineform dec.: support for RG48 2023-02-28 16:44:47 +01:00
Martin Pulec
0654e99744 decompress probe: use pixdesc to represent intern fmt
Use pixfmt_desc instead of codec_t for internal compression
representation. This better alignes eg. YUV 10-bit 4:4:4 which has been
deduced as Y416 and eg. for DeckLink, R12L was chosen because it was
thought to be 16 bit, not 10.

This fixes:

    uv -t testcard:codec=R10k -c libavcodec:encoder=libx265:yuv -d dummy:codec=decklink

being detected internally as Y416 and configured as R12L. Now it is
internally Y444_10 and output DeckLink would be configured to R10k.

Removed also params "lavd-use-10bit", "lavd-use-codec", which were
deprecated already some time and if can be replaced by
"decoder-use-codec" if needed.
2023-02-28 16:44:42 +01:00
Martin Pulec
2f1fc85a8f lavc: set async_depth=1 for mjpeg_qsv
This option improves latency (similarly as done for QSV H.264 and HEVC).
2023-02-28 16:17:36 +01:00
Martin Pulec
de91c41a14 optstring: added missing letter 'F' (capture filter) 2023-02-28 16:17:36 +01:00
Martin Pulec
d04fff8c9e main: catch stoi exceptions
Using short getopt options, a user may make a mistake in parameter name
resulting in passing a non-numeric string to stoi, which leads to crash
on not-nice uncaught exception crash.

+ remove try/catch from parse_port (no longer needed due the above)
2023-02-28 16:17:36 +01:00
Martin Pulec
2519e3593b lavc: print options set in verbose mode 2023-02-28 16:17:36 +01:00
Martin Pulec
df05601e0a lavc: set default Huffman tables only for "mjpeg"
mjpeg_qsv doesn't have such an option
2023-02-28 16:17:36 +01:00
Martin Pulec
c4dfbaf0d7 lavc: set QSV CQP defaults 2023-02-28 16:17:35 +01:00
Martin Pulec
ab832f501e dummy: added gl codecs emulation 2023-02-28 16:17:35 +01:00
Martin Pulec
99fd545511 lavc: set AVCodecContext::global_quality for CQP QSV
set global quality when using CQP with QuickSync

see GH-298
2023-02-28 13:12:14 +01:00
Martin Pulec
42e269f9ff lavc: if setting cqp, set particular codec flag
AV_CODEC_FLAG_QSCALE is used to signalize that fixed qscale should be
used and some codecs like QSV ones require it to signalize that CQP is
used.

refer to GH-298
2023-02-28 13:12:14 +01:00
Martin Pulec
3072321a52 mjpeg: set cqp by default
mjpeg encoders (FFmpeg embedded and QuickSync) don't respond to bitrate
setting, so set cqp by default. This gives user a guidance (via the log
msg, that cqp param may be set).
2023-02-28 13:12:14 +01:00
Martin Pulec
b3c1ab2648 lavc: removed q= parameter in favor cqp=
Setting the constant quality is quite per-codec specific so do not
provide 2 distinct options with similar semantic that are mutually
incompatible.

Instead, try to interpret the cqp parameter and set codecs' properties
individually.
2023-02-28 13:12:14 +01:00
Martin Pulec
58b59f92aa lavc: crf/cqp/bitrate/bpp are mutually exclusive 2023-02-28 13:12:12 +01:00
Martin Piatka
fd72ddb3bb Update NEWS 2023-02-28 13:09:27 +01:00