Commit Graph

978 Commits

Author SHA1 Message Date
Romain Vimont c344522ff2 opengl: init textures properties from modules
All interop modules reused the util function opengl_interop_init()
(written for the software interop) to initialize the textures properties
from the chroma.

However, the actual texture format may not always be deduced from the
chroma: only the interop implementations have the full knowledge of the
texture details.

Therefore, initialize texture properties directly from each interop
implementation.

Fixes #26735
Fixes #26769
2022-04-15 08:43:55 +00:00
Rémi Denis-Courmont 6d8cccee3c vdpau/display: drain the event queue
This adds the vlc_xcb_Manage() call to match the behaviour of the other
XCB-based displays.
2022-04-13 16:16:02 +00:00
Rémi Denis-Courmont 1096398108 xcb/events: do not require a vout display 2022-04-13 16:16:02 +00:00
Steve Lhomme 6d8a6416ae nvdec: get the output pitch without mapping a null frame 2022-04-13 14:30:53 +00:00
Steve Lhomme 44c37b182f nvdec: don't depend on p_sys for CALL_CUDA_DEC() 2022-04-13 14:30:53 +00:00
Steve Lhomme cef1adb34d nvdec: decide the number of decoder pictures later
Once the sequence is fully parsed we can tell the profile. The return value of
HandleVideoSequence() is how many pictures the decoder should use internally.
p_format->min_num_decode_surfaces contains the minimum for that value.
2022-04-13 14:30:53 +00:00
Steve Lhomme 75d719f0cd nvdec: always log issues in CUDA/nvdec calls 2022-04-13 14:30:53 +00:00
Steve Lhomme 2d0f393d06 nvdec: rename nvdec_pool to hw_pool
We may also move it in the core.
2022-04-13 14:30:53 +00:00
Steve Lhomme 7c5cc30bc3 hw:d3d11: check the unlikely failure of using a shared texture 2022-04-06 07:25:36 +00:00
Steve Lhomme 50404ced25 mmal: remove unused picture pool code
pic_pool is always NULL
2022-03-23 19:42:26 +00:00
Steve Lhomme 7582609a7c nvdec: remove unused includes 2022-03-23 19:42:26 +00:00
Steve Lhomme 89a3ca6f46 hw: d3d11: compile with LIBCOMCXXFLAGS
It's using WRL.
2022-03-17 14:31:11 +00:00
Steve Lhomme 73895883a7 hw:d3d11: add a filter to turn D3D11 block into a picture 2022-03-10 22:17:51 +00:00
Steve Lhomme 90ac4d167c d3d11_fmt: allow creating pictures with shared texture
This is useful when textures come from a different Adapter/GPU or the bogus
access with GPU output.
2022-03-10 22:17:51 +00:00
Rémi Denis-Courmont ca13fe633e d3d11: remove unused configuration item 2022-02-08 10:50:38 +00:00
Rémi Denis-Courmont 1ba7ee2d25 d3d11: remove write-only field 2022-02-08 10:50:38 +00:00
Rémi Denis-Courmont f8cc28ca8b d3d11: remove no-op variable callback
The registered callback does nothing with the given variable name.
2022-02-08 10:50:38 +00:00
Rémi Denis-Courmont 5ce987e564 d3d9: remove unused configuration item 2022-02-08 10:50:38 +00:00
Rémi Denis-Courmont 9416bd118d d3d9: remove no-op variable callback
The registered callback does nothing with the given variable name.
2022-02-08 10:50:38 +00:00
Lyndon Brown 40cb631dcd add "too technical" to translate note to some plugin text
per discussion in !90, these strings were considered "too technical"
and/or advanced to want translations for, at the risk of ending up with
poor translations.

