Commit Graph

6213 Commits

Author SHA1 Message Date
Martin Pulec
5ce89a2dc9 host.cpp: validate parameters before assign 2022-07-18 10:08:23 +02:00
Martin Pulec
2c155cc542 video_decompress.cpp: fixed a typo 2022-07-18 09:55:32 +02:00
Martin Pulec
a0458aa6dd video pattern generator: finished SMPTE bars
It is not fully-conformant but the wiki description is rather vague and
it is eg. inpossible to represent a "superblack" color if we assume 0 as
a base black.
2022-07-14 15:54:22 +02:00
Martin Pulec
8f5d5b4ccd video pattern generator: fixed 7nd bar of SMPTE 2022-07-14 15:40:52 +02:00
Martin Pulec
e4f56be955 prevent dangling lambdas
Prevent dangling parameter-less lambdas. Although it may not be so dangerous
(operator() should be a plain function in the end), it is not correct.
2022-07-14 09:29:15 +02:00
Martin Pulec
45d0bfb615 Cineform: Windows warning fix 2022-07-14 09:29:15 +02:00
Martin Piatka
e2d42ecd15 types.h: Fix typo 2022-07-12 14:43:03 +02:00
Martin Pulec
d0224f6b2e .github/scripts/macOS/sign.sh: used shellcheck
Incorporated shellcheck complains.
2022-07-12 11:53:48 +02:00
Martin Pulec
c7a251f327 CI sign.sh [mac]: return 0 on pull request
On pull request, the repository secrets are not available.
2022-07-12 11:32:57 +02:00
Martin Pulec
727841f3bc set_output_buffering: small improvements
- show usage with "help"
- print error if setvbuf fails (but do not return an error - there may
  be some platform problem but the setting is done always, so it would
  unconditionally prevent UltraGrid from running)
- if usage error (or help) occurs, exit UltraGrid
2022-07-01 15:22:54 +02:00
Martin Pulec
67c4bad83b param help: added usage warning
--params should not be considered a part of standard options provided to
users but rather a developer/expert mode.
2022-07-01 14:49:56 +02:00
Martin Pulec
46938b20fb echo: param help indention fix 2022-07-01 14:49:56 +02:00
Martin Pulec
1dc899209d set output buffering early
setvbuf() should be called on a stream prior to any operation with the
stream. Previously it was to late -- it was even after configuration
summary was printed to stdout.
2022-07-01 14:49:32 +02:00
Martin Pulec
8e1369f21f setvbuf: set size=BUFSIZ
The value 0 is mentioned in man setvbuf(3) and indeed glibc
implements setlinebuf as:

    _IO_setvbuf (stream, NULL, 1, 0);

However, except the mention in manual page, this extension doesn't seem
to be anywhere mentioned (not clear if valid with _IOFBF) and it is not
widespread except glibc, since [1] forbids that. Also using _IOLBF+0
behaves in the same way as _IOLBF+BUFSIZ (buffers BUFSIZ bytes).

[1] https://www.ibm.com/docs/en/i/7.1?topic=functions-setvbuf-control-buffering
2022-07-01 09:29:18 +02:00
Martin Pulec
b76351d37e lavc: set rc_buffer_size frame size multiplier 2.5
Replace the original factor of 8 with 2.5. As a drawback, the resulting
stream is 13% smaller than requested bitrate, but maximal frame is
indeed at most 2.5x bigger than the average (measured on NewZealand
short).

This used to cause some artifacts if smaller than 8 but doesn't seem to
be true anymore. Anyways, this commit also adds param
`lavc-rc-buffer-size-factor` in case there is a need to increase the
factor.

Impact on PSNR (NZ@20 Mbps) -- previous: avg. 52.27, new 49.95 (but has
smaller actual bitrate; using the same bitrate yields 51.36).
2022-07-01 08:49:59 +02:00
Martin Pulec
52fad90bbf GL: option for GLFW window hints
See previous commit -- where eg. auto-iconify is desirable, user may opt
in.
2022-07-01 08:49:47 +02:00
Martin Pulec
f40bd85dc3 GL: do not iconify when FS loses focus
Do not iconify when windows is fullscreen and loses focus -- this is
particularly annoying when using 2 displays (but can have a rationale
in a single display setup when platform has full-screen windows always
on top).
2022-06-30 16:41:49 +02:00
Martin Pulec
6a83885516 lavc: do not set slice-max-size at all
Altough in theory it may be beneficial to limit NAL unit sizes to
approximately the size of packet and indeed in synthetic tests it
was, real world use seems to exhibit the opposite - potential artifacts
if exceeding 32 slices (some huge picture). Also the resilliency was
somhow worse.

