Commit Graph

7227 Commits

Author SHA1 Message Date
Martin Pulec
9e1df595e1 fixed a crash when R10k % 64 != 0
fixed crashing:

    uv -t testcard:codec=R10k:size=3600x2160 -d dummy -c \
        libavcode:encoder=libx265:disable_intra_refresh --param \
        force-lavd-decoder=hevc_qsv,decoder-use-codec=R10k

The problem was that 3600 width rounds up to 3648 pixel for which there
was not allocated enough space (even with MAX_PADDING, which doesn't
protect against such cases).

vc_get_size() should be used instead of vc_get_linesize in all this
cases.
2023-01-31 12:23:56 +01:00
Martin Pulec
144fa13ff4 lavd: added hevc_qsv intra refresh hint
hevc_qsv supposedly doesn't support intra refresh decode as encoded by
libx265 so print a hint if decode keeps failing.
2023-01-31 11:01:50 +01:00
Martin Pulec
131e9387d9 added vc_copylineY416toRGB/A 2023-01-31 09:01:31 +01:00
Martin Pulec
bb8933d0b9 added vc_copylineY416toR10k 2023-01-31 09:01:29 +01:00
Martin Pulec
463b4b2199 added vc_copylineY416toR12L 2023-01-31 08:45:40 +01:00
Martin Pulec
4aa6264471 video_codec: fixes 2023-01-31 08:30:35 +01:00
Martin Pulec
bdc0d9ca85 lavc: don't attempt swscale if requested pixfmt fails
Do not attempt to initialize swscale if user requests some intermediate
format explicitly with `--param lavd-use-codec`. This is perhaps not
intended behavior.
2023-01-30 16:11:46 +01:00
Martin Pulec
c87e9a335e lavd: allow AV and UV conversions
Allow to use AV conversion and consequently UG pixfmt conversion.

This should avoid using falling back to swscale conversion in most of
the cases. Moreover, it can be not only a fallback behavior but also a
generailzation reducing the need to write AV conversion to plenty of UG
pixfmts.
2023-01-30 16:11:44 +01:00
Martin Pulec
7182448bba video decoder: do not print first jitter warning
When inter-frame format decoding starts, there may be the initial burst
that doesn't actually mean anything (at least from the point of this
warning message).
2023-01-30 16:09:23 +01:00
Martin Pulec
d374a52f3d testcard blank: accept 0xFFFFFFFF pattern 2023-01-30 16:09:23 +01:00
Martin Pulec
55042c3372 SDL1: implemented 16-bit framebuffer (eg. libcaca) 2023-01-30 16:09:22 +01:00
Martin Pulec
596703395b av_to_uv_conversions: do not NULL terminate 2023-01-30 16:09:16 +01:00
Martin Pulec
787c03abd5 removed av_to_uv_conversion::native 2023-01-30 14:53:20 +01:00
Martin Pulec
c3bd845ef8 pick_av_convertible_to_ug: rewritten
Default to UG-mapped pixel formats if there are decoder. If not, pick
any conversion (but without respect to "native" attribute now).
2023-01-30 14:53:20 +01:00
Martin Pulec
44e3a17d48 pick_av_convertible_to_ug: consider mapped formats
If UG pixel format happens to be eg. UYVY, swscale could convert
directly to that.
2023-01-30 14:53:20 +01:00
Martin Pulec
189eb74093 from_lavc_vid_conv: avoid av_to_uv_conversions::native
Do not use av_to_uv_conversions::native to select best ultragrid codec_t
matching AVPixelFormat.

This will allow deploy policies (to keep color space or bit depth) and
doesn't require developer to pick one <codec_t,AVPixelFormat> pair as
"privileged".
2023-01-30 14:53:20 +01:00
Martin Pulec
f7009a7316 lavc: AVPixelFormat subs. getter to lavc_common
Renamed get_subsampling to av_pixfmt_get_subsampling (the former
overloaded the function for codec_t) and moved to lavc_common.
2023-01-30 14:53:19 +01:00
Martin Pulec
a22ae3e6b0 don't wrap av_to_uv_conversions with function
The structure is no longer part of the API and the indirection is
unneeded. On the other hand, its size could not have been possible to
query.

