Skip to content

Commit

Permalink
rename sunshine directory to src
Browse files Browse the repository at this point in the history
- change is significant, but will allow use of common `cpp` files from `.github` repo
- added missing line endings where applicable
  • Loading branch information
ReenigneArcher committed Aug 8, 2022
1 parent 1d242ae commit 294194d
Show file tree
Hide file tree
Showing 94 changed files with 4,070 additions and 3,053 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/localize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: [nightly]
paths: # prevents workflow from running unless these files change
- '.github/workflows/localize.yml'
- 'sunshine/**'
- 'src/**'
- 'locale/sunshine.po'
workflow_dispatch:

Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
[submodule "third-party/nv-codec-headers"]
path = third-party/nv-codec-headers
url = https://github.com/FFmpeg/nv-codec-headers
[submodule "sunshine/platform/macos/TPCircularBuffer"]
path = sunshine/platform/macos/TPCircularBuffer
[submodule "src/platform/macos/TPCircularBuffer"]
path = src/platform/macos/TPCircularBuffer
url = https://github.com/michaeltyson/TPCircularBuffer
166 changes: 83 additions & 83 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,18 @@ if(WIN32)
if(NOT DEFINED SUNSHINE_ICON_PATH)
set(SUNSHINE_ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/sunshine.ico")
endif()
configure_file(sunshine/platform/windows/windows.rs.in windows.rc @ONLY)
configure_file(src/platform/windows/windows.rs.in windows.rc @ONLY)
set(PLATFORM_TARGET_FILES
"${CMAKE_CURRENT_BINARY_DIR}/windows.rc"
sunshine/platform/windows/publish.cpp
sunshine/platform/windows/misc.h
sunshine/platform/windows/misc.cpp
sunshine/platform/windows/input.cpp
sunshine/platform/windows/display.h
sunshine/platform/windows/display_base.cpp
sunshine/platform/windows/display_vram.cpp
sunshine/platform/windows/display_ram.cpp
sunshine/platform/windows/audio.cpp
src/platform/windows/publish.cpp
src/platform/windows/misc.h
src/platform/windows/misc.cpp
src/platform/windows/input.cpp
src/platform/windows/display.h
src/platform/windows/display_base.cpp
src/platform/windows/display_vram.cpp
src/platform/windows/display_ram.cpp
src/platform/windows/audio.cpp
third-party/ViGEmClient/src/ViGEmClient.cpp
third-party/ViGEmClient/include/ViGEm/Client.h
third-party/ViGEmClient/include/ViGEm/Common.h
Expand Down Expand Up @@ -180,21 +180,21 @@ elseif(APPLE)
set(APPLE_PLIST_FILE ${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/Info.plist)

set(PLATFORM_TARGET_FILES
sunshine/platform/macos/av_audio.h
sunshine/platform/macos/av_audio.m
sunshine/platform/macos/av_img_t.h
sunshine/platform/macos/av_video.h
sunshine/platform/macos/av_video.m
sunshine/platform/macos/display.mm
sunshine/platform/macos/input.cpp
sunshine/platform/macos/microphone.mm
sunshine/platform/macos/misc.cpp
sunshine/platform/macos/misc.h
sunshine/platform/macos/nv12_zero_device.cpp
sunshine/platform/macos/nv12_zero_device.h
sunshine/platform/macos/publish.cpp
sunshine/platform/macos/TPCircularBuffer/TPCircularBuffer.c
sunshine/platform/macos/TPCircularBuffer/TPCircularBuffer.h
src/platform/macos/av_audio.h
src/platform/macos/av_audio.m
src/platform/macos/av_img_t.h
src/platform/macos/av_video.h
src/platform/macos/av_video.m
src/platform/macos/display.mm
src/platform/macos/input.cpp
src/platform/macos/microphone.mm
src/platform/macos/misc.cpp
src/platform/macos/misc.h
src/platform/macos/nv12_zero_device.cpp
src/platform/macos/nv12_zero_device.h
src/platform/macos/publish.cpp
src/platform/macos/TPCircularBuffer/TPCircularBuffer.c
src/platform/macos/TPCircularBuffer/TPCircularBuffer.h
${APPLE_PLIST_FILE})
else()
add_compile_definitions(SUNSHINE_PLATFORM="linux")
Expand Down Expand Up @@ -242,14 +242,14 @@ else()
if(X11_FOUND)
add_compile_definitions(SUNSHINE_BUILD_X11)
include_directories(${X11_INCLUDE_DIR})
list(APPEND PLATFORM_TARGET_FILES sunshine/platform/linux/x11grab.cpp)
list(APPEND PLATFORM_TARGET_FILES src/platform/linux/x11grab.cpp)
endif()

if(CUDA_FOUND)
include_directories(third-party/nvfbc)
list(APPEND PLATFORM_TARGET_FILES
sunshine/platform/linux/cuda.cu
sunshine/platform/linux/cuda.cpp
src/platform/linux/cuda.cu
src/platform/linux/cuda.cpp
third-party/nvfbc/NvFBC.h)

add_compile_definitions(SUNSHINE_BUILD_CUDA)
Expand All @@ -259,7 +259,7 @@ else()
add_compile_definitions(SUNSHINE_BUILD_DRM)
include_directories(${LIBDRM_INCLUDE_DIRS} ${LIBCAP_INCLUDE_DIRS})
list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES} ${LIBCAP_LIBRARIES})
list(APPEND PLATFORM_TARGET_FILES sunshine/platform/linux/kmsgrab.cpp)
list(APPEND PLATFORM_TARGET_FILES src/platform/linux/kmsgrab.cpp)
list(APPEND SUNSHINE_DEFINITIONS EGL_NO_X11=1)
elseif(LIBDRM_FOUND)
message(WARNING "Found libdrm, yet there is no libcap")
Expand Down Expand Up @@ -301,26 +301,26 @@ else()

list(APPEND PLATFORM_LIBRARIES ${WAYLAND_LIBRARIES})
list(APPEND PLATFORM_TARGET_FILES
sunshine/platform/linux/wlgrab.cpp
sunshine/platform/linux/wayland.cpp)
src/platform/linux/wlgrab.cpp
src/platform/linux/wayland.cpp)
endif()
if(NOT ${X11_FOUND} AND NOT (${LIBDRM_FOUND} AND ${LIBCAP_FOUND}) AND NOT ${WAYLAND_FOUND} AND NOT ${})
message(FATAL_ERROR "Couldn't find either x11, wayland, cuda or (libdrm and libcap)")
endif()