User still may pass the parameter explicitly to see if the behavior
improves or worsens: "-t libavcodec:encoder=libx264:slice-max-size=1200"
2022-06-30 16:41:41 +02:00
Martin Pulec
03481f570a DeckLink disp.: use generic FPS indicator
(Main motivation was to have the video capture visually more apparent if
having cap+disp+audio. This is now solved by the generic indicator so
use it.)
2022-06-30 16:41:41 +02:00
Martin Pulec
1ccadb51fe generic display FPS indicator: use colors+bold 2022-06-30 16:41:41 +02:00
Martin Pulec
a50f443095 main: point clog to cout
Point clog to cout instead of default cerr. Unit of log is almost always
a line so it is pointless to flush it after each write (as stderr is set
by default not to buffer /see previous commit/) -- those would make
every '<<' operator a flush point (or in C code multiple calls of
console_out is done).
2022-06-30 16:41:40 +02:00
Martin Pulec
d4775e375e output buffering: set explicitly
Set output buffering to "line" for stdout and "no" for stderr. This is
the case usually but not always (eg. MSYS, GUI console) so make this
explicit to be deterministic.
2022-06-30 16:41:40 +02:00
Martin Pulec
26f85aee9d color_out: support for background color + more cols
+ do not use std::flush at the end of stream
2022-06-30 16:41:40 +02:00
Martin Pulec
801074d4af GL: removed custom FPS indicator and use generic 2022-06-30 16:41:40 +02:00
Martin Pulec
ae9ac7da07 video_display: added optional generic indicator 2022-06-30 16:41:40 +02:00
Martin Pulec
39c1e3f2cb initialize_video_display: return early if not found
refactorization -- return right away if display was not found instead of
indenting the whole opposite "normal" block.
2022-06-30 16:41:39 +02:00
Martin Pulec
3b1b3d6dab DeckLink cap.: use generic FPS indicator 2022-06-30 16:41:39 +02:00
Martin Pulec
a40d1d7c18 highlight video capture module name 2022-06-30 16:41:36 +02:00
Martin Piatka
1d84be609d conference: Support setting layout via control port 2022-06-30 13:03:19 +02:00
Martin Piatka
dab299fb39 utils/sv_parse_num: Support for non-10 bases 2022-06-29 15:15:43 +02:00
Martin Piatka
3a84dfec91 utils/sv_parse_num: Add missing <string> include 2022-06-29 15:15:42 +02:00
Martin Piatka
94795d3f03 tools/ipc_frame: Fix formating 2022-06-29 15:15:42 +02:00
Martin Pulec
c66e7de98d testcard: show "Fill rect" only if verbose 2022-06-29 09:34:04 +02:00
Martin Pulec
0e900170b5 glfw_init_count: improved documentation 2022-06-29 09:34:04 +02:00
Martin Pulec
5de26fd6d3 GL: fixed switching back from FS
If window has approximately the same or higher resolution than the
screen resolution, reverting back from fullscreen caused the window
fail to re-gain its windowed state, reverting to full-screen.

To avoid that glfwSetWindowMonitor() needs to be called with {x,y}pos
set to GLFW_DONT_CARE instead of 0.
2022-06-29 09:34:04 +02:00
Martin Pulec
cad1e9739d GL: fixed crash if exiting with paused frame
The control flow was a bit incorrect - pause should be handled prior to
current_frame update.

Anyways, the whole stuff is still a bit ugly (namely the pop_frame stuff
+ locking). Delaying frame pop was a kind of optimization - not sure if
it is worth it.
2022-06-29 09:34:04 +02:00
Martin Pulec
59379869d8 key control: disable if running in GDB
Terminal control (especitally turning echo off) is probably not a best
idea if running from inside GDB.
2022-06-29 09:33:53 +02:00
Martin Piatka
09ba7d0dad GUI: Remove unnecessary spacer 2022-06-28 16:50:28 +02:00
Martin Piatka
9daac0b249 GUI: Adjust layout resizing behaviour
* Layout groupboxes directly in grid layout
* Disable combo boxes resizing based on contents (sizeAdjustPolicy)
* Reduce minimum combo box width to 8
2022-06-28 16:50:28 +02:00
Martin Pulec
4569fdbb49 main.cpp: adjust_params RX/TX 0 if no traffic
This slightly modifies commit c25a362c that brought a regression if
sending&receiving video but no audio -- TX port was set to base (or +2)
but RX was kept 0 resulting port inequality and thus Jumbo frames were
not chosen.
2022-06-28 15:27:02 +02:00
Martin Pulec
1d8e83ddf6 configure: do not warn if using dylibbundler v1
Main development is in original dylibbundler while the v2 stalls -
important changes are rather being ported into mainstream from v2.
2022-06-28 14:46:09 +02:00
Martin Pulec
db9ee37bb1 lavc: fixed crash on help 2022-06-28 12:03:48 +02:00
Martin Pulec
a3b1758e11 V4L2 cap.: allow "shorthelp"
List of modes may be sometimes excessive, especially whenever there are
multiple devices. But user may usually wish to select the size manually
with V4L2 so keep the modes visible by default but allow hidding it (eg.
to obtain solely list of devices).
2022-06-27 17:04:56 +02:00
Martin Pulec
ba9d2ed520 V4L2 cap.: pretty-print help 2022-06-27 17:04:56 +02:00
Martin Pulec
da99ed3a0a V4L2 cap.: added parameter "permissive" 2022-06-27 17:04:56 +02:00
Martin Pulec
c463f2cc7f V4L2 cap.: check also TPF/FPS 2022-06-27 17:04:56 +02:00
Martin Pulec
a4d37a221b V4L2 cap.: verify captured fmt
Verify if captured format matches the format requested explicitly by
user.

+ print capture format properties only once (was duplicite)
+ removed needless VIDIOC_G_FMT -- VIDIOC_S_FMT already adjusts the
  format so this is unneeded and may be confusing
2022-06-27 17:04:53 +02:00
Martin Piatka
cbda18c0a7 Update NEWS 2022-06-27 14:02:38 +02:00
Martin Piatka
a70d084252 tools/README: Add ipc_frame 2022-06-27 13:37:06 +02:00
Martin Piatka
25f528fd93 GUI: Fix blocking process termination 2022-06-24 13:40:24 +02:00