Commit Graph

205 Commits

Author SHA1 Message Date
Martin Pulec
a6ca815e9c GL: unified handling of DXT GLSL programs
Handle DXT-related (YUV->RGB) programs in the same way as the rest of
the shader programs.
2023-01-16 10:50:54 +01:00
Martin Pulec
c4aa64c800 do not deinterlace progressive
until option "force" is given, do not deinterlace progressive video
2023-01-13 15:52:56 +01:00
Martin Pulec
2afcdf3c1f print which pixel format cannot be deinterlaced
Needs adding log_msg_once variable arguments (printf-like).

+ print always error in deinterlace - if user explicitly wants
  deinterlace PP, maybe we should notify loudly
2023-01-10 16:41:52 +01:00
Martin Pulec
bdf389099c vc_deinterlace_ex: basic check if pixfmt is supported
+ use&check it in GL/SDL/deinterlace pp/double_framerate pp
2023-01-10 15:57:37 +01:00
Martin Pulec
15f5c5302d GL: fixed a bug (c&p err) from prev commit 2023-01-10 14:28:10 +01:00
Martin Pulec
77ba3fa529 GL: small fixes
use ternary operator to shorten the code + removed glBindTexture added by mistake
2023-01-10 12:09:38 +01:00
Martin Pulec
ff181ca757 GL: support for RG48
Can be useful for 12-bit RGB, which didn't have any appropriate pixel
format until now.
2023-01-09 16:53:21 +01:00
Martin Pulec
42e5fd03e1 moved ref_counter to separate source
It is rarely used and we don't need to spoil c++ sources using misc.h
with <optional> header.
2022-11-16 09:07:15 +01:00
Martin Pulec
c2437894fa GL: fixed irregular sized v210 display
fixed `-d gl` of `-t testcard:size=47x32:codec=v210` or `..size=48x32`

The problem was perhaps with truncation of a number slightly below
nearest integer. Result was a "broken" bar of a testcard (in midst it
was shifted by one horizontal pixel).

Quite a huge eps is needed in macOS - .49999 cut-off was not sufficient
for `size=$((48*53))x$((32*53))`.
2022-11-15 16:13:50 +01:00
Martin Pulec
5763273636 GL: improved v210 shader
- simplified comutations (n + .5) instead of (n + 1.) / 2.
- documentation
- renamed imageWidthOrig to imageWidthRaw - it was confusing because
  the originl version used size and sizeOrig, where sizeOrig is our
  imageWidth and size, which is now imageWidthRaw, was imageWidthOrig
  before
+ exit if (any) shader compilation fails and errors are treated as fatal
  (`--param errors-fatal`)
2022-11-15 16:12:45 +01:00
Martin Pulec
742b677da7 GL: fixed odd UYVY pixel width
fixed rendering `-t testcard:size=47x32:codec=UYVY`
2022-11-15 11:46:10 +01:00
Martin Pulec
0364f0253e GL: fixed displaying of R10k width % 64 != 0
R10k line is padded to 256 B (as DeckLinks requires) so widths not
divisible by 64 pixels were not displayed correctly.

Not sure if AJA holds also this convetion, it is not mentioned in docs
for NTV2_FBF_10BIT_DPX. However, SDI formats' line widths are generally
divisible by 64 pixels so it is not relevant there.

Steps to reproduce the problem were:

    uv -t testcard:size=48x32:codec=R10k -d gl
2022-11-14 16:44:16 +01:00
Martin Pulec
4b0b79678c GL: do not fail if shader compile fails
It is possible that some old card do not compile all shaders, eg. in
Windows 10 HD Graphics 3000 doesn't compile v210_to_rgb_fp.

Instead of aborting (until last commit), just disable the codec and let
video decoder to decode it to some of other supported codecs.
2022-11-11 16:39:27 +01:00
Martin Pulec
abc8fe8c94 GL dxt1_yuv: small cleanup
use commonly used GLSL sampler name + rename program
2022-11-11 16:39:26 +01:00
Martin Pulec
144b3df56a GL: fixed displaying of odd number UYVY 2022-11-11 11:26:59 +01:00
Martin Pulec
42b3fc1558 common handling of modules printing usage
Return a macro ((void *) 1) from modules returning pointer to signalize
that help was printed (for correct UG return value). This replaces the
old behavior when module class specific value (eg. &display_init_noerr)
was returned.
2022-10-12 12:05:19 +02:00
Martin Pulec
387276b304 GLFW: print error if init fails
register error calback prior to glfwInit
2022-10-11 15:04:45 +02:00
Martin Pulec
fc5f4820b4 GL: allow writting gamma=1/2.2
gamma can now be a fraction
2022-10-05 16:52:24 +02:00
Martin Pulec
cb42bd94f3 GL: set gamma after toggling fullscreen
When switching to/from fullscreen, gamma setting is not preserved (at
least for mac).
2022-10-05 16:24:25 +02:00
Martin Pulec
0c66f14cfd GL: implement timeout 2022-10-05 16:24:24 +02:00
Martin Pulec
00801fa3d4 video display: updated putf api - use timeout
Replace blocking/nonblock/discard flags with numerical timeout for
fine-grainer control of latency.