list(APPEND PLATFORM_TARGET_FILES
sunshine/platform/linux/publish.cpp
sunshine/platform/linux/vaapi.h
sunshine/platform/linux/vaapi.cpp
sunshine/platform/linux/cuda.h
sunshine/platform/linux/graphics.h
sunshine/platform/linux/graphics.cpp
sunshine/platform/linux/misc.h
sunshine/platform/linux/misc.cpp
sunshine/platform/linux/audio.cpp
sunshine/platform/linux/input.cpp
sunshine/platform/linux/x11grab.h
sunshine/platform/linux/wayland.h
src/platform/linux/publish.cpp
src/platform/linux/vaapi.h
src/platform/linux/vaapi.cpp
src/platform/linux/cuda.h
src/platform/linux/graphics.h
src/platform/linux/graphics.cpp
src/platform/linux/misc.h
src/platform/linux/misc.cpp
src/platform/linux/audio.cpp
src/platform/linux/input.cpp
src/platform/linux/x11grab.h
src/platform/linux/wayland.h
third-party/glad/src/egl.c
third-party/glad/src/gl.c
third-party/glad/include/EGL/eglplatform.h
Expand Down Expand Up @@ -356,47 +356,47 @@ set(SUNSHINE_TARGET_FILES
third-party/moonlight-common-c/src/Rtsp.h
third-party/moonlight-common-c/src/RtspParser.c
third-party/moonlight-common-c/src/Video.h
sunshine/upnp.cpp
sunshine/upnp.h
sunshine/cbs.cpp
sunshine/utility.h
sunshine/uuid.h
sunshine/config.h
sunshine/config.cpp
sunshine/main.cpp
sunshine/main.h
sunshine/crypto.cpp
sunshine/crypto.h
sunshine/nvhttp.cpp
sunshine/nvhttp.h
sunshine/httpcommon.cpp
sunshine/httpcommon.h
sunshine/confighttp.cpp
sunshine/confighttp.h
sunshine/rtsp.cpp
sunshine/rtsp.h
sunshine/stream.cpp
sunshine/stream.h
sunshine/video.cpp
sunshine/video.h
sunshine/input.cpp
sunshine/input.h
sunshine/audio.cpp
sunshine/audio.h
sunshine/platform/common.h
sunshine/process.cpp
sunshine/process.h
sunshine/network.cpp
sunshine/network.h
sunshine/move_by_copy.h
sunshine/task_pool.h
sunshine/thread_pool.h
sunshine/thread_safe.h
sunshine/sync.h
sunshine/round_robin.h
src/upnp.cpp
src/upnp.h
src/cbs.cpp
src/utility.h
src/uuid.h
src/config.h
src/config.cpp
src/main.cpp
src/main.h
src/crypto.cpp
src/crypto.h
src/nvhttp.cpp
src/nvhttp.h
src/httpcommon.cpp
src/httpcommon.h
src/confighttp.cpp
src/confighttp.h
src/rtsp.cpp
src/rtsp.h
src/stream.cpp
src/stream.h
src/video.cpp
src/video.h
src/input.cpp
src/input.h
src/audio.cpp
src/audio.h
src/platform/common.h
src/process.cpp
src/process.h
src/network.cpp
src/network.h
src/move_by_copy.h
src/task_pool.h
src/thread_pool.h
src/thread_safe.h
src/sync.h
src/round_robin.h
${PLATFORM_TARGET_FILES})

set_source_files_properties(sunshine/upnp.cpp PROPERTIES COMPILE_FLAGS -Wno-pedantic)
set_source_files_properties(src/upnp.cpp PROPERTIES COMPILE_FLAGS -Wno-pedantic)

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
Expand All @@ -414,7 +414,7 @@ string(TOUPPER "x${CMAKE_BUILD_TYPE}" BUILD_TYPE)
if("${BUILD_TYPE}" STREQUAL "XDEBUG")
list(APPEND SUNSHINE_COMPILE_OPTIONS -O0 -ggdb3)
if(WIN32)
set_source_files_properties(sunshine/nvhttp.cpp PROPERTIES COMPILE_FLAGS -O2)
set_source_files_properties(src/nvhttp.cpp PROPERTIES COMPILE_FLAGS -O2)
endif()
else()
add_definitions(-DNDEBUG)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing/localization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ any of the following paths are modified.

.. code-block:: yaml
- 'sunshine/**'
- 'src/**'
When testing locally it may be desirable to manually extract, initialize, update, and compile strings. Python is
required for this, along with the python dependencies in the `./scripts/requirements.txt` file. Additionally,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sunshine/cbs.cpp → src/cbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ bool validate_sps(const AVPacket *packet, int codec_id) {

return ((CodedBitstreamH265Context *)ctx->priv_data)->active_sps->vui_parameters_present_flag;
}
} // namespace cbs
} // namespace cbs
2 changes: 1 addition & 1 deletion sunshine/cbs.h → src/cbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ h264_t make_sps_h264(const AVCodecContext *ctx, const AVPacket *packet);
bool validate_sps(const AVPacket *packet, int codec_id);
} // namespace cbs

