Commit Graph

8651 Commits

Author SHA1 Message Date
Martin Pulec
11fd6830be add opt --audio-channel-map shortcut -U 2023-11-06 13:28:18 +01:00
Martin Pulec
9be9e8af5d CONTRIBUTING.md: naming convertion for mod. logger 2023-11-06 13:28:16 +01:00
Martin Piatka
99888c6bf6 GUI: LineEdit: Fix cursor jumping to the end when editing
The issue was that editing the text triggers the change of the option,
which in turn triggers updateUiState which sets the content of the
LineEdit to the changed option causing the cursor to jump to the end.

As a workaround only set the LineEdit contet when it's not focused.
2023-11-06 10:13:03 +01:00
Martin Piatka
1f8644f87f pipewire_common: Stop the loop in destructor 2023-11-06 10:13:03 +01:00
Martin Pulec
b98b5ab02c CI Win: build own Spout
closes GH-352

It looks like the pre-build library BUILD/Binaries/x64/SpoutLibrary.dll
is no longer compatible with the headers in Git.

Pre-built library version is 2.007.010 while the latest version on GitHub
is Spout 2.007.012. When building Spout from sources, the referenced
issue no longer occurs. Also the libraries are not expected to be included
in the Git in future (leadedge/Spout2#103).
2023-11-06 10:11:15 +01:00
Martin Pulec
8b233cd68f Revert "CI: macOS compilation fix (Vulkan missing hdr)"
No longer needed - GH macos-12 runner has VK v1.3.268, which doesn't
miss the needed header.

This reverts commit 70d1c5186d.
2023-11-03 16:46:06 +01:00
Martin Pulec
e4ae1eabf3 CI mac: switch to macOS 12 Monterey
Homebrew builds now dependencies from sources on unsupported macOSes
(which is 11 now), which makes it slow. Relevant snippet from brew output:
```
Warning: You are using macOS 11.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.
It is expected behaviour that Homebrew will be buggy and slow.
```
2023-11-03 16:39:34 +01:00
Martin Pulec
8670a1d25f AppRun: set LD_LIBRARY_PATH at the end
set LD_LIBRARY_PATH just before uv (or other tool) is run

This minimizes interference when running the script.
2023-11-03 16:16:06 +01:00
Martin Pulec
e09db568f9 AppRun FJ: allow /bin/bash
Bash is needed in /bin on U23.10 when running with Firejail (even though
/bin/sh is dash on that system).
2023-11-03 16:15:43 +01:00
Martin Pulec
9ce4b3d557 DeckLik disp.: print errmsg if can't set aud switch 2023-11-03 11:11:10 +01:00
Martin Pulec
f618b6e9e7 DeckLink disp.: ensure that queried ch_count is valid
If not, it may later fail (see GH-354) in
display_decklink_reconfigure_audio() depending what the actual value is
and what will be negotiated, it would certainly fail for < 2.
2023-11-03 10:41:40 +01:00
Martin Pulec
7abe8937e9 DeckLink disp.: set audio chans only on query succ
refers to GH-354

It seems that if the query fails, it sets some undefined or invalid
value to the output variable.

\+ print actual used maximal value in verbose mode

\+ print also error message
2023-11-03 10:21:53 +01:00
Martin Pulec
3a3c607638 types.h: removed a forward decl
unneeded and in a wrong header
2023-11-03 09:51:41 +01:00
Martin Pulec
817f3475aa DeckLink disp.: fixed a typo
fixes GH-355
2023-11-03 09:39:01 +01:00
Martin Pulec
c610aaef5f DeckLink disp.: set_audio_props improved
print the connection directly from the display flag and then we can return
if audio is required to be embedded (no need to set AESEBU/analog switch).

\+ use more defensive msg about audio output (we actually may not set anything)
2023-11-03 09:38:59 +01:00
Martin Pulec
724ab38854 DeckLink disp.: warn in verb. on nosupp aud switch
If cannot switch to AESEBU/analog, warn at least in verbose mode
(shouldn't be an issue in most cases, since this is usually needed only
for more than 2 channels).
2023-11-03 09:31:53 +01:00
Martin Pulec
27ac319234 DeckLink disp.: factor out aud init to fn
Moved audio configuration to a separate function - refactor only, should
behave almost the same as before.
2023-11-03 09:19:39 +01:00
Martin Pulec
b8e0acf5b8 macOS/sign.sh: don't fail if keychain exists
This makes the script reentrant, allowing to run it also interactively
repeatedly, provided that the `apple_key_p12_b64` and
`notarytool_credentials` environment variables are correctly set.
2023-11-02 12:18:06 +01:00
Martin Pulec
0f9dbdf89e Revert "Makefile: added deps on bundle dir"
This still causes the bundle rebuild. Under normal circumstances it
won't matter but as we sign the directory after creating the bundle
and before creating dmg, it actually hurts, becasue to the DMG goes the
freshly-created (unsigned) bundle.

This reverts commit 7294347a9b.
2023-11-02 12:03:51 +01:00
Martin Pulec
bc50883086 Revert "CI mac compilation fix"
natpmp workaround no longer needed

This reverts commit 6c50f15988.
2023-11-02 10:09:31 +01:00
Martin Pulec
9938f6b082 av_log_ug_callback: handle overflow
If the buffer is full, flush the output even if there is no NL at the
end and issue a warning (should be handled - either some error or some
module produces unexpectedly long output).
2023-11-01 17:01:32 +01:00
Martin Pulec
fea0d10f67 improved UG FFmpeg logger
do not prefix messages not starting on new line by timestamps, eg.:

    $ uv -s embedded -t testcard -d file:n=/dev/null -V
    [1698853041.393] [lavc]   Stream #0:0[1698853041.393] : Video: rawvideo, 1 reference frame (UYVY / 0x59565955), uyvy422, 1920x1080 (0x0), q=2-31, 829440 kb/s[1698853041.393] , [1698853041.393] 25 tbn[1698853041.393]

Flush the output only on NL and before it store it in internal
thread-local buffer.

Locking was removed as static data are now thread-local.

this improves 808b3de3
2023-11-01 17:01:31 +01:00
Martin Pulec
40d2c66903 file disp.: initialize UG AV logging
not necessary, but better; also makes UG behavior deterministic, eg.:

    uv -s embedded -t testcard -d file:n=/dev/null [-c libavcodec] -V

produce different output for file depending if libavcodec is on or off
(AV messages prefixed by UG logger).
2023-11-01 17:01:31 +01:00
Martin Pulec
af33553e1c AppRun FJ: do not whitelist /dev
eg. for `-d file:n=/dev/null` - whitelisting /dev is invalid:

    Error: invalid whitelist path /dev
2023-11-01 17:01:27 +01:00
Martin Pulec
f05a200add AppRun FJ: recognize also n[ame]=<n> paths 2023-11-01 15:55:41 +01:00
Martin Pulec
1589eae332 display file: changed allowed av diff to 100 ms
\+ set the option to be in seconds instead of video frame times

refers to GH-333
2023-11-01 12:01:09 +01:00
Martin Pulec
7294347a9b Makefile: added deps on bundle dir
This should now work as expected because the build stuff has been
changed/fixed since the "todo" was written.
2023-11-01 09:10:28 +01:00
Martin Pulec
029a8f3a25 configure.ac: use pkgconf as pkg-config fallback
Some pkgconf distributions (like Arch Linux) make pkg-config symplink,
some (eg. macOS) do not. Even the pkg.m4 macro from pkgconf checks for
binary named pkg-config [1]. So if pkg-config is not found, try to look up
`pkgconf`.

[1]:
<752a9825dc
/pkg.m4#L67>
2023-10-31 12:36:46 +01:00
Martin Pulec
5d3c31c115 to_lavc_vid_conv: cp metadata out to tmp (refactor)
Set metadata to out_frame only and copy it to tmp_frame (not to repeat
every assignment and potentially forgotting something).

\+ check tmp_frame afor allocation failure
2023-10-31 11:03:36 +01:00
Martin Pulec
37ae3935e9 to_lavc_vid_conv: set AVFrame CS and range
Some encoders use `colorspace` and `color_range` from AVFrame,
eg. _hevc_videotoolbox_:

   uv -t testcard -c libavcodec:encoder=hevc_videotoolbox

(defaults to bgra, because other foramts don't keep 4:2:2 subsampling,
supported at the time: videotoolbox_vld nv12 yuv420p bgra p010le).

Fixed error was producing this message:
````
[lavc hevc_videotoolbox @ 0x12fc04190] Could not get pixel format for color format 'bgra' range 'unknown'.
[lavc hevc_videotoolbox @ 0x12fc04190] Error: Cannot convert format 28 color_range 0: -22
```
2023-10-31 10:57:07 +01:00
Martin Pulec
c5e5547229 avfoundation: fixed macOS 14 warning
AVCaptureDeviceTypeExternalUnknown is now AVCaptureDeviceTypeExternal
(the former is a deprecated alias).
2023-10-31 10:18:41 +01:00
Martin Pulec
e3f65ad836 ug_input: option to enforce decode pixfmt
refer to GH-349
2023-10-31 08:37:15 +01:00
Martin Pulec
6d548acf32 ug_input: refuse non-numeric opt
Currently only port number is accepted - refuse any option that doesn't
match this.

\+ created a separate function for parsing
2023-10-30 17:23:32 +01:00
Martin Pulec
f4aeae09a0 ug_input: improved includes+using
- sort includes alphabetically
- system includes first
- do not include config*.h (not needed)
- do use-include whole namespace (std and std::chrono)
2023-10-30 17:21:54 +01:00
Martin Pulec
0d82c70927 hd-rum-translator.cpp: refactor includes
- include system headers first
- do not include config*h (not needed)
- use C++ compatible header name for C headers (stdlib.h->cstdlib)
2023-10-30 16:10:02 +01:00
Martin Pulec
fef59e7b8d hide vidcap "none" in vidcap listing
(when `-t fullhelp` is not used)
2023-10-30 16:03:02 +01:00
Martin Pulec
bbedc297c4 pipewire_common.cpp: suppress a warning 2023-10-30 15:54:09 +01:00
Martin Pulec
eaf805d424 hd-rum-transcode: port val check updates
1. really check non-negativity - until now, the parsed string was
dirrectly assigned to ushort, effectively disabling the check ((short)-1
== 65535)
2. check also upper bound to be less than USHRT_MAX
3. **allow** 0 as a port - supposedly this is a relict when atoi() was
used to parse the port, so that it was supposed to be error in
conversion. There may be, however, legitimate reasons to use 0 as a port
to bind random port (although UG doesn't print it so the user would need
to obtain its value eg. with iproute2 if required). Just print a warn.
2023-10-30 15:40:05 +01:00
Martin Pulec
f09a56b84b hd-rum-translator: moved opt parsing from main()
As we are now throwing exeptions, the validity check can be moved to
the place where it is set.
2023-10-30 12:57:27 +01:00
Martin Pulec
6c64015fb3 hd-rum-transcode: better wrong usage handling
Process exceptions as with:

     hd-rum-transcode 5004 -P 6004 localhost

where buffer size is omitted - `-P` is parsed as buffer number producing
invalid argument exeption.

Converted the expected invalid_argument exceptions to ug_runtime_error
that is catched in main().
2023-10-30 12:47:51 +01:00
Martin Pulec
4b326fc709 hd-rum-transcode: moved size parsing to fn 2023-10-30 12:32:05 +01:00
Martin Pulec
97041f5a49 hd-rum-transcode: print error even if no argument
Until now, if called without argument, help was printed but without the
error message. Since arguments are mandatory and to query help, rather
'-h' should be used, rather print error in this case. This also correspons
with the exit with non-zero return code.
2023-10-30 12:29:30 +01:00
Martin Pulec
534aaa7273 hd-rum-translator: be specific which param is missing 2023-10-30 12:22:46 +01:00
Martin Pulec
8ccead27c7 hd-rum-translator: removed unneeded includes 2023-10-30 11:23:20 +01:00
Martin Pulec
ad59c943ba hd-rum-translator: use stoi instead of atoi
Catches situations when input parameter validation is unintentionally
omitted, eg.:

    hd-rum-transcode 5004 -P 6004 localhost

(missing buffer size not handled)
2023-10-30 11:22:35 +01:00
Martin Pulec
5294185671 hot-fixed crashing Spout on log setting
refer to GH-352
2023-10-30 10:31:33 +01:00
Martin Pulec
468b2ca2eb lavc audio: fixed typo
fixes #351
2023-10-30 10:31:16 +01:00
Martin Pulec
5ac3f93754 screen win: print examples in fullhelp 2023-10-27 15:04:58 +02:00
Martin Pulec
c9bdbc145f screen win: grab even if just screen:clear_prefs
Previously it cleared the preferences and exitted if no options followed
but starts grabbing otherwise, which is inconsistent. If user wants just
clearing preferences, Ctrl-c may be pressed immediately to exit.
2023-10-27 14:45:26 +02:00
Martin Pulec
8b412140d7 renamed get_win_error->get_win32_error
it formats win32 errors, but not HRESULT in general
2023-10-27 12:18:17 +02:00