Repository navigation
feat(video): add PyroWave encoding #5946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
joshrmcdaniel
wants to merge
17
commits into
SunshineStream:master
Choose a base branch
from
joshrmcdaniel:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,847
−45
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8d0a41f
pyrowave
joshrmcdaniel ad40930
add pyrowave to cmake pkg lock
joshrmcdaniel adb926c
point pyrowave to master
joshrmcdaniel 6cfe0bd
include src
joshrmcdaniel 74a51e8
clean up pyrowave test
joshrmcdaniel 5ce0129
propogate pyrowave headers to nvenc
joshrmcdaniel 103887a
granite deps before build
joshrmcdaniel 65de6b4
bitrate ceiling
joshrmcdaniel df9d221
retain frame pools for pyrowave
joshrmcdaniel 7c159e1
add disclaimer for pyrowave usage
joshrmcdaniel 6194e87
rm license copy
joshrmcdaniel 36ca478
4:4:4 support
joshrmcdaniel 38a79b6
skip cpu conversion when not needed
joshrmcdaniel 8e5f295
use gpu frames for pyrowave encoding
joshrmcdaniel 481c59a
ordering
joshrmcdaniel 7427777
fix(video): align PyroWave framing and FEC with existing clients
joshrmcdaniel 90b7c58
fix(video): bound PyroWave budgets by packet capacity
joshrmcdaniel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Build the pinned PyroWave C API into Sunshine. | ||
| include_guard(GLOBAL) | ||
|
|
||
| # Build the codec and C API without exposing upstream options to Sunshine. | ||
| function(sunshine_add_pyrowave) | ||
| set(pyrowave_source_dir "${CMAKE_SOURCE_DIR}/third-party/pyrowave") | ||
| # Defer configuring Granite until the options below are set, including local source overrides. | ||
| CPMAddPackage(NAME pyrowave_granite DOWNLOAD_ONLY YES) | ||
|
|
||
| # Scope upstream options to the dependency build and use its precompiled shaders. | ||
| # cmake-lint: disable=C0103 | ||
| set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) | ||
| set(GRANITE_SHARED OFF) | ||
| set(GRANITE_TOOLS OFF) | ||
| set(GRANITE_RENDERER OFF) | ||
| set(GRANITE_PLATFORM "null") | ||
| set(GRANITE_INSTALL_TARGETS OFF) | ||
| set(GRANITE_HIDDEN ON) | ||
| set(GRANITE_POSITION_INDEPENDENT ON) | ||
| set(GRANITE_SHIPPING ON) | ||
| set(GRANITE_FFMPEG OFF) | ||
| set(GRANITE_FFMPEG_VULKAN OFF) | ||
| set(GRANITE_SHADER_COMPILER_OPTIMIZE OFF) | ||
| set(GRANITE_VULKAN_SHADER_MANAGER_RUNTIME_COMPILER OFF) | ||
| set(GRANITE_VULKAN_SPIRV_CROSS OFF) | ||
| set(GRANITE_VULKAN_FOSSILIZE OFF) | ||
| set(GRANITE_VULKAN_SYSTEM_HANDLES OFF) | ||
| set(GRANITE_VULKAN_DXGI_INTEROP OFF) | ||
| set(GRANITE_RENDERDOC_CAPTURE OFF) | ||
| add_subdirectory("${pyrowave_granite_SOURCE_DIR}" "${pyrowave_granite_BINARY_DIR}" EXCLUDE_FROM_ALL) | ||
|
|
||
| # Keep Volk's function pointers distinct from the Vulkan loader used by FFmpeg. | ||
| target_compile_definitions(granite-volk-headers INTERFACE VOLK_NAMESPACE) | ||
| set_source_files_properties("${pyrowave_granite_SOURCE_DIR}/third_party/volk/volk.c" | ||
| TARGET_DIRECTORY granite-volk PROPERTIES LANGUAGE CXX) | ||
|
|
||
| set(PYROWAVE_DEVEL OFF) | ||
| set(PYROWAVE_UTILS OFF) | ||
| add_subdirectory("${pyrowave_source_dir}" "${CMAKE_BINARY_DIR}/third-party/pyrowave" EXCLUDE_FROM_ALL) | ||
|
|
||
| # Upstream exposes the C API only for standalone builds; add its wrapper here. | ||
| add_library(sunshine_pyrowave STATIC | ||
| "${pyrowave_source_dir}/pyrowave_c.cpp" | ||
| "${pyrowave_granite_SOURCE_DIR}/video/scaler.cpp") | ||
| target_include_directories(sunshine_pyrowave PRIVATE | ||
| "${pyrowave_source_dir}/shaders" "${pyrowave_granite_SOURCE_DIR}/video") | ||
| target_include_directories(sunshine_pyrowave SYSTEM INTERFACE | ||
| "${pyrowave_source_dir}" | ||
| "${pyrowave_granite_SOURCE_DIR}/third_party/khronos/vulkan-headers/include") | ||
| target_link_libraries(sunshine_pyrowave PRIVATE pyrowave granite-vulkan granite-math Threads::Threads) | ||
|
|
||
| # Clients use the vendored revision to diagnose bitstream compatibility. | ||
| execute_process(COMMAND git -C "${pyrowave_source_dir}" rev-parse --short=8 HEAD | ||
| OUTPUT_VARIABLE pyrowave_bitstream_id OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) | ||
| target_compile_definitions(sunshine_pyrowave INTERFACE | ||
| SUNSHINE_PYROWAVE_BITSTREAM_ID="${pyrowave_bitstream_id}") | ||
| endfunction() | ||
|
|
||
| sunshine_add_pyrowave() | ||
| list(APPEND SUNSHINE_EXTERNAL_LIBRARIES sunshine_pyrowave) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.