#endif
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sunshine/crypto.cpp → src/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,4 +492,4 @@ std::string rand_alphabet(std::size_t bytes, const std::string_view &alphabet) {
return value;
}

} // namespace crypto
} // namespace crypto
File renamed without changes.
2 changes: 1 addition & 1 deletion sunshine/httpcommon.cpp → src/httpcommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ int create_creds(const std::string &pkey, const std::string &cert) {

return 0;
}
} // namespace http
} // namespace http
2 changes: 1 addition & 1 deletion sunshine/httpcommon.h → src/httpcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ extern std::string unique_id;
extern net::net_e origin_pin_allowed;
extern net::net_e origin_web_ui_allowed;

} // namespace http
} // namespace http
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sunshine/network.cpp → src/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ void free_host(ENetHost *host) {

enet_host_destroy(host);
}
} // namespace net
} // namespace net
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions sunshine/platform/common.h → src/platform/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <mutex>
#include <string>

#include "sunshine/thread_safe.h"
#include "sunshine/utility.h"
#include "src/thread_safe.h"
#include "src/utility.h"

struct sockaddr;
struct AVFrame;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include <pulse/pulseaudio.h>
#include <pulse/simple.h>

#include "sunshine/platform/common.h"
#include "src/platform/common.h"

#include "sunshine/config.h"
#include "sunshine/main.h"
#include "sunshine/thread_safe.h"
#include "src/config.h"
#include "src/main.h"
#include "src/thread_safe.h"

namespace platf {
using namespace std::literals;
Expand Down Expand Up @@ -503,4 +503,4 @@ std::unique_ptr<audio_control_t> audio_control() {

return audio;
}
} // namespace platf
} // namespace platf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ extern "C" {

#include "cuda.h"
#include "graphics.h"
#include "sunshine/main.h"
#include "sunshine/utility.h"
#include "src/main.h"
#include "src/utility.h"
#include "wayland.h"

#define SUNSHINE_STRINGVIEW_HELPER(x) x##sv
Expand Down Expand Up @@ -714,4 +714,4 @@ std::vector<std::string> nvfbc_display_names() {

return display_names;
}
} // namespace platf
} // namespace platf
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,4 @@ int sws_t::load_ram(platf::img_t &img, cudaArray_t array) {
return CU_CHECK_IGNORE(cudaMemcpy2DToArray(array, 0, 0, img.data, img.row_pitch, img.width * img.pixel_pitch, img.height, cudaMemcpyHostToDevice), "Couldn't copy to cuda array");
}

} // namespace cuda
} // namespace cuda
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ class sws_t {
};
} // namespace cuda

#endif
#endif
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <glad/gl.h>

#include "misc.h"
#include "sunshine/main.h"
#include "sunshine/platform/common.h"
#include "sunshine/utility.h"
#include "src/main.h"
#include "src/platform/common.h"
#include "src/utility.h"

#define SUNSHINE_STRINGIFY_HELPER(x) #x
#define SUNSHINE_STRINGIFY(x) SUNSHINE_STRINGIFY_HELPER(x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include <cstring>
#include <filesystem>

#include "sunshine/main.h"
#include "sunshine/platform/common.h"
#include "sunshine/utility.h"
#include "src/main.h"
#include "src/platform/common.h"
#include "src/utility.h"

#include "sunshine/platform/common.h"
#include "src/platform/common.h"

// Support older versions
#ifndef REL_HWHEEL_HI_RES
Expand Down
Loading

0 comments on commit 294194d

Please sign in to comment.