Commit Graph

41 Commits

Author SHA1 Message Date
Martin Pulec
847336eac2 do not hide vdisp/multiplier
users may legitimately want to use it directly
2024-04-29 08:32:18 +02:00
Martin Pulec
a314ec79ea disp/multiplier: do not return with abort 2024-02-02 14:25:04 +01:00
Martin Pulec
458aa0bdaa disp/multiplier: simplify - cannot receive multiple sources 2024-02-02 14:24:55 +01: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
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
a3daa89ef6 displays: changed api for mainloop
- removed `needs_mainloop` attribute and deduce if mainloop is needed
  from the presence of _run callback (the information is now redundant
  only displays needing/running mainloop should announce _run callback)

- run the custom mainloop (currently only Syphon!) only when display
  doesn't run its mainloop. This allows running Syphon and GL/SDL
  display because it connects to the display mainloop.
2023-03-29 13:39:48 +02:00
Martin Piatka
c33c39da10 multiplier disp: Pass reconfigure to all displays
Fixes crash when used with the vulkan display.
2022-12-01 10:49:52 +01:00
Martin Piatka
7cb9771962 Move tokenize and sv_parse_num into string_view_utils 2022-11-10 12:04:41 +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
cfc2bdca53 displays: if timeout > 0, act as nonblocking
For displays not implementing timeout, take timeout > 0 as nonblocking.
2022-10-05 16:24:25 +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
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
ae9ac7da07 video_display: added optional generic indicator 2022-06-30 16:41:40 +02:00
Martin Pulec
6e9e96b63d multiplier: no fail if mainloop display not first
Do not fail when display requiring mainloop is not first. On Linux,
although eg. GL declares the need to be run from mainloop (GLFW-induced
constraint), it runs fine also without it. Thus print only and error
and don't fail.
2022-06-01 11:22:01 +02:00
Martin Pulec
6729a8a1ad audio: use const audio_frame 2022-05-25 17:09:42 +02:00
Martin Piatka
a1c57f2511 display/multiplier: simplify config parsing 2022-04-26 15:55:22 +02:00
Martin Piatka
196d5db590 display/multiplier: use smart pointer for state creation 2022-04-26 15:55:21 +02:00
Martin Piatka
a779d9bdc7 video_display: Split display_run() into blocking and non-blocking ver 2022-02-21 13:22:36 +01:00
Martin Piatka
b0f065640c multiplier disp: move check to assert
Displays should never be empty anyway - init abort()s on display init
failure and prints help if no display is specified
2022-02-18 15:37:08 +01:00
Martin Piatka
4a8e1ca33c multiplier disp: simplify destruction 2022-02-18 15:37:08 +01:00
Martin Piatka
dcb7e6d772 multiplier disp: Fix segfault on display_done
If a display does not need the mainloop, display_run() just spawns a new
thread and immediately returns. This means that the 'disp_thread' thread
isn't the actual display thread and finishes far sooner than the display.
As a result, display_done() was called while the display was still running.
2022-02-18 15:36:10 +01:00
Martin Pulec
1b3b27eb7c Updated copyright dates for modified files 2021-11-08 15:43:14 +01:00
Martin Piatka
eab94c12c0 Remove some unused includes
Removes some unused includes reported by include-what-you-use
2021-06-08 15:22:25 +02:00
Martin Pulec
96ed004707 Multiplier: pass audio to 1st display 2020-12-07 18:03:28 +01:00
Martin Pulec
69a6c7ca0f Hide internal/helper displays from cmdline listing 2020-09-21 14:34:02 +02:00
Martin Pulec
199f5c65cd Multiplier: small improvments 2020-09-15 11:28:19 +02:00
Martin Pulec
3b26787b1a Aggregate, multiplier: fixed invalid NULL passed
Caused crash for displays that didn't expect NULL (eg. NDI).
2020-09-15 10:00:13 +02:00
Martin Pulec
15df3f7268 Video display: get_property->ctl_property
Renamed display_get_property to display_ctl_property to indicate that
the function can be used as a setter as well.
2020-08-28 15:10:28 +02:00
Martin Pulec
508524bdc2 Multiplier: fixes needs_mainloop
* return error if some of displays needs mainloop but is not given as the
  first one
* return the need according to the first display given
2020-07-22 15:45:12 +02:00
Martin Pulec
6651695c1e Video display: added needs_mainloop callback
This allows more fine-grained evaluation if the display really needs to
be run in the main thread or not (eg. for multiplier)
2020-07-22 15:45:10 +02:00
Martin Pulec
31d80b34b9 Video display: run mainloop only if needed
Do not run the display worker in the main thread if not needed.

This would allow to run a custom mainloop (eg. from Syphon) while being able
to run a display that doesn't need to be run in the main thread.
2020-04-14 10:52:54 +02:00
Martin Pulec
4c71573a89 Fixed first series of Coverity bugs 2019-11-09 17:20:37 +01:00
Martin Pulec
b9b80fae91 Fixed few warnings (and small errror in NDI) 2019-07-24 10:57:06 +02:00
Martin Piatka
25e6f31662 video_display_info: probe: pass function ptr to deleter func 2019-03-15 13:00:59 +01:00
Martin Pulec
0649ef14d4 macOS: re-allow GL/SDL
GL/SDL display is now run from a main-thread to work properly.
2018-11-13 15:13:21 +01:00
Milos Liska
2b734abd25 -d multiplier:help should parse the help param explicitely and display
the help message.
2017-12-18 14:29:04 +01:00
Martin Piatka
ad0ac256b3 Fix memory leak 2017-11-22 11:18:56 +01:00
Martin Piatka
95bec4a9a4 Add help 2017-10-20 11:23:57 +02:00
Martin Piatka
22e836d957 More work - kind of working now 2017-10-19 11:37:40 +02:00
Martin Piatka
3ceb2d0237 Start work on multiplier display 2017-10-18 11:50:36 +02:00