mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-02 15:56:02 +00:00
Fix CEC build problems
This commit is contained in:
parent
86a9eb2233
commit
dc83e8c9a1
@ -28,7 +28,6 @@ pkg_check_modules(AVUTIL libavutil)
|
|||||||
pkg_check_modules(SWSCALE libswscale)
|
pkg_check_modules(SWSCALE libswscale)
|
||||||
|
|
||||||
if(CEC_FOUND)
|
if(CEC_FOUND)
|
||||||
include_directories(./third_party/libcec)
|
|
||||||
list(APPEND MOONLIGHT_DEFINITIONS HAVE_LIBCEC)
|
list(APPEND MOONLIGHT_DEFINITIONS HAVE_LIBCEC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -69,7 +68,7 @@ set_property(TARGET moonlight PROPERTY C_STANDARD 11)
|
|||||||
|
|
||||||
if (CEC_FOUND)
|
if (CEC_FOUND)
|
||||||
list(APPEND MOONLIGHT_DEFINITIONS HAVE_LIBCEC)
|
list(APPEND MOONLIGHT_DEFINITIONS HAVE_LIBCEC)
|
||||||
target_include_directories(moonlight PRIVATE ./third_party/libcec ${CEC_INCLUDE_DIRS})
|
target_include_directories(moonlight PRIVATE ./third_party/libcec ${CEC_INCLUDE_DIRS}/libcec)
|
||||||
target_link_libraries (moonlight PUBLIC ${CEC_LIBRARIES})
|
target_link_libraries (moonlight PUBLIC ${CEC_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -18,8 +18,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_LIBCEC
|
#ifdef HAVE_LIBCEC
|
||||||
|
|
||||||
|
#include "limelight-common/Limelight.h"
|
||||||
|
|
||||||
#include <ceccloader.h>
|
#include <ceccloader.h>
|
||||||
|
|
||||||
|
#define KEY_LEFT 0x25
|
||||||
|
#define KEY_UP 0x26
|
||||||
|
#define KEY_RIGHT 0x27
|
||||||
|
#define KEY_DOWN 0x28
|
||||||
|
#define KEY_ENTER 0x0D
|
||||||
|
#define KEY_TAB 0x09
|
||||||
|
#define KEY_ESC 0x1B
|
||||||
|
|
||||||
static libcec_configuration g_config;
|
static libcec_configuration g_config;
|
||||||
static char g_strPort[50] = { 0 };
|
static char g_strPort[50] = { 0 };
|
||||||
static libcec_interface_t g_iface;
|
static libcec_interface_t g_iface;
|
||||||
@ -57,12 +68,12 @@ static int on_cec_keypress(void* userdata, const cec_keypress key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (value != 0) {
|
if (value != 0) {
|
||||||
short code = 0x80 << 8 | keyCodes[value];
|
short code = 0x80 << 8 | value;
|
||||||
LiSendKeyboardEvent(code, (key.duration > 0)?KEY_ACTION_UP:KEY_ACTION_DOWN, 0);
|
LiSendKeyboardEvent(code, (key.duration > 0)?KEY_ACTION_UP:KEY_ACTION_DOWN, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_cec() {
|
void cec_init() {
|
||||||
libcecc_reset_configuration(&g_config);
|
libcecc_reset_configuration(&g_config);
|
||||||
g_config.clientVersion = LIBCEC_VERSION_CURRENT;
|
g_config.clientVersion = LIBCEC_VERSION_CURRENT;
|
||||||
g_config.bActivateSource = 0;
|
g_config.bActivateSource = 0;
|
||||||
|
@ -17,4 +17,4 @@
|
|||||||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void init_cec();
|
void cec_init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user