aboutsummaryrefslogtreecommitdiff
path: root/src/vaapi.c
diff options
context:
space:
mode:
authorSteam Deck User <deck@archlinux.steamdeck>2023-04-01 15:14:36 +0200
committerSteam Deck User <deck@archlinux.steamdeck>2023-04-01 16:29:24 +0200
commit2f67083915ccb16727d00d49917a520d0962fb8c (patch)
tree6bc13adc7819305f03aa3e68f904d9e19e4b1248 /src/vaapi.c
parent162eac8c2f460ac8231696b511785d69bb7c97ff (diff)
Use vaapi to do rgb->yuv420p color conversion
Enable window capture for amd/intel. Properly check if h264/hevc is supported on amd/intel before using codec.
Diffstat (limited to 'src/vaapi.c')
-rw-r--r--src/vaapi.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/vaapi.c b/src/vaapi.c
deleted file mode 100644
index 93ef797..0000000
--- a/src/vaapi.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "../include/vaapi.h"
-#include "../include/library_loader.h"
-#include <string.h>
-
-bool gsr_vaapi_load(gsr_vaapi *self) {
- memset(self, 0, sizeof(gsr_vaapi));
-
- dlerror(); /* clear */
- void *lib = dlopen("libva.so.2", RTLD_LAZY);
- if(!lib) {
- fprintf(stderr, "gsr error: gsr_vaapi_load failed: failed to load libva.so, error: %s\n", dlerror());
- return false;
- }
-
- dlsym_assign required_dlsym[] = {
- { (void**)&self->vaExportSurfaceHandle, "vaExportSurfaceHandle" },
- { (void**)&self->vaSyncSurface, "vaSyncSurface" },
-
- { NULL, NULL }
- };
-
- if(!dlsym_load_list(lib, required_dlsym)) {
- fprintf(stderr, "gsr error: gsr_vaapi_load failed: missing required symbols in libva.so\n");
- goto fail;
- }
-
- self->library = lib;
- return true;
-
- fail:
- dlclose(lib);
- memset(self, 0, sizeof(gsr_vaapi));
- return false;
-}
-
-void gsr_vaapi_unload(gsr_vaapi *self) {
- if(self->library) {
- dlclose(self->library);
- memset(self, 0, sizeof(gsr_vaapi));
- }
-}