Commit Graph

6931 Commits

Author SHA1 Message Date
Martin Pulec
671b188013 change_pixfmt: added buffer padding
Pixelformat conversion suppose buffers with additional padding to handle
"odd" resolutions that doesn't match the pixfmt native block
size. Eg. this change fixes:
```
uv -t testcard:codec=R12L:size=1922x1080 -d gl -p change_pixfmt:RG48
```
2024-08-30 15:49:05 +02:00
Martin Pulec
3adb9a46cc vcomp/cmpto_j2k: do not set convertFunc
Needless because it is directly deduced from the src and dst
codec. Currently always R12L->RG48.
2024-08-30 15:49:05 +02:00
Martin Pulec
af5d5841d0 vcomp/cmpto_j2k: fixed misleading comments
Actually the pool properties is precompress_desc, saved_desc is used
in usual sense to check whether the properties were changed from last
(re)configuratio.
2024-08-30 15:49:05 +02:00
Martin Pulec
c2cebd3198 vcomp/cmpto_j2k: do R12L to RG48 conv in parallel
CPU only as for now
2024-08-30 15:49:05 +02:00
Martin Pulec
4061f8d0f2 vcomp/cmpto_j2k: fixed setting cuda_device!=0 2024-08-30 15:49:05 +02:00
Martin Pulec
ca71f59b9c vcomp/cmpto_j2k: disable CUDA buffers with |GPU|>1
Disable copying to CUDA buffers if there is more CUDA devices configured,
it does cause the following error:
```
[J2K enc.] Setting image samples: Cannot configure input samples in CUDA
buffer because argument 'device_id' doesn't match the configured CUDA
device in encoder. Single CUDA encoder must be configured.
```
2024-08-30 15:49:04 +02:00
Martin Pulec
c2e7811152 vcomp/cmpto_j2k: copy directly to device memory
If convert function is not used, copy the data directly to GPU memory
instead of duplicating with memcpy. CUDA support must also be enabled
for this to work.
2024-08-30 15:49:04 +02:00
Martin Pulec
779021b804 vcomp/cmpto_j2k: if enque fails, return frm to pool
see also the commit 95773727 for similar change for the dec
2024-08-30 15:49:04 +02:00
Martin Pulec
bda593c85b vcap/cmpto_j2k + video_frame_pool rework
use pimpl for video_frame_pool

use implicit constructor for vcomp/cmpto_j2k to allow switching of pools
2024-08-30 15:49:04 +02:00
Martin Pulec
c2448bc613 vcomp/cmpto_j2k: free with cudaFreeHost
The pointer is allocated with cudaMallocHost so it should be freed
with cudaFreeHost.
2024-08-30 15:49:04 +02:00
Martin Pulec
904c2bb4f2 added debug CUDA kernel duration measureent
to measure the duration of the newly created kernel for ->R12L kernel

