43
.github/workflows/CI.yml
vendored
43
.github/workflows/CI.yml
vendored
@@ -106,7 +106,6 @@ jobs:
|
|||||||
|
|
||||||
echo "aur_publish=true" >> $GITHUB_ENV
|
echo "aur_publish=true" >> $GITHUB_ENV
|
||||||
elif [[ ${{ github.ref == 'refs/heads/nightly' }} ]]; then
|
elif [[ ${{ github.ref == 'refs/heads/nightly' }} ]]; then
|
||||||
aur_pkg=sunshine-git
|
|
||||||
sub_version=".r${commit}"
|
sub_version=".r${commit}"
|
||||||
|
|
||||||
echo "aur_publish=true" >> $GITHUB_ENV
|
echo "aur_publish=true" >> $GITHUB_ENV
|
||||||
@@ -218,7 +217,7 @@ jobs:
|
|||||||
cmake -DGITHUB_CLONE_URL=${clone_url} \
|
cmake -DGITHUB_CLONE_URL=${clone_url} \
|
||||||
-DGITHUB_BRANCH=${branch} \
|
-DGITHUB_BRANCH=${branch} \
|
||||||
-DGITHUB_COMMIT=${commit} \
|
-DGITHUB_COMMIT=${commit} \
|
||||||
-DSUNSHINE_CONFIGURE_FLATPAK=ON \
|
-DSUNSHINE_CONFIGURE_FLATPAK_MAN=ON \
|
||||||
-DSUNSHINE_CONFIGURE_ONLY=ON \
|
-DSUNSHINE_CONFIGURE_ONLY=ON \
|
||||||
..
|
..
|
||||||
|
|
||||||
@@ -253,14 +252,8 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include: # package these differently
|
include: # package these differently
|
||||||
- type: cpack
|
- type: cpack
|
||||||
CMAKE_INSTALL_PREFIX: '/usr'
|
|
||||||
SUNSHINE_ASSETS_DIR: 'local/sunshine/assets'
|
|
||||||
SUNSHINE_CONFIG_DIR: 'local/sunshine/config'
|
|
||||||
EXTRA_ARGS: ''
|
EXTRA_ARGS: ''
|
||||||
- type: appimage
|
- type: appimage
|
||||||
CMAKE_INSTALL_PREFIX: '/usr'
|
|
||||||
SUNSHINE_ASSETS_DIR: 'sunshine.AppImage.config'
|
|
||||||
SUNSHINE_CONFIG_DIR: 'sunshine.AppImage.home'
|
|
||||||
EXTRA_ARGS: '-DSUNSHINE_CONFIGURE_APPIMAGE=ON'
|
EXTRA_ARGS: '-DSUNSHINE_CONFIGURE_APPIMAGE=ON'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -280,7 +273,6 @@ jobs:
|
|||||||
build-essential \
|
build-essential \
|
||||||
cmake \
|
cmake \
|
||||||
gcc-10 \
|
gcc-10 \
|
||||||
git \
|
|
||||||
g++-10 \
|
g++-10 \
|
||||||
libavdevice-dev \
|
libavdevice-dev \
|
||||||
libboost-filesystem-dev \
|
libboost-filesystem-dev \
|
||||||
@@ -343,9 +335,8 @@ jobs:
|
|||||||
|
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX=${{ matrix.CMAKE_INSTALL_PREFIX }} \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DSUNSHINE_ASSETS_DIR=${{ matrix.SUNSHINE_ASSETS_DIR }} \
|
-DSUNSHINE_ASSETS_DIR=share/sunshine \
|
||||||
-DSUNSHINE_CONFIG_DIR=${{ matrix.SUNSHINE_CONFIG_DIR }} \
|
|
||||||
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
|
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
|
||||||
-DSUNSHINE_ENABLE_WAYLAND=ON \
|
-DSUNSHINE_ENABLE_WAYLAND=ON \
|
||||||
-DSUNSHINE_ENABLE_X11=ON \
|
-DSUNSHINE_ENABLE_X11=ON \
|
||||||
@@ -380,12 +371,9 @@ jobs:
|
|||||||
# install sunshine to the DESTDIR
|
# install sunshine to the DESTDIR
|
||||||
make install DESTDIR=AppDir
|
make install DESTDIR=AppDir
|
||||||
|
|
||||||
# portable home and config
|
# custom AppRun file
|
||||||
# todo - this is ugly... we should use a custom AppRun script to take care of this
|
cp -f ../packaging/linux/AppImage/AppRun ./AppDir/
|
||||||
mv ./AppDir${{ matrix.CMAKE_INSTALL_PREFIX }}/sunshine.AppImage.* ../artifacts/
|
chmod +x ./AppDir/AppRun
|
||||||
mkdir -p ../artifacts/${{ matrix.SUNSHINE_CONFIG_DIR }}/.config/sunshine/${{ matrix.SUNSHINE_CONFIG_DIR }}
|
|
||||||
cp ../artifacts/${{ matrix.SUNSHINE_CONFIG_DIR }}/apps.json \
|
|
||||||
../artifacts/${{ matrix.SUNSHINE_CONFIG_DIR }}/.config/sunshine/${{ matrix.SUNSHINE_CONFIG_DIR }}/
|
|
||||||
|
|
||||||
# variables
|
# variables
|
||||||
DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}"
|
DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}"
|
||||||
@@ -396,12 +384,6 @@ jobs:
|
|||||||
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||||
chmod +x linuxdeploy-x86_64.AppImage
|
chmod +x linuxdeploy-x86_64.AppImage
|
||||||
|
|
||||||
# # https://github.com/linuxdeploy/linuxdeploy-plugin-gtk
|
|
||||||
# sudo apt-get install libgtk-3-dev librsvg2-dev -y
|
|
||||||
# wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
|
|
||||||
# chmod +x linuxdeploy-plugin-gtk.sh
|
|
||||||
# export DEPLOY_GTK_VERSION=3
|
|
||||||
|
|
||||||
./linuxdeploy-x86_64.AppImage \
|
./linuxdeploy-x86_64.AppImage \
|
||||||
--appdir ./AppDir \
|
--appdir ./AppDir \
|
||||||
--executable ./sunshine \
|
--executable ./sunshine \
|
||||||
@@ -411,8 +393,6 @@ jobs:
|
|||||||
--library /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 \
|
--library /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 \
|
||||||
--library /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 \
|
--library /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 \
|
||||||
--output appimage
|
--output appimage
|
||||||
# # add this argument back if using gtk plugin
|
|
||||||
# --plugin gtk \
|
|
||||||
|
|
||||||
# move
|
# move
|
||||||
mv Sunshine*.AppImage ../artifacts/sunshine.AppImage
|
mv Sunshine*.AppImage ../artifacts/sunshine.AppImage
|
||||||
@@ -430,14 +410,6 @@ jobs:
|
|||||||
|
|
||||||
./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage
|
./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage
|
||||||
|
|
||||||
- name: Archive AppImage
|
|
||||||
if: ${{ matrix.type == 'appimage' }}
|
|
||||||
working-directory: artifacts
|
|
||||||
run: |
|
|
||||||
chmod +x ./sunshine.AppImage
|
|
||||||
|
|
||||||
zip --recurse-paths --move --test ./sunshine-appimage.zip ./*
|
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -479,7 +451,7 @@ jobs:
|
|||||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DSUNSHINE_ASSETS_DIR=local/sunshine/assets \
|
-DSUNSHINE_ASSETS_DIR=local/sunshine/assets \
|
||||||
-DSUNSHINE_CONFIG_DIR=local/sunshine/config \
|
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
|
||||||
..
|
..
|
||||||
make -j ${nproc}
|
make -j ${nproc}
|
||||||
|
|
||||||
@@ -770,7 +742,6 @@ jobs:
|
|||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||||
-DSUNSHINE_ASSETS_DIR=assets \
|
-DSUNSHINE_ASSETS_DIR=assets \
|
||||||
-DSUNSHINE_CONFIG_DIR=config \
|
|
||||||
-G "MinGW Makefiles" \
|
-G "MinGW Makefiles" \
|
||||||
..
|
..
|
||||||
mingw32-make -j2
|
mingw32-make -j2
|
||||||
|
|||||||
159
CMakeLists.txt
159
CMakeLists.txt
@@ -9,9 +9,10 @@ set(PROJECT_LONG_DESCRIPTION "Sunshine is a self hosted, low latency, cloud gami
|
|||||||
Intel, and Nvidia GPUs. It is an open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield. \
|
Intel, and Nvidia GPUs. It is an open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield. \
|
||||||
Connect to Sunshine from any Moonlight client, available for nearly any device imaginable.")
|
Connect to Sunshine from any Moonlight client, available for nearly any device imaginable.")
|
||||||
|
|
||||||
option(SUNSHINE_CONFIGURE_APPIMAGE "Configure files required for AppImage." OFF)
|
option(SUNSHINE_CONFIGURE_APPIMAGE "Configuration specific for AppImage." OFF)
|
||||||
option(SUNSHINE_CONFIGURE_AUR "Configure files required for AUR." OFF)
|
option(SUNSHINE_CONFIGURE_AUR "Configure files required for AUR." OFF)
|
||||||
option(SUNSHINE_CONFIGURE_FLATPAK "Configure files required for Flatpak." OFF)
|
option(SUNSHINE_CONFIGURE_FLATPAK_MAN "Configure manifest file required for Flatpak build." OFF)
|
||||||
|
option(SUNSHINE_CONFIGURE_FLATPAK "Configuration specific for Flatpak." OFF)
|
||||||
option(SUNSHINE_CONFIGURE_PORTFILE "Configure macOS Portfile." OFF)
|
option(SUNSHINE_CONFIGURE_PORTFILE "Configure macOS Portfile." OFF)
|
||||||
option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF)
|
option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF)
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ if(${SUNSHINE_CONFIGURE_APPIMAGE})
|
|||||||
configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY)
|
configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY)
|
||||||
elseif(${SUNSHINE_CONFIGURE_AUR})
|
elseif(${SUNSHINE_CONFIGURE_AUR})
|
||||||
configure_file(packaging/linux/aur/PKGBUILD PKGBUILD @ONLY)
|
configure_file(packaging/linux/aur/PKGBUILD PKGBUILD @ONLY)
|
||||||
elseif(${SUNSHINE_CONFIGURE_FLATPAK})
|
elseif(${SUNSHINE_CONFIGURE_FLATPAK_MAN})
|
||||||
configure_file(packaging/linux/flatpak/dev.lizardbyte.sunshine.yml dev.lizardbyte.sunshine.yml @ONLY)
|
configure_file(packaging/linux/flatpak/dev.lizardbyte.sunshine.yml dev.lizardbyte.sunshine.yml @ONLY)
|
||||||
elseif(${SUNSHINE_CONFIGURE_PORTFILE})
|
elseif(${SUNSHINE_CONFIGURE_PORTFILE})
|
||||||
configure_file(packaging/macos/Portfile Portfile @ONLY)
|
configure_file(packaging/macos/Portfile Portfile @ONLY)
|
||||||
@@ -93,7 +94,7 @@ if(WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_compile_definitions(SUNSHINE_PLATFORM="windows")
|
add_compile_definitions(SUNSHINE_PLATFORM="windows")
|
||||||
add_subdirectory(tools) #This is temporary, only tools for Windows are needed, for now
|
add_subdirectory(tools) # This is temporary, only tools for Windows are needed, for now
|
||||||
|
|
||||||
include_directories(third-party/ViGEmClient/include)
|
include_directories(third-party/ViGEmClient/include)
|
||||||
|
|
||||||
@@ -421,19 +422,23 @@ else()
|
|||||||
list(APPEND SUNSHINE_COMPILE_OPTIONS -O3)
|
list(APPEND SUNSHINE_COMPILE_OPTIONS -O3)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# setup assets directory
|
||||||
if(NOT SUNSHINE_ASSETS_DIR)
|
if(NOT SUNSHINE_ASSETS_DIR)
|
||||||
set(SUNSHINE_ASSETS_DIR "${CMAKE_CURRENT_BINARY_DIR}/assets")
|
set(SUNSHINE_ASSETS_DIR "assets")
|
||||||
endif()
|
endif()
|
||||||
|
if(UNIX)
|
||||||
if(NOT SUNSHINE_CONFIG_DIR)
|
|
||||||
set(SUNSHINE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/config")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(UNIX AND CMAKE_INSTALL_PREFIX AND NOT ${SUNSHINE_CONFIGURE_APPIMAGE})
|
|
||||||
set(SUNSHINE_ASSETS_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_ASSETS_DIR}")
|
set(SUNSHINE_ASSETS_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_ASSETS_DIR}")
|
||||||
set(SUNSHINE_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_CONFIG_DIR}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# use relative assets path for AppImage... maybe for all unix
|
||||||
|
if(${SUNSHINE_CONFIGURE_APPIMAGE})
|
||||||
|
string(REPLACE "${CMAKE_INSTALL_PREFIX}" ".${CMAKE_INSTALL_PREFIX}" SUNSHINE_ASSETS_DIR_DEF ${SUNSHINE_ASSETS_DIR})
|
||||||
|
else()
|
||||||
|
set(SUNSHINE_ASSETS_DIR_DEF "${SUNSHINE_ASSETS_DIR}")
|
||||||
|
endif()
|
||||||
|
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR_DEF}")
|
||||||
|
|
||||||
|
|
||||||
list(APPEND CBS_EXTERNAL_LIBRARIES
|
list(APPEND CBS_EXTERNAL_LIBRARIES
|
||||||
cbs)
|
cbs)
|
||||||
|
|
||||||
@@ -452,8 +457,6 @@ if(NOT WIN32)
|
|||||||
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES Boost::log)
|
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES Boost::log)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR}")
|
|
||||||
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_CONFIG_DIR="${SUNSHINE_CONFIG_DIR}")
|
|
||||||
add_executable(sunshine ${SUNSHINE_TARGET_FILES})
|
add_executable(sunshine ${SUNSHINE_TARGET_FILES})
|
||||||
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS})
|
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS})
|
||||||
target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS})
|
target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS})
|
||||||
@@ -501,70 +504,101 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h
|
|||||||
install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio)
|
install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio)
|
||||||
install(TARGETS sunshinesvc RUNTIME DESTINATION "tools" COMPONENT sunshinesvc)
|
install(TARGETS sunshinesvc RUNTIME DESTINATION "tools" COMPONENT sunshinesvc)
|
||||||
|
|
||||||
|
# scripts
|
||||||
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/firewall/" DESTINATION "scripts" COMPONENT firewall)
|
||||||
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/service/" DESTINATION "scripts" COMPONENT service)
|
||||||
|
|
||||||
|
# Sunshine assets
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets)
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets)
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets)
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets)
|
||||||
|
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT config)
|
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT config)
|
|
||||||
|
|
||||||
|
|
||||||
# set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp
|
# set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp
|
||||||
|
|
||||||
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico")
|
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico")
|
||||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}")
|
set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}")
|
||||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") # The name of the directory that will be created in C:/Program files/
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") # The name of the directory that will be created in C:/Program files/
|
||||||
string(APPEND CPACK_NSIS_DEFINES "\n RequestExecutionLevel admin") # TODO: Not sure if this is needed but it took me a while to figure out where to put this option so I'm leaving it here
|
string(APPEND CPACK_NSIS_DEFINES "\n RequestExecutionLevel admin") # TODO: Not sure if this is needed but it took me a while to figure out where to put this option so I'm leaving it here
|
||||||
|
|
||||||
|
# Extra install commands
|
||||||
# Sets permissions on the installed folder so that we can write in it
|
# Sets permissions on the installed folder so that we can write in it
|
||||||
|
# Install service
|
||||||
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
|
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
|
||||||
"${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
|
"${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
|
||||||
ExecWait 'icacls \\\"$INSTDIR\\\" /grant:r Users:\\\(OI\\\)\\\(CI\\\)\\\(F\\\)'
|
ExecWait 'icacls \\\"$INSTDIR\\\" /grant:r Users:\\\(OI\\\)\\\(CI\\\)\\\(F\\\)'
|
||||||
")
|
ExecWait '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"'
|
||||||
|
ExecWait '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"'
|
||||||
|
")
|
||||||
|
|
||||||
|
# Extra uninstall commands
|
||||||
|
# Uninstall service
|
||||||
|
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
|
||||||
|
"${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
|
||||||
|
ExecWait '\\\"$INSTDIR\\\\scripts\\\\delete-firewall-rule.bat\\\"'
|
||||||
|
ExecWait '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"'
|
||||||
|
MessageBox MB_YESNO|MB_ICONQUESTION 'Do you want to completely remove the directory $INSTDIR and all of its contents?' IDNO NoDelete
|
||||||
|
RMDir /r \\\"$INSTDIR\\\" ; skipped if no
|
||||||
|
NoDelete:
|
||||||
|
")
|
||||||
|
|
||||||
# Adding an option for the start menu and PATH
|
# Adding an option for the start menu and PATH
|
||||||
set(CPACK_NSIS_MODIFY_PATH "OFF") # TODO: it asks to add it to the PATH but is not working https://gitlab.kitware.com/cmake/cmake/-/issues/15635
|
set(CPACK_NSIS_MODIFY_PATH "OFF") # TODO: it asks to add it to the PATH but is not working https://gitlab.kitware.com/cmake/cmake/-/issues/15635
|
||||||
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
||||||
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${CMAKE_PROJECT_NAME}.exe")
|
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${CMAKE_PROJECT_NAME}.exe")
|
||||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") # This will be shown on the installed apps Windows settings
|
set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") # This will be shown on the installed apps Windows settings
|
||||||
set(CPACK_NSIS_CREATE_ICONS "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' '\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe'")
|
set(CPACK_NSIS_CREATE_ICONS_EXTRA
|
||||||
|
"${CPACK_NSIS_CREATE_ICONS_EXTRA}
|
||||||
|
CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' '\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe'
|
||||||
|
")
|
||||||
|
set(CPACK_NSIS_DELETE_ICONS_EXTRA
|
||||||
|
"${CPACK_NSIS_DELETE_ICONS_EXTRA}
|
||||||
|
Delete '\$SMPROGRAMS\\\\$MUI_TEMP\\\\${CMAKE_PROJECT_NAME}.lnk'
|
||||||
|
")
|
||||||
|
|
||||||
# Checking for previous installed versions
|
# Checking for previous installed versions
|
||||||
# set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") # TODO: doesn't work on my machine when Sunshine is already installed
|
# set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") # TODO: doesn't work on my machine when Sunshine is already installed
|
||||||
|
|
||||||
|
set(CPACK_NSIS_HELP_LINK "https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/installation.html")
|
||||||
|
set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}")
|
||||||
|
set(CPACK_NSIS_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}/support")
|
||||||
|
|
||||||
# Setting components groups and dependencies
|
# Setting components groups and dependencies
|
||||||
# sunshine binary
|
# sunshine binary
|
||||||
set(CPACK_COMPONENT_APPLICATION_DISPLAY_NAME "${CMAKE_PROJECT_NAME}")
|
set(CPACK_COMPONENT_APPLICATION_DISPLAY_NAME "${CMAKE_PROJECT_NAME}")
|
||||||
set(CPACK_COMPONENT_APPLICATION_DESCRIPTION "The main application.")
|
set(CPACK_COMPONENT_APPLICATION_DESCRIPTION "${CMAKE_PROJECT_NAME} main application.")
|
||||||
set(CPACK_COMPONENT_APPLICATION_GROUP "${CMAKE_PROJECT_NAME}")
|
set(CPACK_COMPONENT_APPLICATION_GROUP "core")
|
||||||
set(CPACK_COMPONENT_APPLICATION_REQUIRED true)
|
set(CPACK_COMPONENT_APPLICATION_REQUIRED true)
|
||||||
set(CPACK_COMPONENT_APPLICATION_DEPENDS assets)
|
set(CPACK_COMPONENT_APPLICATION_DEPENDS assets)
|
||||||
|
|
||||||
# assets
|
# assets
|
||||||
set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Assets")
|
set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "assets")
|
||||||
set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Shaders, default box art, and web ui.")
|
set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Shaders, default box art, and web ui.")
|
||||||
set(CPACK_COMPONENT_ASSETS_GROUP "${CMAKE_PROJECT_NAME}")
|
set(CPACK_COMPONENT_ASSETS_GROUP "core")
|
||||||
set(CPACK_COMPONENT_ASSETS_REQUIRED true)
|
set(CPACK_COMPONENT_ASSETS_REQUIRED true)
|
||||||
|
|
||||||
# config
|
|
||||||
set(CPACK_COMPONENT_CONFIG_DISPLAY_NAME "Config")
|
|
||||||
set(CPACK_COMPONENT_CONFIG_DESCRIPTION "Default config and apps.json files.")
|
|
||||||
set(CPACK_COMPONENT_CONFIG_GROUP "${CMAKE_PROJECT_NAME}")
|
|
||||||
set(CPACK_COMPONENT_CONFIG_REQUIRED true)
|
|
||||||
|
|
||||||
# audio tool
|
# audio tool
|
||||||
set(CPACK_COMPONENT_AUDIO_DISPLAY_NAME "audio-info.exe")
|
set(CPACK_COMPONENT_AUDIO_DISPLAY_NAME "audio-info")
|
||||||
set(CPACK_COMPONENT_AUDIO_DESCRIPTION "CLI tool that allows you to get information about sound devices.")
|
set(CPACK_COMPONENT_AUDIO_DESCRIPTION "CLI tool providing information about sound devices.")
|
||||||
set(CPACK_COMPONENT_AUDIO_GROUP "Tools")
|
set(CPACK_COMPONENT_AUDIO_GROUP "tools")
|
||||||
|
|
||||||
# display tool
|
# display tool
|
||||||
set(CPACK_COMPONENT_DXGI_DISPLAY_NAME "dxgi-info.exe")
|
set(CPACK_COMPONENT_DXGI_DISPLAY_NAME "dxgi-info")
|
||||||
set(CPACK_COMPONENT_DXGI_DESCRIPTION "CLI tool that allows you to get information about graphics cards and displays.")
|
set(CPACK_COMPONENT_DXGI_DESCRIPTION "CLI tool providing information about graphics cards and displays.")
|
||||||
set(CPACK_COMPONENT_DXGI_GROUP "Tools")
|
set(CPACK_COMPONENT_DXGI_GROUP "tools")
|
||||||
|
|
||||||
# service tool
|
# service
|
||||||
set(CPACK_COMPONENT_SUNSHINESVC_DISPLAY_NAME "sunshinesvc.exe")
|
set(CPACK_COMPONENT_SUNSHINESVC_DISPLAY_NAME "sunshinesvc")
|
||||||
set(CPACK_COMPONENT_SUNSHINESVC_DESCRIPTION "CLI tool that allows you to enable/disable the Sunshine service.")
|
set(CPACK_COMPONENT_SUNSHINESVC_DESCRIPTION "CLI tool providing ability to enable/disable the Sunshine service.")
|
||||||
set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Tools")
|
set(CPACK_COMPONENT_SUNSHINESVC_GROUP "tools")
|
||||||
|
|
||||||
|
# service scripts
|
||||||
|
set(CPACK_COMPONENT_SERVICE_DISPLAY_NAME "service-scripts")
|
||||||
|
set(CPACK_COMPONENT_SERVICE_DESCRIPTION "Scripts to enable/disable the service.")
|
||||||
|
set(CPACK_COMPONENT_SERVICE_GROUP "scripts")
|
||||||
|
set(CPACK_COMPONENT_SERVICE_DEPENDS sunshinesvc)
|
||||||
|
|
||||||
|
# firewall scripts
|
||||||
|
set(CPACK_COMPONENT_FIREWALL_DISPLAY_NAME "firewall-scripts")
|
||||||
|
set(CPACK_COMPONENT_FIREWALL_DESCRIPTION "Scripts to enable or disable firewall rules.")
|
||||||
|
set(CPACK_COMPONENT_FIREWALL_GROUP "scripts")
|
||||||
endif()
|
endif()
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
# TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop
|
# TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop
|
||||||
@@ -573,15 +607,12 @@ if(APPLE)
|
|||||||
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
|
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
|
||||||
# set(CPACK_BUNDLE_STARTUP_COMMAND "${INSTALL_RUNTIME_DIR}/sunshine")
|
# set(CPACK_BUNDLE_STARTUP_COMMAND "${INSTALL_RUNTIME_DIR}/sunshine")
|
||||||
endif()
|
endif()
|
||||||
if(APPLE AND SUNSHINE_MACOS_PACKAGE) # TODO
|
if(APPLE AND SUNSHINE_MACOS_PACKAGE) # TODO
|
||||||
set(prefix "${CMAKE_PROJECT_NAME}.app/Contents")
|
set(prefix "${CMAKE_PROJECT_NAME}.app/Contents")
|
||||||
set(INSTALL_RUNTIME_DIR "${prefix}/MacOS")
|
set(INSTALL_RUNTIME_DIR "${prefix}/MacOS")
|
||||||
|
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
|
|
||||||
|
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
|
|
||||||
|
|
||||||
install(TARGETS sunshine
|
install(TARGETS sunshine
|
||||||
BUNDLE DESTINATION . COMPONENT Runtime
|
BUNDLE DESTINATION . COMPONENT Runtime
|
||||||
@@ -590,39 +621,35 @@ elseif(UNIX)
|
|||||||
# Installation destination dir
|
# Installation destination dir
|
||||||
set(CPACK_SET_DESTDIR true)
|
set(CPACK_SET_DESTDIR true)
|
||||||
if(NOT CMAKE_INSTALL_PREFIX)
|
if(NOT CMAKE_INSTALL_PREFIX)
|
||||||
set(CMAKE_INSTALL_PREFIX "/usr/local/sunshine")
|
set(CMAKE_INSTALL_PREFIX "/usr/share/sunshine")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS sunshine RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
install(TARGETS sunshine RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
|
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
|
|
||||||
|
|
||||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/misc/uninstall_pkg.sh" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/misc/uninstall_pkg.sh" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||||
else()
|
else()
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
|
if(${SUNSHINE_CONFIGURE_APPIMAGE} OR ${SUNSHINE_CONFIGURE_FLATPAK})
|
||||||
|
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules" DESTINATION "${SUNSHINE_ASSETS_DIR}/udev/rules.d")
|
||||||
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${SUNSHINE_ASSETS_DIR}/systemd/user")
|
||||||
|
else()
|
||||||
|
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules" DESTINATION "${CMAKE_INSTALL_LIBDIR}/udev/rules.d")
|
||||||
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user")
|
||||||
|
endif()
|
||||||
|
|
||||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules" DESTINATION "${CMAKE_INSTALL_LIBDIR}/udev/rules.d")
|
# Post install
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user")
|
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/postinst")
|
||||||
|
|
||||||
# Pre and post install
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
|
||||||
"${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/preinst"
|
|
||||||
"${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/postinst"
|
|
||||||
"${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/conffiles")
|
|
||||||
set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/preinst")
|
|
||||||
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/postinst")
|
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/postinst")
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
set(CPACK_DEB_COMPONENT_INSTALL ON)
|
set(CPACK_DEB_COMPONENT_INSTALL ON)
|
||||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "openssl, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2")
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS "openssl, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2")
|
||||||
set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1, libavdevice >= 4.3, boost-thread >= 1.67.0, boost-filesystem >= 1.67.0, boost-log >= 1.67.0, pulseaudio-libs >= 10.0, libopusenc >= 0.2.1, libxcb >= 1.13, libXtst >= 1.2.3, libevdev >= 1.5.6, libdrm >= 2.4.97, libcap >= 2.22")
|
set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1, libavdevice >= 4.3, boost-thread >= 1.67.0, boost-filesystem >= 1.67.0, boost-log >= 1.67.0, pulseaudio-libs >= 10.0, libopusenc >= 0.2.1, libxcb >= 1.13, libXtst >= 1.2.3, libevdev >= 1.5.6, libdrm >= 2.4.97, libcap >= 2.22")
|
||||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config
|
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,8 @@ location by modifying the configuration file.
|
|||||||
Value Description
|
Value Description
|
||||||
========= ===========
|
========= ===========
|
||||||
Docker /config/
|
Docker /config/
|
||||||
Linux-aur /usr/share/sunshine/config/
|
Linux ~/.config/sunshine/
|
||||||
Linux-deb /usr/local/sunshine/config/
|
macOS ~/.config/sunshine/
|
||||||
Linux-rpm /usr/local/sunshine/config/
|
|
||||||
macOS /usr/local/sunshine/config/
|
|
||||||
Windows ./config/
|
Windows ./config/
|
||||||
========= ===========
|
========= ===========
|
||||||
|
|
||||||
@@ -445,7 +443,28 @@ port
|
|||||||
^^^^
|
^^^^
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Set the family of ports used by Sunshine.
|
Set the family of ports used by Sunshine. Changing this value will offset other ports per the table below.
|
||||||
|
|
||||||
|
.. table::
|
||||||
|
:widths: auto
|
||||||
|
|
||||||
|
================ ============ ===========================
|
||||||
|
Port Description Default Port Difference from config port
|
||||||
|
================ ============ ===========================
|
||||||
|
HTTPS 47984 TCP -5
|
||||||
|
HTTP 47989 TCP 0
|
||||||
|
Web 47990 TCP +1
|
||||||
|
RTSP 48010 TCP +21
|
||||||
|
Video 47998 UDP +9
|
||||||
|
Control 47999 UDP +10
|
||||||
|
Audio 48000 UDP +11
|
||||||
|
tbd 48002 UDP +13
|
||||||
|
================ ============ ===========================
|
||||||
|
|
||||||
|
.. Attention:: Custom ports are only allowed on select Moonlight clients.
|
||||||
|
|
||||||
|
.. Todo:: Determine the function of port 48002 UDP. See
|
||||||
|
`here <https://github.com/moonlight-stream/moonlight-docs/wiki/Setup-Guide#manual-port-forwarding-advanced>`_.
|
||||||
|
|
||||||
Default
|
Default
|
||||||
``47989``
|
``47989``
|
||||||
|
|||||||
@@ -4,9 +4,12 @@ Installation
|
|||||||
============
|
============
|
||||||
The recommended method for running Sunshine is to use the `binaries`_ bundled with the `latest release`_.
|
The recommended method for running Sunshine is to use the `binaries`_ bundled with the `latest release`_.
|
||||||
|
|
||||||
|
.. Attention:: Additional setup is required after installation. See
|
||||||
|
:ref:`Setup <about/usage:setup>`.
|
||||||
|
|
||||||
Binaries
|
Binaries
|
||||||
--------
|
--------
|
||||||
Binaries of Sunshine are created for each release. They are available for Linux, and Windows.
|
Binaries of Sunshine are created for each release. They are available for Linux, macOS, and Windows.
|
||||||
Binaries can be found in the `latest release`_.
|
Binaries can be found in the `latest release`_.
|
||||||
|
|
||||||
.. Tip:: Some third party packages also exist. See
|
.. Tip:: Some third party packages also exist. See
|
||||||
@@ -19,7 +22,13 @@ Docker
|
|||||||
|
|
||||||
Linux
|
Linux
|
||||||
-----
|
-----
|
||||||
Follow the instructions for your preferred package type below.
|
First, follow the instructions for your preferred package type below.
|
||||||
|
|
||||||
|
Then start sunshine with the following command, unless a start command is listed in the specified package.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
sunshine
|
||||||
|
|
||||||
AppImage
|
AppImage
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
@@ -41,6 +50,23 @@ According to AppImageLint the AppImage can run on the following distros.
|
|||||||
- [✖] CentOS 7
|
- [✖] CentOS 7
|
||||||
|
|
||||||
#. Download ``sunshine-appimage.zip`` and extract the contents to your home directory.
|
#. Download ``sunshine-appimage.zip`` and extract the contents to your home directory.
|
||||||
|
#. Open terminal and run the following code.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
./sunshine.AppImage --install
|
||||||
|
|
||||||
|
Start:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
./sunshine.AppImage --install && ./sunshine.AppImage
|
||||||
|
|
||||||
|
Uninstall:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
./sunshine.AppImage --remove
|
||||||
|
|
||||||
AUR Package
|
AUR Package
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
@@ -48,10 +74,16 @@ AUR Package
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
git clone https://aur.archlinux.org/sunshine-git.git
|
git clone https://aur.archlinux.org/sunshine.git
|
||||||
cd sunshine-git
|
cd sunshine
|
||||||
makepkg -fi
|
makepkg -fi
|
||||||
|
|
||||||
|
Uninstall:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
pacman -R sunshine
|
||||||
|
|
||||||
Debian Package
|
Debian Package
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:deb?logo=github&style=for-the-badge
|
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:deb?logo=github&style=for-the-badge
|
||||||
@@ -65,13 +97,17 @@ Debian Package
|
|||||||
|
|
||||||
.. Tip:: You can double click the deb file to see details about the package and begin installation.
|
.. Tip:: You can double click the deb file to see details about the package and begin installation.
|
||||||
|
|
||||||
|
Uninstall:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
sudo apt remove sunshine
|
||||||
|
|
||||||
Flatpak Package
|
Flatpak Package
|
||||||
^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^
|
||||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:flatpak?logo=github&style=for-the-badge
|
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:flatpak?logo=github&style=for-the-badge
|
||||||
:alt: GitHub issues by-label
|
:alt: GitHub issues by-label
|
||||||
|
|
||||||
.. Todo:: This package needs to have CUDA added.
|
|
||||||
|
|
||||||
#. Install `Flatpak <https://flatpak.org/setup/>`_ as required.
|
#. Install `Flatpak <https://flatpak.org/setup/>`_ as required.
|
||||||
#. Download ``sunshine.flatpak`` and run the following code.
|
#. Download ``sunshine.flatpak`` and run the following code.
|
||||||
|
|
||||||
@@ -85,6 +121,18 @@ Flatpak Package
|
|||||||
|
|
||||||
flatpak install --user sunshine.flatpak
|
flatpak install --user sunshine.flatpak
|
||||||
|
|
||||||
|
Start:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
flatpak run dev.lizardbyte.sunshine
|
||||||
|
|
||||||
|
Uninstall:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
flatpak uninstall --delete-data sunshine.flatpak
|
||||||
|
|
||||||
RPM Package
|
RPM Package
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:rpm?logo=github&style=for-the-badge
|
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:rpm?logo=github&style=for-the-badge
|
||||||
@@ -105,41 +153,62 @@ RPM Package
|
|||||||
|
|
||||||
.. Tip:: You can double click the rpm file to see details about the package and begin installation.
|
.. Tip:: You can double click the rpm file to see details about the package and begin installation.
|
||||||
|
|
||||||
|
Uninstall:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
sudo dnf remove sunshine
|
||||||
|
|
||||||
macOS
|
macOS
|
||||||
-----
|
-----
|
||||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/os:macos?logo=github&style=for-the-badge
|
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/os:macos?logo=github&style=for-the-badge
|
||||||
:alt: GitHub issues by-label
|
:alt: GitHub issues by-label
|
||||||
|
|
||||||
pkg
|
pkg
|
||||||
.. Warning:: The `pkg` does not include runtime dependencies and should be considered experimental.
|
^^^
|
||||||
|
.. Warning:: The `pkg` does not include runtime dependencies and should be considered experimental.
|
||||||
|
|
||||||
#. Download the ``sunshine.pkg`` file and install it as normal.
|
#. Download the ``sunshine.pkg`` file and install it as normal.
|
||||||
|
|
||||||
|
Uninstall:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
cd /etc/sunshine/assets
|
||||||
|
uninstall_pkg.sh
|
||||||
|
|
||||||
Portfile
|
Portfile
|
||||||
#. Install `MacPorts <https://www.macports.org>`_
|
^^^^^^^^
|
||||||
#. Update the Macports sources.
|
#. Install `MacPorts <https://www.macports.org>`_
|
||||||
|
#. Update the Macports sources.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
sudo nano /opt/local/etc/macports/sources.conf
|
sudo nano /opt/local/etc/macports/sources.conf
|
||||||
|
|
||||||
Add this line, replacing your username, below the line that starts with ``rsync``.
|
Add this line, replacing your username, below the line that starts with ``rsync``.
|
||||||
|
|
||||||
file://Users/<username>/ports
|
``file:///Users/<username>/ports``
|
||||||
|
|
||||||
``Ctrl+x``, then ``Y`` to exit and save changes.
|
``Ctrl+x``, then ``Y`` to exit and save changes.
|
||||||
|
|
||||||
#. Download the ``Portfile`` to ``~/Downloads`` and run the following code.
|
#. Download the ``Portfile`` to ``~/Downloads`` and run the following code.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
mkdir -p ~/ports/multimedia/sunshine
|
mkdir -p ~/ports/multimedia/sunshine
|
||||||
mv ~/Downlaods/Portfile ~/ports/multimedia/sunshine
|
mv ~/Downloads/Portfile ~/ports/multimedia/sunshine/
|
||||||
cd ~/ports
|
cd ~/ports
|
||||||
portindex
|
portindex
|
||||||
sudo port install sunshine
|
sudo port install sunshine
|
||||||
|
|
||||||
#. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone.
|
#. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone.
|
||||||
|
|
||||||
|
Uninstall:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
sudo port uninstall sunshine
|
||||||
|
|
||||||
Windows
|
Windows
|
||||||
-------
|
-------
|
||||||
@@ -149,11 +218,18 @@ Windows
|
|||||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/os:windows:11?logo=github&style=for-the-badge
|
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/os:windows:11?logo=github&style=for-the-badge
|
||||||
:alt: GitHub issues by-label
|
:alt: GitHub issues by-label
|
||||||
|
|
||||||
Installed option:
|
Installer
|
||||||
#. Download and install ``sunshine-windows.exe``
|
^^^^^^^^^
|
||||||
|
#. Download and install ``sunshine-windows.exe``
|
||||||
|
|
||||||
Standalone option:
|
To uninstall, find Sunshine in the list `here <ms-settings:installed-apps>`_ and select "Uninstall" from the overflow
|
||||||
#. Download and extract ``sunshine-windows.zip``
|
menu. Different versions of Windows may provide slightly different steps for uninstall.
|
||||||
|
|
||||||
|
Standalone
|
||||||
|
^^^^^^^^^^
|
||||||
|
#. Download and extract ``sunshine-windows.zip``
|
||||||
|
|
||||||
|
To uninstall, delete the extracted directory which contains the ``sunshine.exe`` file.
|
||||||
|
|
||||||
.. _latest release: https://github.com/LizardByte/Sunshine/releases/latest
|
.. _latest release: https://github.com/LizardByte/Sunshine/releases/latest
|
||||||
.. _Dockerhub.io: https://hub.docker.com/repository/docker/lizardbyte/sunshine
|
.. _Dockerhub.io: https://hub.docker.com/repository/docker/lizardbyte/sunshine
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ Usage
|
|||||||
|
|
||||||
Network
|
Network
|
||||||
-------
|
-------
|
||||||
Sunshine will be available on port 47990 by default.
|
The Sunshine user interface will be available on port 47990 by default.
|
||||||
|
|
||||||
.. Danger:: Do not expose port 47990, or the web ui, to the internet!
|
.. Warning:: Exposing ports to the internet can be dangerous. Do this at your own risk.
|
||||||
|
|
||||||
Arguments
|
Arguments
|
||||||
---------
|
---------
|
||||||
@@ -56,7 +56,8 @@ Setup
|
|||||||
|
|
||||||
Linux
|
Linux
|
||||||
^^^^^
|
^^^^^
|
||||||
The deb and rpm packages handle these steps automatically. The AppImage does not, third party packages may not as well.
|
The deb, rpm, and AppImage packages handle these steps automatically. The flatpak does not, third party packages
|
||||||
|
also may not.
|
||||||
|
|
||||||
Sunshine needs access to `uinput` to create mouse and gamepad events.
|
Sunshine needs access to `uinput` to create mouse and gamepad events.
|
||||||
|
|
||||||
@@ -105,7 +106,7 @@ Sunshine needs access to `uinput` to create mouse and gamepad events.
|
|||||||
aur /usr/bin/sunshine ✔
|
aur /usr/bin/sunshine ✔
|
||||||
deb /usr/bin/sunshine ✔
|
deb /usr/bin/sunshine ✔
|
||||||
rpm /usr/bin/sunshine ✔
|
rpm /usr/bin/sunshine ✔
|
||||||
AppImage ~/sunshine.AppImage ✖
|
AppImage ~/sunshine.AppImage ✔
|
||||||
Flatpak flatpak run dev.lizardbyte.sunshine ✖
|
Flatpak flatpak run dev.lizardbyte.sunshine ✖
|
||||||
======== ============================================== ===============
|
======== ============================================== ===============
|
||||||
|
|
||||||
@@ -169,9 +170,11 @@ All shortcuts start with CTRL + ALT + SHIFT, just like Moonlight
|
|||||||
|
|
||||||
Application List
|
Application List
|
||||||
----------------
|
----------------
|
||||||
|
- Applications should be configured via the web UI.
|
||||||
|
- A basic understanding of working directories and commands is recommended.
|
||||||
- You can use Environment variables in place of values
|
- You can use Environment variables in place of values
|
||||||
- ``$(HOME)`` will be replaced by the value of ``$HOME``
|
- ``$(HOME)`` will be replaced by the value of ``$HOME``
|
||||||
- ``$$`` will be replaced by ``$``, e.g. ``$$(HOME)`` will be replaced by ``$(HOME)``
|
- ``$$`` will be replaced by ``$``, e.g. ``$$(HOME)`` will be become ``$(HOME)``
|
||||||
- ``env`` - Adds or overwrites Environment variables for the commands/applications run by Sunshine
|
- ``env`` - Adds or overwrites Environment variables for the commands/applications run by Sunshine
|
||||||
- ``"Variable name":"Variable value"``
|
- ``"Variable name":"Variable value"``
|
||||||
- ``apps`` - The list of applications
|
- ``apps`` - The list of applications
|
||||||
@@ -219,3 +222,4 @@ Considerations
|
|||||||
- When the application has been shutdown, the stream shuts down as well.
|
- When the application has been shutdown, the stream shuts down as well.
|
||||||
- In addition to the apps listed, one app "Desktop" is hardcoded into Sunshine. It does not start an application,
|
- In addition to the apps listed, one app "Desktop" is hardcoded into Sunshine. It does not start an application,
|
||||||
instead it simply starts a stream.
|
instead it simply starts a stream.
|
||||||
|
- For the Linux flatpak you must prepend commands with ``flatpak-spawn --host``.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Linux
|
Linux
|
||||||
=====
|
=====
|
||||||
If screencasting fails with Wayland, you may need to run the following to force screencasting with X11.
|
If screencasting fails with KMS, you may need to run the following to force unprivileged screencasting.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
|
|||||||
110
packaging/linux/AppImage/AppRun
Normal file
110
packaging/linux/AppImage/AppRun
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# custom AppRun for Sunshine AppImage
|
||||||
|
|
||||||
|
# path of the extracted AppRun
|
||||||
|
HERE="$(dirname "$(readlink -f "${0}")")"
|
||||||
|
SUNSHINE_PATH=/usr/bin/sunshine
|
||||||
|
SUNSHINE_BIN_HERE=$HERE/usr/bin/sunshine
|
||||||
|
SUNSHINE_SHARE_HERE=$HERE/usr/share/sunshine
|
||||||
|
|
||||||
|
# Set APPDIR when running directly from the AppDir:
|
||||||
|
if [ -z "$APPDIR" ]; then
|
||||||
|
ARGV0="AppRun"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$HERE" || exit 1
|
||||||
|
|
||||||
|
function help() {
|
||||||
|
echo "
|
||||||
|
------------------------------
|
||||||
|
Sunshine AppImage package.
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
sunshine.AppImage options
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
Usage: $ARGV0 --help, -h
|
||||||
|
------ # This message
|
||||||
|
|
||||||
|
$ARGV0 --install, -i
|
||||||
|
# Install input rules sunshine.service files. Restart required.
|
||||||
|
|
||||||
|
$ARGV0 --remove, -r
|
||||||
|
# Remove input rules sunshine.service files.
|
||||||
|
|
||||||
|
$ARGV0 --appimage-help
|
||||||
|
# Show available AppImage options
|
||||||
|
|
||||||
|
sunshine options
|
||||||
|
----------------
|
||||||
|
"
|
||||||
|
# print sunshine binary help, replacing the sunshine command in usage statement
|
||||||
|
"$SUNSHINE_BIN_HERE" --help | sed -e "s#$SUNSHINE_BIN_HERE#$ARGV0#g"
|
||||||
|
}
|
||||||
|
|
||||||
|
function install() {
|
||||||
|
# user input rules
|
||||||
|
sudo usermod -a -G input $USER
|
||||||
|
# shellcheck disable=SC2002
|
||||||
|
cat "$SUNSHINE_SHARE_HERE/udev/rules.d/85-sunshine.rules" | sudo tee /etc/udev/85-sunshine.rules
|
||||||
|
|
||||||
|
# sunshine service
|
||||||
|
mkdir -p ~/.config/systemd/user
|
||||||
|
cp -r "$SUNSHINE_SHARE_HERE/systemd/user/" ~/.config/systemd/
|
||||||
|
# patch service executable path
|
||||||
|
sed -i -e "s#$SUNSHINE_PATH#$(readlink -f $ARGV0)#g" ~/.config/systemd/user/sunshine.service
|
||||||
|
|
||||||
|
# setcap
|
||||||
|
sudo setcap cap_sys_admin+p "$(readlink -f "$SUNSHINE_BIN_HERE")"
|
||||||
|
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
read -r -p "This installation requires a reboot. Do you want to reboot NOW? [y/n] " input
|
||||||
|
|
||||||
|
case $input in
|
||||||
|
[yY][eE][sS]|[yY])
|
||||||
|
echo "Yes"
|
||||||
|
sudo reboot now
|
||||||
|
;;
|
||||||
|
[nN][oO]|[nN])
|
||||||
|
echo "No"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid input..."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove() {
|
||||||
|
# remove input rules
|
||||||
|
sudo rm -f /etc/udev/rules.d/85-sunshine.rules
|
||||||
|
|
||||||
|
# remove service
|
||||||
|
sudo rm -f ~/.config/systemd/user/sunshine.service
|
||||||
|
}
|
||||||
|
|
||||||
|
# process arguments
|
||||||
|
if [ "x$1" == "xhelp" ] || [ "x$1" == "x--help" ] || [ "x$1" == "x-h" ] ; then
|
||||||
|
help
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "x$1" == "xinstall" ] || [ "x$1" == "x--install" ] || [ "x$1" == "x-i" ] ; then
|
||||||
|
install
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "x$1" == "xremove" ] || [ "x$1" == "x--remove" ] || [ "x$1" == "x-r" ] ; then
|
||||||
|
remove
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
# create config directory if it doesn't exist
|
||||||
|
# https://github.com/LizardByte/Sunshine/issues/324
|
||||||
|
mkdir -p ~/.config/sunshine
|
||||||
|
|
||||||
|
# run sunshine
|
||||||
|
"$SUNSHINE_BIN_HERE" $@
|
||||||
@@ -32,10 +32,9 @@ build() {
|
|||||||
-S "$pkgname" \
|
-S "$pkgname" \
|
||||||
-B build \
|
-B build \
|
||||||
-Wno-dev \
|
-Wno-dev \
|
||||||
|
-D CMAKE_INSTALL_PREFIX=/usr \
|
||||||
-D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
|
-D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
|
||||||
-D CMAKE_INSTALL_PREFIX="/usr" \
|
-D SUNSHINE_ASSETS_DIR="share/sunshine" \
|
||||||
-D SUNSHINE_ASSETS_DIR="share/sunshine/assets" \
|
|
||||||
-D SUNSHINE_CONFIG_DIR="share/sunshine/config" \
|
|
||||||
-D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
-D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
||||||
-D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \
|
-D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \
|
||||||
-D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
-D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
||||||
|
|||||||
@@ -6,16 +6,16 @@ sdk: org.freedesktop.Sdk
|
|||||||
command: sunshine
|
command: sunshine
|
||||||
separate-locales: false
|
separate-locales: false
|
||||||
finish-args:
|
finish-args:
|
||||||
- --device=all
|
- --device=all # access all devices
|
||||||
- --env=PULSE_PROP_media.category=Manager
|
- --env=PULSE_PROP_media.category=Manager # allow sunshine to manage audio sinks
|
||||||
- --persist=.config/sunshine
|
- --filesystem=home # need to save files in user's home directory
|
||||||
- --share=ipc
|
- --share=ipc # required for X11 shared memory extension
|
||||||
- --share=network
|
- --share=network # access network
|
||||||
- --socket=pulseaudio
|
- --socket=pulseaudio # play sounds using pulseaudio
|
||||||
- --socket=wayland
|
- --socket=wayland # show windows using Wayland
|
||||||
- --socket=x11
|
- --socket=x11 # show windows using X11
|
||||||
- --system-talk-name=org.freedesktop.Avahi
|
- --system-talk-name=org.freedesktop.Avahi # talk to avahi on the system bus
|
||||||
- --talk-name=org.freedesktop.Flatpak
|
- --talk-name=org.freedesktop.Flatpak # talk to flatpak on the session bus
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
- /include
|
- /include
|
||||||
@@ -23,7 +23,7 @@ cleanup:
|
|||||||
- /lib/pkgconfig
|
- /lib/pkgconfig
|
||||||
- /lib/*.la
|
- /lib/*.la
|
||||||
- /lib/*.a
|
- /lib/*.a
|
||||||
- /share
|
- /share/man
|
||||||
|
|
||||||
modules:
|
modules:
|
||||||
- name: cuda
|
- name: cuda
|
||||||
@@ -88,7 +88,7 @@ modules:
|
|||||||
# - --extra-ldflags=-L${FLATPAK_DEST}/cuda/lib64
|
# - --extra-ldflags=-L${FLATPAK_DEST}/cuda/lib64
|
||||||
# - --nvccflags="-gencode arch=compute_52,code=sm_52 -O2"
|
# - --nvccflags="-gencode arch=compute_52,code=sm_52 -O2"
|
||||||
cleanup:
|
cleanup:
|
||||||
- /share/ffmpeg/examples
|
- /share
|
||||||
sources:
|
sources:
|
||||||
- type: archive
|
- type: archive
|
||||||
url: http://archive.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/ffmpeg_4.4.2.orig.tar.xz
|
url: http://archive.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/ffmpeg_4.4.2.orig.tar.xz
|
||||||
@@ -137,8 +137,7 @@ modules:
|
|||||||
cleanup:
|
cleanup:
|
||||||
- /bin
|
- /bin
|
||||||
- /lib/avahi
|
- /lib/avahi
|
||||||
- /share/applications/*.desktop
|
- /share
|
||||||
- /share/avahi
|
|
||||||
config-opts:
|
config-opts:
|
||||||
- --with-distro=none
|
- --with-distro=none
|
||||||
- --disable-gobject
|
- --disable-gobject
|
||||||
@@ -202,13 +201,13 @@ modules:
|
|||||||
- -DCMAKE_BUILD_TYPE=Release
|
- -DCMAKE_BUILD_TYPE=Release
|
||||||
- -DCMAKE_INSTALL_PREFIX=/app
|
- -DCMAKE_INSTALL_PREFIX=/app
|
||||||
- -DCMAKE_CUDA_COMPILER=/app/cuda/bin/nvcc
|
- -DCMAKE_CUDA_COMPILER=/app/cuda/bin/nvcc
|
||||||
- -DSUNSHINE_ASSETS_DIR=assets
|
- -DSUNSHINE_ASSETS_DIR=share/sunshine
|
||||||
- -DSUNSHINE_CONFIG_DIR=config
|
|
||||||
- -DSUNSHINE_EXECUTABLE_PATH=/app/bin/sunshine
|
- -DSUNSHINE_EXECUTABLE_PATH=/app/bin/sunshine
|
||||||
- -DSUNSHINE_ENABLE_WAYLAND=ON
|
- -DSUNSHINE_ENABLE_WAYLAND=ON
|
||||||
- -DSUNSHINE_ENABLE_X11=ON
|
- -DSUNSHINE_ENABLE_X11=ON
|
||||||
- -DSUNSHINE_ENABLE_DRM=ON
|
- -DSUNSHINE_ENABLE_DRM=ON
|
||||||
- -DSUNSHINE_ENABLE_CUDA=ON
|
- -DSUNSHINE_ENABLE_CUDA=ON
|
||||||
|
- -DSUNSHINE_CONFIGURE_FLATPAK=ON
|
||||||
sources:
|
sources:
|
||||||
- type: git
|
- type: git
|
||||||
url: '@GITHUB_CLONE_URL@'
|
url: '@GITHUB_CLONE_URL@'
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ depends_lib port:avahi \
|
|||||||
boost.version 1.80
|
boost.version 1.80
|
||||||
|
|
||||||
configure.args -DCMAKE_INSTALL_PREFIX=${prefix} \
|
configure.args -DCMAKE_INSTALL_PREFIX=${prefix} \
|
||||||
-DSUNSHINE_ASSETS_DIR=etc/sunshine/assets \
|
-DSUNSHINE_ASSETS_DIR=etc/sunshine/assets
|
||||||
-DSUNSHINE_CONFIG_DIR=etc/sunshine/config
|
|
||||||
|
|
||||||
startupitem.create yes
|
startupitem.create yes
|
||||||
startupitem.executable "${prefix}/bin/{$name}"
|
startupitem.executable "${prefix}/bin/{$name}"
|
||||||
@@ -54,30 +53,6 @@ platform darwin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# destroot not required as cmake install directive handles moving files
|
|
||||||
|
|
||||||
# # Rename files in `destroot`
|
|
||||||
# post-destroot {
|
|
||||||
# file rename ${destroot}${prefix}/etc/${name}/config/sunshine.conf ${destroot}${prefix}/etc/${name}/config/sunshine.conf.sample
|
|
||||||
# file rename ${destroot}${prefix}/etc/${name}/config/apps.json ${destroot}${prefix}/etc/${name}/config/apps.json.sample
|
|
||||||
# }
|
|
||||||
|
|
||||||
# # Don't overwrite existing preference files
|
|
||||||
# post-activate {
|
|
||||||
# if {![file exists ${prefix}/etc/${name}/config/sunshine.conf]} {
|
|
||||||
# file copy ${destroot}${prefix}/etc/${name}/config/sunshine.conf.sample \
|
|
||||||
# ${prefix}/etc/${name}/config/sunshine.conf
|
|
||||||
# }
|
|
||||||
# if {![file exists ${prefix}/etc/${name}/config/apps.json]} {
|
|
||||||
# file copy ${destroot}${prefix}/etc/${name}/config/apps.json.sample \
|
|
||||||
# ${prefix}/etc/${name}/config/apps.json
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
|
|
||||||
# disabled not overwriting config files... these are the default config files required by Sunshine
|
|
||||||
# this did not work with pkg created by macports
|
|
||||||
# we should always install the default files and user should start sunshine like "sunshine <path to user config file>"
|
|
||||||
# if the file doesn't exist sunshine will copy the default config to that location
|
|
||||||
notes-append "Run @PROJECT_NAME@ by executing 'sunshine <path to user config>', e.g. 'sunshine ~/sunshine.conf' "
|
notes-append "Run @PROJECT_NAME@ by executing 'sunshine <path to user config>', e.g. 'sunshine ~/sunshine.conf' "
|
||||||
notes-append "The config file will be created if it doesn't exist."
|
notes-append "The config file will be created if it doesn't exist."
|
||||||
notes-append "It is recommended to set a location for the apps file in the config."
|
notes-append "It is recommended to set a location for the apps file in the config."
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ auto control_shared = safe::make_shared<audio_ctx_t>(start_audio_control, stop_a
|
|||||||
void encodeThread(sample_queue_t samples, config_t config, void *channel_data) {
|
void encodeThread(sample_queue_t samples, config_t config, void *channel_data) {
|
||||||
auto packets = mail::man->queue<packet_t>(mail::audio_packets);
|
auto packets = mail::man->queue<packet_t>(mail::audio_packets);
|
||||||
|
|
||||||
//FIXME: Pick correct opus_stream_config_t based on config.channels
|
// FIXME: Pick correct opus_stream_config_t based on config.channels
|
||||||
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
|
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
|
||||||
|
|
||||||
opus_t opus { opus_multistream_encoder_create(
|
opus_t opus { opus_multistream_encoder_create(
|
||||||
@@ -120,7 +120,7 @@ void encodeThread(sample_queue_t samples, config_t config, void *channel_data) {
|
|||||||
void capture(safe::mail_t mail, config_t config, void *channel_data) {
|
void capture(safe::mail_t mail, config_t config, void *channel_data) {
|
||||||
auto shutdown_event = mail->event<bool>(mail::shutdown);
|
auto shutdown_event = mail->event<bool>(mail::shutdown);
|
||||||
|
|
||||||
//FIXME: Pick correct opus_stream_config_t based on config.channels
|
// FIXME: Pick correct opus_stream_config_t based on config.channels
|
||||||
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
|
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
|
||||||
|
|
||||||
auto ref = control_shared.ref();
|
auto ref = control_shared.ref();
|
||||||
@@ -135,7 +135,7 @@ void capture(safe::mail_t mail, config_t config, void *channel_data) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Order of priorty:
|
// Order of priority:
|
||||||
// 1. Config
|
// 1. Config
|
||||||
// 2. Virtual if available
|
// 2. Virtual if available
|
||||||
// 3. Host
|
// 3. Host
|
||||||
|
|||||||
@@ -124,9 +124,9 @@ util::buffer_t<std::uint8_t> make_sps_h264(const AVCodecContext *ctx) {
|
|||||||
sps.seq_parameter_set_id = 0;
|
sps.seq_parameter_set_id = 0;
|
||||||
sps.chroma_format_idc = 1;
|
sps.chroma_format_idc = 1;
|
||||||
|
|
||||||
sps.log2_max_frame_num_minus4 = 3; //4;
|
sps.log2_max_frame_num_minus4 = 3; // 4;
|
||||||
sps.pic_order_cnt_type = 0;
|
sps.pic_order_cnt_type = 0;
|
||||||
sps.log2_max_pic_order_cnt_lsb_minus4 = 0; //4;
|
sps.log2_max_pic_order_cnt_lsb_minus4 = 0; // 4;
|
||||||
|
|
||||||
sps.max_num_ref_frames = dpb_frame;
|
sps.max_num_ref_frames = dpb_frame;
|
||||||
|
|
||||||
@@ -297,4 +297,4 @@ bool validate_sps(const AVPacket *packet, int codec_id) {
|
|||||||
|
|
||||||
return ((CodedBitstreamH265Context *)ctx->priv_data)->active_sps->vui_parameters_present_flag;
|
return ((CodedBitstreamH265Context *)ctx->priv_data)->active_sps->vui_parameters_present_flag;
|
||||||
}
|
}
|
||||||
} // namespace cbs
|
} // namespace cbs
|
||||||
|
|||||||
@@ -31,4 +31,4 @@ h264_t make_sps_h264(const AVCodecContext *ctx, const AVPacket *packet);
|
|||||||
bool validate_sps(const AVPacket *packet, int codec_id);
|
bool validate_sps(const AVPacket *packet, int codec_id);
|
||||||
} // namespace cbs
|
} // namespace cbs
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
@@ -104,14 +105,14 @@ enum quality_e : int {
|
|||||||
enum class rc_hevc_e : int {
|
enum class rc_hevc_e : int {
|
||||||
constqp, /**< Constant QP mode */
|
constqp, /**< Constant QP mode */
|
||||||
vbr_latency, /**< Latency Constrained Variable Bitrate */
|
vbr_latency, /**< Latency Constrained Variable Bitrate */
|
||||||
vbr_peak, /**< Peak Contrained Variable Bitrate */
|
vbr_peak, /**< Peak Constrained Variable Bitrate */
|
||||||
cbr, /**< Constant bitrate mode */
|
cbr, /**< Constant bitrate mode */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class rc_h264_e : int {
|
enum class rc_h264_e : int {
|
||||||
constqp, /**< Constant QP mode */
|
constqp, /**< Constant QP mode */
|
||||||
cbr, /**< Constant bitrate mode */
|
cbr, /**< Constant bitrate mode */
|
||||||
vbr_peak, /**< Peak Contrained Variable Bitrate */
|
vbr_peak, /**< Peak Constrained Variable Bitrate */
|
||||||
vbr_latency, /**< Latency Constrained Variable Bitrate */
|
vbr_latency, /**< Latency Constrained Variable Bitrate */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -702,7 +703,7 @@ int apply_flags(const char *line) {
|
|||||||
|
|
||||||
void apply_config(std::unordered_map<std::string, std::string> &&vars) {
|
void apply_config(std::unordered_map<std::string, std::string> &&vars) {
|
||||||
if(!fs::exists(stream.file_apps.c_str())) {
|
if(!fs::exists(stream.file_apps.c_str())) {
|
||||||
fs::copy_file(SUNSHINE_CONFIG_DIR "/apps.json", stream.file_apps);
|
fs::copy_file(SUNSHINE_ASSETS_DIR "/apps.json", stream.file_apps);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto &[name, val] : vars) {
|
for(auto &[name, val] : vars) {
|
||||||
@@ -910,8 +911,14 @@ int parse(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create appdata folder if it does not exist
|
||||||
|
if(!boost::filesystem::exists(platf::appdata().string())) {
|
||||||
|
boost::filesystem::create_directory(platf::appdata().string());
|
||||||
|
}
|
||||||
|
|
||||||
|
// create config file if it does not exist
|
||||||
if(!fs::exists(sunshine.config_file)) {
|
if(!fs::exists(sunshine.config_file)) {
|
||||||
fs::copy_file(SUNSHINE_CONFIG_DIR "/sunshine.conf", sunshine.config_file);
|
std::ofstream { sunshine.config_file }; // create empty config file
|
||||||
}
|
}
|
||||||
|
|
||||||
auto vars = parse_config(read_file(sunshine.config_file.c_str()));
|
auto vars = parse_config(read_file(sunshine.config_file.c_str()));
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
//
|
|
||||||
// Created by TheElixZammuto on 2021-05-09.
|
// Created by TheElixZammuto on 2021-05-09.
|
||||||
// TODO: Authentication, better handling of routes common to nvhttp, cleanup
|
// TODO: Authentication, better handling of routes common to nvhttp, cleanup
|
||||||
|
|
||||||
@@ -92,7 +91,7 @@ bool authenticate(resp_https_t response, req_https_t request) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//If credentials are shown, redirect the user to a /welcome page
|
// If credentials are shown, redirect the user to a /welcome page
|
||||||
if(config::sunshine.username.empty()) {
|
if(config::sunshine.username.empty()) {
|
||||||
send_redirect(response, request, "/welcome");
|
send_redirect(response, request, "/welcome");
|
||||||
return false;
|
return false;
|
||||||
@@ -314,7 +313,7 @@ void saveApp(resp_https_t response, req_https_t request) {
|
|||||||
|
|
||||||
BOOST_LOG(fatal) << config::stream.file_apps;
|
BOOST_LOG(fatal) << config::stream.file_apps;
|
||||||
try {
|
try {
|
||||||
//TODO: Input Validation
|
// TODO: Input Validation
|
||||||
pt::read_json(ss, inputTree);
|
pt::read_json(ss, inputTree);
|
||||||
pt::read_json(config::stream.file_apps, fileTree);
|
pt::read_json(config::stream.file_apps, fileTree);
|
||||||
|
|
||||||
@@ -335,7 +334,7 @@ void saveApp(resp_https_t response, req_https_t request) {
|
|||||||
apps_node.push_back(std::make_pair("", inputTree));
|
apps_node.push_back(std::make_pair("", inputTree));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//Unfortuantely Boost PT does not allow to directly edit the array, copy should do the trick
|
// Unfortunately Boost PT does not allow to directly edit the array, copy should do the trick
|
||||||
pt::ptree newApps;
|
pt::ptree newApps;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(const auto &kv : apps_node) {
|
for(const auto &kv : apps_node) {
|
||||||
@@ -388,7 +387,7 @@ void deleteApp(resp_https_t response, req_https_t request) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//Unfortuantely Boost PT does not allow to directly edit the array, copy should do the trick
|
// Unfortunately Boost PT does not allow to directly edit the array, copy should do the trick
|
||||||
pt::ptree newApps;
|
pt::ptree newApps;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(const auto &kv : apps_node) {
|
for(const auto &kv : apps_node) {
|
||||||
@@ -452,7 +451,7 @@ void saveConfig(resp_https_t response, req_https_t request) {
|
|||||||
});
|
});
|
||||||
pt::ptree inputTree;
|
pt::ptree inputTree;
|
||||||
try {
|
try {
|
||||||
//TODO: Input Validation
|
// TODO: Input Validation
|
||||||
pt::read_json(ss, inputTree);
|
pt::read_json(ss, inputTree);
|
||||||
for(const auto &kv : inputTree) {
|
for(const auto &kv : inputTree) {
|
||||||
std::string value = inputTree.get<std::string>(kv.first);
|
std::string value = inputTree.get<std::string>(kv.first);
|
||||||
@@ -488,7 +487,7 @@ void savePassword(resp_https_t response, req_https_t request) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//TODO: Input Validation
|
// TODO: Input Validation
|
||||||
pt::read_json(ss, inputTree);
|
pt::read_json(ss, inputTree);
|
||||||
auto username = inputTree.count("currentUsername") > 0 ? inputTree.get<std::string>("currentUsername") : "";
|
auto username = inputTree.count("currentUsername") > 0 ? inputTree.get<std::string>("currentUsername") : "";
|
||||||
auto newUsername = inputTree.get<std::string>("newUsername");
|
auto newUsername = inputTree.get<std::string>("newUsername");
|
||||||
@@ -544,7 +543,7 @@ void savePin(resp_https_t response, req_https_t request) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//TODO: Input Validation
|
// TODO: Input Validation
|
||||||
pt::read_json(ss, inputTree);
|
pt::read_json(ss, inputTree);
|
||||||
std::string pin = inputTree.get<std::string>("pin");
|
std::string pin = inputTree.get<std::string>("pin");
|
||||||
outputTree.put("status", nvhttp::pin(pin));
|
outputTree.put("status", nvhttp::pin(pin));
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/3/19.
|
// Created by loki on 6/3/19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_CONFIGHTTP_H
|
#ifndef SUNSHINE_CONFIGHTTP_H
|
||||||
#define SUNSHINE_CONFIGHTTP_H
|
#define SUNSHINE_CONFIGHTTP_H
|
||||||
@@ -18,4 +16,4 @@ constexpr auto PORT_HTTPS = 1;
|
|||||||
void start();
|
void start();
|
||||||
} // namespace confighttp
|
} // namespace confighttp
|
||||||
|
|
||||||
#endif //SUNSHINE_CONFIGHTTP_H
|
#endif // SUNSHINE_CONFIGHTTP_H
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
//
|
|
||||||
// Created by loki on 5/31/19.
|
// Created by loki on 5/31/19.
|
||||||
//
|
|
||||||
|
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
namespace crypto {
|
namespace crypto {
|
||||||
using big_num_t = util::safe_ptr<BIGNUM, BN_free>;
|
using big_num_t = util::safe_ptr<BIGNUM, BN_free>;
|
||||||
//using rsa_t = util::safe_ptr<RSA, RSA_free>;
|
// using rsa_t = util::safe_ptr<RSA, RSA_free>;
|
||||||
using asn1_string_t = util::safe_ptr<ASN1_STRING, ASN1_STRING_free>;
|
using asn1_string_t = util::safe_ptr<ASN1_STRING, ASN1_STRING_free>;
|
||||||
|
|
||||||
cert_chain_t::cert_chain_t() : _certs {}, _cert_ctx { X509_STORE_CTX_new() } {}
|
cert_chain_t::cert_chain_t() : _certs {}, _cert_ctx { X509_STORE_CTX_new() } {}
|
||||||
@@ -22,7 +20,7 @@ static int openssl_verify_cb(int ok, X509_STORE_CTX *ctx) {
|
|||||||
int err_code = X509_STORE_CTX_get_error(ctx);
|
int err_code = X509_STORE_CTX_get_error(ctx);
|
||||||
|
|
||||||
switch(err_code) {
|
switch(err_code) {
|
||||||
//FIXME: Checking for X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY is a temporary workaround to get mmonlight-embedded to work on the raspberry pi
|
// FIXME: Checking for X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY is a temporary workaround to get mmonlight-embedded to work on the raspberry pi
|
||||||
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
|
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@@ -274,7 +272,7 @@ int cbc_t::encrypt(const std::string_view &plaintext, std::uint8_t *cipher, aes_
|
|||||||
|
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
int size = plaintext.size(); //round_to_pkcs7_padded(plaintext.size());
|
int size = plaintext.size(); // round_to_pkcs7_padded(plaintext.size());
|
||||||
|
|
||||||
// Encrypt into the caller's buffer
|
// Encrypt into the caller's buffer
|
||||||
if(EVP_EncryptUpdate(encrypt_ctx.get(), cipher, &size, (const std::uint8_t *)plaintext.data(), plaintext.size()) != 1) {
|
if(EVP_EncryptUpdate(encrypt_ctx.get(), cipher, &size, (const std::uint8_t *)plaintext.data(), plaintext.size()) != 1) {
|
||||||
@@ -492,4 +490,4 @@ std::string rand_alphabet(std::size_t bytes, const std::string_view &alphabet) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace crypto
|
} // namespace crypto
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/1/19.
|
// Created by loki on 6/1/19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_CRYPTO_H
|
#ifndef SUNSHINE_CRYPTO_H
|
||||||
#define SUNSHINE_CRYPTO_H
|
#define SUNSHINE_CRYPTO_H
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ int init() {
|
|||||||
|
|
||||||
if(clean_slate) {
|
if(clean_slate) {
|
||||||
unique_id = util::uuid_t::generate().string();
|
unique_id = util::uuid_t::generate().string();
|
||||||
auto dir = std::filesystem::temp_directory_path() / "Sushine"sv;
|
auto dir = std::filesystem::temp_directory_path() / "Sunshine"sv;
|
||||||
config::nvhttp.cert = (dir / ("cert-"s + unique_id)).string();
|
config::nvhttp.cert = (dir / ("cert-"s + unique_id)).string();
|
||||||
config::nvhttp.pkey = (dir / ("pkey-"s + unique_id)).string();
|
config::nvhttp.pkey = (dir / ("pkey-"s + unique_id)).string();
|
||||||
}
|
}
|
||||||
@@ -180,4 +180,4 @@ int create_creds(const std::string &pkey, const std::string &cert) {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} // namespace http
|
} // namespace http
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ extern std::string unique_id;
|
|||||||
extern net::net_e origin_pin_allowed;
|
extern net::net_e origin_pin_allowed;
|
||||||
extern net::net_e origin_web_ui_allowed;
|
extern net::net_e origin_web_ui_allowed;
|
||||||
|
|
||||||
} // namespace http
|
} // namespace http
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/20/19.
|
// Created by loki on 6/20/19.
|
||||||
//
|
|
||||||
|
|
||||||
// define uint32_t for <moonlight-common-c/src/Input.h>
|
// define uint32_t for <moonlight-common-c/src/Input.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -89,7 +87,7 @@ struct gamepad_t {
|
|||||||
|
|
||||||
// When emulating the HOME button, we may need to artificially release the back button.
|
// When emulating the HOME button, we may need to artificially release the back button.
|
||||||
// Afterwards, the gamepad state on sunshine won't match the state on Moonlight.
|
// Afterwards, the gamepad state on sunshine won't match the state on Moonlight.
|
||||||
// To prevent Sunshine from sending erronious input data to the active application,
|
// To prevent Sunshine from sending erroneous input data to the active application,
|
||||||
// Sunshine forces the button to be in a specific state until the gamepad state matches that of
|
// Sunshine forces the button to be in a specific state until the gamepad state matches that of
|
||||||
// Moonlight once more.
|
// Moonlight once more.
|
||||||
button_state_e back_button_state;
|
button_state_e back_button_state;
|
||||||
@@ -316,11 +314,11 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_MOUSE_BUTTON_PACKET packet
|
|||||||
/*/
|
/*/
|
||||||
* When Moonlight sends mouse input through absolute coordinates,
|
* When Moonlight sends mouse input through absolute coordinates,
|
||||||
* it's possible that BUTTON_RIGHT is pressed down immediately after releasing BUTTON_LEFT.
|
* it's possible that BUTTON_RIGHT is pressed down immediately after releasing BUTTON_LEFT.
|
||||||
* As a result, Sunshine will left click on hyperlinks in the browser before right clicking
|
* As a result, Sunshine will left-click on hyperlinks in the browser before right-clicking
|
||||||
*
|
*
|
||||||
* This can be solved by delaying BUTTON_LEFT, however, any delay on input is undesirable during gaming
|
* This can be solved by delaying BUTTON_LEFT, however, any delay on input is undesirable during gaming
|
||||||
* As a compromise, Sunshine will only put delays on BUTTON_LEFT when
|
* As a compromise, Sunshine will only put delays on BUTTON_LEFT when
|
||||||
* absolute mouse coordinates have been send.
|
* absolute mouse coordinates have been sent.
|
||||||
*
|
*
|
||||||
* Try to make sure BUTTON_RIGHT gets called before BUTTON_LEFT is released.
|
* Try to make sure BUTTON_RIGHT gets called before BUTTON_LEFT is released.
|
||||||
*
|
*
|
||||||
@@ -428,7 +426,7 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_KEYBOARD_PACKET packet) {
|
|||||||
if(!pressed) {
|
if(!pressed) {
|
||||||
if(!release) {
|
if(!release) {
|
||||||
// A new key has been pressed down, we need to check for key combo's
|
// A new key has been pressed down, we need to check for key combo's
|
||||||
// If a keycombo has been pressed down, don't pass it through
|
// If a key-combo has been pressed down, don't pass it through
|
||||||
if(input->shortcutFlags == input_t::SHORTCUT && apply_shortcut(keyCode) > 0) {
|
if(input->shortcutFlags == input_t::SHORTCUT && apply_shortcut(keyCode) > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/20/19.
|
// Created by loki on 6/20/19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_INPUT_H
|
#ifndef SUNSHINE_INPUT_H
|
||||||
#define SUNSHINE_INPUT_H
|
#define SUNSHINE_INPUT_H
|
||||||
@@ -32,4 +30,4 @@ struct touch_port_t : public platf::touch_port_t {
|
|||||||
};
|
};
|
||||||
} // namespace input
|
} // namespace input
|
||||||
|
|
||||||
#endif //SUNSHINE_INPUT_H
|
#endif // SUNSHINE_INPUT_H
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 5/30/19.
|
// Created by loki on 5/30/19.
|
||||||
//
|
|
||||||
|
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
|
|
||||||
@@ -289,7 +287,7 @@ int main(int argc, char *argv[]) {
|
|||||||
upnp_unmap = upnp::start();
|
upnp_unmap = upnp::start();
|
||||||
});
|
});
|
||||||
|
|
||||||
//FIXME: Temporary workaround: Simple-Web_server needs to be updated or replaced
|
// FIXME: Temporary workaround: Simple-Web_server needs to be updated or replaced
|
||||||
if(shutdown_event->peek()) {
|
if(shutdown_event->peek()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 12/22/19.
|
// Created by loki on 12/22/19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_MAIN_H
|
#ifndef SUNSHINE_MAIN_H
|
||||||
#define SUNSHINE_MAIN_H
|
#define SUNSHINE_MAIN_H
|
||||||
@@ -54,4 +52,4 @@ MAIL(rumble);
|
|||||||
} // namespace mail
|
} // namespace mail
|
||||||
|
|
||||||
|
|
||||||
#endif //SUNSHINE_MAIN_H
|
#endif // SUNSHINE_MAIN_H
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 12/27/19.
|
// Created by loki on 12/27/19.
|
||||||
//
|
|
||||||
|
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
@@ -112,4 +110,4 @@ void free_host(ENetHost *host) {
|
|||||||
|
|
||||||
enet_host_destroy(host);
|
enet_host_destroy(host);
|
||||||
}
|
}
|
||||||
} // namespace net
|
} // namespace net
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 12/27/19.
|
// Created by loki on 12/27/19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_NETWORK_H
|
#ifndef SUNSHINE_NETWORK_H
|
||||||
#define SUNSHINE_NETWORK_H
|
#define SUNSHINE_NETWORK_H
|
||||||
@@ -32,4 +30,4 @@ net_e from_address(const std::string_view &view);
|
|||||||
host_t host_create(ENetAddress &addr, std::size_t peers, std::uint16_t port);
|
host_t host_create(ENetAddress &addr, std::size_t peers, std::uint16_t port);
|
||||||
} // namespace net
|
} // namespace net
|
||||||
|
|
||||||
#endif //SUNSHINE_NETWORK_H
|
#endif // SUNSHINE_NETWORK_H
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/3/19.
|
// Created by loki on 6/3/19.
|
||||||
//
|
|
||||||
|
|
||||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||||
|
|
||||||
@@ -297,7 +295,7 @@ void clientpairingsecret(std::shared_ptr<safe::queue_t<crypto::x509_t>> &add_cer
|
|||||||
|
|
||||||
// if hash not correct, probably MITM
|
// if hash not correct, probably MITM
|
||||||
if(std::memcmp(hash.data(), sess.clienthash.data(), hash.size())) {
|
if(std::memcmp(hash.data(), sess.clienthash.data(), hash.size())) {
|
||||||
//TODO: log
|
// TODO: log
|
||||||
|
|
||||||
map_id_sess.erase(client.uniqueID);
|
map_id_sess.erase(client.uniqueID);
|
||||||
tree.put("root.paired", 0);
|
tree.put("root.paired", 0);
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/3/19.
|
// Created by loki on 6/3/19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_NVHTTP_H
|
#ifndef SUNSHINE_NVHTTP_H
|
||||||
#define SUNSHINE_NVHTTP_H
|
#define SUNSHINE_NVHTTP_H
|
||||||
@@ -17,4 +15,4 @@ bool pin(std::string pin);
|
|||||||
void erase_all_clients();
|
void erase_all_clients();
|
||||||
} // namespace nvhttp
|
} // namespace nvhttp
|
||||||
|
|
||||||
#endif //SUNSHINE_NVHTTP_H
|
#endif // SUNSHINE_NVHTTP_H
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ static std::uint32_t from_view(const std::string_view &string) {
|
|||||||
_CONVERT("eDP"sv, eDP);
|
_CONVERT("eDP"sv, eDP);
|
||||||
_CONVERT("DSI"sv, DSI);
|
_CONVERT("DSI"sv, DSI);
|
||||||
|
|
||||||
BOOST_LOG(error) << "Unknown Monitor connector type ["sv << string << "]: Please report this to the Github issue tracker"sv;
|
BOOST_LOG(error) << "Unknown Monitor connector type ["sv << string << "]: Please report this to the GitHub issue tracker"sv;
|
||||||
return DRM_MODE_CONNECTOR_Unknown;
|
return DRM_MODE_CONNECTOR_Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 12/14/19.
|
// Created by loki on 12/14/19.
|
||||||
//
|
|
||||||
|
|
||||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||||
|
|
||||||
@@ -47,7 +45,7 @@ int exe(const std::string &cmd, bp::environment &env, file_t &file, std::error_c
|
|||||||
|
|
||||||
int proc_t::execute(int app_id) {
|
int proc_t::execute(int app_id) {
|
||||||
if(!running() && _app_id != -1) {
|
if(!running() && _app_id != -1) {
|
||||||
// previous process exited on it's own, reset _process_handle
|
// previous process exited on its own, reset _process_handle
|
||||||
_process_handle = bp::group();
|
_process_handle = bp::group();
|
||||||
|
|
||||||
_app_id = -1;
|
_app_id = -1;
|
||||||
@@ -73,7 +71,7 @@ int proc_t::execute(int app_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
//Executed when returning from function
|
// Executed when returning from function
|
||||||
auto fg = util::fail_guard([&]() {
|
auto fg = util::fail_guard([&]() {
|
||||||
terminate();
|
terminate();
|
||||||
});
|
});
|
||||||
@@ -193,9 +191,9 @@ std::vector<ctx_t> &proc_t::get_apps() {
|
|||||||
return _apps;
|
return _apps;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets application image from application list.
|
// Gets application image from application list.
|
||||||
/// Returns default image if image configuration is not set.
|
// Returns default image if image configuration is not set.
|
||||||
/// returns http content-type header compatible image type
|
// returns http content-type header compatible image type
|
||||||
std::string proc_t::get_app_image(int app_id) {
|
std::string proc_t::get_app_image(int app_id) {
|
||||||
auto app_index = app_id - 1;
|
auto app_index = app_id - 1;
|
||||||
if(app_index < 0 || app_index >= _apps.size()) {
|
if(app_index < 0 || app_index >= _apps.size()) {
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 12/14/19.
|
// Created by loki on 12/14/19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_PROCESS_H
|
#ifndef SUNSHINE_PROCESS_H
|
||||||
#define SUNSHINE_PROCESS_H
|
#define SUNSHINE_PROCESS_H
|
||||||
@@ -105,4 +103,4 @@ std::optional<proc::proc_t> parse(const std::string &file_name);
|
|||||||
|
|
||||||
extern proc_t proc;
|
extern proc_t proc;
|
||||||
} // namespace proc
|
} // namespace proc
|
||||||
#endif //SUNSHINE_PROCESS_H
|
#endif // SUNSHINE_PROCESS_H
|
||||||
|
|||||||
16
src/rtsp.cpp
16
src/rtsp.cpp
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 2/2/20.
|
// Created by loki on 2/2/20.
|
||||||
//
|
|
||||||
|
|
||||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||||
|
|
||||||
@@ -123,7 +121,7 @@ public:
|
|||||||
socket->read_payload();
|
socket->read_payload();
|
||||||
});
|
});
|
||||||
|
|
||||||
auto content_lenght = 0;
|
auto content_length = 0;
|
||||||
for(auto option = req->options; option != nullptr; option = option->next) {
|
for(auto option = req->options; option != nullptr; option = option->next) {
|
||||||
if("Content-length"sv == option->option) {
|
if("Content-length"sv == option->option) {
|
||||||
BOOST_LOG(debug) << "Found Content-Length: "sv << option->content << " bytes"sv;
|
BOOST_LOG(debug) << "Found Content-Length: "sv << option->content << " bytes"sv;
|
||||||
@@ -133,14 +131,14 @@ public:
|
|||||||
std::string_view content { option->content };
|
std::string_view content { option->content };
|
||||||
auto begin = std::find_if(std::begin(content), std::end(content), [](auto ch) { return (bool)std::isdigit(ch); });
|
auto begin = std::find_if(std::begin(content), std::end(content), [](auto ch) { return (bool)std::isdigit(ch); });
|
||||||
|
|
||||||
content_lenght = util::from_chars(begin, std::end(content));
|
content_length = util::from_chars(begin, std::end(content));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(end - socket->crlf >= content_lenght) {
|
if(end - socket->crlf >= content_length) {
|
||||||
if(end - socket->crlf > content_lenght) {
|
if(end - socket->crlf > content_length) {
|
||||||
BOOST_LOG(warning) << "(end - socket->crlf) > content_lenght -- "sv << (std::size_t)(end - socket->crlf) << " > "sv << content_lenght;
|
BOOST_LOG(warning) << "(end - socket->crlf) > content_length -- "sv << (std::size_t)(end - socket->crlf) << " > "sv << content_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
fg.disable();
|
fg.disable();
|
||||||
@@ -271,7 +269,7 @@ public:
|
|||||||
if(ec) {
|
if(ec) {
|
||||||
BOOST_LOG(error) << "Couldn't accept incoming connections: "sv << ec.message();
|
BOOST_LOG(error) << "Couldn't accept incoming connections: "sv << ec.message();
|
||||||
|
|
||||||
//Stop server
|
// Stop server
|
||||||
clear();
|
clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -380,7 +378,7 @@ void launch_session_raise(launch_session_t launch_session) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int session_count() {
|
int session_count() {
|
||||||
// Ensure session_count is up to date
|
// Ensure session_count is up-to-date
|
||||||
server.clear(false);
|
server.clear(false);
|
||||||
|
|
||||||
return server.session_count();
|
return server.session_count();
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 2/2/20.
|
// Created by loki on 2/2/20.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_RTSP_H
|
#ifndef SUNSHINE_RTSP_H
|
||||||
#define SUNSHINE_RTSP_H
|
#define SUNSHINE_RTSP_H
|
||||||
@@ -27,4 +25,4 @@ void rtpThread();
|
|||||||
|
|
||||||
} // namespace stream
|
} // namespace stream
|
||||||
|
|
||||||
#endif //SUNSHINE_RTSP_H
|
#endif // SUNSHINE_RTSP_H
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/5/19.
|
// Created by loki on 6/5/19.
|
||||||
//
|
|
||||||
|
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
|
|
||||||
@@ -240,11 +238,10 @@ struct broadcast_ctx_t {
|
|||||||
udp::socket video_sock { io };
|
udp::socket video_sock { io };
|
||||||
udp::socket audio_sock { io };
|
udp::socket audio_sock { io };
|
||||||
|
|
||||||
// This is purely for adminitrative purposes.
|
// This is purely for administrative purposes.
|
||||||
//
|
// It's possible two instances of Moonlight are behind a NAT.
|
||||||
// It's possible two instances of Moonlight are behind a NAT.
|
// From Sunshine's point of view, the ip addresses are identical
|
||||||
// From Sunshine's point of view, the ip addresses are identical
|
// We need some way to know what ports are already used for different streams
|
||||||
// We need some way to know what ports are already used for different streams
|
|
||||||
util::sync_t<std::vector<std::pair<std::string, std::uint16_t>>> audio_video_connections;
|
util::sync_t<std::vector<std::pair<std::string, std::uint16_t>>> audio_video_connections;
|
||||||
|
|
||||||
control_server_t control_server;
|
control_server_t control_server;
|
||||||
@@ -767,7 +764,7 @@ void controlBroadcastThread(control_server_t *server) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Let all remaining connections know the server is shutting down
|
// Let all remaining connections know the server is shutting down
|
||||||
// reason: gracefull termination
|
// reason: graceful termination
|
||||||
std::uint32_t reason = 0x80030023;
|
std::uint32_t reason = 0x80030023;
|
||||||
|
|
||||||
control_terminate_t plaintext;
|
control_terminate_t plaintext;
|
||||||
@@ -932,7 +929,7 @@ void videoBroadcastThread(udp::socket &sock) {
|
|||||||
|
|
||||||
// With a fecpercentage of 255, if payload_new is broken up into more than a 100 data_shards
|
// With a fecpercentage of 255, if payload_new is broken up into more than a 100 data_shards
|
||||||
// it will generate greater than DATA_SHARDS_MAX shards.
|
// it will generate greater than DATA_SHARDS_MAX shards.
|
||||||
// Therefore, we start breaking the data up into three seperate fec blocks.
|
// Therefore, we start breaking the data up into three separate fec blocks.
|
||||||
auto multi_fec_threshold = 90 * blocksize;
|
auto multi_fec_threshold = 90 * blocksize;
|
||||||
|
|
||||||
// We can go up to 4 fec blocks, but 3 is plenty
|
// We can go up to 4 fec blocks, but 3 is plenty
|
||||||
@@ -1331,7 +1328,7 @@ void join(session_t &session) {
|
|||||||
session.audioThread.join();
|
session.audioThread.join();
|
||||||
BOOST_LOG(debug) << "Waiting for control to end..."sv;
|
BOOST_LOG(debug) << "Waiting for control to end..."sv;
|
||||||
session.controlEnd.view();
|
session.controlEnd.view();
|
||||||
//Reset input on session stop to avoid stuck repeated keys
|
// Reset input on session stop to avoid stuck repeated keys
|
||||||
BOOST_LOG(debug) << "Resetting Input..."sv;
|
BOOST_LOG(debug) << "Resetting Input..."sv;
|
||||||
input::reset(session.input);
|
input::reset(session.input);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/5/19.
|
// Created by loki on 6/5/19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_STREAM_H
|
#ifndef SUNSHINE_STREAM_H
|
||||||
#define SUNSHINE_STREAM_H
|
#define SUNSHINE_STREAM_H
|
||||||
@@ -45,4 +43,4 @@ state_e state(session_t &session);
|
|||||||
} // namespace session
|
} // namespace session
|
||||||
} // namespace stream
|
} // namespace stream
|
||||||
|
|
||||||
#endif //SUNSHINE_STREAM_H
|
#endif // SUNSHINE_STREAM_H
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 16-4-19.
|
// Created by loki on 16-4-19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_SYNC_H
|
#ifndef SUNSHINE_SYNC_H
|
||||||
#define SUNSHINE_SYNC_H
|
#define SUNSHINE_SYNC_H
|
||||||
@@ -92,4 +90,4 @@ private:
|
|||||||
} // namespace util
|
} // namespace util
|
||||||
|
|
||||||
|
|
||||||
#endif //T_MAN_SYNC_H
|
#endif // SUNSHINE_SYNC_H
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace util {
|
|||||||
|
|
||||||
class _ImplBase {
|
class _ImplBase {
|
||||||
public:
|
public:
|
||||||
//_unique_base_type _this_ptr;
|
// _unique_base_type _this_ptr;
|
||||||
|
|
||||||
inline virtual ~_ImplBase() = default;
|
inline virtual ~_ImplBase() = default;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
namespace util {
|
namespace util {
|
||||||
/*
|
/*
|
||||||
* Allow threads to execute unhindered
|
* Allow threads to execute unhindered
|
||||||
* while keeping full controll over the threads.
|
* while keeping full control over the threads.
|
||||||
*/
|
*/
|
||||||
class ThreadPool : public TaskPool {
|
class ThreadPool : public TaskPool {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/10/19.
|
// Created by loki on 6/10/19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_THREAD_SAFE_H
|
#ifndef SUNSHINE_THREAD_SAFE_H
|
||||||
#define SUNSHINE_THREAD_SAFE_H
|
#define SUNSHINE_THREAD_SAFE_H
|
||||||
@@ -37,7 +35,7 @@ public:
|
|||||||
_cv.notify_all();
|
_cv.notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
// pop and view shoud not be used interchangebly
|
// pop and view shoud not be used interchangeably
|
||||||
status_t pop() {
|
status_t pop() {
|
||||||
std::unique_lock ul { _lock };
|
std::unique_lock ul { _lock };
|
||||||
|
|
||||||
@@ -58,7 +56,7 @@ public:
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pop and view shoud not be used interchangebly
|
// pop and view shoud not be used interchangeably
|
||||||
template<class Rep, class Period>
|
template<class Rep, class Period>
|
||||||
status_t pop(std::chrono::duration<Rep, Period> delay) {
|
status_t pop(std::chrono::duration<Rep, Period> delay) {
|
||||||
std::unique_lock ul { _lock };
|
std::unique_lock ul { _lock };
|
||||||
@@ -78,7 +76,7 @@ public:
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pop and view shoud not be used interchangebly
|
// pop and view shoud not be used interchangeably
|
||||||
const status_t &view() {
|
const status_t &view() {
|
||||||
std::unique_lock ul { _lock };
|
std::unique_lock ul { _lock };
|
||||||
|
|
||||||
@@ -508,4 +506,4 @@ inline void cleanup(mail_raw_t *mail) {
|
|||||||
}
|
}
|
||||||
} // namespace safe
|
} // namespace safe
|
||||||
|
|
||||||
#endif //SUNSHINE_THREAD_SAFE_H
|
#endif // SUNSHINE_THREAD_SAFE_H
|
||||||
|
|||||||
@@ -181,4 +181,4 @@ std::unique_ptr<platf::deinit_t> start() {
|
|||||||
|
|
||||||
return std::make_unique<deinit_t>(std::move(urls), data, std::move(mappings));
|
return std::make_unique<deinit_t>(std::move(urls), data, std::move(mappings));
|
||||||
}
|
}
|
||||||
} // namespace upnp
|
} // namespace upnp
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ namespace upnp {
|
|||||||
[[nodiscard]] std::unique_ptr<platf::deinit_t> start();
|
[[nodiscard]] std::unique_ptr<platf::deinit_t> start();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 8-2-19.
|
// Created by loki on 8-2-19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef T_MAN_UUID_H
|
#ifndef T_MAN_UUID_H
|
||||||
#define T_MAN_UUID_H
|
#define T_MAN_UUID_H
|
||||||
@@ -76,4 +74,4 @@ union uuid_t {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace util
|
} // namespace util
|
||||||
#endif //T_MAN_UUID_H
|
#endif // T_MAN_UUID_H
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/6/19.
|
// Created by loki on 6/6/19.
|
||||||
//
|
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
@@ -225,7 +223,7 @@ public:
|
|||||||
|
|
||||||
~swdevice_t() override {}
|
~swdevice_t() override {}
|
||||||
|
|
||||||
// Store ownsership when frame is hw_frame
|
// Store ownership when frame is hw_frame
|
||||||
frame_t hw_frame;
|
frame_t hw_frame;
|
||||||
|
|
||||||
frame_t sw_frame;
|
frame_t sw_frame;
|
||||||
@@ -239,7 +237,7 @@ public:
|
|||||||
enum flag_e {
|
enum flag_e {
|
||||||
DEFAULT = 0x00,
|
DEFAULT = 0x00,
|
||||||
PARALLEL_ENCODING = 0x01,
|
PARALLEL_ENCODING = 0x01,
|
||||||
H264_ONLY = 0x02, // When HEVC is to heavy
|
H264_ONLY = 0x02, // When HEVC is too heavy
|
||||||
LIMITED_GOP_SIZE = 0x04, // Some encoders don't like it when you have an infinite GOP_SIZE. *cough* VAAPI *cough*
|
LIMITED_GOP_SIZE = 0x04, // Some encoders don't like it when you have an infinite GOP_SIZE. *cough* VAAPI *cough*
|
||||||
SINGLE_SLICE_ONLY = 0x08, // Never use multiple slices <-- Older intel iGPU's ruin it for everyone else :P
|
SINGLE_SLICE_ONLY = 0x08, // Never use multiple slices <-- Older intel iGPU's ruin it for everyone else :P
|
||||||
};
|
};
|
||||||
@@ -1622,12 +1620,7 @@ retry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int init() {
|
int init() {
|
||||||
BOOST_LOG(info) << "//////////////////////////////////////////////////////////////////"sv;
|
BOOST_LOG(info) << "// Testing for available encoders, this may generate errors. You can safely ignore those errors. //"sv;
|
||||||
BOOST_LOG(info) << "// //"sv;
|
|
||||||
BOOST_LOG(info) << "// Testing for available encoders, this may generate errors. //"sv;
|
|
||||||
BOOST_LOG(info) << "// You can safely ignore those errors. //"sv;
|
|
||||||
BOOST_LOG(info) << "// //"sv;
|
|
||||||
BOOST_LOG(info) << "//////////////////////////////////////////////////////////////////"sv;
|
|
||||||
|
|
||||||
KITTY_WHILE_LOOP(auto pos = std::begin(encoders), pos != std::end(encoders), {
|
KITTY_WHILE_LOOP(auto pos = std::begin(encoders), pos != std::end(encoders), {
|
||||||
if(
|
if(
|
||||||
@@ -1643,11 +1636,7 @@ int init() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
BOOST_LOG(info);
|
BOOST_LOG(info);
|
||||||
BOOST_LOG(info) << "//////////////////////////////////////////////////////////////"sv;
|
BOOST_LOG(info) << "// Ignore any errors mentioned above, they are not relevant. //"sv;
|
||||||
BOOST_LOG(info) << "// //"sv;
|
|
||||||
BOOST_LOG(info) << "// Ignore any errors mentioned above, they are not relevant //"sv;
|
|
||||||
BOOST_LOG(info) << "// //"sv;
|
|
||||||
BOOST_LOG(info) << "//////////////////////////////////////////////////////////////"sv;
|
|
||||||
BOOST_LOG(info);
|
BOOST_LOG(info);
|
||||||
|
|
||||||
if(encoders.empty()) {
|
if(encoders.empty()) {
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
//
|
|
||||||
// Created by loki on 6/9/19.
|
// Created by loki on 6/9/19.
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUNSHINE_VIDEO_H
|
#ifndef SUNSHINE_VIDEO_H
|
||||||
#define SUNSHINE_VIDEO_H
|
#define SUNSHINE_VIDEO_H
|
||||||
@@ -84,4 +82,4 @@ void capture(
|
|||||||
int init();
|
int init();
|
||||||
} // namespace video
|
} // namespace video
|
||||||
|
|
||||||
#endif //SUNSHINE_VIDEO_H
|
#endif // SUNSHINE_VIDEO_H
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
# See our documentation at https://docs.lizardbyte.dev/projects/sunshine
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/usr/local/sunshine/config/sunshine.conf
|
|
||||||
/usr/local/sunshine/config/apps.json
|
|
||||||
@@ -12,27 +12,6 @@ else
|
|||||||
echo "Warning: /etc/group not found"
|
echo "Warning: /etc/group not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /usr/local/sunshine/config/sunshine.conf.old ]; then
|
|
||||||
echo "Restoring old sunshine.conf"
|
|
||||||
mv /usr/local/sunshine/config/sunshine.conf.old /usr/local/sunshine/config/sunshine.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /usr/local/sunshine/config/apps.json.old ]; then
|
|
||||||
echo "Restoring old apps.json"
|
|
||||||
mv /usr/local/sunshine/config/apps.json.old /usr/local/sunshine/config/apps.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Update permissions on config files for Web Manager
|
|
||||||
if [ -f /usr/local/sunshine/config/apps.json ]; then
|
|
||||||
echo "chmod 666 /etc/sunshine/apps.json"
|
|
||||||
chmod 666 /usr/local/sunshine/config/apps.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /usr/local/sunshine/config/sunshine.conf ]; then
|
|
||||||
echo "chmod 666 /etc/sunshine/sunshine.conf"
|
|
||||||
chmod 666 /usr/local/sunshine/config/sunshine.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure Sunshine can grab images from KMS
|
# Ensure Sunshine can grab images from KMS
|
||||||
path_to_setcap=$(which setcap)
|
path_to_setcap=$(which setcap)
|
||||||
if [ -x "$path_to_setcap" ] ; then
|
if [ -x "$path_to_setcap" ] ; then
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#Store backup for old config files to prevent it from being overwritten
|
|
||||||
if [ -f /usr/local/sunshine/config/sunshine.conf ]; then
|
|
||||||
cp /usr/local/sunshine/config/sunshine.conf /usr/local/sunshine/config/sunshine.conf.old
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /usr/local/sunshine/config/apps.json ]; then
|
|
||||||
cp /usr/local/sunshine/config/apps.json /usr/local/sunshine/config/apps.json.old
|
|
||||||
fi
|
|
||||||
@@ -6,41 +6,10 @@ package_name=org.macports.Sunshine
|
|||||||
echo "Removing files now..."
|
echo "Removing files now..."
|
||||||
FILES=$(pkgutil --files $package_name --only-files)
|
FILES=$(pkgutil --files $package_name --only-files)
|
||||||
|
|
||||||
remove_config=True
|
|
||||||
remove_apps=True
|
|
||||||
|
|
||||||
for file in ${FILES}; do
|
for file in ${FILES}; do
|
||||||
file="/$file"
|
file="/$file"
|
||||||
remove_current=True
|
echo "removing: $file"
|
||||||
if [[ $file == *sunshine.conf ]]; then
|
rm -f "$file"
|
||||||
if [[ $remove_config == True ]]; then
|
|
||||||
while true; do
|
|
||||||
read -p -r "Do you wish to remove 'sunshine.conf'?" yn
|
|
||||||
case $yn in
|
|
||||||
[Yy]* ) echo "removing: $file"; rm -f "$file"; break;;
|
|
||||||
[Nn]* ) remove_config=False; remove_current=False; break;;
|
|
||||||
* ) echo "Please answer yes or no.";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [[ $file == *apps.json ]]; then
|
|
||||||
if [[ $remove_apps == True ]]; then
|
|
||||||
while true; do
|
|
||||||
read -p -r "Do you wish to remove 'apps.conf'?" yn
|
|
||||||
case $yn in
|
|
||||||
[Yy]* ) echo "removing: $file"; rm -f "$file"; break;;
|
|
||||||
[Nn]* ) remove_apps=False; remove_current=False; break;;
|
|
||||||
* ) echo "Please answer yes or no.";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $remove_current == True ]]; then
|
|
||||||
echo "removing: $file"
|
|
||||||
rm -f "$file"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Removing directories now..."
|
echo "Removing directories now..."
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
rem Get sunshine root directory
|
||||||
|
for %%I in ("%~dp0\..") do set "ROOT_DIR=%%~fI"
|
||||||
|
|
||||||
set RULE_NAME=Sunshine
|
set RULE_NAME=Sunshine
|
||||||
set PROGRAM_BIN="%~dp0sunshine.exe"
|
set PROGRAM_BIN="%ROOT_DIR%\sunshine.exe"
|
||||||
|
|
||||||
rem Add the rule
|
rem Add the rule
|
||||||
netsh advfirewall firewall add rule name=%RULE_NAME% dir=in action=allow protocol=tcp program=%PROGRAM_BIN% enable=yes
|
netsh advfirewall firewall add rule name=%RULE_NAME% dir=in action=allow protocol=tcp program=%PROGRAM_BIN% enable=yes
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
rem Get sunshine root directory
|
||||||
|
for %%I in ("%~dp0\..") do set "ROOT_DIR=%%~fI"
|
||||||
|
|
||||||
set SERVICE_NAME=sunshinesvc
|
set SERVICE_NAME=sunshinesvc
|
||||||
set SERVICE_BIN="%~dp0\tools\sunshinesvc.exe"
|
set SERVICE_BIN="%ROOT_DIR%\tools\sunshinesvc.exe"
|
||||||
set SERVICE_START_TYPE=auto
|
set SERVICE_START_TYPE=auto
|
||||||
|
|
||||||
rem Check if sunshinesvc already exists
|
rem Check if sunshinesvc already exists
|
||||||
Reference in New Issue
Block a user