mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-02-16 10:30:47 +00:00
Make Amlogic decoder a plugin
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
typedef bool(*ImxInit)();
|
||||
@@ -48,14 +49,17 @@ enum platform platform_check(char* name) {
|
||||
return PI;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_AML
|
||||
if (std || strcmp(name, "aml") == 0) {
|
||||
void *handle = dlopen("libmoonlight-aml.so", RTLD_NOW | RTLD_GLOBAL);
|
||||
if (handle != NULL && access("/dev/amvideo", F_OK) != -1)
|
||||
return AML;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_SDL
|
||||
if (std || strcmp(name, "sdl") == 0)
|
||||
return SDL;
|
||||
#endif
|
||||
#ifdef HAVE_AML
|
||||
if (std || strcmp(name, "aml") == 0)
|
||||
return AML;
|
||||
#endif
|
||||
#ifdef HAVE_FAKE
|
||||
if (std || strcmp(name, "fake") == 0)
|
||||
return FAKE;
|
||||
@@ -79,7 +83,7 @@ DECODER_RENDERER_CALLBACKS* platform_get_video(enum platform system) {
|
||||
#endif
|
||||
#ifdef HAVE_AML
|
||||
case AML:
|
||||
return &decoder_callbacks_aml;
|
||||
return (PDECODER_RENDERER_CALLBACKS) dlsym(RTLD_DEFAULT, "decoder_callbacks_aml");
|
||||
#endif
|
||||
#ifdef HAVE_FAKE
|
||||
case FAKE:
|
||||
|
||||
@@ -31,9 +31,6 @@ enum platform platform_check(char*);
|
||||
PDECODER_RENDERER_CALLBACKS platform_get_video(enum platform system);
|
||||
PAUDIO_RENDERER_CALLBACKS platform_get_audio(enum platform system);
|
||||
|
||||
#ifdef HAVE_AML
|
||||
extern DECODER_RENDERER_CALLBACKS decoder_callbacks_aml;
|
||||
#endif
|
||||
#ifdef HAVE_FAKE
|
||||
extern DECODER_RENDERER_CALLBACKS decoder_callbacks_fake;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user