diff options
Diffstat (limited to 'src/codec_query')
-rw-r--r-- | src/codec_query/vaapi.c | 9 | ||||
-rw-r--r-- | src/codec_query/vulkan.c | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/codec_query/vaapi.c b/src/codec_query/vaapi.c index f919131..2c74d96 100644 --- a/src/codec_query/vaapi.c +++ b/src/codec_query/vaapi.c @@ -170,6 +170,7 @@ static bool get_supported_video_codecs(VADisplay va_dpy, gsr_supported_video_cod bool gsr_get_supported_video_codecs_vaapi(gsr_supported_video_codecs *video_codecs, const char *card_path, bool cleanup) { memset(video_codecs, 0, sizeof(*video_codecs)); bool success = false; + int drm_fd = -1; char render_path[128]; if(!gsr_card_path_get_render_path(card_path, render_path)) { @@ -177,7 +178,7 @@ bool gsr_get_supported_video_codecs_vaapi(gsr_supported_video_codecs *video_code goto done; } - const int drm_fd = open(render_path, O_RDWR); + drm_fd = open(render_path, O_RDWR); if(drm_fd == -1) { fprintf(stderr, "gsr error: gsr_get_supported_video_codecs_vaapi: failed to open device %s\n", render_path); goto done; @@ -193,8 +194,10 @@ bool gsr_get_supported_video_codecs_vaapi(gsr_supported_video_codecs *video_code } done: - if(cleanup) - close(drm_fd); + if(cleanup) { + if(drm_fd > 0) + close(drm_fd); + } return success; } diff --git a/src/codec_query/vulkan.c b/src/codec_query/vulkan.c index 5e0abe2..15dd98b 100644 --- a/src/codec_query/vulkan.c +++ b/src/codec_query/vulkan.c @@ -4,7 +4,8 @@ #include <string.h> #include <stdlib.h> #include <xf86drm.h> -#include <vulkan/vulkan.h> +#define VK_NO_PROTOTYPES +//#include <vulkan/vulkan.h> #define MAX_PHYSICAL_DEVICES 32 @@ -149,6 +150,7 @@ bool gsr_get_supported_video_codecs_vulkan(gsr_supported_video_codecs *video_cod #else // TODO: Low power query video_codecs->h264 = (gsr_supported_video_codec){ true, false }; + video_codecs->hevc = (gsr_supported_video_codec){ true, false }; return true; #endif } |