Commit Graph

8120 Commits

Author SHA1 Message Date
Martin Pulec
43972b36ea fixed CIDs 4167{1,2,3,4,5,7,8} 2023-07-25 09:32:15 +02:00
Martin Pulec
10c280959b Revert "CI Linux FFmpeg: remove NVENC IDR patch"
This reverts commit e457ab87f7 but the
patch is updated to match current FFmpeg.

The FFmpeg commit that seemed to do the same (7eeef72c6) is not working
correctly because it assigns idrPeriod cc->gopLength, which was set to
NVENC_INFINITE_GOPLENGTH above in case of intra-refresh.

refer to GH-330
2023-07-24 16:23:44 +02:00
Martin Pulec
41da22a399 fixed video_desc_to_string returning same desc
The function returned description was not updated by subsequent call,
because the returned thread_local variable is initialized statically.
2023-07-24 15:59:50 +02:00
Martin Pulec
c2c7a2ddb8 lavc video: NVENC: update ver comparison
Current libavcodec version is still 60.22.100 so intra-refresh has been
disabled since e457ab8 because the version is still not strictly greater
(is equal). Using non-strict equality breaks the compilation with version
60.22.100 prior to FFmpeg commit e457ab8 (perhaps not a big deal).

refer to GH-330
2023-07-24 15:17:09 +02:00
Martin Pulec
bb596e0fc1 CI Linux: fixed failing tests
Fixes some weird error with Pipewire over ALSA on Arch:

https://github.com/CESNET/UltraGrid/actions/runs/5642223630/job/15281663172
2023-07-24 14:48:13 +02:00
Martin Pulec
47be77ed94 create-appimage.sh: do not require fc-match
If not running in GitHub CI, do not fail on fc-match absence, only print
the error.
2023-07-24 14:48:12 +02:00
Martin Pulec
6f6ef9d691 CI Linux/install_others.sh: not use lsb_release
lsb_release command is not always present, even in Ubuntu, wheresas
/etc/lsb-release file is but it isn't necessarily in all distros,
eg. Arch doesn't have it by default.

+ install libdbus-1-dev dependency - not needed for the CI because there
  it is at this point already installed but the script can be used also
  to setup the environment outside GitHub CI
2023-07-24 14:48:12 +02:00
Martin Pulec
e10cf0948c configure: help for screen cap Linux
suggest accepted values for screen capture module
2023-07-24 14:48:10 +02:00
Martin Piatka
38a7126a63 video_decoders: Fix FEC
Fixes #331
2023-07-24 12:26:31 +02:00
Martin Pulec
03f0a5f939 testcard2 Ubuntu DejaVu path fix
DejaVuSansMono.ttf is in /usr/share/fonts/truetype/dejavu in Ubuntu
at least since version 14.04.
2023-07-24 09:47:57 +02:00
Martin Pulec
0ce939e5e9 testcard2: use parse_fps to allow interlacing
this allows syntax like "59.74i"
2023-07-24 09:27:08 +02:00
Martin Pulec
1579f5fa19 testcard2: fmt parse in a separate func 2023-07-24 09:27:08 +02:00
Martin Pulec
7e00fdb14f testcard2: (hot) fix thread wild exit if TTF fails 2023-07-24 09:27:02 +02:00
Martin Pulec
b77a4ac669 DeckLink cap.: fail if audio init fails
Continuing and only issuing a warning (while not capturing audio at all)
is perhaps not desired and should end with an error.
2023-07-21 16:48:12 +02:00
Martin Pulec
e6fcbec6b4 DeckLink: prepare support for 32 and 64 audio ch.
BMD API starting with 12.0 support 64 channels so enable it when using
eligible SDK.

UG ships currently 11.6 so it won't be enabled by default but user can
ship own version.

