diff options
| author | Walter McKelvie <walt@mckelvie.org> | 2026-08-02 20:19:32 +0200 |
|---|---|---|
| committer | dec05eba <dec05eba@protonmail.com> | 2026-08-02 20:20:12 +0200 |
| commit | 8397e7307eb68c857117d74ba332916bb7af6be4 (patch) | |
| tree | bb17714ed3e2e331220c36183dff021b5f9d21b9 | |
| parent | f39ebf1a607b2f45c5049560756fb0f0054c5f6f (diff) | |
feat: Apple Silicon support
| -rw-r--r-- | include/defs.h | 1 | ||||
| -rw-r--r-- | src/cli/commands.c | 3 | ||||
| -rw-r--r-- | src/recorder/codec_select.c | 1 | ||||
| -rw-r--r-- | src/utils.c | 5 |
4 files changed, 9 insertions, 1 deletions
diff --git a/include/defs.h b/include/defs.h index 4bb10d8..5ffb546 100644 --- a/include/defs.h +++ b/include/defs.h @@ -11,6 +11,7 @@ typedef enum { GSR_GPU_VENDOR_INTEL, GSR_GPU_VENDOR_NVIDIA, GSR_GPU_VENDOR_BROADCOM, + GSR_GPU_VENDOR_APPLE } gsr_gpu_vendor; typedef struct { diff --git a/src/cli/commands.c b/src/cli/commands.c index 12de13b..bf07285 100644 --- a/src/cli/commands.c +++ b/src/cli/commands.c @@ -53,6 +53,9 @@ static void list_gpu_info(gsr_egl *egl) { case GSR_GPU_VENDOR_BROADCOM: printf("vendor|broadcom\n"); break; + case GSR_GPU_VENDOR_APPLE: + printf("vendor|apple\n"); + break; } printf("card_path|%s\n", egl->card_path); } diff --git a/src/recorder/codec_select.c b/src/recorder/codec_select.c index 48af0b2..38f7c61 100644 --- a/src/recorder/codec_select.c +++ b/src/recorder/codec_select.c @@ -71,6 +71,7 @@ bool get_supported_video_codecs(gsr_egl *egl, gsr_video_codec video_codec, bool case GSR_GPU_VENDOR_AMD: case GSR_GPU_VENDOR_INTEL: case GSR_GPU_VENDOR_BROADCOM: + case GSR_GPU_VENDOR_APPLE: return gsr_get_supported_video_codecs_vaapi(video_codecs, egl->card_path, cleanup); case GSR_GPU_VENDOR_NVIDIA: return gsr_get_supported_video_codecs_nvenc(video_codecs, cleanup); diff --git a/src/utils.c b/src/utils.c index 9ae34d7..71ad02d 100644 --- a/src/utils.c +++ b/src/utils.c @@ -389,6 +389,8 @@ bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info) { info->vendor = GSR_GPU_VENDOR_NVIDIA; else if(strstr(gl_vendor, "Broadcom")) info->vendor = GSR_GPU_VENDOR_BROADCOM; + else if(strstr(gl_vendor, "Mesa") && gl_renderer && strstr(gl_renderer, "Apple")) + info->vendor = GSR_GPU_VENDOR_APPLE; else { gsr_log(GSR_LOG_LEVEL_ERROR, "unknown gpu vendor: %s", gl_vendor); return false; @@ -450,7 +452,8 @@ bool try_card_has_valid_plane(const char *card_path) { bool gsr_get_valid_card_path(gsr_egl *egl, char *output, bool is_monitor_capture) { if(egl->dri_card_path) { snprintf(output, 128, "%s", egl->dri_card_path); - return is_monitor_capture ? try_card_has_valid_plane(output) : true; + if(!is_monitor_capture || try_card_has_valid_plane(output)) + return true; } for(int i = 0; i < 10; ++i) { |
