moonlight: update addon

This commit is contained in:
cvh 2017-09-17 16:46:41 +02:00
parent b98a31e2e9
commit 04806db70c
9 changed files with 223 additions and 32 deletions

View File

@ -1,6 +1,6 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016 Team LibreELEC
# Copyright (C) 2016-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -17,20 +17,18 @@
################################################################################
PKG_NAME="enet"
PKG_VERSION="1.3.13"
PKG_SHA256="e36072021faa28731b08c15b1c3b5b91b911baf5f6abcc7fe4a6d425abada35c"
PKG_VERSION="e33ca1d"
PKG_SHA256="0ba5547de2c4c7fc79d367179a9bc92a7ac27e9258dd50fb277cd8761afaf9b0"
PKG_ARCH="any"
PKG_LICENSE=""
PKG_SITE=""
PKG_URL="http://enet.bespin.org/download/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_SITE="https://github.com/cgutman/enet/"
PKG_URL="https://github.com/cgutman/enet/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain"
PKG_SECTION="network"
PKG_SHORTDESC="ENet's purpose is to provide a relatively thin, simple and robust network communication layer on top of UDP (User Datagram Protocol)"
PKG_LONGDESC="ENet's purpose is to provide a relatively thin, simple and robust network communication layer on top of UDP (User Datagram Protocol)"
PKG_IS_ADDON="no"
PKG_USE_CMAKE="no"
PKG_AUTORECONF="no"
PKG_AUTORECONF="yes"
PKG_CONFIGURE_OPTS_TARGET="--enable-static --disable-shared"

View File

