enum platform platform_check(char* name) { bool std = strcmp(name, "default") == 0; #ifdef HAVE_SDL if (std || strcmp(name, "sdl") == 0) return SDL; #endif #ifdef HAVE_IMX if (std || strcmp(name, "imx") == 0) { void *handle = dlopen("libmoonlight-imx.so", RTLD_NOW | RTLD_GLOBAL); ImxInit video_imx_init = (ImxInit) dlsym(RTLD_DEFAULT, "video_imx_init"); if (handle != NULL) { if (video_imx_init()) return IMX; } } #endif #ifdef HAVE_PI if (std || strcmp(name, "pi") == 0) { void *handle = dlopen("libmoonlight-pi.so", RTLD_NOW | RTLD_GLOBAL); if (handle != NULL && dlsym(RTLD_DEFAULT, "bcm_host_init") != NULL) return PI; } #endif #ifdef HAVE_FAKE if (std || strcmp(name, "fake") == 0) return FAKE; #endif return 0; }
void video_init() { decoder_callbacks = &decoder_callbacks_fake; #ifdef HAVE_IMX if (dlsym(RTLD_DEFAULT, "vpu_Init") != NULL && video_imx_init()) { decoder_callbacks = &decoder_callbacks_imx; } #endif #ifdef HAVE_OMX if (dlsym(RTLD_DEFAULT, "bcm_host_init") != NULL) { decoder_callbacks = &decoder_callbacks_omx; } #endif }
void video_init() { #ifdef HAVE_FAKE decoder_callbacks = &decoder_callbacks_fake; #endif #ifdef HAVE_IMX if (dlsym(RTLD_DEFAULT, "vpu_Init") != NULL && video_imx_init()) { decoder_callbacks = &decoder_callbacks_imx; } #endif #ifdef HAVE_OMX if (dlsym(RTLD_DEFAULT, "bcm_host_init") != NULL) { decoder_callbacks = &decoder_callbacks_omx; } #endif if (decoder_callbacks == NULL) { fprintf(stderr, "No video output available\n"); exit(EXIT_FAILURE); } }