mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-06-16 22:01:11 +00:00
Always include fake output but never choose it by default
This commit is contained in:
+3
-4
@@ -45,9 +45,8 @@ SET(MOONLIGHT_COMMON_INCLUDE_DIR ./third_party/moonlight-common-c/src)
|
|||||||
SET(GAMESTREAM_INCLUDE_DIR ./libgamestream)
|
SET(GAMESTREAM_INCLUDE_DIR ./libgamestream)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
list(APPEND SRC_LIST ./src/video/fake.c)
|
list(APPEND MOONLIGHT_DEFINITIONS LC_DEBUG)
|
||||||
list(APPEND MOONLIGHT_DEFINITIONS HAVE_FAKE LC_DEBUG)
|
list(APPEND MOONLIGHT_OPTIONS DEBUG)
|
||||||
list(APPEND MOONLIGHT_OPTIONS FAKE DEBUG)
|
|
||||||
elseif(NOT AMLOGIC_FOUND AND NOT BROADCOM_FOUND AND NOT FREESCALE_FOUND AND NOT SOFTWARE_FOUND)
|
elseif(NOT AMLOGIC_FOUND AND NOT BROADCOM_FOUND AND NOT FREESCALE_FOUND AND NOT SOFTWARE_FOUND)
|
||||||
message(FATAL_ERROR "No video output available")
|
message(FATAL_ERROR "No video output available")
|
||||||
endif()
|
endif()
|
||||||
@@ -76,7 +75,7 @@ endif()
|
|||||||
|
|
||||||
include_directories("${PROJECT_BINARY_DIR}")
|
include_directories("${PROJECT_BINARY_DIR}")
|
||||||
|
|
||||||
list(APPEND SRC_LIST ./src/audio/alsa.c)
|
list(APPEND SRC_LIST ./src/audio/alsa.c ./src/audio/fake.c ./src/video/fake.c)
|
||||||
|
|
||||||
add_subdirectory(libgamestream)
|
add_subdirectory(libgamestream)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of Moonlight Embedded.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2016 Iwan Timmer
|
||||||
|
*
|
||||||
|
* Moonlight is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Moonlight is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../audio.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
static FILE* fd;
|
||||||
|
static const char* fileName = "fake.opus";
|
||||||
|
|
||||||
|
static void alsa_renderer_init(int audioConfiguration, POPUS_MULTISTREAM_CONFIGURATION opusConfig) {
|
||||||
|
fd = fopen(fileName, "w");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void alsa_renderer_cleanup() {
|
||||||
|
fclose(fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void alsa_renderer_decode_and_play_sample(char* data, int length) {
|
||||||
|
fwrite(data, length, 1, fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
AUDIO_RENDERER_CALLBACKS audio_callbacks_fake = {
|
||||||
|
.init = alsa_renderer_init,
|
||||||
|
.cleanup = alsa_renderer_cleanup,
|
||||||
|
.decodeAndPlaySample = alsa_renderer_decode_and_play_sample,
|
||||||
|
.capabilities = CAPABILITY_DIRECT_SUBMIT,
|
||||||
|
};
|
||||||
+4
-5
@@ -59,10 +59,9 @@ enum platform platform_check(char* name) {
|
|||||||
if (std || strcmp(name, "sdl") == 0)
|
if (std || strcmp(name, "sdl") == 0)
|
||||||
return SDL;
|
return SDL;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_FAKE
|
if (strcmp(name, "fake") == 0)
|
||||||
if (std || strcmp(name, "fake") == 0)
|
|
||||||
return FAKE;
|
return FAKE;
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,10 +83,8 @@ DECODER_RENDERER_CALLBACKS* platform_get_video(enum platform system) {
|
|||||||
case AML:
|
case AML:
|
||||||
return (PDECODER_RENDERER_CALLBACKS) dlsym(RTLD_DEFAULT, "decoder_callbacks_aml");
|
return (PDECODER_RENDERER_CALLBACKS) dlsym(RTLD_DEFAULT, "decoder_callbacks_aml");
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_FAKE
|
|
||||||
case FAKE:
|
case FAKE:
|
||||||
return &decoder_callbacks_fake;
|
return &decoder_callbacks_fake;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -109,6 +106,8 @@ AUDIO_RENDERER_CALLBACKS* platform_get_audio(enum platform system) {
|
|||||||
return &audio_callbacks_pulse;
|
return &audio_callbacks_pulse;
|
||||||
#endif
|
#endif
|
||||||
return &audio_callbacks_alsa;
|
return &audio_callbacks_alsa;
|
||||||
|
case FAKE:
|
||||||
|
return &audio_callbacks_fake;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -33,9 +33,8 @@ PDECODER_RENDERER_CALLBACKS platform_get_video(enum platform system);
|
|||||||
PAUDIO_RENDERER_CALLBACKS platform_get_audio(enum platform system);
|
PAUDIO_RENDERER_CALLBACKS platform_get_audio(enum platform system);
|
||||||
bool platform_supports_hevc(enum platform system);
|
bool platform_supports_hevc(enum platform system);
|
||||||
|
|
||||||
#ifdef HAVE_FAKE
|
|
||||||
extern DECODER_RENDERER_CALLBACKS decoder_callbacks_fake;
|
extern DECODER_RENDERER_CALLBACKS decoder_callbacks_fake;
|
||||||
#endif
|
extern AUDIO_RENDERER_CALLBACKS audio_callbacks_fake;
|
||||||
#ifdef HAVE_SDL
|
#ifdef HAVE_SDL
|
||||||
extern DECODER_RENDERER_CALLBACKS decoder_callbacks_sdl;
|
extern DECODER_RENDERER_CALLBACKS decoder_callbacks_sdl;
|
||||||
void sdl_loop();
|
void sdl_loop();
|
||||||
|
|||||||
Reference in New Issue
Block a user