+ use enum AVPixelFormat in the struct instead of int
+ removed unneeded headers from module header
2023-01-30 14:53:19 +01:00
Martin Pulec
f42ad235e2 from_lavc_vid_conv: enable mapped+uv conversion 2023-01-30 14:53:19 +01:00
Martin Pulec
95549473ac lavd: moved memcpy handling 2023-01-30 14:53:19 +01:00
Martin Pulec
037d6bef64 fixed tests
broken by API change from last commit
2023-01-30 14:53:19 +01:00
Martin Pulec
6a91191404 lavd: make av_to_uv conversion stateful
This will allow the conversion more possiblities (eg. conversion with
additional UltraGrid pixfmt conversion) while keeping the abstraction.
2023-01-30 14:53:19 +01:00
Martin Pulec
6ef1350f1d lavd: hide api of av->ug conversions 2023-01-30 14:53:19 +01:00
Martin Pulec
c7c1d5b17a lavd: small simplification 2023-01-30 14:53:19 +01:00
Martin Piatka
f9bd80bec1 capabilities: factor module probing into a function 2023-01-30 12:41:13 +01:00
Martin Piatka
1bcfbd38f2 audio_playback: Use the unified probe API 2023-01-30 12:41:13 +01:00
Martin Piatka
4e5d329803 audio_capture: Use the unified probe API 2023-01-30 12:41:13 +01:00
Martin Piatka
2eba74f59d video_display: Use the unified probe typedef 2023-01-30 12:41:12 +01:00
Martin Piatka
0920845462 video_capture: New probe API 2023-01-30 12:41:12 +01:00
Martin Piatka
cd6e2dbbf3 capabilities: Added "noprobe" option 2023-01-30 12:41:12 +01:00
Martin Piatka
f0cb8374bd swmix: Fix trimming trailing space
The previous implementation could corrupt memory before the string
buffer, if the string contained only whitespace or was empty.
2023-01-27 14:14:50 +01:00
Martin Pulec
2afb243491 added xv30_to_v210, xv30_to_y416 2023-01-26 11:22:20 +01:00
Martin Pulec
b9ece76554 added xv30_to_uyvy 2023-01-26 10:42:08 +01:00
Martin Pulec
3da459da95 decoder: print hint to use blocking decoding 2023-01-26 10:42:05 +01:00
Martin Pulec
d6aaf6a6c3 create-appimage.sh: add --fail as curl opt 2023-01-25 16:25:53 +01:00
Martin Pulec
5733659d60 lavd: fixed directly mapped pixfmts memcpy
it should respect AVFrame set linesize
2023-01-25 16:25:53 +01:00
Martin Pulec
1b4bfb206c lavc: XV36 is Y416 2023-01-25 16:25:53 +01:00
Martin Pulec
4336daba4d dummy disp.: warn on useless option
Some options make sense only if using also ":dump" so warn in such a
case.
2023-01-25 16:25:53 +01:00
Martin Pulec
c6f1df9bf0 lavd: print selected pixfmt as INFO
Decoder may attempt first pixelformat (eg. nv12) that won't be used in
the end because it changes its mind to eg. p010. _But_, the display may
have been already reconfigured to v210 which would cause swscale
conversion for nv12 (but not p010), thus it would seem to be like a
problem in output because the swscale information is shown by default
but subsequent pixel format change isn't.
2023-01-25 16:25:53 +01:00
Martin Pulec
b7dac8b47a lavc: VA-API updates
1. push AV_PIX_FMT_VAAPI at the back of the preferred formats list.

   This changes HEAD~5 behavior - before that that it was always first.
   After that it was subject of sort - also sorted first but for all
   codecs, not only those named '.*vaapi.*', which is undesirable
   because currently it uses NV12 format exclusively.

   Finally, this change puts AV_PIX_FMT_VAAPI at the back of the list.
   It is not harmfull, however, because the vaapi-named codecs support
   just this pixel format. On the other hand, it may be a fallback for
   eg. hevc_qsv. In future if more SW formats are added, it could be
   ordered like other formats

2. log msg that we are using vaapi (otherwise only `Selected pixfmt: nv12`
   was displayed)

3. set frame pixfmt always to state_video_compress_libavcodec::selected_pixfmt.
   Either swscale is not performed and then selected_pixfmt is already
   AV_PIX_FMT_NV12 or if swscale is performed, its input fmt should be
   selected, anyway.
2023-01-25 16:25:52 +01:00
Martin Pulec
65d4830aec lavc: dump/transfer correct frame
Input frame may not be s->in_frame if just setting the pointers to input
buffer (without copying).
2023-01-25 09:30:17 +01:00
Martin Pulec
a9fbc06b70 added RGBA->AV_PIX_FMT_BGRA conversion 2023-01-24 16:19:17 +01:00
Martin Pulec
f7bae9fcd8 added conversions from R10k/R12L to XV30 over Y416
Added conversions from R10k/R12L to Y416 and from Y416 to XV30, mainly
to support HEVC QuickSync. Those converisons would indirectly allow
R10k/R12L->XV30 conversion.
2023-01-24 16:18:40 +01:00
Martin Pulec
be96a58f92 lavc: measure also UG pixfmt conversion duration 2023-01-24 16:18:40 +01:00
Martin Pulec
4cedc38c0d lavc: removed AVCodec from pixfmt offer
As it is written now, passing the AVCodec parameter was unneeded since
we are returning with appropriate function rather the list of all AV
pixels format that are possible to use without respect to actual codec.

Actually it was only used to check `vaapi` in codec name - this is not
needed, we can add vaapi to the list regardless to it - if the codec
doesn't support this, it just skips it.
2023-01-24 16:18:39 +01:00
Martin Pulec
4e9e2a9137 lavc: do not print blacklisted pixfmt
Fixes eg. x2rgb10le to be displayed as supported even when blacklisted:

    [lavc] Blacklisting x2rgb10le because there has been issues with this pixfmt and current encoder (hevc_qsv) , use '--param lavc-use-codec=x2rgb10le' to enforce.
    [lavc] Codec supported pixel formats: nv12 p010le p012le yuyv422 y210le qsv vaapi d3d11 bgra x2rgb10le vuyx xv30le
    [lavc] Supported pixel formats: gbrp12le rgb48le gbrp16le gbrp10le x2rgb10le rgb24 rgba gbrp bgr0 yuv444p12le yuv444p16le yuv444p10le yuv422p10le yuv420p10le

get_first_matching_pix_fmt() was slightly rewritten to use regular
iterator.
2023-01-24 16:18:39 +01:00
Martin Pulec
d3edea113f v210_to_xv30: finish non-full v210 block 2023-01-24 16:18:39 +01:00
Martin Pulec
43240edb54 fixed yuv444p1Xle_to_uyvy
shift + more correct average
2023-01-24 16:18:39 +01:00
Martin Pulec
4ae0bf8aeb lavc: small debug output fixes
- use logger
- "Usable pixel formats" -> "supported" (usable may imply that it is
  subset of pixel formats, which codec supports, but it is not)
2023-01-24 16:18:39 +01:00
Martin Piatka
d51d956817 Fix compile on older gcc
GCC on Ubuntu 18.04 doesn't seem to support the string_view overload of
std::quoted
2023-01-23 16:44:27 +01:00