[host1x] FreeBSD: Fix random crashes due to CUDA/VAAPI check sideeffects #64

Merged
MaranBr merged 4 commits from :master into master 2025-07-14 22:30:08 +02:00
Member

FreeBSD doesn't support NVDEC, CUDA, and partially supports VAAPI (mostly for firefox).
Implementing VAAPI for other use cases would be a little bit complicated so, I chose to switch it off for FreeBSD.
This PR ensures that FFmpeg will always default to software decoding on FreeBSD, but should remain the same functionalities for other OS's.
The results are slight CPU increases while decoding in software mode, but still neglectable and they don't really harm performance.

FreeBSD doesn't support NVDEC, CUDA, and partially supports VAAPI (mostly for firefox). Implementing VAAPI for other use cases would be a little bit complicated so, I chose to switch it off for FreeBSD. This PR ensures that FFmpeg will always default to software decoding on FreeBSD, but should remain the same functionalities for other OS's. The results are slight CPU increases while decoding in software mode, but still neglectable and they don't really harm performance.
SDK-Chan added 1 commit 2025-07-14 18:27:43 +02:00
[desktop] FreeBSD: Fix random crashes due to CUDA/VAAPI check sideeffects
All checks were successful
eden-license / license-header (pull_request) Successful in 20s
9d3f515b45
SDK-Chan added 1 commit 2025-07-14 18:52:43 +02:00
Update src/video_core/host1x/ffmpeg/ffmpeg.cpp
All checks were successful
eden-license / license-header (pull_request) Successful in 16s
8de0ecae62
SDK-Chan added 1 commit 2025-07-14 19:17:09 +02:00
Update src/video_core/host1x/ffmpeg/ffmpeg.cpp
All checks were successful
eden-license / license-header (pull_request) Successful in 20s
1d02264844
MaranBr changed title from [desktop] FreeBSD: Fix random crashes due to CUDA/VAAPI check sideeffects to [host1x] FreeBSD: Fix random crashes due to CUDA/VAAPI check sideeffects 2025-07-14 19:22:03 +02:00
MaranBr requested changes 2025-07-14 19:41:22 +02:00
MaranBr left a comment
Member

This removes the duplicate AV_HWDEVICE_TYPE_VDPAU and keep the code cleaner and compatible with both systems.

constexpr std::array PreferredGpuDecoders = {
#ifdef _WIN32
    AV_HWDEVICE_TYPE_CUDA,
    AV_HWDEVICE_TYPE_D3D11VA,
    AV_HWDEVICE_TYPE_DXVA2,
#elif defined(__FreeBSD__)
    AV_HWDEVICE_TYPE_VDPAU,
#elif defined(__unix__)
    AV_HWDEVICE_TYPE_VAAPI,
#endif
    AV_HWDEVICE_TYPE_VULKAN,
};
This removes the duplicate AV_HWDEVICE_TYPE_VDPAU and keep the code cleaner and compatible with both systems. ``` constexpr std::array PreferredGpuDecoders = { #ifdef _WIN32 AV_HWDEVICE_TYPE_CUDA, AV_HWDEVICE_TYPE_D3D11VA, AV_HWDEVICE_TYPE_DXVA2, #elif defined(__FreeBSD__) AV_HWDEVICE_TYPE_VDPAU, #elif defined(__unix__) AV_HWDEVICE_TYPE_VAAPI, #endif AV_HWDEVICE_TYPE_VULKAN, }; ```
MaranBr added 1 commit 2025-07-14 22:29:08 +02:00
Clean up the code
All checks were successful
eden-license / license-header (pull_request) Successful in 22s
0163b66e64
MaranBr merged commit a8564a09b7 into master 2025-07-14 22:30:08 +02:00
Sign in to join this conversation.
No description provided.