Commit Graph

6324 Commits

Author SHA1 Message Date
Martin Pulec
92bc623fff color_out: added a C++ API
Added some basic C++ API removing the need to use rang.
2022-08-08 16:09:58 +02:00
Martin Pulec
b15ede7aec video_codec: v210, R10k add 10b to description 2022-08-08 15:08:38 +02:00
Martin Pulec
78bef43bf0 testcard_show_codec_help: color print + improvments 2022-08-08 15:08:04 +02:00
Martin Pulec
0587e5537b testcard: removed "apattern" from usage
apattern is no longer a valid configuration option (`midi` was removed so
the only apattern remains `sine`)
2022-08-08 14:38:23 +02:00
Martin Pulec
e96084d875 testcard: prefer key-val opt syntax in usage 2022-08-08 14:12:16 +02:00
Martin Pulec
f9c4e4af52 GL: display frame dropped message
similar to SDL2
2022-08-08 11:16:24 +02:00
Martin Pulec
51a91c12ba lavcd: opt to disable slice threads
Just in case it is needed, in addition to 'F' and 'S' option 'n' was
added which disables (implicitly toggled) slice threads.
2022-08-08 10:16:07 +02:00
Martin Pulec
d6dd0d9a9c lavc: fixed thread cap check for slice+frame
fixes ecd5a750 - comparison instead of bit sum is used
2022-08-08 09:39:32 +02:00
Martin Pulec
ec702d5c25 lavd: enable frame multithreading for hevc
Setting frame-based multithreading for FFmpeg internal hevc decoder
allows parallel decoding of HEVC stream generated by NVENC.

Performance evaluation shows that (interestingly) not only it doesn't
increase decoding latency but it actually reduces it. It holds for both
libx265 and NVENC (tested with `testcard:codec=R10k:pattern=gray`).

Note that the observation in previous paragraph doesn't hold for all
codecs, eg. setting frame+slice threading for FFmpeg JPEG
encoder+decoder increases latency from some 200 ms to 400 ms.

Refer to GitHub CESENT/UltraGrid discussion #241.
2022-08-05 16:11:46 +02:00
Martin Pulec
4b7515079b lavcd: print actual thread settings in verbose mode 2022-08-05 16:11:46 +02:00
Martin Pulec
89e98287b1 lavc: print codec capabilities if verbose 2022-08-05 16:11:46 +02:00
Martin Pulec
26a739dc6b testcard gray: preinit frames
Generating frames on-fly is a bit slow.
2022-08-05 16:11:46 +02:00
Martin Pulec
34eb23cb12 Added "color" capture filter and postprocess
The motivation for this filter currently is to measure compression
latency in UltraGrid, eg.:

    uv  --verbose=+timestamps --capture-filter color -t testcard:pattern=gray \
     -d dummy -p color [-c libavcodec]
2022-08-05 16:11:46 +02:00
Martin Piatka
168dee12ce CI: Update svt-av1 repo URL 2022-08-05 15:52:06 +02:00
Martin Piatka
ca0421787a keyboard_control: use getter&setter for repeat skipping 2022-08-05 13:44:35 +02:00
Martin Piatka
d395377a5d logging: debug_dump: simplify 2022-08-05 13:44:34 +02:00
Martin Piatka
60e6d00130 logging: remove old dead code 2022-08-05 13:44:34 +02:00
Martin Pulec
e1a490b334 testcard: added gray pattern 2022-08-05 09:43:22 +02:00
Martin Pulec
7670900724 testcard2: fixed stack smash 2022-08-04 16:30:53 +02:00
Martin Pulec
55f7eb3da3 fixed wrong condition in e861ed5f 2022-08-04 16:05:58 +02:00
Martin Pulec
76e6a824c9 still_image_video_pattern_generator: use vector
use vector instead of unique ptrs for still_image_video_pattern_generator and image_pattern.
2022-08-04 15:33:00 +02:00
Martin Pulec
85111a96c2 restructuralize video_pattern_generactor a bit
Currently only still image patterns are used, but it can be also
something else so factor out it to separate class.
2022-08-04 15:00:44 +02:00
Martin Pulec
b9ea5ec9a9 testcard: encapsulate frame sequence to video_pattern_generator
Get every frame from video_pattern_generator, i. e. every frame, not
only first one.

This will allow more complex pattern than just sliding over one picture.
2022-08-04 14:32:40 +02:00
Martin Pulec
53caa93976 restore old tio in crash_signal_handler
In case of crash, atexit callbacks are not called, thus terminal state
is not restored (if modified by keyboard control).
2022-08-04 14:07:46 +02:00
Martin Pulec
ecd5a7509d lavc: set_codec_thread_mode - improved behavior
Behavior described in doxygen. Changes:
- do not override user selected nr. of threads/mode if OTHER (thr=0) or
  SLICE (thr=<cpu>,type=slice) threading is supported
