nurupo / vlc-pause-click-plugin

Plugin for VLC that pauses/plays video on mouse click
GNU Lesser General Public License v2.1
892 stars 64 forks source link

Newer commit of VLC 4 does not seem to build #106

Closed toby63 closed 3 months ago

toby63 commented 3 months ago

Checklist

Environment

Describe the bug

It seems that the plugin does not build with the latest VLC version.

Steps to reproduce

Try to build the plugin with VLC 4. I use the AUR package (modified for using latest commit) for that.

Observed behavior

Errors, mostly about "failed" or unknown declarations. E.g.: »set_category«; did you mean »set_subcategory«?

Expected behavior

Build should be sucessful.

Additional info

I could add a log, but it is mostly in german, so I would need to translate it, or somehow change the language of the build process. But I assume this should be reproducable, if it's an issue with ABI incompatibility.

nurupo commented 3 months ago

Works just fine for me using the master branch of the plugin, i.e. c119e7b724c0fd68948bbff8e2a1ce3f81d2a95e.

I'm unable to test a Linux build at the moment, I typically rely on Debian-packaged VLC for testing the plugin on Linux and VLC 4 is not yet packaged in Debian. Building VLC 4 from source is a bit involved, so I did a quick test by building the plugin for Windows instead, building it against the 586bf64e commit of VLC 4 from March 27th 2024. It produces two warnings, but otherwise the plugin dll builds successfully.