It is actually 1.6 ms for 1920x1080 picture on GeForce GTX TITAN, which
seems to be more or less OK for now (it could be perhaps optimzed but
doesn't seem to be a blocker for now).
2024-08-28 13:29:49 +02:00
Martin Pulec
4f3add780d vdec/cmpto_j2k: use kernel for ->R12L conversion
refers to GH-406
2024-08-28 13:29:36 +02:00
Martin Pulec
3e988715bf vdisp: fixed restrict_returned_codecs
Rewritten restrict_returned_codecs to respect eventual pixfmt change by
the postprocessor (as with change_pixfmt).

Originally the set intersection of codecs accepted for vo_postprocess
and display was used, which is unsuitable when the vo_postprocess changes
the format. Now the postprocessor is queried for the output format instead,
which is then compared with display list of supported codecs.
2024-08-28 08:23:13 +02:00
Martin Pulec
57eb2f52e1 vo_postprocess: additional asserts
+ includes
2024-08-28 08:23:07 +02:00
Martin Pulec
973e3b9413 vo_postprocess: fixed state passing for get_prop
wrong state was passed
2024-08-27 10:47:48 +02:00
Martin Pulec
46b8c2f4f5 capture_filter_wrapper: assert state magic
there seem to be some problem passing the correct state
2024-08-27 10:46:10 +02:00
Martin Pulec
493033ee53 change_pixfmt: fixed including 2024-08-27 10:36:38 +02:00
Martin Pulec
2ec634bbfa added magic to change_pixfmt and cf/vo_pp wrap. 2024-08-27 10:31:04 +02:00
Martin Pulec
4b12d3c376 vo_pp/change_pixfmt.c: report convertible codecs
Properly report codecs that we can accept on input. If not reported,
the display native codecs were reported, which is not correct in general
(although may work in some cases).
2024-08-27 10:29:11 +02:00
Martin Pulec
d65df35c8f vo_postprocess_cf_wrapper: get_property callback
Allow setting the get_property callback that can be specified for
vo_postproess filters. This is optional for the wrapper - if set to
nullptr, false will be always returned as until now.
2024-08-27 09:38:03 +02:00
Martin Pulec
fa93411f15 vdec/cmpto_j2k: convert to R12L in parallel
refers to GH-406
2024-08-26 16:04:47 +02:00
Martin Pulec
9577372760 vcomp/cmpto_j2k: if enc fails, free data
We need to release the resources if encode fails - otherwise eg. the
pool will get exhausted because it has a limited capacity.

+ print enc image failure whether was in push or pop
2024-08-26 15:16:47 +02:00
Martin Pulec
9304717149 vdec/cmpto_j2k: include-what-you-use 2024-08-26 11:06:12 +02:00
Martin Piatka
efd502a92e decklink: Fix device id in capabilities 2024-08-19 16:13:22 +02:00
Martin Piatka
4682cf6506 main: Allow multiple --capture-filter options 2024-08-19 14:38:12 +02:00
Martin Piatka
cdc6d59307 disp/decklink: Add GUI option for HDR 2024-08-19 13:49:04 +02:00
Martin Pulec
922fe47fc9 check for unexpected exit
Ensure that some code/library doesn't call delilberately exit(). If so,
write an error msg to warn about it.

refer to GH-402
2024-08-16 16:32:54 +02:00
Martin Pulec
7995b18255 print_stacktrace_win: print stack ptr addr
possibly useful sometimes (?)
2024-08-16 16:15:13 +02:00
Martin Pulec
0092d0cc3a windows: print stacktrace in crash handler
added print_stacktrace_win

similarly to other platforms
2024-08-16 16:05:05 +02:00
Martin Pulec
6fdee3e08f vcap/dshow: improved new-lines in help
- avoid extra NL for even number of modes
- print NL before Mode flags for shorthelp (otherwise it will be just
after last device in the short mode)
2024-08-16 15:46:05 +02:00
Martin Pulec
8f2239374f vcap/dshow: allow shorthelp
prints devices without modes
2024-08-16 15:46:00 +02:00
Martin Pulec
f53204dd3c audio/utils: use static_assert for endianness
Use static_assert to ensure little endian instead of the preprocessor
checks - if the those macros are not defined by the compiler, the check
will be eliminated. If other complier is used, write this more
generically.
2024-08-14 15:37:22 +02:00
Martin Pulec
50812bba34 replacing PACKAGE_BUGREPORT with bug_msg
Where the PACKAGE_BUGREPORT is the only used item from config.h,
use bug_msg(), which can be then removed.

Improved bug_msg() to allow printf-like fomat + arguments.
2024-08-14 15:26:12 +02:00
Martin Pulec
e154dfa294 rxrx/sdp: print URL only once + when no autorun
- print the direct RTP stream URLs only once (== do not repeat with
every printed address)
- print only if autorun was not specifiec
- take the IP version from the state
2024-08-14 11:28:11 +02:00
Martin Pulec
2535d66f25 rxtx/sdp: direct play url again print
Since the rtpmap line is now generated also for static packet types,
the condition must have been updated to check the packet type rather
than the presence of rtpmap line.
2024-08-14 11:28:11 +02:00
Martin Pulec
781ac7689b rxrx/sdp: set actual audio specs
Instead of deducing from audio parameters, defer the creation until we
receive some audio data.

This complements identical change for RTSP in the commit 41b038862
(2024-08-13).
2024-08-14 11:28:11 +02:00
Martin Pulec
77deb0f1c0 h264_sdp, utils/sdp: improved including 2024-08-14 11:28:11 +02:00
Martin Pulec
c41e7f8a47 vcomp/lavc: check MJPEG params validity
MJPEG does produce wrong JPEGs[^1] if either slices or threads == 1 and
the other not (until now also the implicit case, because the values
are auto-adjusted).

So if either is 1, auto-set the other value to 1 as well. If both are
set and either is 1 and the other not, issue at least a warning.

[^1]: for the s=1 && t>1, FFmpeg own decoder is capable to decode,
but the bitstream is definitely wrong - instead of RST markers there
are EOI markers.
2024-08-14 11:28:11 +02:00
Martin Pulec
ea66f734e6 fixed CIDs 467079 and 467173
fixed some Coverity issues - actually no important, just complains about
uninitialized class members, that are, however, to be initialized later
2024-08-14 11:28:11 +02:00
Martin Pulec
b1d5309a81 vcf/logo: CID 467080 fix
Fixed the Coverity complaint by keeping the behavior of "doing nothing" with
the frame while passing it unchanged. It may also return nothing, as it was
doing for the short time - this seems to be inferior in cases when the input
changes from supported to unsupported, this would cut-off the picture eniterely,
not just the logo.
2024-08-14 11:28:11 +02:00
Martin Pulec
4a2b934759 av_to_uv_log: write more clearly 2024-08-14 11:28:09 +02:00
Martin Pulec
6a86eb89b0 lavc_common: simplify logging setting
1. do not call av_log_set_level if using custom callback - seemingly not
used for custom callbacks
2. simplify lavc-log-level (rename from lavcd-...) and keep it only for FFmpeg
values only (+ use FFmpeg default logger)

As indicated by the point 1, it didn't perhaps even work unless the
'D' suffix (now removed) was added to the param because the value set
was not used by the custom callback but default (UG global) log_msg was
used instead.
2024-08-14 11:15:52 +02:00
Martin Pulec
c6a1714b0d host.cpp: improved including 2024-08-14 11:15:42 +02:00
Martin Pulec
220e8b4744 replace BUG_MSG with bug_msg() fn
used just in DirectShowGrabber
2024-08-14 10:42:01 +02:00
Martin Pulec
58e0ac7c2c add opt -DCUDA_DEVICE_RESET for explicit cuda reset
Needed for `cuda-memcheck --leak-check full` to really detect leaks.
2024-08-14 10:41:33 +02:00
Martin Pulec
5f90324328 tx: pass parent in common_opts 2024-08-13 12:59:51 +02:00
Martin Pulec
46c18c9be9 workaround to a buggy GPUJPEG 2024-08-09 11:26:16 +02:00
Martin Pulec
4143900605 export: crash if nullptr passed
The export module is now intended to be initialized always, although
not exporting at that moment, so assert the state presence for
export_audio/export_video.
2024-08-09 09:31:38 +02:00
Martin Pulec
b0704afb8e utils/sdp: do not repeat a condition 2024-08-09 09:23:01 +02:00
Martin Pulec
544b641391 vrxtx/sdp: do not print warning
suppress:
```
 [vrxtx] video RXTX not h264_rtp, not setting audio...
```
2024-08-09 09:23:00 +02:00