Commit Graph

5495 Commits

Author SHA1 Message Date
Martin Pulec
963c09f72d vidcap testcard: support for audio for 119.88p 2023-06-02 09:28:54 +02:00
Martin Pulec
5b91957c7d allow capture filter spec (-F) after single vidcap
When only one vidcap device given, allow capture filter specification
following the capture because it is unambigous.
2023-06-01 15:41:16 +02:00
Martin Pulec
25f4ee904d PAM,Y4M: improved error checking
- errno will not be set on eg. EOF
- report expected and actual read/written sizes
2023-06-01 14:29:14 +02:00
Martin Pulec
4ba8c70a7e vidcap testcard: support for 8b 444 Y4M 2023-06-01 12:17:50 +02:00
Martin Pulec
d1b404a7d8 PAM,Y4M: fixed warnings
The reported problem was not actually a bug, since feof() and ferror()
were both checked but both gcc and coverity complained about that and
changing it accordingly actually simplifies the code.
2023-06-01 11:13:11 +02:00
Martin Pulec
e7a03c3ea2 DeckLink cap.: improved examples in help 2023-06-01 10:52:10 +02:00
Martin Pulec
2302810ad1 video testcard: support audio for 29.97/59.94 FPS
refer to GH-316
2023-05-31 16:00:19 +02:00
Martin Pulec
d0cb80edb6 video testcard: support audio for 23.98 FPS
support 29.98, because 48 kHz is divisible by 24000/1001 (it's 2002
samples)

Note that 29.97 (or 59.94) is still not supported because 48 kHz is not
evenly divisible by that value (it is 1601.6 audio samples per 29.97
video frame).
2023-05-31 16:00:19 +02:00
Martin Pulec
560abdf058 video testcard: refuse video FPS unsupp. by audio 2023-05-31 16:00:19 +02:00
Martin Piatka
8602727d35 acap/wasapi: Fix setting sample rate 2023-05-31 13:11:36 +02:00
Martin Pulec
aa24e65598 parse_options: ensure audio device given once
avoid unintended audio playback/capture devices given

refer GH-316
2023-05-31 12:21:08 +02:00
Martin Pulec
f90214d0c9 CoreAudio: print error numbers 2023-05-30 17:14:21 +02:00
Martin Pulec
0f546e1f4d CoreAudio cap.: check sample rate
On incorrect device index, the further call succeeds but rate returned
is 0, resulting in wrong assert in ring_buffer_init().

+ s/MODULE_NAME/MOD_NAME for convenience (usual in other code)
2023-05-30 17:14:21 +02:00
Martin Pulec
9abd64ff5b CoreAudio: check indices val validity 2023-05-30 17:14:21 +02:00
Martin Pulec
bb5c413ce4 fixed CoreAudio default devices
if no configuration is set, empty string ("") is passed, not NULL

This resulted in wrong device set 0 set because the atoi doesn't check
its arguments. Example of fixed behavior:

    uv -s testcard -r coreaudio

`AudioUnitSetProperty(s->auHALComponentInstance, kAudioOutputUnitProperty_CurrentDevice,
kAudioUnitScope_Global, 1, &device, sizeof(device));` succeeded with 0
for some reason (but not with other values).
2023-05-30 17:14:21 +02:00
Martin Pulec
0d86ec56d1 video testcard: added afrequency
added "afrequency" option to set sine wave frequency
2023-05-30 17:14:21 +02:00
Martin Pulec
0461ad2f0d video testcard: moved help to separate function 2023-05-30 17:14:20 +02:00
Martin Pulec
5390a307e0 testcard (vidcap+standalone audio): clang warn fix 2023-05-30 17:14:17 +02:00
Martin Pulec
033576f3cc sdl_mixer: paths to Ubuntu SF should be w/o /usr
The listed paths are suffixes to installation prefix, which may be /usr
but almost certainly won't be /, so that the path will be incorrect.
2023-05-30 10:23:55 +02:00
Martin Pulec
108348509e switcher: print device name when switching
Since in last commit, the printed index has changed, print device name
to ensure user that it is the correct one.

+ fixed not freed device state array on cleanup
2023-05-30 10:08:10 +02:00
Martin Pulec
2720dc3bef switcher: print 1-based indices
keys as well as devices in help are 1-based
2023-05-30 09:57:13 +02:00
Martin Pulec
90ee2a2023 fixed CID 408095 2023-05-30 08:58:20 +02:00
Martin Pulec
fbb6b77b4c testcard: improved help
- describe 'fps' option - although the semantics is obvious, it was not
  mentioned that it accepts 'i' (interlaced) suffix
- change FPS in examples to '59.94i' to illustrate the syntax

refer to GH-317
2023-05-26 16:58:17 +02:00
Martin Pulec
066d1f4fd9 PAM: ignore comments
synced with GPUJPEG

comments are correctly skipped in PAM

- moved fread to while (not to repeat and potentially forget when there
  is continue keyword)
2023-05-25 16:58:31 +02:00
Martin Pulec
194849ad2b added video capture filter ratelimit
Limits frame rate to specified value.

This can be used if source doesn't keep its nominal frame rate, as some
Magewells do and use higher.