it is hoped that by adding these comments, it will avoid such unwanted
translation being resubmitted by anyone later.
2022-01-29 07:56:05 +00:00
Alexandre Janniaux 5a010800c4 opengl: interop: unify type signatures
We don't depend on OpenGL types for the signature anymore.
2022-01-23 19:13:10 +00:00
Alexandre Janniaux fc2e04da87 nvdec_gl: load OpenGL function from GL
This removes the dependency from the vtable in vlc_gl_api_t.
2022-01-23 19:13:10 +00:00
Pierre Lamot f850dd9155 vdpau: fix segv when VDPAU uses VAAPI
The Close function was called with an uninitialized structure
2022-01-19 13:49:49 +00:00
Rémi Denis-Courmont 647bafc3b9 vdpau: identify the driver only once 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 4913808e80 vdpau: don't initialise Xlib twice
By the time we got to this piece of code, this had already been taken
care of by the decoder device.
2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 46130b4f41 vdpau: remove dead code 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont fae5234d2f vdpau: add working decoder device module (fixes #26385)
This associates the correct X11 screen and does not depend on GL for no
particular reasons.
2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont aebb631421 vdpau: remove the instance reference count
This was necessary for sharing and for vlc_hold_x11(), but they were
both removed.

Note that the list is still used to match a display to an instance, so
it cannot be removed quite yet.
2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 98632a966f vdpau: remove in-process instance sharing
Originally, both the decoder and the video output would instantiate
VDPAU devices on their own. The process-global list was necessary to
force paired decoder and output to use the same VDPAU instance: they
were matched by server name and screen number.

Now that all components in a given pipeline obtain the VDPAU instance
from a shared decoder device, this trick is no longer necessary.

Incidentally, VDPAU instances would also harmlessly but nevertheless
unnecessarily be shared between independent pipelines within the same
process using the same X11 screen. We can ignore this.
2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 5c8b143662 vdpau: remove dead code 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 4b464e8d7f vdpau: output surfaces hold context rather than instance 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 739d7a4630 vdpau: pass video context to allocate output surfaces 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 7ba2e95011 vdpau: remove redundant instance from frame structure 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 7c097becf1 vdpau: frames need not hold the instance
Frames (video surfaces) are always held by one of more fields. Fields
already hold the video context, which holds the decoder device, which
holds the instance.

So frames can rely on any one of their referencing fields to hold the
video context.
2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 29f94a7174 vdpau: remove dead code 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 7c27f01ba8 vdpau: hold the video context while cloning a picture context 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 4fa9fbc355 vdpau: really reference the context from fields
Video surfaces in the VA pool do not really need to reference the video
context of their own as they cannot outlive the VA, which already
references the video context.

But referencing the context anyway is cleaner and allows for further
simplifications.
2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 81c602dfe4 vdpau: remove dead code 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 04a580f1ab vdpau: move surface pool back to VA
Surfaces logically reference their device (i.e. the video context).
So long as they are stored in the video context, a cycle of
cross-references leads to an enormous memory leak.
2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont cd341e3c4f vdpau: hold video context when creating a field 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 724a978ba8 vdpau: allocate picture contexts from video context 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 86e2881d63 vdpau/chroma: keep the device context directly 2022-01-13 10:02:51 +00:00
Rémi Denis-Courmont 743929f457 vdpau: name and document the device context 2022-01-13 10:02:51 +00:00
Alexandre Janniaux 6b7a57f984 modules: fix typos
Typos found and reworked from codespell.
2022-01-08 15:19:32 +00:00
Lyndon Brown 105d81cc33 vaapi_filter: fix wrong upper bound for --denoise-sigma range
and remove the range from the labels, which is unnecessary.
2022-01-06 06:53:50 +00:00
Francois Cartegnie a0c259ea0a hxxx_helper: simplify extradata getters 2022-01-05 10:40:01 +00:00
Francois Cartegnie b89e4fc13d hxxx_helper: replace config_changed with getter 2022-01-05 10:40:01 +00:00
Francois Cartegnie 0e3f3d5d6f hxxx_helper: replace ambigous xvcC/AnnexB parameter 2022-01-05 10:40:01 +00:00
Francois Cartegnie 926bf50440 codec: nvdec: fix extradata leak 2022-01-05 10:40:01 +00:00
Francois Cartegnie 7c7516d578 hxxx_helper: remove direct calls to process_block 2022-01-05 10:40:01 +00:00
Lyndon Brown 6f68f89498 plugins: purge use of set_category()
see e967f81f6a.

note, this does **not** affect cat-based module selection items
(of which there are just three in use by the core), since that
mechanism uses subcats not cats.
2021-12-20 09:45:01 +00:00
Alexandre Janniaux 2dfb7d8418 nvdec: fix multiple call to cuInit
Each cuInit is leaking memory, and cuInit is supposed to be called only
once. Ensure it through a vlc_once_t wrapper, but since the function
table needs to be loaded in order to call into cuda functions, forward
some available device for the initialization.

Below, there is two leaks because of the double decoder device
allocation in debug mode. The first leak is leaked once, and is still
there. The second and third leaks are now reduced to a single one.

Direct leak of 65536 byte(s) in 1 object(s) allocated from:
    #0 0x7febb6bf3652 in __interceptor_realloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:164
    #1 0x7feb8b56828f  (<unknown module>)

Direct leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x7febb6bf3459 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7feb89dc586a  (/home/alexandre/workspace/videolabs/vlc-meson/build-native/modules/.libs/libskins2_plugin.so+0x2f1086a)
    #2 0x7febb5f195c1 in decoder_device_Open ../../src/input/decoder_helpers.c:174
    #3 0x7febb5e67106 in vlc_module_load ../../src/modules/modules.c:243
    #4 0x7febb5f196e8 in vlc_decoder_device_Create ../../src/input/decoder_helpers.c:188
    #5 0x7febb60a7435 in vout_GetDevice ../../src/video_output/video_output.c:2244
    #6 0x7febb5ef7f26 in ModuleThread_GetDecoderDevice ../../src/input/decoder.c:608
    #7 0x7feba02ee139 in decoder_GetDecoderDevice ../../include/vlc_codec.h:304
    #8 0x7feba02fb51e in lavc_UpdateVideoFormat ../../modules/codec/avcodec/video.c:286
    #9 0x7feba0313ff7 in ffmpeg_GetFormat ../../modules/codec/avcodec/video.c:1682
    #10 0x7feb9f0bfe12  (/usr/lib/libavcodec.so.58+0x29ae12)

Direct leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x7febb6bf3459 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7feb8b5d386a  (<unknown module>)
    #2 0x7febb5f195c1 in decoder_device_Open ../../src/input/decoder_helpers.c:174
    #3 0x7febb5e67106 in vlc_module_load ../../src/modules/modules.c:243
    #4 0x7febb5f196e8 in vlc_decoder_device_Create ../../src/input/decoder_helpers.c:188
    #5 0x7febb60a7435 in vout_GetDevice ../../src/video_output/video_output.c:2244
    #6 0x7febb5ef7f26 in ModuleThread_GetDecoderDevice ../../src/input/decoder.c:608
    #7 0x7feba02ee139 in decoder_GetDecoderDevice ../../include/vlc_codec.h:304
    #8 0x7feba02fb51e in lavc_UpdateVideoFormat ../../modules/codec/avcodec/video.c:286
    #9 0x7feba0313ff7 in ffmpeg_GetFormat ../../modules/codec/avcodec/video.c:1682
    #10 0x7feb9f0bfe12  (/usr/lib/libavcodec.so.58+0x29ae12)
2021-11-21 18:58:55 +00:00
Steve Lhomme e99f23d50f win32: don't get the COM interface pointers directly
We can't really use an interface** where a void** is expected, that's a
cast/aliasing violation, even though that's what Windows and mingw64 API's do
as well.

We use an interim void* variable that receives the pointer and then set it on
the proper variable with the given type.

Fixes #26083
2021-11-17 17:31:34 +00:00
Steve Lhomme 0af664b02d vdpau/chroma: always use the history
No need to skip it with "forced" pictures otherwise the filter is no applied.
2021-09-18 16:30:20 +00:00
Steve Lhomme 3c829a4758 vdpau/chroma: copy the b_still status of the source picture 2021-09-18 16:30:20 +00:00
Steve Lhomme de1bdfd4fb vdpau/chroma: remove always false condition
sys->history[MAX_PAST + MAX_FUTURE] is set a few lines above and can't be NULL
otherwise it would crash on the src->context check above.

It can't be NULL since at least 47c9655e19.
2021-09-18 16:30:20 +00:00
Steve Lhomme e1c7694d75 d3d11: query the driver version using Windows Management Instrumentation
It doesn't work in UWP as that part of the registry is not available via
CoCreateInstanceFromApp(). This might be available via DeviceInformation
from winrt Windows.Devices.Enumeration (not available in wine yet) in the
Properties dictionary, but it would be for UAP/UWP builds only.

Cannot be ported back to 3.0 as this is Vista and above.
2021-09-01 07:50:52 +00:00
Romain Vimont 7621d23ec1 opengl: remove useless includes of internal.h 2021-08-28 16:07:02 +00:00
Marvin Scholz 347f73b9a7 Only define VLC_WINSTORE_APP if true
This makes it consistent with all the other uses of such defines in
the source code, which are tested for their existence rather than the
actual value.
2021-08-19 05:38:17 +00:00
Rémi Denis-Courmont dd20ace531 Rename VLC_EBADVAR to VLC_EINVAL 2021-07-14 14:53:16 +00:00
Rémi Denis-Courmont aebb111024 Introduce VLC_ENOTSUP error code
Better than VLC_EGENERIC when something is understood to be unsupported
on the local system.
2021-07-14 14:53:16 +00:00
Thomas Guillem e3b5b5b07b avcodec: va: change vlc_va_Get arguments
Provide the AVCodecContext and the full AVFrame. It will be used by the
new vaapi va module.
2021-07-12 09:52:31 +02:00
Steve Lhomme 2721256e9b display: don't pass the vout_display_cfg_t on Open
It's already set as a read-only pointer in vd->cfg before calling Open().
2021-07-12 09:21:55 +02:00
Romain Vimont 6208d519af vout: use designated initializers for display ops
Benefits of *not* using designated initializers:
 - we can't forget a callback
 - it's the same in C and C++ (<20)

Benefits of using designated initializers:
 - the order of callbacks may not be wrong
 - we can read immediately which function is assigned to which callback
   (especially if some are NULL)
 - an optional callback may be added without modifying all the modules
 - we can grep a callback name to find its assignments easily
 - it is consistent with others xxx_operations in the codebase
2021-07-10 15:16:50 +00:00
Thomas Guillem bd8359f36f avcodec: va: make sys a void pointer
The concrete sys type is local to each module.
2021-07-10 09:06:46 +00:00
Romain Vimont 3af1b9dc30 vout display: make sys a void pointer
The concrete sys type is local to each module.
2021-07-07 09:26:17 +00:00
Steve Lhomme c7227ecf47 avcodec: vdpau: do not rely on AVCodecContext->refs for HEVC
lavc doesn't set this value to a meaningful value. Only the H264 codec
has this value properly set.

Bogus log introduced in 7905bf1eba.
Before the code would rely on refs which is one and add 5 arbitrary pictures
which was OK until HEVC and VP9 were introduced.
2021-07-01 10:37:37 +00:00
Steve Lhomme c78f7ac90f avcodec: always use AVPixelFormat instead of PixelFormat
AVPixelFormat was introduced in libavutil 51.42.0 we require 55.9.0.
2021-06-29 09:56:47 +00:00
Romain Vimont 3716a7da5b config: remove remaining "advanced" flags
The config "advanced" flag was unused and has been removed by
6a7a137f7b.

It has been removed from many add_*() macros, but not all. Remove it
from the remaining macros.
2021-06-06 08:42:50 +00:00
Lyndon Brown 94d04d840a mmal: remove pointless add_submodule() call 2021-05-29 19:21:35 +01:00
Lyndon Brown 98c824ab05 add missing 'since' version tags to obsolete options 2021-05-29 11:02:18 +00:00
Lyndon Brown d75459a35b remove unnecessary option longtext
where identical to shorttext, or near enough.

bad because:
 - wastes resources.
 - useless tooltips in prefs GUI (poor UX) - tooltip longtext should add
   something of value.
 - useless repetition of text in certain help output.

in some cases they differed only in full-stop, creating unnecessary extra
burden on translators.
2021-05-12 05:44:11 +00:00
Alexandre Janniaux 931ec8b2de nvdec: Makefile.am: move nvdec plugin into nvdecdir
Like all other hw plugins.
2021-03-15 13:57:03 +01:00
Alexandre Janniaux c5181b2187 nvdec: Makefile.am: remove redundant LDFLAGS definition
Without conditional activation of the plugins through autoconf, -rpath
is always defined when adding the plugin libtool archive target to
codec_LTLIBRARIES or nvdec_LTLIBRARIES. If the target's LDFLAGS is not
defined, it will also use AM_LDFLAGS by default.
2021-03-15 13:57:03 +01:00
Alexandre Janniaux 4ef3f338ee Makefile.am: mmal: remove recursive Makefile target
Sort of revert 1d2b56c68b but it actually
finish the work done in ticket #9367 by removing the last recursive
makefile target in modules/.

It allows faster make (though not significant here) but most of all,
sharing the same variable definition scope in modules/ for all
makefiles.

In particular, this facilitate for future work implementing partial
linking at the module level, which actually needs the list of all
plugins being compiled.
2021-03-15 13:57:03 +01:00
Alexandre Janniaux 1fdebc28dc mmal: Makefile.am: use convenience library for mmal
The convenience library factors the mmal libs and the object between the
different plugins.
2021-03-15 13:57:03 +01:00
Alexandre Janniaux 38db98d6ce mmal: Makefile.am: fix mmal plugin definition
Use only the MMAL_CFLAGS/MMAL_LIBS instead of sharing the flags of a
non-existant plugin. In addition, LDFLAGS is for linker flags different
from the -l or -L ones, and -rpath only needs to be defined when using
conditional compilation from autoconf (LTLIB and VLC_ADD_PLUGIN) so the
MMAL_LIBS must go to LIBADD.

In prevision of the removal of the recursive Makefile.am, use the
MMAL_CFLAGS on every targets that needs them.
2021-03-15 13:57:03 +01:00
Alexandre Janniaux b448334861 mmal: fix typo 2021-03-15 13:57:03 +01:00
Steve Lhomme ed6e9b9a9f dxgi_fmt: rename some defines/constants from D3D11_ to DXGI_
Move some defines from d3d11_fmt.h to dxgi_fmt.h.
2021-02-10 12:06:28 +01:00
Steve Lhomme 104e9bbdd4 dxgi_fmt: rename GetRenderFormatList to DxgiGetRenderFormatList 2021-02-10 12:06:28 +01:00
Steve Lhomme 5253904756 mmal/vout: simplify the configure_display() calls
Passing NULL ends up using the same value.
We use vd->cfg in all cases so no need to pass it.

Also clean subsequent place_dest calls so we can tell which are not using
vd->source.
2020-11-13 16:51:49 +01:00
Steve Lhomme c014f2a5a1 mmal: codec: remove write-only variable 2020-11-09 15:30:15 +01:00
Steve Lhomme 46485a27dd nvdec: always set the top field order in the picture
We don't need to care if it's interlaced or not.
2020-11-09 15:30:15 +01:00
Steve Lhomme f00c62a88b d3d11_deinterlace: log the filter that actually failed
Not the "auto" name.
2020-10-23 13:01:35 +02:00
Steve Lhomme 3e58876a3e d3d11_deinterlace: find the d3d_format once and for all
Also rename bogus vtcx_sys to vctx_sys.
2020-10-23 13:01:35 +02:00
Steve Lhomme dfe1ce9159 vdpau/deinterlace: implement flushing
We should not rely on the old PTS values after a flush.
2020-10-15 12:04:58 +02:00
Steve Lhomme 18830ea5be mmal/deinterlace: use a function to turn MMAL_BUFFER_HEADER_T into a picture 2020-10-13 14:59:53 +02:00
Steve Lhomme 05fc34f462 vaapi/deinterlace: flush the history when closing the filter
There is no guarantee fluash has been called before and it does a lot of the
cleaning we do in Close.

No need to check for NULL when calling free().
2020-10-13 14:59:52 +02:00
Steve Lhomme b67e48ab5b dxva2_deinterlace: flush the history when closing the filter
There is no guarantee it has been called before.
The software implementations also does the same.
2020-10-13 13:03:26 +02:00
Steve Lhomme a66d2a3a8f d3d11_deinterlace: flush the history when closing the filter
There is no guarantee it has been called before.
The software implementations also does the same.
2020-10-13 13:03:26 +02:00
Steve Lhomme 3dcb9bf8d8 vdpau/deinterlace: allocate the p_sys with vlc_obj_malloc 2020-10-13 09:40:25 +02:00
Steve Lhomme 92596e16f1 filters: use filter_Flush() instead of accessing the callback directly
It's easier to find out who flushes filters and when.

It's also easier to reorder the code without having the Flush callback above a
lot of common code.

The di_flush call in MMAL passthrough mode was probably wrong.
2020-10-13 09:21:33 +02:00
Steve Lhomme 94e23d51bb filters: use macro to set the typed Open callback for generic video filters 2020-10-13 09:21:31 +02:00
Steve Lhomme 0d5d447d70 filters: use macro to set the typed Open callback for video converters 2020-10-13 09:21:31 +02:00
Steve Lhomme 1c87e29042 filters: use macro to set the typed Open callback for deinterlacers
All deinterlacers have a priority of 0 since they are each specific to an input
chroma/video context.
2020-10-13 09:21:31 +02:00
Steve Lhomme 442904e35e vaapi: fix compilation after f0f5064812
This went one step too far in this commit.
2020-10-13 07:49:41 +02:00
Steve Lhomme f0f5064812 video_filters: use a typed close callback in the operations structure 2020-10-12 15:47:10 +02:00
Steve Lhomme 766a37d4cc mmal/converter: use a Close callback in the operations structure 2020-10-12 15:47:09 +02:00
Steve Lhomme 1c75c4bead vdpau/chroma: use a Close callback in the operations structure 2020-10-12 15:47:09 +02:00
Steve Lhomme 80c9de258e vdpau/deinterlace: use a Close callback in the operations structure 2020-10-12 15:47:09 +02:00