diff --git a/multimedia/Makefile b/multimedia/Makefile index 0f1efed27ab9..1646fd0dda9f 100644 --- a/multimedia/Makefile +++ b/multimedia/Makefile @@ -1,418 +1,419 @@ COMMENT = Multimedia software SUBDIR += Bento4 SUBDIR += ab-av1 SUBDIR += ab25 SUBDIR += alass SUBDIR += aom SUBDIR += aravis SUBDIR += arcan SUBDIR += aribb24 SUBDIR += asdcplib SUBDIR += assimp SUBDIR += atomicparsley SUBDIR += audacious SUBDIR += audacious-plugins SUBDIR += av1an SUBDIR += avidemux SUBDIR += avidemux-cli SUBDIR += avidemux-plugins SUBDIR += avidemux-qt5 SUBDIR += baka-mplayer SUBDIR += bcmatroska2 SUBDIR += bino SUBDIR += bitstream SUBDIR += blind SUBDIR += btavctpd SUBDIR += butt SUBDIR += ccextractor SUBDIR += celluloid SUBDIR += cheese SUBDIR += chilitags SUBDIR += cineencoder SUBDIR += clapper SUBDIR += clutter-gst SUBDIR += clutter-gst3 SUBDIR += cmrt SUBDIR += cmrtlib SUBDIR += cx88 SUBDIR += dav1d SUBDIR += deforaos-camera SUBDIR += deforaos-player SUBDIR += dovi_tool SUBDIR += dragon SUBDIR += droidcam SUBDIR += dtv-scan-tables SUBDIR += dv2sub SUBDIR += dvb-apps SUBDIR += dvbsnoop SUBDIR += dvd-slideshow SUBDIR += dvdauthor SUBDIR += dvdid SUBDIR += dvdread SUBDIR += elementary-videos SUBDIR += emby-server SUBDIR += ffaudioconverter SUBDIR += ffdec SUBDIR += ffmpeg SUBDIR += ffmpeg3 SUBDIR += ffmpeg4 SUBDIR += ffmpeg6 SUBDIR += ffmpegthumbnailer SUBDIR += ffms2 SUBDIR += ffnvcodec-headers SUBDIR += filebot SUBDIR += flvmeta SUBDIR += fswebcam SUBDIR += funnelcake SUBDIR += gaupol SUBDIR += gavl SUBDIR += get_iplayer SUBDIR += gmmlib SUBDIR += gmp-api SUBDIR += go2tv SUBDIR += gpac SUBDIR += gpodder SUBDIR += gst123 SUBDIR += gstreamer1 SUBDIR += gstreamer1-editing-services SUBDIR += gstreamer1-libav SUBDIR += gstreamer1-plugins SUBDIR += gstreamer1-plugins-all SUBDIR += gstreamer1-plugins-aom SUBDIR += gstreamer1-plugins-assrender SUBDIR += gstreamer1-plugins-bad SUBDIR += gstreamer1-plugins-core SUBDIR += gstreamer1-plugins-dash SUBDIR += gstreamer1-plugins-dts SUBDIR += gstreamer1-plugins-dv SUBDIR += gstreamer1-plugins-dvdread SUBDIR += gstreamer1-plugins-good SUBDIR += gstreamer1-plugins-hls SUBDIR += gstreamer1-plugins-libde265 SUBDIR += gstreamer1-plugins-mpeg2dec SUBDIR += gstreamer1-plugins-mpeg2enc SUBDIR += gstreamer1-plugins-mplex SUBDIR += gstreamer1-plugins-msdk SUBDIR += gstreamer1-plugins-openh264 SUBDIR += gstreamer1-plugins-resindvd SUBDIR += gstreamer1-plugins-rust SUBDIR += gstreamer1-plugins-smoothstreaming SUBDIR += gstreamer1-plugins-svt-av1 SUBDIR += gstreamer1-plugins-svt-vp9 SUBDIR += gstreamer1-plugins-theora SUBDIR += gstreamer1-plugins-ttml SUBDIR += gstreamer1-plugins-ugly SUBDIR += gstreamer1-plugins-v4l2 SUBDIR += gstreamer1-plugins-vpx SUBDIR += gstreamer1-plugins-webrtc SUBDIR += gstreamer1-plugins-x264 SUBDIR += gstreamer1-plugins-x265 SUBDIR += gstreamer1-rtsp-server SUBDIR += gstreamermm SUBDIR += gtk-pipe-viewer SUBDIR += gtk-youtube-viewer SUBDIR += guvcview SUBDIR += hana SUBDIR += handbrake SUBDIR += haruna SUBDIR += harvid SUBDIR += hdrprobe SUBDIR += helvum SUBDIR += hyprpwcenter SUBDIR += intel-media-sdk SUBDIR += iso2mkv SUBDIR += jellyfin SUBDIR += jellyfin-desktop SUBDIR += jmref SUBDIR += kaffeine SUBDIR += kamoso SUBDIR += kasts SUBDIR += kdemultimedia SUBDIR += kdemultimedia-ffmpegthumbs SUBDIR += kdenlive SUBDIR += kew SUBDIR += kf5-kmediaplayer SUBDIR += kmplayer SUBDIR += kodi SUBDIR += kodi-addon-inputstream.adaptive SUBDIR += kodi-addon-peripheral.joystick SUBDIR += kodi-addon-pvr.hts SUBDIR += kodi-addon-pvr.iptvsimple SUBDIR += kodi-addon-screensaver.biogenesis SUBDIR += kodi-addon-screensaver.matrixtrails SUBDIR += kodi-addon-screensaver.stars SUBDIR += kodi-addon-visualization.fishbmc SUBDIR += kodi-addon-visualization.projectm SUBDIR += kodi-addon-visualization.shadertoy SUBDIR += kodi-addon-visualization.spectrum SUBDIR += kooha SUBDIR += kvazaar SUBDIR += l-smash SUBDIR += lebiniou SUBDIR += lebiniou-data SUBDIR += libaacs SUBDIR += libass SUBDIR += libbdplus SUBDIR += libbluray SUBDIR += libcec SUBDIR += libdc1394 SUBDIR += libdca SUBDIR += libdcadec SUBDIR += libde265 SUBDIR += libdv SUBDIR += libdvbcsa SUBDIR += libdvbpsi SUBDIR += libdvdcss SUBDIR += libdvdnav SUBDIR += libdvdread SUBDIR += libgav1 SUBDIR += libhdhomerun SUBDIR += libmatroska SUBDIR += libmediaart SUBDIR += libmediainfo SUBDIR += libmpeg2 SUBDIR += libmtp SUBDIR += libndi SUBDIR += libopenshot SUBDIR += librav1e SUBDIR += librespot SUBDIR += librist SUBDIR += libtheora SUBDIR += libtuner SUBDIR += libudfread SUBDIR += libuvc SUBDIR += libv4l SUBDIR += libva SUBDIR += libva-intel-driver SUBDIR += libva-intel-hybrid-driver SUBDIR += libva-intel-media-driver SUBDIR += libva-nvidia-driver SUBDIR += libva-utils SUBDIR += libva-vdpau-driver SUBDIR += libvdpau SUBDIR += libvdpau-va-gl SUBDIR += libvlcpp + SUBDIR += libvpl SUBDIR += libvpx SUBDIR += libwebm SUBDIR += libx264 SUBDIR += libxine SUBDIR += libxspf SUBDIR += libzen SUBDIR += linux-c7-libtheora SUBDIR += linux-c7-libv4l SUBDIR += linux-rl9-aom SUBDIR += linux-rl9-ffmpeg SUBDIR += linux-rl9-gstreamer1 SUBDIR += linux-rl9-gstreamer1-libav SUBDIR += linux-rl9-libtheora SUBDIR += linux-rl9-libv4l SUBDIR += linux-rl9-libva SUBDIR += linux-rl9-libvdpau SUBDIR += linux-rl9-libvpx SUBDIR += linux-rl9-qt5-qtmultimedia SUBDIR += linux-rl9-vmaf SUBDIR += linux-tsmuxer SUBDIR += linux_dvbwrapper-kmod SUBDIR += livego SUBDIR += lives SUBDIR += lms SUBDIR += lsdvd SUBDIR += m2vrequantiser SUBDIR += makemkv SUBDIR += mediaelch SUBDIR += mediainfo SUBDIR += mediamtx SUBDIR += mencoder SUBDIR += minisatip SUBDIR += minitube SUBDIR += mjpegtools SUBDIR += mkclean SUBDIR += mkvalidator SUBDIR += mkvtoolnix SUBDIR += mlt7 SUBDIR += mlt7-glaxnimate SUBDIR += mlt7-qt SUBDIR += moonshine SUBDIR += motion SUBDIR += mp3cd SUBDIR += mp4v2 SUBDIR += mpc-qt SUBDIR += mplayer SUBDIR += mplayer-skins SUBDIR += mplex SUBDIR += mpv SUBDIR += mpv-mpris SUBDIR += mpvpaper SUBDIR += mpvqt SUBDIR += msopenh264 SUBDIR += mswebrtc SUBDIR += musikcube SUBDIR += musique SUBDIR += mxflib SUBDIR += mythtv SUBDIR += naludump SUBDIR += navidrome SUBDIR += neolink SUBDIR += nostt SUBDIR += nymphcastlib SUBDIR += nymphrpc SUBDIR += obs-multi-rtmp SUBDIR += obs-studio SUBDIR += obs-text-pthread SUBDIR += obs-waveform SUBDIR += obuparse SUBDIR += oggvideotools SUBDIR += ogmtools SUBDIR += olive SUBDIR += onevpl SUBDIR += openh264 SUBDIR += openshot SUBDIR += opentimelineio SUBDIR += opentoonz SUBDIR += oscam SUBDIR += ossia-score SUBDIR += p5-Audio-M4P SUBDIR += p5-FFmpeg-Command SUBDIR += p5-FLV-Info SUBDIR += p5-File-Format-RIFF SUBDIR += p5-MP4-Info SUBDIR += p5-Net-UPnP SUBDIR += p5-Subtitles SUBDIR += peek SUBDIR += phonon SUBDIR += phonon-designerplugin SUBDIR += phonon-mpv SUBDIR += phonon-vlc SUBDIR += photofilmstrip SUBDIR += pipe-viewer SUBDIR += pipewire SUBDIR += pitivi SUBDIR += plasmatube SUBDIR += playerctl SUBDIR += plexmediaserver SUBDIR += plexmediaserver-plexpass SUBDIR += podcastdl SUBDIR += poe SUBDIR += ptx-kmod SUBDIR += pwcbsd SUBDIR += pwcview SUBDIR += py-av SUBDIR += py-cec SUBDIR += py-enzyme SUBDIR += py-gstreamer1 SUBDIR += py-guessit SUBDIR += py-knowit SUBDIR += py-mat2 SUBDIR += py-metadata-cleaner SUBDIR += py-mido SUBDIR += py-moviepy SUBDIR += py-opentimelineio SUBDIR += py-periscope SUBDIR += py-pretty_midi SUBDIR += py-pymediainfo SUBDIR += py-pysubs2 SUBDIR += py-python-mpv SUBDIR += py-pytube SUBDIR += py-scenedetect SUBDIR += py-soco SUBDIR += py-srt SUBDIR += py-subliminal SUBDIR += py-tartube SUBDIR += py-torchcodec SUBDIR += py-trakit SUBDIR += py-ustreamer SUBDIR += qmmp-plugin-pack-qt5 SUBDIR += qmmp-plugin-pack-qt6 SUBDIR += qmmp-qt5 SUBDIR += qmmp-qt6 SUBDIR += qpwgraph SUBDIR += qt5-multimedia SUBDIR += qt6-multimedia SUBDIR += quodlibet SUBDIR += qwinff SUBDIR += rage SUBDIR += rav1e SUBDIR += recordmydesktop SUBDIR += replex SUBDIR += ringrtc SUBDIR += rubygem-av SUBDIR += rubygem-clutter-gstreamer SUBDIR += rubygem-flvtool2 SUBDIR += rubygem-gstreamer SUBDIR += rubygem-streamio-ffmpeg SUBDIR += scte35dump SUBDIR += shaka-packager SUBDIR += shotcut SUBDIR += shotcut-qt6 SUBDIR += showtime SUBDIR += simplescreenrecorder SUBDIR += smelter SUBDIR += smpeg SUBDIR += smpeg2 SUBDIR += smplayer SUBDIR += smplayer-skins SUBDIR += smplayer-themes SUBDIR += snapcast SUBDIR += streamlink SUBDIR += subtitlecomposer SUBDIR += subtitleoffsetmodifier SUBDIR += subtools SUBDIR += supersonic SUBDIR += svt-av1 SUBDIR += svt-av1-hdr SUBDIR += svt-hevc SUBDIR += svt-vp9 SUBDIR += syncplay SUBDIR += szap-s2 SUBDIR += tautulli SUBDIR += tenacity SUBDIR += termplay SUBDIR += termusic SUBDIR += tinyobjloader SUBDIR += tivodecode SUBDIR += totem SUBDIR += totem-pl-parser SUBDIR += tsduck SUBDIR += tvheadend SUBDIR += ustreamer SUBDIR += uvg266 SUBDIR += uxplay SUBDIR += v4l-utils SUBDIR += v4l_compat SUBDIR += vamps SUBDIR += vapoursynth SUBDIR += vapoursynth-l-smash-works SUBDIR += vapoursynth-vmaf SUBDIR += vcdgear SUBDIR += vcdimager SUBDIR += vdpauinfo SUBDIR += vid.stab SUBDIR += video-trimmer SUBDIR += vlc SUBDIR += vmaf SUBDIR += vvdec SUBDIR += vvenc SUBDIR += w_scan2 SUBDIR += webcamd SUBDIR += webcamoid SUBDIR += wf-recorder SUBDIR += winff SUBDIR += wireplumber SUBDIR += wl-screenrec SUBDIR += wlrobs SUBDIR += x264 SUBDIR += x265 SUBDIR += xanim SUBDIR += xawtv SUBDIR += xfce4-parole SUBDIR += xine SUBDIR += xporthdmv SUBDIR += xvid SUBDIR += yamdi SUBDIR += youtui SUBDIR += ytfzf SUBDIR += zart SUBDIR += zoneminder .include diff --git a/multimedia/libvpl/Makefile b/multimedia/libvpl/Makefile new file mode 100644 index 000000000000..aebdebeb2595 --- /dev/null +++ b/multimedia/libvpl/Makefile @@ -0,0 +1,36 @@ +PORTNAME= libvpl +DISTVERSIONPREFIX= v +DISTVERSION= 2.17.0 +CATEGORIES= multimedia + +MAINTAINER= naito.yuichiro@gmail.com +COMMENT= Intel Video Processing Library API, dispatcher, and examples +WWW= https://www.intel.com/content/www/us/en/developer/tools/vpl/overview.html + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +ONLY_FOR_ARCHS= amd64 +ONLY_FOR_ARCHS_REASON= only Intel GPUs on x86 are supported + +USES= cmake:testing compiler:c++14-lang localbase:ldflags pkgconfig pathfix +PATHFIX_CMAKELISTSTXT=CMakeLists.txt InstallDirs.cmake +USE_CXXSTD= c++14 +USE_GITHUB= yes +GH_ACCOUNT= intel +USE_LDCONFIG= yes + +CMAKE_TESTING_ON= BUILD_TESTS +CONFLICTS_INSTALL= onevpl +DATADIR= ${PREFIX}/share/vpl + +post-patch: + @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' \ + ${WRKSRC}/libvpl/src/mfx_dispatcher_vpl_loader.cpp + @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' \ + ${WRKSRC}/libvpl/src/mfx_dispatcher_vpl_lowlatency.cpp + +post-install: + @${FIND} ${STAGEDIR} -name \*.orig -delete + +.include diff --git a/multimedia/libvpl/distinfo b/multimedia/libvpl/distinfo new file mode 100644 index 000000000000..d6e867916a65 --- /dev/null +++ b/multimedia/libvpl/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1784249375 +SHA256 (intel-libvpl-v2.17.0_GH0.tar.gz) = 4de3e2faf1e8307fb282e4a43f443191810f6a6b0a484fffa7995ba1c814c6ec +SIZE (intel-libvpl-v2.17.0_GH0.tar.gz) = 12974961 diff --git a/multimedia/libvpl/files/patch-api_vpl_mfxdefs.h b/multimedia/libvpl/files/patch-api_vpl_mfxdefs.h new file mode 100644 index 000000000000..865635bd0dc3 --- /dev/null +++ b/multimedia/libvpl/files/patch-api_vpl_mfxdefs.h @@ -0,0 +1,20 @@ +--- api/vpl/mfxdefs.h.orig 2025-04-18 15:44:33 UTC ++++ api/vpl/mfxdefs.h +@@ -64,7 +64,7 @@ extern "C" + #define MFX_PACK_BEGIN_STRUCT_W_PTR() MFX_PACK_BEGIN_X(8) + #define MFX_PACK_BEGIN_STRUCT_W_L_TYPE() MFX_PACK_BEGIN_X(8) + /* 32-bit ILP32 data model Windows* (Intel(r) architecture) */ +-#elif defined(_WIN32) || defined(_M_IX86) && !defined(__linux__) ++#elif defined(_WIN32) || defined(_M_IX86) && !defined(__unix__) + #define MFX_PACK_BEGIN_STRUCT_W_PTR() MFX_PACK_BEGIN_X(4) + #define MFX_PACK_BEGIN_STRUCT_W_L_TYPE() MFX_PACK_BEGIN_X(8) + /* 32-bit ILP32 data model Linux* */ +@@ -99,7 +99,7 @@ extern "C" + #define MFX_DEPRECATED __declspec(deprecated) + #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg + #define MFX_DEPRECATED_ENUM_FIELD_OUTSIDE(arg) __pragma(deprecated(arg)) +- #elif defined(__linux__) ++ #elif defined(__unix__) + #define MFX_DEPRECATED __attribute__((deprecated)) + #if defined(__cplusplus) + #define MFX_DEPRECATED_ENUM_FIELD_INSIDE(arg) arg __attribute__((deprecated)) diff --git a/multimedia/libvpl/files/patch-libvpl_CMakeLists.txt b/multimedia/libvpl/files/patch-libvpl_CMakeLists.txt new file mode 100644 index 000000000000..58cce5533153 --- /dev/null +++ b/multimedia/libvpl/files/patch-libvpl_CMakeLists.txt @@ -0,0 +1,11 @@ +--- libvpl/CMakeLists.txt.orig 2025-12-17 23:04:39 UTC ++++ libvpl/CMakeLists.txt +@@ -190,7 +190,7 @@ if(INSTALL_DEV) + # WIN32 in general + set(MINGW_LIBS "-lole32 -lgdi32 -luuid") + endif() +- set(VPL_PKGCONFIG_DEPENDENT_LIBS ++ set(VPL_PKGCONFIG_PRIVATE_LIBS + "${DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${MINGW_LIBS} ${CXX_LIB}") + configure_file("pkgconfig/vpl.pc.in" "pkgconfig/vpl.pc" @ONLY) + install( diff --git a/multimedia/libvpl/files/patch-libvpl_src_linux_device__ids.h b/multimedia/libvpl/files/patch-libvpl_src_linux_device__ids.h new file mode 100644 index 000000000000..f1e76440dcd2 --- /dev/null +++ b/multimedia/libvpl/files/patch-libvpl_src_linux_device__ids.h @@ -0,0 +1,73 @@ +--- libvpl/src/linux/device_ids.h.orig 2025-04-18 15:44:33 UTC ++++ libvpl/src/linux/device_ids.h +@@ -380,7 +380,62 @@ static inline eMFXHWType get_platform(unsigned int dev + return MFX_HW_UNKNOWN; + } + ++#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) ++#if defined(__FreeBSD__) && __FreeBSD__ < 13 ++#include ++#else ++#include ++#include ++#include ++#endif // defined(__FreeBSD__) && __FreeBSD__ < 13 ++ ++struct drm_pciinfo { ++ uint16_t domain; ++ uint8_t bus; ++ uint8_t dev; ++ uint8_t func; ++ uint16_t vendor_id; ++ uint16_t device_id; ++ uint16_t subvendor_id; ++ uint16_t subdevice_id; ++ uint8_t revision_id; ++}; ++ ++#define DRM_IOCTL_BASE 'd' ++#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOCTL_GET_PCIINFO DRM_IOR(0x15, struct drm_pciinfo) ++#endif ++ + static mfxStatus get_devices(std::vector &allDevices) { ++#ifdef DRM_IOCTL_GET_PCIINFO ++ std::vector result; ++ for (int i = 0; i < 64; ++i) { ++#if defined(__FreeBSD__) && __FreeBSD__ < 13 ++ std::string mib = "dev.drm." + std::to_string(128 + i) + ".PCI_ID"; ++ char pci_id[20]; ++ size_t len = sizeof(pci_id); ++ if (sysctlbyname(mib.c_str(), pci_id, &len, NULL, 0)) continue; ++ Device device; ++ sscanf(pci_id, "%x:%x", &device.vendor_id, &device.device_id); ++#else ++ std::string path = "/dev/dri/renderD" + std::to_string(128 + i); ++ int fd = open(path.c_str(), O_RDONLY); ++ if (fd == -1) continue; ++ struct drm_pciinfo pinfo; ++ if (ioctl(fd, DRM_IOCTL_GET_PCIINFO, &pinfo)) { ++ close(fd); ++ continue; ++ } ++ Device device = { .vendor_id = pinfo.vendor_id, .device_id = pinfo.device_id }; ++ close(fd); ++#endif // defined(__FreeBSD__) && __FreeBSD__ < 13 ++ if (device.vendor_id != 0x8086) { // Filter out non-Intel devices ++ continue; ++ } ++ device.platform = get_platform(device.device_id); ++ allDevices.emplace_back(device); ++ } ++#else + const char *dir = "/sys/class/drm"; + const char *device_id_file = "/device/device"; + const char *vendor_id_file = "/device/vendor"; +@@ -433,6 +488,7 @@ static mfxStatus get_devices(std::vector &allD + + allDevices.emplace_back(device); + } ++#endif + + // sort by platform, unknown will appear at beginning + std::sort(allDevices.begin(), allDevices.end(), [](const Device &a, const Device &b) { diff --git a/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl.h b/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl.h new file mode 100644 index 000000000000..698008e0d31c --- /dev/null +++ b/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl.h @@ -0,0 +1,11 @@ +--- libvpl/src/mfx_dispatcher_vpl.h.orig 2025-04-18 15:44:33 UTC ++++ libvpl/src/mfx_dispatcher_vpl.h +@@ -48,7 +48,7 @@ typedef char CHAR_TYPE; + #define MSDK_LIB_NAME L"libmfxhw64." + #endif + #define ONEVPL_PRIORITY_PATH_VAR L"ONEVPL_PRIORITY_PATH" +-#elif defined(__linux__) ++#elif defined(__unix__) + // Linux x64 + #define MSDK_LIB_NAME "libmfxhw64." + #define ONEVPL_PRIORITY_PATH_VAR "ONEVPL_PRIORITY_PATH" diff --git a/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl__loader.cpp b/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl__loader.cpp new file mode 100644 index 000000000000..f7812d5a04bc --- /dev/null +++ b/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl__loader.cpp @@ -0,0 +1,27 @@ +--- libvpl/src/mfx_dispatcher_vpl_loader.cpp.orig 2025-12-17 23:04:39 UTC ++++ libvpl/src/mfx_dispatcher_vpl_loader.cpp +@@ -432,13 +432,14 @@ mfxU32 LoaderCtxVPL::GetSearchPathsSystemDefault(std:: + mfxU32 LoaderCtxVPL::GetSearchPathsSystemDefault(std::list &searchDirs) { + searchDirs.clear(); + +-#ifdef __linux__ ++#ifdef __unix__ + // Add the standard path for libmfx1 install in Ubuntu + searchDirs.push_back("/usr/lib/x86_64-linux-gnu"); + + // Add other default paths + searchDirs.push_back("/lib"); + searchDirs.push_back("/usr/lib"); ++ searchDirs.push_back("%%PREFIX%%/lib"); + searchDirs.push_back("/lib64"); + searchDirs.push_back("/usr/lib64"); + #endif +@@ -450,7 +451,7 @@ mfxU32 LoaderCtxVPL::GetSearchPathsInstallDir(std::lis + mfxU32 LoaderCtxVPL::GetSearchPathsInstallDir(std::list &searchDirs) { + searchDirs.clear(); + +- #ifdef __linux__ ++ #ifdef __unix__ + STRING_TYPE install_dir = INSTALL_LIBDIR_SEARCH; + searchDirs.push_back(install_dir); + #endif diff --git a/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl__lowlatency.cpp b/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl__lowlatency.cpp new file mode 100644 index 000000000000..a6bcbf2a6bb0 --- /dev/null +++ b/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl__lowlatency.cpp @@ -0,0 +1,30 @@ +--- libvpl/src/mfx_dispatcher_vpl_lowlatency.cpp.orig 2025-12-17 23:04:39 UTC ++++ libvpl/src/mfx_dispatcher_vpl_lowlatency.cpp +@@ -18,7 +18,7 @@ + #define LIB_ONEVPL L"libmfx64-gen.dll" + #define LIB_MSDK L"libmfxhw64.dll" + #endif +-#elif defined(__linux__) ++#elif defined(__unix__) + // Linux x64 + #define LIB_ONEVPL "libmfx-gen.so.1.2" + #define LIB_MSDK "libmfxhw64.so.1" +@@ -191,14 +191,17 @@ mfxStatus LoaderCtxVPL::LoadLibsFromMultipleDirs(LibTy + } + + mfxStatus LoaderCtxVPL::LoadLibsFromMultipleDirs(LibType libType) { +-#ifdef __linux__ ++#ifdef __unix__ + // clang-format off + + // standard paths for RT installation on Linux + std::vector llSearchDir = { ++#ifdef __linux__ + "/usr/lib/x86_64-linux-gnu", ++#endif + "/lib", + "/usr/lib", ++ "%%PREFIX%%/lib", + "/lib64", + "/usr/lib64", + }; diff --git a/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl__msdk.cpp b/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl__msdk.cpp new file mode 100644 index 000000000000..7034cdeedfef --- /dev/null +++ b/multimedia/libvpl/files/patch-libvpl_src_mfx__dispatcher__vpl__msdk.cpp @@ -0,0 +1,131 @@ +--- libvpl/src/mfx_dispatcher_vpl_msdk.cpp.orig 2025-12-17 23:04:39 UTC ++++ libvpl/src/mfx_dispatcher_vpl_msdk.cpp +@@ -11,7 +11,7 @@ + #include "src/mfx_dispatcher_vpl_win.h" + #endif + +-#ifdef __linux__ ++#ifdef __unix__ + #include + #define strncpy_s(dst, size, src, cnt) strncpy((dst), (src), (cnt)) // NOLINT + #endif +@@ -97,7 +97,7 @@ static const mfxImplementedFunctions msdkImplFuncs = { + (mfxChar**)msdkImplFuncsNames + }; + +-#ifdef __linux__ ++#ifdef __unix__ + // optional extBuf to limit threads created in MSDK session creation + // to enable, set vplParam.NumExtParam and vplParam.ExtParam before calling MFXInitEx2() + static const mfxExtThreadsParam extThreadParam = { +@@ -142,7 +142,7 @@ mfxStatus LoaderCtxMSDK::OpenSession(mfxSession *sessi + mfxInitializationParam vplParam = {}; + vplParam.AccelerationMode = accelMode; + +-#ifdef __linux__ ++#ifdef __unix__ + vplParam.ExtParam = (mfxExtBuffer **)&extParams; + vplParam.NumExtParam = 1; + #else +@@ -183,7 +183,7 @@ mfxStatus LoaderCtxMSDK::GetDefaultAccelType(mfxU32 ad + } + + mfxStatus LoaderCtxMSDK::GetDefaultAccelType(mfxU32 adapterID, mfxIMPL *implDefault, mfxU64 *luid) { +-#ifdef __linux__ ++#ifdef __unix__ + // VAAPI only + *implDefault = MFX_IMPL_VIA_VAAPI; + *luid = 0; +@@ -235,7 +235,7 @@ mfxStatus LoaderCtxMSDK::QueryAPIVersion(STRING_TYPE l + vplParam.AccelerationMode = + (mfxAccelerationMode)CvtAccelType(MFX_IMPL_HARDWARE, implDefault & 0xFF00); + +-#ifdef __linux__ ++#ifdef __unix__ + vplParam.ExtParam = (mfxExtBuffer **)&extParams; + vplParam.NumExtParam = 1; + #else +@@ -279,7 +279,7 @@ mfxStatus LoaderCtxMSDK::QueryMSDKCaps(STRING_TYPE lib + m_libNameFull = libNameFull; + m_deviceID = 0; + +-#ifdef __linux__ ++#ifdef __unix__ + // require pthreads to be linked in for MSDK RT to load + pthread_key_t pkey; + if (pthread_key_create(&pkey, NULL) == 0) { +@@ -504,13 +504,64 @@ mfxU32 read_device_file(std::string &path) { + return result; + } + ++#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) ++#if defined(__FreeBSD__) && __FreeBSD__ < 13 ++#include ++#else ++#include ++#include ++#include ++#endif // defined(__FreeBSD__) && __FreeBSD__ < 13 ++ ++struct drm_pciinfo { ++ uint16_t domain; ++ uint8_t bus; ++ uint8_t dev; ++ uint8_t func; ++ uint16_t vendor_id; ++ uint16_t device_id; ++ uint16_t subvendor_id; ++ uint16_t subdevice_id; ++ uint8_t revision_id; ++}; ++ ++#define DRM_IOCTL_BASE 'd' ++#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOCTL_GET_PCIINFO DRM_IOR(0x15, struct drm_pciinfo) ++#endif ++ + mfxStatus LoaderCtxMSDK::GetRenderNodeDescription(mfxU32 adapterID, + mfxU32 &vendorID, + mfxU16 &deviceID) { + vendorID = 0; + deviceID = 0; + +-#if defined(__linux__) ++#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) ++#if defined(__FreeBSD__) && __FreeBSD__ < 13 ++ std::string mib = "dev.drm." + std::to_string(128 + adapterID) + ".PCI_ID"; ++ char pci_id[20]; ++ size_t len = sizeof(pci_id); ++ if (sysctlbyname(mib.c_str(), pci_id, &len, NULL, 0)) ++ return MFX_ERR_UNSUPPORTED; ++ sscanf(pci_id, "%x:%x", &vendorID, &deviceID); ++#else ++ std::string path = "/dev/dri/renderD" + std::to_string(128 + adapterID); ++ int fd = open(path.c_str(), O_RDONLY); ++ if (fd == -1) ++ return MFX_ERR_UNSUPPORTED; ++ struct drm_pciinfo pinfo; ++ if (ioctl(fd, DRM_IOCTL_GET_PCIINFO, &pinfo)) { ++ close(fd); ++ return MFX_ERR_UNSUPPORTED; ++ } ++ vendorID = pinfo.vendor_id; ++ deviceID = pinfo.device_id; ++ close(fd); ++#endif // defined(__FreeBSD__) && __FreeBSD__ < 13 ++ if (vendorID != 0x8086 || deviceID == 0) ++ return MFX_ERR_UNSUPPORTED; ++ return MFX_ERR_NONE; ++#elif defined(__linux__) + mfxU32 DRMRenderNodeNum = 128 + adapterID; + std::string nodeStr = std::to_string(DRMRenderNodeNum); + +@@ -583,7 +634,7 @@ mfxStatus LoaderCtxMSDK::QueryExtDeviceID(mfxExtendedD + luidArr >>= 8; + } + } +-#elif defined(__linux__) ++#elif defined(__unix__) + extDeviceID->DRMPrimaryNodeNum = adapterID; + extDeviceID->DRMRenderNodeNum = 128 + adapterID; + #endif diff --git a/multimedia/libvpl/files/patch-libvpl_test_runtimes_stub_src_config.h b/multimedia/libvpl/files/patch-libvpl_test_runtimes_stub_src_config.h new file mode 100644 index 000000000000..730ba7f18783 --- /dev/null +++ b/multimedia/libvpl/files/patch-libvpl_test_runtimes_stub_src_config.h @@ -0,0 +1,11 @@ +--- libvpl/test/runtimes/stub/src/config.h.orig 2025-12-17 23:04:39 UTC ++++ libvpl/test/runtimes/stub/src/config.h +@@ -13,7 +13,7 @@ + + #include "vpl/mfx.h" + +-#if defined(__linux__) ++#if defined(__unix__) + #define vsprintf_s(s, l, m, a) vsprintf(s, m, a) + #endif + diff --git a/multimedia/libvpl/files/patch-libvpl_test_unit_src_dispatcher__enum__impls.cpp b/multimedia/libvpl/files/patch-libvpl_test_unit_src_dispatcher__enum__impls.cpp new file mode 100644 index 000000000000..4afa28283f95 --- /dev/null +++ b/multimedia/libvpl/files/patch-libvpl_test_unit_src_dispatcher__enum__impls.cpp @@ -0,0 +1,11 @@ +--- libvpl/test/unit/src/dispatcher_enum_impls.cpp.orig 2025-04-18 15:44:33 UTC ++++ libvpl/test/unit/src/dispatcher_enum_impls.cpp +@@ -30,7 +30,7 @@ typedef enum { + #define STUB_RT "libvplstubrt64.dll" + #endif + #endif +-#elif defined(__linux__) ++#elif defined(__unix__) + #define STUB_RT "libvplstubrt1x64.so" + #endif + diff --git a/multimedia/libvpl/pkg-descr b/multimedia/libvpl/pkg-descr new file mode 100644 index 000000000000..5ce7351e0bb9 --- /dev/null +++ b/multimedia/libvpl/pkg-descr @@ -0,0 +1,16 @@ +Intel Video Processing Library (Intel VPL) provides access to hardware +accelerated video decode, encode, and processing capabilities on Intel GPUs +to support AI visual inference, media delivery, cloud gaming, and virtual +desktop infrastructure use cases. + +This repository contains the following components: + +- Copies of the Intel VPL API header files. + The version of the API is listed in the mfxdefs.h file. +- Intel VPL Dispatcher +- Examples demonstrating API usage + +*** IMPORTANT *** + +Intel VPL Tools are no longer in this repository. They have all been +moved to libvpl-tools. diff --git a/multimedia/libvpl/pkg-plist b/multimedia/libvpl/pkg-plist new file mode 100644 index 000000000000..ffc924269e6b --- /dev/null +++ b/multimedia/libvpl/pkg-plist @@ -0,0 +1,113 @@ +etc/vpl/vars.sh +include/vpl/mfx.h +include/vpl/mfxadapter.h +include/vpl/mfxbrc.h +include/vpl/mfxcamera.h +include/vpl/mfxcommon.h +include/vpl/mfxdefs.h +include/vpl/mfxdispatcher.h +include/vpl/mfxdispatcherprefixedfunctions.h +include/vpl/mfxencodestats.h +include/vpl/mfximplcaps.h +include/vpl/mfxjpeg.h +include/vpl/mfxmemory.h +include/vpl/mfxmvc.h +include/vpl/mfxpcp.h +include/vpl/mfxsession.h +include/vpl/mfxstructures.h +include/vpl/mfxsurfacepool.h +include/vpl/mfxvideo++.h +include/vpl/mfxvideo.h +include/vpl/mfxvp8.h +include/vpl/preview/README.txt +include/vpl/preview/legacy/README.txt +include/vpl/preview/legacy/mfxvideo++.h +lib/cmake/vpl/VPLConfig.cmake +lib/cmake/vpl/VPLConfigVersion.cmake +lib/libvpl.so +lib/libvpl.so.2 +lib/libvpl.so.2.17 +libdata/pkgconfig/vpl.pc +%%DATADIR%%/examples/api1x_core/legacy-decode/CMakeLists.txt +%%DATADIR%%/examples/api1x_core/legacy-decode/License.txt +%%DATADIR%%/examples/api1x_core/legacy-decode/README.md +%%DATADIR%%/examples/api1x_core/legacy-decode/src/legacy-decode.cpp +%%DATADIR%%/examples/api1x_core/legacy-decode/src/util.hpp +%%DATADIR%%/examples/api1x_core/legacy-encode/CMakeLists.txt +%%DATADIR%%/examples/api1x_core/legacy-encode/License.txt +%%DATADIR%%/examples/api1x_core/legacy-encode/PreLoad.cmake +%%DATADIR%%/examples/api1x_core/legacy-encode/README.md +%%DATADIR%%/examples/api1x_core/legacy-encode/src/legacy-encode.cpp +%%DATADIR%%/examples/api1x_core/legacy-encode/src/util.hpp +%%DATADIR%%/examples/api1x_core/legacy-vpp/CMakeLists.txt +%%DATADIR%%/examples/api1x_core/legacy-vpp/License.txt +%%DATADIR%%/examples/api1x_core/legacy-vpp/README.md +%%DATADIR%%/examples/api1x_core/legacy-vpp/src/legacy-vpp.cpp +%%DATADIR%%/examples/api1x_core/legacy-vpp/src/util.hpp +%%DATADIR%%/examples/api2x/hello-decode/CMakeLists.txt +%%DATADIR%%/examples/api2x/hello-decode/License.txt +%%DATADIR%%/examples/api2x/hello-decode/PreLoad.cmake +%%DATADIR%%/examples/api2x/hello-decode/README.md +%%DATADIR%%/examples/api2x/hello-decode/src/hello-decode.cpp +%%DATADIR%%/examples/api2x/hello-decode/src/util.hpp +%%DATADIR%%/examples/api2x/hello-decvpp/CMakeLists.txt +%%DATADIR%%/examples/api2x/hello-decvpp/License.txt +%%DATADIR%%/examples/api2x/hello-decvpp/PreLoad.cmake +%%DATADIR%%/examples/api2x/hello-decvpp/README.md +%%DATADIR%%/examples/api2x/hello-decvpp/src/hello-decvpp.cpp +%%DATADIR%%/examples/api2x/hello-decvpp/src/util.hpp +%%DATADIR%%/examples/api2x/hello-encode-jpeg/CMakeLists.txt +%%DATADIR%%/examples/api2x/hello-encode-jpeg/License.txt +%%DATADIR%%/examples/api2x/hello-encode-jpeg/PreLoad.cmake +%%DATADIR%%/examples/api2x/hello-encode-jpeg/README.md +%%DATADIR%%/examples/api2x/hello-encode-jpeg/src/hello-encode-jpeg.cpp +%%DATADIR%%/examples/api2x/hello-encode-jpeg/src/util.hpp +%%DATADIR%%/examples/api2x/hello-encode/CMakeLists.txt +%%DATADIR%%/examples/api2x/hello-encode/License.txt +%%DATADIR%%/examples/api2x/hello-encode/PreLoad.cmake +%%DATADIR%%/examples/api2x/hello-encode/README.md +%%DATADIR%%/examples/api2x/hello-encode/src/hello-encode.cpp +%%DATADIR%%/examples/api2x/hello-encode/src/util.hpp +%%DATADIR%%/examples/api2x/hello-sharing-vaapi/CMakeLists.txt +%%DATADIR%%/examples/api2x/hello-sharing-vaapi/License.txt +%%DATADIR%%/examples/api2x/hello-sharing-vaapi/PreLoad.cmake +%%DATADIR%%/examples/api2x/hello-sharing-vaapi/README.md +%%DATADIR%%/examples/api2x/hello-sharing-vaapi/include/device-vaapi.h +%%DATADIR%%/examples/api2x/hello-sharing-vaapi/include/util.hpp +%%DATADIR%%/examples/api2x/hello-sharing-vaapi/include/vasurface_wrapper.h +%%DATADIR%%/examples/api2x/hello-sharing-vaapi/src/device-vaapi.cpp +%%DATADIR%%/examples/api2x/hello-sharing-vaapi/src/hello-sharing-vaapi-export.cpp +%%DATADIR%%/examples/api2x/hello-sharing-vaapi/src/hello-sharing-vaapi-import.cpp +%%DATADIR%%/examples/api2x/hello-transcode/CMakeLists.txt +%%DATADIR%%/examples/api2x/hello-transcode/License.txt +%%DATADIR%%/examples/api2x/hello-transcode/README.md +%%DATADIR%%/examples/api2x/hello-transcode/src/hello-transcode.cpp +%%DATADIR%%/examples/api2x/hello-transcode/src/util.hpp +%%DATADIR%%/examples/api2x/hello-vpp/CMakeLists.txt +%%DATADIR%%/examples/api2x/hello-vpp/License.txt +%%DATADIR%%/examples/api2x/hello-vpp/PreLoad.cmake +%%DATADIR%%/examples/api2x/hello-vpp/README.md +%%DATADIR%%/examples/api2x/hello-vpp/src/hello-vpp.cpp +%%DATADIR%%/examples/api2x/hello-vpp/src/util.hpp +%%DATADIR%%/examples/content/cars_320x240.bgra +%%DATADIR%%/examples/content/cars_320x240.h264 +%%DATADIR%%/examples/content/cars_320x240.h265 +%%DATADIR%%/examples/content/cars_320x240.i420 +%%DATADIR%%/examples/content/cars_320x240.mjpeg +%%DATADIR%%/examples/content/cars_320x240.nv12 +%%DATADIR%%/examples/content/cars_320x240.y8 +%%DATADIR%%/examples/interop/vpl-infer/CMakeLists.txt +%%DATADIR%%/examples/interop/vpl-infer/CPPLINT.cfg +%%DATADIR%%/examples/interop/vpl-infer/License.txt +%%DATADIR%%/examples/interop/vpl-infer/PreLoad.cmake +%%DATADIR%%/examples/interop/vpl-infer/README.md +%%DATADIR%%/examples/interop/vpl-infer/src/util.hpp +%%DATADIR%%/examples/interop/vpl-infer/src/vpl-infer.cpp +%%DATADIR%%/examples/tutorials/01_transition/License.txt +%%DATADIR%%/examples/tutorials/01_transition/MediaSDK/CMakeLists.txt +%%DATADIR%%/examples/tutorials/01_transition/MediaSDK/cmake/FindMFX.cmake +%%DATADIR%%/examples/tutorials/01_transition/README.md +%%DATADIR%%/examples/tutorials/01_transition/VPL/CMakeLists.txt +%%DATADIR%%/examples/tutorials/01_transition/src/transition.cpp +%%DATADIR%%/licensing/license.txt +%%DATADIR%%/licensing/third-party-programs.txt