My build log ```bash + wget https://artifacts.videolan.org/vlc/nightly-win64/20240328-0429/vlc-4.0.0-dev-win64-586bf64e.7z -O vlc-4.0.0-win64.7z --2024-03-29 11:31:43-- https://artifacts.videolan.org/vlc/nightly-win64/20240328-0429/vlc-4.0.0-dev-win64-586bf64e.7z Resolving artifacts.videolan.org (artifacts.videolan.org)... 213.36.253.119, 2a01:e0d:1:3:58bf:fa77:f00d:face Connecting to artifacts.videolan.org (artifacts.videolan.org)|213.36.253.119|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 45657458 (44M) [application/x-7z-compressed] Saving to: 'vlc-4.0.0-win64.7z' vlc-4.0.0-win64.7z 100%[====================================================================================================>] 43.54M 18.1MB/s in 2.4s 2024-03-29 11:31:46 (18.1 MB/s) - 'vlc-4.0.0-win64.7z' saved [45657458/45657458] + 7zr x vlc-4.0.0-win64.7z '-o*' '*/sdk' 7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21 p7zip Version 16.02 (locale=C,Utf16=off,HugeFiles=on,64 bits,8 CPUs Intel(R) Core(TM) i7-2720QM CPU @ 2.20GHz (206A7),ASM,AES-NI) Scanning the drive for archives: 1 file, 45657458 bytes (44 MiB) Extracting archive: vlc-4.0.0-win64.7z -- Path = vlc-4.0.0-win64.7z Type = 7z Physical Size = 45657458 Headers Size = 10081 Method = LZMA:25 BCJ2 Solid = + Blocks = 2 Everything is Ok Folders: 7 Files: 336 Size: 41326842 Compressed: 45657458 + [[ 64 == \3\2 ]] + [[ 64 == \6\4 ]] + TOOLCHAIN=x86_64-w64-mingw32 + DESTDIR=/build/4.0/64 + cd /vlc-4.0.0-win64/vlc-4.0.0-dev/sdk + sed -i 's|^prefix=.*|prefix=/vlc-4.0.0-win64/vlc-4.0.0-dev/sdk|g' lib/pkgconfig/libvlc.pc lib/pkgconfig/vlc-plugin.pc + export PKG_CONFIG_PATH=/vlc-4.0.0-win64/vlc-4.0.0-dev/sdk/lib/pkgconfig + PKG_CONFIG_PATH=/vlc-4.0.0-win64/vlc-4.0.0-dev/sdk/lib/pkgconfig + '[' '!' -f lib/vlccore.lib ']' + echo 'INPUT(libvlccore.lib)' + cd /repo + make clean OS=Windows rm -f -- libpause_click_plugin.dll src/*.o packaging/windows/*.o + make CC=x86_64-w64-mingw32-gcc LD=x86_64-w64-mingw32-ld RC=x86_64-w64-mingw32-windres OS=Windows x86_64-w64-mingw32-gcc -std=gnu11 -g0 -O3 -Wall -Wextra -fPIC -fdiagnostics-color -I/vlc-4.0.0-win64/vlc-4.0.0-dev/sdk/include -I/vlc-4.0.0-win64/vlc-4.0.0-dev/sdk/include/vlc/plugins -DVLC_DYNAMIC_PLUGIN -D_FILE_OFFSET_BITS=64 -DPIC -I. -Isrc -DMODULE_STRING=\"pause_click\" -c -o src/pause_click.o src/pause_click.c In file included from src/pause_click.c:46: src/pause_click.c: In function 'vlc_entry': src/pause_click.c:157:31: warning: initialization of 'vlc_video_filter_open' {aka 'int (*)(filter_t *)'} from incompatible pointer type 'int (*)(vlc_object_t *)' [-Wincompatible-pointer-types] 157 | set_callback_video_filter(OpenFilter) | ^~~~~~~~~~ /vlc-4.0.0-win64/vlc-4.0.0-dev/sdk/include/vlc/plugins/vlc_filter.h:166:40: note: in definition of macro 'set_callback_video_filter' 166 | vlc_video_filter_open open__ = activate; \ | ^~~~~~~~ src/pause_click.c: At top level: src/pause_click.c:587:14: warning: initialization of 'void (*)(filter_t *)' from incompatible pointer type 'void (*)(vlc_object_t *)' [-Wincompatible-pointer-types] 587 | .close = CloseFilter, | ^~~~~~~~~~~ src/pause_click.c:587:14: note: (near initialization for 'filter_ops.close') x86_64-w64-mingw32-windres -o packaging/windows/version.rc.o packaging/windows/version.rc -I/vlc-4.0.0-win64/vlc-4.0.0-dev/sdk/include -I/vlc-4.0.0-win64/vlc-4.0.0-dev/sdk/include/vlc/plugins -DVLC_DYNAMIC_PLUGIN -D_FILE_OFFSET_BITS=64 -I. x86_64-w64-mingw32-gcc -std=gnu11 -shared -o libpause_click_plugin.dll src/pause_click.o packaging/windows/version.rc.o -L/vlc-4.0.0-win64/vlc-4.0.0-dev/sdk/lib -lvlccore + x86_64-w64-mingw32-strip libpause_click_plugin.dll + mkdir -p /build/4.0/64 + cp libpause_click_plugin.dll /build/4.0/64 ```

VLC API is rather cross-platform, so if the plugin compiles on Windows, I would expect it to also compile on Linux without issues.

Could you provide your build logs? You can make the output get printed in English if you do export LC_ALL=C in the shell environment in which the plugin is being built. You can later unset it with unset LC_ALL. Not sure how package building works on Arch Linux, if it builds in a clean environment without inheriting anything from the parent shell, then that would have no effect.

nurupo commented 3 months ago

E.g.: »set_category«; did you mean »set_subcategory«?

This sounds like you are not using the master branch of the plugin. The plugin does not use set_category when building against VLC 4, it uses set_category only for VLC <= 3. You can do CTRL+F for set_category in https://github.com/nurupo/vlc-pause-click-plugin/blob/c119e7b724c0fd68948bbff8e2a1ce3f81d2a95e/src/pause_click.c.

toby63 commented 3 months ago

Thx for the fast answer.

Even though /usr/include/vlc/libvlc_version.h shows # define LIBVLC_VERSION_MAJOR (4)

I tried to manually set the following in src/pause_click.c:

-#include <vlc/libvlc_version.h>
+/** LibVLC major version number */
+# define LIBVLC_VERSION_MAJOR    (4)

and now it builds (only a few warnings, like you said) and also works in VLC.

So something seems to be wrong on my system...sry for the fuss, it looked like a typical incompatibility between versions.