@ -1,6 +1,6 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016 Team LibreELEC
# Copyright (C) 2016-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -17,18 +17,16 @@
################################################################################
PKG_NAME="moonlight-common-c"
PKG_VERSION="1d058cb"
PKG_SHA256="d5cdeeb84b99ae73b8799b471e6a9c48859a2c4ecba059b9f38303c543494236"
PKG_VERSION="957b1de"
PKG_SHA256="1e31014b233bd7ab5578e03b4dd872117e796a400ebd912f6624d27133b2e415"
PKG_ARCH="any"
PKG_LICENSE="GPLv3"
PKG_SITE="https://github.com/irtimmer/moonlight-common-c"
PKG_URL="https://github.com/irtimmer/moonlight-common-c/archive/$PKG_VERSION.tar.gz"
PKG_SITE="https://github.com/moonlight-stream/moonlight-common-c"
PKG_URL="https://github.com/moonlight-stream/moonlight-common-c/archive/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain"
PKG_SECTION=""
PKG_SHORTDESC="Shared C code for the implementation of Nvidia's GameStream protocol"
PKG_LONGDESC="Shared C code for the implementation of Nvidia's GameStream protocol"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
make_target() {

View File

@ -1,6 +1,6 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016 Team LibreELEC
# Copyright (C) 2016-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -17,8 +17,8 @@
################################################################################
PKG_NAME="moonlight-embedded"
PKG_VERSION="9301898"
PKG_SHA256="62fcfbb0c775b0b8836e9b959ea9bebf0ffeecc6424e90f6e4beab353f1ef2d0"
PKG_VERSION="82b956a"
PKG_SHA256="379c499bbfa8e6e2178a5778c7886ebacea63da49ab84865bc618749f807607e"
PKG_ARCH="any"
PKG_LICENSE="GPLv3"
PKG_SITE="https://github.com/irtimmer/moonlight-embedded"
@ -27,8 +27,6 @@ PKG_DEPENDS_TARGET="toolchain curl libcec pulseaudio ffmpeg systemd alsa-lib moo
PKG_SECTION=""
PKG_SHORTDESC="Gamestream client for embedded systems"
PKG_LONGDESC="Moonlight Embedded is an open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield, but built for Linux"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
FREESCALE_V4L_INCLUDE=""

View File

@ -5,8 +5,8 @@ diff -Naur a/CMakeLists.txt b/CMakeLists.txt
set_property(TARGET moonlight PROPERTY COMPILE_DEFINITIONS ${MOONLIGHT_DEFINITIONS})
target_include_directories(moonlight PRIVATE ${GAMESTREAM_INCLUDE_DIR} ${MOONLIGHT_COMMON_INCLUDE_DIR} ${OPUS_INCLUDE_DIRS} ${EVDEV_INCLUDE_DIRS} ${UDEV_INCLUDE_DIRS})
-target_link_libraries(moonlight ${EVDEV_LIBRARIES} ${ALSA_LIBRARY} ${OPUS_LIBRARY} ${UDEV_LIBRARIES} ${CMAKE_DL_LIBS})
+target_link_libraries(moonlight ${EVDEV_LIBRARIES} ${ALSA_LIBRARY} ${OPUS_LIBRARY} ${UDEV_LIBRARIES} ${CMAKE_DL_LIBS} m)
-target_link_libraries(moonlight ${EVDEV_LIBRARIES} ${OPUS_LIBRARY} ${UDEV_LIBRARIES} ${CMAKE_DL_LIBS})
+target_link_libraries(moonlight ${EVDEV_LIBRARIES} ${OPUS_LIBRARY} ${UDEV_LIBRARIES} ${CMAKE_DL_LIBS} m)
add_subdirectory(docs)

View File

@ -5,8 +5,8 @@ diff -Naur a/CMakeLists.txt b/CMakeLists.txt
set_property(TARGET moonlight PROPERTY COMPILE_DEFINITIONS ${MOONLIGHT_DEFINITIONS})
target_include_directories(moonlight PRIVATE ${GAMESTREAM_INCLUDE_DIR} ${MOONLIGHT_COMMON_INCLUDE_DIR} ${OPUS_INCLUDE_DIRS} ${EVDEV_INCLUDE_DIRS} ${UDEV_INCLUDE_DIRS})
-target_link_libraries(moonlight ${EVDEV_LIBRARIES} ${ALSA_LIBRARY} ${OPUS_LIBRARY} ${UDEV_LIBRARIES} ${CMAKE_DL_LIBS} m)
+target_link_libraries(moonlight ${EVDEV_LIBRARIES} ${ALSA_LIBRARY} ${OPUS_LIBRARY} ${UDEV_LIBRARIES} ${CMAKE_DL_LIBS} pthread m)
-target_link_libraries(moonlight ${EVDEV_LIBRARIES} ${OPUS_LIBRARY} ${UDEV_LIBRARIES} ${CMAKE_DL_LIBS} m)
+target_link_libraries(moonlight ${EVDEV_LIBRARIES} ${OPUS_LIBRARY} ${UDEV_LIBRARIES} ${CMAKE_DL_LIBS} pthread m)
add_subdirectory(docs)

View File

@ -0,0 +1,11 @@
--- a/libgamestream/CMakeLists.txt
+++ b/libgamestream/CMakeLists.txt
@@ -27,7 +27,7 @@ set_target_properties(moonlight-common P
target_include_directories(gamestream PRIVATE ../third_party/moonlight-common-c/src ../third_party/h264bitstream ${AVAHI_INCLUDE_DIRS} ${LIBUUID_INCLUDE_DIRS})
target_include_directories(moonlight-common PRIVATE ../third_party/moonlight-common-c/reedsolomon ${ENET_INCLUDE_DIRS})
target_link_libraries(gamestream ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ${EXPAT_LIBRARIES} ${AVAHI_LIBRARIES} ${LIBUUID_LIBRARIES})
-target_link_libraries(moonlight-common ${ENET_LIBRARIES})
+target_link_libraries(moonlight-common ${ENET_LIBRARIES} ${OPENSSL_LIBRARIES})
target_link_libraries(gamestream ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})

View File

@ -1,3 +1,9 @@
107
- updated moonlight-embedded and moonlight-common-c
106
- rebuild
105
- update moonlight-embedded to support GFE 3.2

View File

@ -1,6 +1,6 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016-2017 Team LibreELEC
# Copyright (C) 2016-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -20,7 +20,7 @@ PKG_NAME="moonlight"
PKG_VERSION="391de3f"
PKG_SHA256="10aa7613afec0f7035135f67aa9cdcb12b8c444b8f92cf976fd2ceec5865a278"
PKG_VERSION_NUMBER="2.2.2"
PKG_REV="106"
PKG_REV="107"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/dead/script.moonlight"
@ -65,8 +65,8 @@ addon() {
cp -P $(get_build_dir moonlight-embedded)/.$TARGET_NAME/moonlight $ADDON_BUILD/$PKG_ADDON_ID/bin
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -P $(get_build_dir moonlight-embedded)/.$TARGET_NAME/libgamestream/libgamestream.so* $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -P $(get_build_dir moonlight-embedded)/.$TARGET_NAME/libgamestream/libmoonlight-common.so* $ADDON_BUILD/$PKG_ADDON_ID/lib
cp $(get_build_dir moonlight-embedded)/.$TARGET_NAME/libgamestream/libgamestream.so.2 $ADDON_BUILD/$PKG_ADDON_ID/lib
cp $(get_build_dir moonlight-embedded)/.$TARGET_NAME/libgamestream/libmoonlight-common.so.2 $ADDON_BUILD/$PKG_ADDON_ID/lib
if [ "$KODIPLAYER_DRIVER" = "bcm2835-driver" ]; then
cp -P $(get_build_dir moonlight-embedded)/.$TARGET_NAME/libmoonlight-pi.so $ADDON_BUILD/$PKG_ADDON_ID/lib
@ -76,11 +76,9 @@ addon() {
cp -P $(get_build_dir moonlight-embedded)/.$TARGET_NAME/libmoonlight-aml.so $ADDON_BUILD/$PKG_ADDON_ID/lib
fi
cp -P $(get_build_dir libevdev)/.install_pkg/usr/lib/libevdev.so* $ADDON_BUILD/$PKG_ADDON_ID/lib
cp $(get_build_dir libevdev)/.install_pkg/usr/lib/libevdev.so.2 $ADDON_BUILD/$PKG_ADDON_ID/lib
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/etc
cp -P $(get_build_dir moonlight-embedded)/moonlight.conf $ADDON_BUILD/$PKG_ADDON_ID/etc
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/share/moonlight
cp -PR $(get_build_dir moonlight-embedded)/mappings $ADDON_BUILD/$PKG_ADDON_ID/share/moonlight
cp -P $(get_build_dir moonlight-embedded)/gamecontrollerdb.txt $ADDON_BUILD/$PKG_ADDON_ID/etc
}

View File

@ -0,0 +1,182 @@
From 7057b4af0c5921393d7a5c79b798cb923a895e67 Mon Sep 17 00:00:00 2001
From: HDKiller <hdkiller@gmail.com>
Date: Sat, 16 Sep 2017 19:29:42 +0200
Subject: [PATCH 1/3] make parameteres compatible with moonlight 2.4.3
---
script.moonlight/bin/moonlight.sh | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/script.moonlight/bin/moonlight.sh b/script.moonlight/bin/moonlight.sh
index 967c6e0..e389041 100644
--- a/script.moonlight/bin/moonlight.sh
+++ b/script.moonlight/bin/moonlight.sh
@@ -4,6 +4,14 @@
oe_setup_addon script.moonlight
+# copy gamecontrollerdb.txt to folder
+MOONLIGHT_CONF_DIR="/storage/.config/moonlight"
+
+if [ ! -f "$MOONLIGHT_CONF_DIR/gamecontrollerdb.txt" ]; then
+ mkdir -p $MOONLIGHT_CONF_DIR
+ cp $ADDON_DIR/etc/gamecontrollerdb.txt $MOONLIGHT_CONF_DIR
+fi
+
while [ 1 ]; do
if [ -f $ADDON_DIR/start_moonlight.tmp ]; then
@@ -30,13 +38,9 @@ while [ 1 ]; do
fi
if [ "$MOON_FRAMERATE" = "60" ]; then
- MOONLIGHT_ARG="$MOONLIGHT_ARG -60fps"
+ MOONLIGHT_ARG="$MOONLIGHT_ARG -fps 60"
else
- MOONLIGHT_ARG="$MOONLIGHT_ARG -30fps"
- fi
-
- if [ "$MOON_FORCEHW" = "true" ]; then
- MOONLIGHT_ARG="$MOONLIGHT_ARG -forcehw"
+ MOONLIGHT_ARG="$MOONLIGHT_ARG -fps 30"
fi
if [ "$MOON_SURROUND" = "true" ]; then
@@ -59,10 +63,6 @@ while [ 1 ]; do
MOONLIGHT_ARG="$MOONLIGHT_ARG -audio $MOON_AUDIO"
fi
- if [ "$MOON_MAPPING" != "" ]; then
- MOONLIGHT_ARG="$MOONLIGHT_ARG -mapping \"${ADDON_DIR}/share/moonlight/mappings/${MOON_MAPPING}.conf\""
- fi
-
if [ "$MOONLIGHT_APP" != "" ]; then
MOONLIGHT_ARG="$MOONLIGHT_ARG -app \"${MOONLIGHT_APP}\""
fi
@@ -78,7 +78,7 @@ while [ 1 ]; do
fi
modprobe snd_bcm2835 || :
- echo $MOONLIGHT_ARG >> $ADDON_LOG_FILE
+ echo "${MOONLIGHT_ARG}" >> ${ADDON_LOG_FILE}
/bin/sh -c "${ADDON_DIR}/bin/moonlight ${MOONLIGHT_ARG} > ${ADDON_LOG_FILE} 2>&1"
rmmod snd_bcm2835 || :
systemctl start kodi
From c93f573cd46305fc630109faf8be8c5032e9c847 Mon Sep 17 00:00:00 2001
From: HDKiller <hdkiller@gmail.com>
Date: Sun, 17 Sep 2017 07:29:25 +0200
Subject: [PATCH 2/3] add new parameter (-4k) and remove obsolete ones
(-mapping) since controller config now comes from gamecontrollerdb
---
script.moonlight/bin/moonlight.sh | 2 ++
script.moonlight/resources/settings.xml | 5 ++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/script.moonlight/bin/moonlight.sh b/script.moonlight/bin/moonlight.sh
index e389041..69a5aff 100644
--- a/script.moonlight/bin/moonlight.sh
+++ b/script.moonlight/bin/moonlight.sh
@@ -33,6 +33,8 @@ while [ 1 ]; do
MOONLIGHT_ARG="$MOONLIGHT_ARG -720"
elif [ "$MOON_RESOLUTION" = "1080p" ]; then
MOONLIGHT_ARG="$MOONLIGHT_ARG -1080"
+ elif [ "$MOON_RESOLUTION" = "4k" ]; then
+ MOONLIGHT_ARG="$MOONLIGHT_ARG -4k"
else
MOONLIGHT_ARG="$MOONLIGHT_ARG -width $MOON_WIDTH_RESOLUTION -height $MOON_HEIGHT_RESOLUTION"
fi
diff --git a/script.moonlight/resources/settings.xml b/script.moonlight/resources/settings.xml
index d035ecd..723d57e 100644
--- a/script.moonlight/resources/settings.xml
+++ b/script.moonlight/resources/settings.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<setting id="MOON_SERVER_IP" type="ipaddress" label="Server IP" default="0.0.0.0"/>
- <setting id="MOON_RESOLUTION" type="labelenum" label="Resolution" values="Custom|720p|1080p" default="720p" />
+ <setting id="MOON_RESOLUTION" type="labelenum" label="Resolution" values="Custom|720p|1080p|4k" default="720p" />
<setting id="MOON_WIDTH_RESOLUTION" type="text" label="Width" visible="eq(-1,0)" default="1366" />
<setting id="MOON_HEIGHT_RESOLUTION" type="text" label="Height" visible="eq(-2,0)" default="768" />
<setting id="MOON_FRAMERATE" type="select" values="30|60" label="FPS" default="30" />
@@ -13,6 +13,5 @@
<setting id="MOON_LOCALAUDIO" type="bool" label="Play audio locally" default="false"/>
<setting id="MOON_SURROUND" type="bool" label="Stream 5.1 surround sound (requires GFE 2.7)" default="false"/>
<setting id="MOON_FORCEHW" type="bool" label="Force hardware acceleration" default="true"/>
- <setting id="MOON_MAPPING" type="select" label="Control Mapping" values="default|dualshock3|dualshock3alt|dualshock4|rumblepad2|xbox360" default="dualshock4" />
<setting id="MOON_AUDIO" type="text" label="Audio Device" default="sysdefault" />
-</settings>
\ No newline at end of file
+</settings>
From f9bb350c1b99e088e16bf67ef547bfadb6dbd1fc Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca>
Date: Sun, 17 Sep 2017 11:37:41 +0200
Subject: [PATCH 3/3] Update moonlight embedded wrapper to 2.4.3
---
script.moonlight/addon.xml | 4 ++--
script.moonlight/lib/moonlight.py | 15 +++++++++++++--
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/script.moonlight/addon.xml b/script.moonlight/addon.xml
index 9d53246..d18a813 100644
--- a/script.moonlight/addon.xml
+++ b/script.moonlight/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.moonlight" name="Moonlight" version="1.0.11" provider-name="dead">
+<addon id="script.moonlight" name="Moonlight" version="1.1.1" provider-name="dead">
<requires>
<import addon="xbmc.python" version="2.14.0"/>
</requires>
@@ -16,4 +16,4 @@
<language></language>
<email>gustavobenn@hotmail.com</email>
</extension>
-</addon>
\ No newline at end of file
+</addon>
diff --git a/script.moonlight/lib/moonlight.py b/script.moonlight/lib/moonlight.py
index 7edae39..87065fc 100644
--- a/script.moonlight/lib/moonlight.py
+++ b/script.moonlight/lib/moonlight.py
@@ -10,6 +10,14 @@
GS_IO_ERROR = -5
GS_NOT_SUPPORTED_4K = -6
+class DISPLAY_MODE(ctypes.Structure):
+ pass
+
+DISPLAY_MODE._fields_ = [("height", ctypes.c_int),
+ ("width", ctypes.c_int),
+ ("refresh", ctypes.c_int),
+ ("next", ctypes.POINTER(DISPLAY_MODE))]
+
class SERVER_INFORMATION(ctypes.Structure):
_fields_ = [("address", ctypes.c_char_p),
("serverInfoAppVersion", ctypes.c_char_p),
@@ -20,8 +28,11 @@ class SERVER_DATA(ctypes.Structure):
("gpuType", ctypes.c_char_p),
("paired", ctypes.c_bool),
("supports4K", ctypes.c_bool),
+ ("unsupported", ctypes.c_bool),
("currentGame", ctypes.c_int),
("serverMajorVersion", ctypes.c_int),
+ ("gsVersion", ctypes.c_char_p),
+ ("modes", DISPLAY_MODE),
("serverInfo", SERVER_INFORMATION)]
class APP_LIST(ctypes.Structure):
@@ -37,8 +48,8 @@ class _HTTP_DATA(ctypes.Structure):
class LibGameStream:
def __init__(self, libpath = ""):
- self.commonlib = ctypes.cdll.LoadLibrary(os.path.join(libpath, "libmoonlight-common.so.0"))
- self.gslib = ctypes.cdll.LoadLibrary(os.path.join(libpath, "libgamestream.so.0"))
+ self.commonlib = ctypes.cdll.LoadLibrary(os.path.join(libpath, "libmoonlight-common.so.2"))
+ self.gslib = ctypes.cdll.LoadLibrary(os.path.join(libpath, "libgamestream.so.2"))
self.connected = False
self.address = ""
self.key_dir = ""