The original flags are kept as convenience macros so the API changes is
only small as long as non-block (default) or blocking is used.
2022-10-05 16:24:24 +02:00
Martin Pulec
02e52afa7b video display FPS ind.: provide name by module
Use name (MOD_NAME) provided by module rather than name given from
command-line. Those 2 may not match - in command-line it is
case-insensitive so ("gl" or even "gL" would be printed inestead of
expected "GL"). Also there may be input/output module of the same name
(eg. decklink) for which we may want to distinguish.
2022-09-27 15:52:28 +02:00
Martin Pulec
8eaa08505f Spout sender: updated to 2.007 API
no need to pass size on init
2022-09-19 09:21:06 +02:00
Martin Pulec
f7f6d9acd3 GL disp.: clear buf with new vf_clear 2022-08-25 12:17:38 +02:00
Martin Pulec
994ae371a5 GL disp.: removed some old useless code
fixed_size is no longer configured in this way
2022-08-25 11:42:48 +02:00
Martin Pulec
8c94ace22c GL disp.: added option to set gamma 2022-08-24 16:12:30 +02:00
Martin Pulec
fb18850906 GL disp.: ignore glfwInit error only if ==4
generally it perhaps shouldnt be ignored, the error 4 is just a special case
2022-08-24 16:12:18 +02:00
Martin Pulec
c052b7128e GL disp.: removed rang.hpp dependency 2022-08-24 16:12:13 +02:00
Martin Pulec
3fb5bd9188 GL disp.: sort options in help alphabetically 2022-08-24 10:00:20 +02:00
Martin Pulec
b1f0e004f4 fixed new Coverity bugs
Fixed some of (easy) newly detected Coverity bugs. Those are mostly
innocent ones (performance) and not new (detected because of new release
of Coverity).
2022-08-22 09:57:16 +02:00
Martin Pulec
a4767d0117 Revert "GL: set Cocoa color space properly"
This reverts commit 365417ac7a.

Now "patched" GLFW supports full colorspace/EOTF specification.
2022-08-19 11:44:34 +02:00
Martin Pulec
365417ac7a GL: set Cocoa color space properly 2022-08-19 11:25:01 +02:00
Martin Pulec
65557d112d get rid of rang.hpp dependency through color_out.h
Removed indirect dependency on rang.hpp through color_out.h. Now only
remaining dependencies on rang.hpp are direct.

+ fixed escape sequence for foreground magenta
2022-08-17 17:24:34 +02:00
Martin Pulec
bb91dc8567 GLFW Wayland crash workaround
Fixes a crash using Wayland GLFW version, starting fullscreen and
returning to windowed mode. It may be rather a GLFW bug.

Steps to reproduce -- start `uv -t testcard -d gl:fs` and press 'F'
(fullscreen). Needs Wayland GLFW build (as in current Arch Linux).
2022-08-15 09:30:40 +02:00
Martin Pulec
6e793ba8e1 GL disp.: refresh rate deduction to separate func
This task is a bit complex so it is pointless to do it multiple times.
Also it was very hard to comprehend as used as one-liner in determined
branch.
2022-08-15 09:02:25 +02:00
Martin Pulec
fcd2522822 moved OPTIMIZED_FOR to utils/macros.h
It belongs rather there than to host.h where it was originally.
2022-08-12 12:22:22 +02:00
Martin Pulec
dc196ff55a GL: fixed R10k shifts
Rlo and Glo (shifted right) had incorrect shifts.

+ use delimiter in bit mask (readibility)
+ make all constants unsigned (already implicitly cast but to make it
  clear)
2022-08-11 17:15:51 +02:00
Martin Pulec
39338a2e50 GL: fixed swapped R/B channels in byte_swap_r10k 2022-08-10 13:45:04 +02:00
Martin Pulec
2dc9a3d214 GLFW: init module after GLFW
if glfwInit failed, module has not been unregistred
2022-08-10 08:14:00 +02:00
Martin Piatka
a1483444e5 gl: vdpau: make load frame a member func 2022-08-09 17:00:26 +02:00
Martin Piatka
29eec7f19e gl: Move vdpau functionality into separate file 2022-08-09 17:00:25 +02:00
Martin Piatka
19083593ab gl: vdpau: rename render_vdpau to vdpau_load_frame 2022-08-09 17:00:25 +02:00
Martin Piatka
0038eb5e8f gl: vdpau: check_mixer: pass state_vdpau as argument 2022-08-09 17:00:25 +02:00
Martin Pulec
c7f33901d2 GL disp.: use different data type for R10k tex
Used GL_UNSIGNED_INT_2_10_10_10_REV instead of GL_UNSIGNED_INT_10_10_10_2
for R10k texture. The later has much better performance on AMD RX 580.
2022-08-09 15:17:09 +02:00
Martin Pulec
f9c4e4af52 GL: display frame dropped message
similar to SDL2
2022-08-08 11:16:24 +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
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
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