- do not set unsupported thread type
- do not set thread count if thread_mode=0
- allow user to select both slice and thread multithreading (slice
  remains default)
2022-08-04 14:07:46 +02:00
Martin Pulec
949c41f244 lavc: simplify compat 2022-08-04 14:07:46 +02:00
Martin Pulec
9744f2c514 lavc: use same syntax for thread spec as lavd
Instead of "no", "slice[=<num>]', "frame[=<num>]" or "<num>" use just
the "<num>[F][S]" or "no".
2022-08-04 14:07:46 +02:00
Martin Pulec
30f1d06cd5 lavd: allow both slice+frame threads
User can specify to use both frame and slice threads. Previously,
setting frame threads unset slices.
2022-08-04 14:07:45 +02:00
Martin Pulec
b78f67077d display/dump: use color_printf instead of rang 2022-08-04 14:07:45 +02:00
Martin Pulec
cb8fa0497f display/dump: removed own FPS indicator 2022-08-04 14:07:45 +02:00
Martin Pulec
2e424d50ca replaced instances of color_out with color_printf
+ reindent vidcap/file help ("where" keyword)
2022-08-04 14:07:45 +02:00
Martin Piatka
d1fbb7cb34 output buffering: Set _IONBF for stdout on WIN32 in all cases
Setting line buffering does not appear to work correctly on Powershell nor
cmd.exe and instead behaves like full buffering (lines do not appear
util flush).
2022-08-03 14:09:17 +02:00
Martin Piatka
386ea3ec16 logging: reset style only on tty 2022-08-03 13:16:03 +02:00
Martin Piatka
853015ecec logging: work around stringstream cast
The << operator for stringstream casts the result to basic_ostream
which does not have the .str() method on some compilers. (See C++ defect
report 1023).
2022-08-03 12:00:14 +02:00
Martin Piatka
c20b41dd2d color_out: simplify style resetting
The reset code seems to reset everything including boldness and colors,
so no need to reset each individually
2022-08-03 10:43:44 +02:00
Martin Piatka
e6d1a36409 color_out: output using Log_output
This makes the color functions work correctly when used together with
other log functions (will not overwrite the "Last msg repeated", etc.)
2022-08-03 10:43:43 +02:00
Martin Piatka
ddcf2bf399 logging: Add submit_raw 2022-08-03 10:43:43 +02:00
Martin Piatka
332000e4b8 logging: check if output is a terminal only once 2022-08-03 10:43:43 +02:00
Martin Piatka
c0a9db6d0f logging: reserve space in buffer 2022-08-03 10:43:42 +02:00
Martin Piatka
33c8ac5c90 logging: log_msg(): Write directly to Log_output buffer 2022-08-03 10:43:42 +02:00
Martin Piatka
04fbcddfed logging: expose styles as strings 2022-08-03 10:43:42 +02:00
Martin Piatka
c439b05887 logging: Log_out: nicer interface 2022-08-03 10:43:41 +02:00
Martin Piatka
d108c068f4 logging: Log_output: avoid using streams
Avoids an allocation and copy for timestamp
2022-08-03 10:43:41 +02:00
Martin Piatka
b4144ffa5b logging: put style reset into the msg buffer 2022-08-03 10:43:41 +02:00
Martin Piatka
241c930299 logging: Flush stream on msg repeat
Since the repeat msg does not contain a newline we need to flush the
stream to make sure it appears when stream buffering is used
2022-08-03 10:43:40 +02:00
Martin Piatka
e031547a1d logging: use mutex for repeated msg checking
The previous implementation using atomics was not entirely correct,
since the following situation could happen:

1. Thread 1 detects a msg repeat
2. Thread 2 prints a message before thread 1 could print repeat notice
3. Thread 1 outputs "last msg repeated" for the msg from step 1

The stdout stream uses locking internaly anyway, so this should not have
any significant overhead. On the other hand this simplifies the code,
eliminates an allocation and fixes the leak on exit.
2022-08-03 10:43:40 +02:00
Martin Piatka
65d7cf69b8 logging: Split timestamp and repeat functionality into its own class
This will eventually allow better integration with other formatting
functions like color_out, color_printf
2022-08-03 10:41:14 +02:00
Martin Piatka
44294ef0c6 logging: Logger: set color&style in constructor 2022-08-03 10:13:31 +02:00
Martin Pulec
ec20f7877c logger: trigger flush on repeated messages
When the output is line-buffered, the repeated message isn't immediately
printed.
2022-08-03 09:51:07 +02:00
Martin Pulec
d2c5ca065d fixed vc_copylineRGBAtoUYVY
- the required space for intermediate result was actually 2x larger than
  dst buffer could provide
+ make arguments of vc_copylineRGBAtoUYVY restrict again -- no longer
  used in situ, thus it can be restricted again
2022-08-02 15:03:55 +02:00