Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
build/
config.tests/*/.qmake.stash
config.tests/*/Makefile

# IDE
.vscode/*
!.vscode/extensions.json
!.vscode/tasks.json
!.vscode/launch.json
32 changes: 32 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Launch",
"program": "${workspaceFolder}/builddir/app/moonlight",
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "attach",
"name": "Attach",
"pid": "${input:pickMoonlightProcess}"
}
],
"inputs": [
{
"id": "pickMoonlightProcess",
"type": "command",
"command": "lldb.pickProcess",
"args": {
"filter": "moonlight"
}
}
]
}
44 changes: 44 additions & 0 deletions app/gui/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
src += files(
'appmodel.cpp',
'computermodel.cpp',
'sdlgamepadkeynavigation.cpp',
)

moc_sources += files(
'computermodel.cpp',
)

moc_headers += files(
'appmodel.h',
'computermodel.h',
'sdlgamepadkeynavigation.h',
)

qml_modules = qt.qml_module(
'com.moonlight_stream.Moonlight',
qml_sources: files(
# 'main.qml',

'AppView.qml',
'PcView.qml',
'SettingsView.qml',

'NavigableDialog.qml',
'NavigableItemDelegate.qml',
'NavigableMenu.qml',
'NavigableMenuItem.qml',
'NavigableMessageDialog.qml',
'NavigableToolButton.qml',

'AutoResizingComboBox.qml',
'CenteredGridView.qml',
'ErrorMessageDialog.qml',
'GamepadMapper.qml',

'CliPair.qml',
'StreamSegue.qml',
'CliQuitStreamSegue.qml',
'CliStartStreamSegue.qml',
'QuitSegue.qml',
),
)
34 changes: 34 additions & 0 deletions app/languages/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
qt.compile_translations(
ts_files: [
'qml_zh_CN.ts',
'qml_zh_TW.ts',
'qml_de.ts',
'qml_fr.ts',
'qml_nb_NO.ts',
'qml_ru.ts',
'qml_es.ts',
'qml_ja.ts',
'qml_vi.ts',
'qml_th.ts',
'qml_ko.ts',
'qml_hu.ts',
'qml_nl.ts',
'qml_sv.ts',
'qml_tr.ts',
'qml_uk.ts',
'qml_el.ts',
'qml_hi.ts',
'qml_it.ts',
'qml_pt.ts',
'qml_pt_BR.ts',
'qml_pl.ts',
'qml_cs.ts',
'qml_he.ts',
'qml_ckb.ts',
'qml_lt.ts',
'qml_et.ts',
'qml_bg.ts',
'qml_eo.ts',
'qml_ta.ts',
],
)
213 changes: 213 additions & 0 deletions app/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
dep = [
dependency('Qt6', modules: [
'Core',
'Gui',
'Widgets',
'Quick',
'QuickControls2',
'Network',
'Svg',
]),
dependency('openssl'),
dependency('sdl2'),
dependency('SDL2_ttf'),
dependency('opus'),
dependency('libavcodec'),
dependency('libavutil'),
dependency('libswscale'),
dependency('libdrm'),
dependency('libva'),
dependency('libva-drm'),
dependency('libva-wayland'),
dependency('cuda'),
dependency('libplacebo'),
dependency('wayland-client'),
dependency('egl'), # TODO: wrap
dependency('opengl'),
# TODO: maybe add mmal?
]

src = files(
'main.cpp',
'path.cpp',
'wm.cpp',

'cli' / 'commandlineparser.cpp',
'cli' / 'pair.cpp',
'cli' / 'listapps.cpp',
'cli' / 'startstream.cpp',
'cli' / 'quitstream.cpp',

'backend' / 'computerseeker.cpp',
'backend' / 'computermanager.cpp',
'backend' / 'identitymanager.cpp',
'backend' / 'boxartmanager.cpp',
'backend' / 'richpresencemanager.cpp',
'backend' / 'autoupdatechecker.cpp',
'backend' / 'systemproperties.cpp',

'backend' / 'nvapp.cpp',
'backend' / 'nvaddress.cpp',
'backend' / 'nvhttp.cpp',
'backend' / 'nvcomputer.cpp',
'backend' / 'nvpairingmanager.cpp',

'settings' / 'compatfetcher.cpp',
'settings' / 'mappingfetcher.cpp',
'settings' / 'mappingmanager.cpp',
'settings' / 'streamingpreferences.cpp',

'streaming' / 'session.cpp',
'streaming' / 'streamutils.cpp',

'streaming' / 'video' / 'overlaymanager.cpp',

'streaming' / 'audio' / 'audio.cpp',
'streaming' / 'audio' / 'renderers' / 'sdlaud.cpp',

'streaming' / 'input' / 'input.cpp',
'streaming' / 'input' / 'gamepad.cpp',
'streaming' / 'input' / 'keyboard.cpp',
'streaming' / 'input' / 'mouse.cpp',
'streaming' / 'input' / 'abstouch.cpp',
'streaming' / 'input' / 'reltouch.cpp',
)
moc_sources = files(
'backend' / 'computermanager.cpp',
'backend' / 'boxartmanager.cpp',
)
moc_headers = files(
'cli' / 'pair.h',
'cli' / 'listapps.h',
'cli' / 'startstream.h',
'cli' / 'quitstream.h',

'backend' / 'computerseeker.h',
'backend' / 'computermanager.h',
'backend' / 'boxartmanager.h',
'backend' / 'autoupdatechecker.h',
'backend' / 'nvhttp.h',
'backend' / 'systemproperties.h',

'settings' / 'compatfetcher.h',
'settings' / 'mappingfetcher.h',
'settings' / 'streamingpreferences.h',

'streaming' / 'session.h',
)

# FFmpeg
add_project_arguments('-D', 'HAVE_FFMPEG', language: ['c', 'cpp'])
src += files(
'streaming' / 'video' / 'ffmpeg.cpp',
'streaming' / 'video' / 'ffmpeg-renderers' / 'genhwaccel.cpp',
'streaming' / 'video' / 'ffmpeg-renderers' / 'sdlvid.cpp',
'streaming' / 'video' / 'ffmpeg-renderers' / 'swframemapper.cpp',
'streaming' / 'video' / 'ffmpeg-renderers' / 'pacer' / 'pacer.cpp',
)

# libva
add_project_arguments('-D', 'HAVE_LIBVA', language: ['c', 'cpp'])
src += files(
'streaming' / 'video' / 'ffmpeg-renderers' / 'vaapi.cpp',
)
# libva-wayland
add_project_arguments('-D', 'HAVE_LIBVA_WAYLAND', language: ['c', 'cpp'])
# libva-drm
add_project_arguments('-D', 'HAVE_LIBVA_DRM', language: ['c', 'cpp'])

# libdrm
add_project_arguments('-D', 'HAVE_DRM', language: ['c', 'cpp'])
src += files(
'streaming' / 'video' / 'ffmpeg-renderers' / 'drm.cpp',

# linux hooks
'masterhook.c',
'masterhook_internal.c',
)

# CUDA
add_project_arguments('-D', 'HAVE_CUDA', language: ['c', 'cpp'])
src += files(
'streaming' / 'video' / 'ffmpeg-renderers' / 'cuda.cpp',
)

# libplacebo
add_project_arguments('-D', 'HAVE_LIBPLACEBO_VULKAN', language: ['c', 'cpp'])
src += files(
'streaming' / 'video' / 'ffmpeg-renderers' / 'plvk.cpp',
'streaming' / 'video' / 'ffmpeg-renderers' / 'plvk_c.c',
)

# EGL
add_project_arguments('-D', 'HAVE_EGL', language: ['c', 'cpp'])
src += files(
'streaming' / 'video' / 'ffmpeg-renderers' / 'eglvid.cpp',
'streaming' / 'video' / 'ffmpeg-renderers' / 'egl_extensions.cpp',
'streaming' / 'video' / 'ffmpeg-renderers' / 'eglimagefactory.cpp',
)

# TODO: maybe include Steam Link (config_SL)?

# soundio
add_project_arguments('-D', 'HAVE_SOUNDIO', language: ['c', 'cpp'])
add_project_arguments('-D', 'SOUNDIO_STATIC_LIBRARY', language: ['c', 'cpp'])
src += files(
'streaming' / 'audio' / 'renderers' / 'soundioaudiorenderer.cpp',
)

# Wayland
# add_project_arguments('-D', 'HAVE_WAYLAND', language: ['c', 'cpp'])
add_project_arguments('-D', 'HAS_WAYLAND', language: ['c', 'cpp']) # a typo?
src += files(
'streaming' / 'video' / 'ffmpeg-renderers' / 'pacer' / 'waylandvsyncsource.cpp',
)

qt = import('qt6')

subdir('gui')

moc_files = qt.compile_moc(
sources: moc_sources,
headers: moc_headers,
dependencies: dep,
)

qrc = qt.compile_resources(sources: [
'resources.qrc',
'qml.qrc',
])

executable(
'moonlight',
src,
qml_modules,
moc_files,
qrc,
dependencies: [
dep,
moonlight_common_c_dep,
qmdnsengine_dep,
soundio_dep,
h264bitstream_dep,
ffnvcodec_dep,
],
pie: true,
win_subsystem: 'windows',
)

# desktop files
install_data(
'deploy' / 'linux' / 'com.moonlight_stream.Moonlight.desktop',
install_dir: get_option('datadir') / 'applications',
)
# icons
install_data(
'res' / 'moonlight.svg',
install_dir: get_option('datadir') / 'icons' / 'hicolor' / 'scalable' / 'apps',
)
# appstream
install_data(
'deploy' / 'linux' / 'com.moonlight_stream.Moonlight.appdata.xml',
install_dir: get_option('datadir') / 'metainfo',
)
36 changes: 36 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
project(
'moonlight-qt',
'c',
'cpp',
meson_version: '>= 1.7.0',
version: files('app' / 'version.txt'),
default_options: [
'warning_level=3',
'c_std=gnu11',
'cpp_std=c++17',
'b_ndebug=if-release',
],
)

version_str = meson.project_version()
add_project_arguments('-D', 'VERSION_STR="@0@"'.format(version_str), language: ['c', 'cpp'])

add_project_arguments('-D', 'typeof=__typeof__', language: ['c', 'cpp'])

moonlight_common_c_dep = dependency(
'moonlight-common-c',
fallback: 'moonlight-common-c',
)
qmdnsengine_dep = dependency(
'qmdnsengine',
fallback: 'qmdnsengine',
)
soundio_dep = dependency(
'soundio',
static: true,
fallback: 'libsoundio',
)
h264bitstream_dep = dependency('h264bitstream', fallback: 'h264bitstream')
ffnvcodec_dep = dependency('ffnvcodec', fallback: 'ffnvcodec')

subdir('app')
4 changes: 4 additions & 0 deletions subprojects/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/h264bitstream
/moonlight-common-c
/qmdnsengine
/soundio
1 change: 1 addition & 0 deletions subprojects/enet
Submodule enet added at 44c85e
5 changes: 5 additions & 0 deletions subprojects/enet.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[wrap-git]
url = https://github.com/cgutman/enet.git
revision = HEAD
depth = 1
patch_directory = enet
1 change: 1 addition & 0 deletions subprojects/ffnvcodec
Submodule ffnvcodec added at f2fb9b
5 changes: 5 additions & 0 deletions subprojects/ffnvcodec.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[wrap-git]
url = https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
revision = HEAD
depth = 1
patch_directory = ffnvcodec
Loading