+ replaced unneeded checks in display_decklink_reconfigure_audio
  with assert (not needed, this should not happen because the format is
  negotiated with `get_property(AUDIO_FORMAT)`` first)
2023-07-21 16:48:08 +02:00
Martin Pulec
f4086999fe DeckLink sync.: allow "sync" shortcut 2023-07-21 12:31:35 +02:00
Martin Pulec
a1eea8e221 DeckLink sync: aud. discontinuity check removed
As for now, it breaks things when using OPUS, eg on DeckLink 4K Extrme:
```
uv -t testcard:mode=Hi59 -s embedded -A OPUS -d decklink:sync -r embedded
```

Poorly synchronized input, especially when there is a timing jitter,
like sdl_mixer will stop to be played properly, but this isn't actually
purpose of this mode so it isn't perhaps a good idea to complicate the
things by adding some error-prone stuff.
2023-07-21 12:31:35 +02:00
Martin Pulec
542d5c2d55 DeckLink disp synchronized: do not play audio during reconf
Not a big deal but it produces following error on reconfiguration:
```
sender $ uv -t testcard -s embedded -c libavcodec receiver # restart 2x
receiver $ uv -d decklink:synchronized -r embedded 2>&1 | grep error:wq
ScheduleAudioSamples: General access denied error (0x80000009)
``
2023-07-21 12:31:34 +02:00
Martin Pulec
a41bb5ffa9 DeckLink disp: fixed scheduled reconfigure
Callback is removed in reconfigure if already initialized but was set
only in _init.
2023-07-20 15:34:50 +02:00
Martin Pulec
c1891a2b82 video decoder: reconfigure only once after probe
When probing for the internal format, multiple reconfigure messages may
be emitted (because multiple frames might have been processed, as needed
for inter-frame compressions). Thus we need to check and store our
internal format instead of forcing reconfigure (that has been needed,
since the video_desc of the stream hasn't changed).
2023-07-20 15:10:35 +02:00
Martin Pulec
13c8cc76f6 video decoder: removed reconfiguration in future
This is most likely defunct, anyways, and removing it improves
maintainablilty a little.
2023-07-20 15:02:05 +02:00
Martin Pulec
8973fb4daf video_decoder: fixed display reconf on probe
Display should not be reconfigured when not needed, otherwise it will be
reconfigured twice even when received single compressed stream (because
reconf is run twice here - once as probe and second real).

Therefore the display description is stored in decoder->display_desc and
compared with the actual desc. But it doesn't work with compresed stream,
because display_desc.color_spec is set to the network desc and rewritten
to the correct uncompressed color-spec just after the if. So eg.:

- stored desc is "1920x1080 @50.00i, codec UYVY"; **but** compared to:
- actual "1920x1080 @50.00i, codec MJPEG"
2023-07-20 11:54:30 +02:00
Martin Pulec
c6fea2249e MacOS updater: release is updated to next release
Until now, the update was done unconditionally to continuous regardless
if the updated version was release or continuous.
2023-07-20 10:39:03 +02:00
Martin Pulec
bc5e580b43 override_prop: added also (wrapped) postprocessor
from capture filter of the same name
2023-07-20 09:36:50 +02:00
Martin Pulec
306b26aede DeckLink disp.: report ext stats every 5 sec, not 6
Doesn't matter much, moreover it is only in verbose mode, just to be
consistent.
2023-07-20 09:27:17 +02:00
Martin Pulec
d8ccc3b729 video rxtx: removed remains of multi-link sending
This is not used and removing it simplifies the code.
2023-07-19 16:31:00 +02:00
Martin Pulec
a2d8913569 DeckLink disp.: when resync the stream, reset all audio vals
Keep own copy of original and working (with wraparounds) audio TS in
order not to fight with the video over the shared variable - reconfigure
only if there is a change.
2023-07-19 12:15:15 +02:00
Martin Pulec
18775820e7 DeckLink disp.: frames should be released 2023-07-19 11:26:13 +02:00
Martin Pulec
6780691b4e modernize playback APIs
modernized video display, audio playback and vo postprocess APIs

THe APIs were already recently updated so modernize it by using bool
where the return value is semantically boolean value. Using TRUE/FALSE is
inherently ambiguous because it is not obvious from the prototype if
success is 0 or TRUE (1).
2023-07-18 16:43:37 +02:00
Martin Pulec
baa0c661c1 DeckLink disp.: fixed stream discontinuity detection 2023-07-18 16:43:30 +02:00
Martin Pulec
2748e3687d IDeckLinkVideoOutputCallback haven't virt dtor
IDeckLinkVideoOutputCallback doesn't have a virtual desctructor in
Windows, thus its subclass destructor cannot be marked override.
2023-07-18 14:20:00 +02:00
Martin Pulec
d2b39acab0 video display: returns bool from putf API
Use bool return value from putf - returning int here may be error-prone
because the semantics is unclear (is success 0 or TRUE).
2023-07-18 13:46:54 +02:00
Martin Pulec
a97352afc8 Merge branch 'decklink-sync-output' into master 2023-07-18 13:46:41 +02:00
Martin Pulec
e38117214f DeckLink disp.: added synchronized opt (replace)
Replace [no-]low-latency option with synchronized opt - the behavior
of the no-low-latency mode has changed, anyways, so as a benefit it is
more obvious.
2023-07-18 13:30:13 +02:00
Martin Pulec
037e0bc670 DeckLink disp.: do not dyn alloc PlaybackDelegate
make it aggregate directly inside state_decklink

+ moved all scheduled things to the PlaybackDelegate state
2023-07-18 11:20:44 +02:00
Martin Pulec
1e3af5ed78 DeckLink disp. sched aud: no sync on large diff
When the timestamp difference is too large, do not sync at all and
schedule continuously. This has been already there but the difference
wasn't allowed to be more than 2000.
2023-07-18 11:12:11 +02:00
Martin Pulec
3ac4f7cee2 DeckLink disp.: reconfigure audio w. video (schd)
In scheduled mode, we need to restart stream after configuring audio. The
previous implemenation was rather error-prone because if the audio was
configured after video, it didn't work. Now it simplifies the workflow.

This also fixes a potential crash when DisableVideoOutput in reconfigure
was called after deleting the delegate structure.
2023-07-18 11:09:08 +02:00
Martin Pulec
68b8c40955 DeckLink disp.: EnableAudioOutput with corr. type
This fixes E_ACCESSDENIED from ScheduleAudioSamples in some runs.
2023-07-18 11:09:08 +02:00
Martin Pulec
49e1ae4dd1 DeckLink disp.: print ScheduleAudioSamples error 2023-07-18 11:09:08 +02:00
Martin Pulec
4570b8aeab DeckLink disp: resync after missing/extra frame
When there is a missing frame, seq is incremented but the actual time
base may have diverged.

Similarly to dropped frame - one frame is elapsed but the time base
didn't reflect that, because it was dropped.
2023-07-18 11:09:08 +02:00
Martin Pulec
8dcfdf9937 DeckLink disp.: use DeckLink frame internally
Use our DeckLink frame type rather than the IDeckLinkMutableVideoFrame
ancestor because we may use its specifics.
2023-07-18 11:09:08 +02:00
Martin Pulec
426de8d842 DeckLink disp.: fixed audio wrap-around 2023-07-18 11:09:08 +02:00
Martin Pulec
cee1bc3847 DeckLink disp.: properly schedule audio 2023-07-18 11:09:08 +02:00
Martin Pulec
60c7e71357 DeckLink disp.: recreate PlaybackDelegate on reconf
Actually there are now more things that need to be reset, like
scheduled frames for playback so we'd better delete and recreate the
state altogether.
2023-07-18 11:09:08 +02:00
Martin Pulec
670a9c056c DeckLink disp: add PlaybackDelegate::PrintStats
This cancels the need to friending with display_decklink_putf.

+ make some class members private if possible
2023-07-18 11:09:08 +02:00
Martin Pulec
f4e622135c vidcap testcard: set accurate audio timestamps
Set accurate timestamps for 1001-fractioned videos, where audio frame
sizes are swinging between different number of samples (aka 1601 and
1602 for 59.94i/29.97p video) so that the timestamp isn't exactly aligned
to the video timestamp.
2023-07-18 11:09:08 +02:00
Martin Pulec
4687e3f287 vidcap testcard: moved audio grab to separate fcn
only a refactor

+ ptrdiff_t cast to silence clang-tidy complaint (but can be considered
  also as a refactor, since no overflow here is known)
2023-07-18 11:09:08 +02:00
Martin Pulec
bcf4f52554 DeckLink disp.: queue for sched frames 2023-07-18 11:09:08 +02:00
Martin Pulec
e98bbb4bff DeckLink disp.: fixed clang-tidy warnings 2023-07-18 11:09:07 +02:00
Martin Pulec
a5c2e7559c DeckLink disp.: rewritte scheduled playback
video only, audio support will be readded later

Rewritten scheduled playback - instead of pushing the frames and guessing
the playback time as it has been before, store the frames inside and let
the completition callback pull when needed.
2023-07-18 11:09:07 +02:00