Another use case is just to limit the framerate from eg. 60 to 25 (which
are coprimes, for 60 and 30, already existing capture filter 'every')
can be used.
2023-05-24 09:35:17 +02:00
Martin Pulec
0f4855e7f1 testcard: added some examples
+ few more mode aliases
2023-05-24 09:35:10 +02:00
Martin Piatka
aa0adb152e logger: Add missing initialization
Doesn't really matter since it's set in host.cpp
2023-05-23 13:05:14 +02:00
Martin Pulec
65c7924e4d testcard: allow mode specification with shortcut
added support for specifying video with something like:
`-t testcard:mode=vga`.
2023-05-23 09:29:39 +02:00
Martin Pulec
3f5e4df87b testcard help: small updates
- sort options alphabetically + change some
- print default used format
2023-05-22 16:37:50 +02:00
Martin Pulec
6ad63dc300 testcard: fixed a crash 2023-05-22 16:37:50 +02:00
Martin Pulec
0e0ffb3454 GLFW: swap buffers after changing size
In Wayland, when resizing windows programmatically glfwSetWindowSize(),
if swap buffers was not triggered, event returning back to the original
resolution is triggered when swap buffer is triggered just after
drawing. It looks like that no drawing should occur before window size
change and swap buffers, seems there has been reports for SDL, eg. [1].

Also do not call gl_resize() after glfw_resize_window() (needless, it
will be triggered via callback after swapping the buffers).

To reproduce the wrong behavior - use Wayland with GLFW native Wayland
build, then: `uv -t testcard -d gl` (size may be any other than the
splashscreen size 512x512).

[1] https://github.com/libsdl-org/SDL/pull/4821
2023-05-19 12:49:35 +02:00
Martin Pulec
54c2bcce8b GL display: round window width
Window width is not taken directly from video desc but rather computed
according to height (to reflect optional aspect ratio). So the window
size needs to be rather rounded to respect odd sizes like 187x77, which
rounded down 186x77, eg.:

    uv -t testcard:size=187x77 -d gl
2023-05-19 12:49:35 +02:00
Martin Pulec
1b6ed9252b vidcap testcard: moved to C 2023-05-19 12:49:27 +02:00
Martin Pulec
a24878cadc vidcap testcard: print error on unsupported Y4M
Instead of crashing on assert, print user-friendly message that the Y4M
is not supported. Also print the properties of the file and what is
supported, which allows easy debug and user can eg. request the feature.
2023-05-19 09:56:35 +02:00
Martin Pulec
0555e49acf vidcap testcard: support for RGBA PAM
+ print user-friendly message if PAM has unsupported channel count,
  instead of crashing on assert
2023-05-19 09:56:35 +02:00
Martin Pulec
98d0372b95 testcard: use time_ns_t instead of std::chrono 2023-05-19 09:56:34 +02:00
Martin Pulec
a55e42a421 vidcap testcard: do not use vectors 2023-05-19 09:56:27 +02:00
Martin Pulec
fa3a69473c video_pattern_generator can have C API 2023-05-19 08:53:17 +02:00
Martin Pulec
9585480c56 vidcap testcard: remove no nonger used midi_buf
Testcard doesn't longer play a MIDI, this has been moved to audio
capture sdl_mixer.
2023-05-19 08:37:59 +02:00
Martin Pulec
1c8c2fdba2 RTP: small fixes
retval + includes
2023-05-18 16:46:50 +02:00
Martin Pulec
1ceced7ded UG RTP audio: use longer timeouts when idle
Similarly to previous commit (and the original, 8977fd42), use longer
timeouts when not receiving any audio to preserve CPU cycles.
2023-05-18 16:46:49 +02:00
Martin Pulec
efb927735f UG RTP video: use longer timeouts when idle - fix
this fixes the original commit 8977fd42 (2016-09-02) that presumably
never worked, because there were inverted conditions.

The idea of the original commit (fixed with this) was to conserve CPU
cycles when not receiving any data.
2023-05-18 16:46:45 +02:00
Martin Pulec
8b5673ec5c lavc video: set defaults for rav1e
This speeds up rav1e encoding from fractions of FPS to few FPS in
FullHD, but clearly the speed is lagging behind its AOM and SVT
counterparts.
2023-05-18 14:34:18 +02:00
Martin Pulec
c6789d656a sdl_mixer: prefer system sound font
check if Mix_GetSoundFonts() is a usable font and if so, use

This has precedence over bundled songs. But most importantly, it will
allow running also from just compiled source, where there is no sound
font relative to `uv` executable but there could be a sound font in
system paths.
2023-05-18 14:34:18 +02:00
Martin Pulec
55482e784b sdl_mixer: try more sound font alternatives 2023-05-18 14:34:15 +02:00
Martin Piatka
13fa90b1ff reflector: Fix crash on exit 2023-05-18 10:21:23 +02:00
Martin Pulec
386b9bfd4c suppresseded some of AJA warnings 2023-05-18 08:43:51 +02:00
Martin Pulec
78796781db bundled SoundFount is sf3 2023-05-18 08:43:39 +02:00
Martin Pulec
5b750c2ff3 lavc video: prefer libaom-av1 for ARM macs
While on x86_64 is libsvtav1 still slightly ahead, on the M1 mac, the
AOM AV1 performs significantly better (2x faster).

The above holds for native builds, it actually looks like the x86_64
build running SVT AV1 on M1 mac doesn't run correctly at all - it
produces just blank picture (green as is zeroed YCbCr buffer).
2023-05-17 14:56:11 +02:00
Martin Pulec
2961fe2f44 lavc video: print used thread count and mode 2023-05-17 11:48:08 +02:00