-
Notifications
You must be signed in to change notification settings - Fork 5
Add Experimental GeForce NOW support #5
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
Producdevity
wants to merge
15
commits into
master
Choose a base branch
from
feat/geforce-now
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.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a1017cb
fix(media): correct Cedar frame submission and initialization cleanup
Producdevity 7e6ceac
refactor(input): share controller sampling between streaming services
Producdevity 4bc42d8
fix(auth): honor device-code expiry and polling intervals
Producdevity 552c54f
feat(gfn): add native GeForce NOW streaming
Producdevity 790dd1c
fix(build): package Cedar from the installed library directory
Producdevity 9c18f39
fix(ci): declare native SDL dependencies for host tests
Producdevity b33fc91
fix(gfn): retain ICE candidates received before the offer
Producdevity f9b59d7
fix(gfn): reject invalid token lifetimes
Producdevity 89b0b91
fix(gfn): honor cancellation during session discovery
Producdevity 01fff5a
fix(input): preserve Guide combinations and Escape cancellation
Producdevity 3700a77
refactor(session): share UUID generation between providers
Producdevity 185f248
docs: clarify streaming requirements and dArkOS support
Producdevity 3724080
fix(build): isolate target pkg-config dependencies
Producdevity f5a176b
fix(gfn): route ICE candidates by SDP media index
Producdevity 455f4b5
chore(build): clarify prerequisites and test failures
Producdevity 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,7 +11,6 @@ const aarch64_linux_query: std.Target.Query = .{ | |||||
| const c_test_flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" }; | ||||||
|
|
||||||
| const project_include_paths = [_][]const u8{ | ||||||
| ".tools/deps/aarch64-linux-gnu/include", | ||||||
| "vendor/libdatachannel/include", | ||||||
| "src/media/audio", | ||||||
| "src/media/video", | ||||||
|
|
@@ -51,6 +50,7 @@ const release_zig_roots = [_]struct { | |||||
| .imports = &.{ | ||||||
| .{ .name = "json_reader", .path = "src/net/json_reader.zig" }, | ||||||
| .{ .name = "json_writer", .path = "src/net/json_writer.zig" }, | ||||||
| .{ .name = "uuid", .path = "src/util/uuid.zig" }, | ||||||
| }, | ||||||
| }, | ||||||
| .{ .name = "greenovercast-controller", .path = "src/input/controller.zig" }, | ||||||
|
|
@@ -81,6 +81,7 @@ const release_c_sources = [_][]const u8{ | |||||
| "src/media/video/video_decoder_v4l2_request.c", | ||||||
| "src/auth/token_store_adapter.c", | ||||||
| "src/net/http_client.c", | ||||||
| "src/net/websocket_client.c", | ||||||
| "src/ui/artwork_decoder.c", | ||||||
| }; | ||||||
|
|
||||||
|
|
@@ -122,6 +123,7 @@ fn addReleaseZigObject( | |||||
| .link_libc = true, | ||||||
| }); | ||||||
| addProjectIncludes(b, module); | ||||||
| module.addIncludePath(b.path(".tools/deps/aarch64-linux-gnu/include")); | ||||||
| for (imports) |item| | ||||||
| addZigImport(b, module, target, optimize, item.name, item.path); | ||||||
| return b.addObject(.{ .name = name, .root_module = module }); | ||||||
|
|
@@ -146,6 +148,28 @@ fn addStaticArchive(module: *std.Build.Module, b: *std.Build, path: []const u8) | |||||
| module.addObjectFile(b.path(path)); | ||||||
| } | ||||||
|
|
||||||
| fn addHostUnitTest( | ||||||
| b: *std.Build, | ||||||
| test_step: *std.Build.Step, | ||||||
| source: []const u8, | ||||||
| project_includes: bool, | ||||||
| sdl: bool, | ||||||
| imports: []const ZigImport, | ||||||
| ) void { | ||||||
| const module = b.createModule(.{ | ||||||
| .root_source_file = b.path(source), | ||||||
| .target = b.graph.host, | ||||||
| .optimize = .Debug, | ||||||
| .link_libc = project_includes, | ||||||
| }); | ||||||
| if (project_includes) addProjectIncludes(b, module); | ||||||
| if (sdl) module.linkSystemLibrary("SDL2", .{ .use_pkg_config = .force }); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: The host tests request the wrong pkg-config module name, so CI cannot resolve SDL2 and Prompt for AI agents
Suggested change
|
||||||
| for (imports) |item| | ||||||
| addZigImport(b, module, b.graph.host, .Debug, item.name, item.path); | ||||||
| const unit_tests = b.addTest(.{ .root_module = module }); | ||||||
| test_step.dependOn(&b.addRunArtifact(unit_tests).step); | ||||||
| } | ||||||
|
|
||||||
| fn addReleaseArtifacts( | ||||||
| b: *std.Build, | ||||||
| target: std.Build.ResolvedTarget, | ||||||
|
|
@@ -166,6 +190,31 @@ fn addReleaseArtifacts( | |||||
| .strip = true, | ||||||
| }); | ||||||
| addProjectIncludes(b, main_module); | ||||||
| main_module.addIncludePath(b.path(".tools/deps/aarch64-linux-gnu/include")); | ||||||
| addZigImport( | ||||||
| b, | ||||||
| main_module, | ||||||
| target, | ||||||
| optimize, | ||||||
| "form_writer", | ||||||
| "src/net/form_writer.zig", | ||||||
| ); | ||||||
| addZigImport( | ||||||
| b, | ||||||
| main_module, | ||||||
| target, | ||||||
| optimize, | ||||||
| "catalog_parser", | ||||||
| "src/catalog/catalog_parser.zig", | ||||||
| ); | ||||||
| addZigImport( | ||||||
| b, | ||||||
| main_module, | ||||||
| target, | ||||||
| optimize, | ||||||
| "uuid", | ||||||
| "src/util/uuid.zig", | ||||||
| ); | ||||||
| main_module.addLibraryPath(b.path(".tools/deps/aarch64-linux-gnu/lib")); | ||||||
| main_module.addRPathSpecial("$ORIGIN"); | ||||||
| main_module.addCSourceFiles(.{ | ||||||
|
|
@@ -456,32 +505,97 @@ pub fn build(b: *std.Build) void { | |||||
| }); | ||||||
| rocknix_build_regression_test.setCwd(b.path(".")); | ||||||
| test_step.dependOn(&rocknix_build_regression_test.step); | ||||||
|
|
||||||
| const test_roots = [_][]const u8{ | ||||||
| "src/app/state.zig", | ||||||
| "src/catalog/catalog_parser.zig", | ||||||
| "src/catalog/catalog_search.zig", | ||||||
| "src/input/wire_encoder.zig", | ||||||
| "src/input/guide_chord.zig", | ||||||
| "src/session/message_protocol.zig", | ||||||
| "src/ui/keyboard.zig", | ||||||
| "src/ui/control_icons.zig", | ||||||
| "src/ui/navigation_repeat.zig", | ||||||
| "src/ui/persistent_settings.zig", | ||||||
| "src/ui/stream_dimensions.zig", | ||||||
| "src/media/rtp/h264_depacketizer.zig", | ||||||
| "src/net/json_reader.zig", | ||||||
| "src/net/json_writer.zig", | ||||||
| "src/net/form_writer.zig", | ||||||
| const dependency_toolchain_test = b.addSystemCommand(&.{ | ||||||
| "sh", | ||||||
| b.pathFromRoot("tests/dependency_toolchain_test.sh"), | ||||||
| }); | ||||||
| dependency_toolchain_test.setCwd(b.path(".")); | ||||||
| test_step.dependOn(&dependency_toolchain_test.step); | ||||||
|
|
||||||
| const tests = [_]struct { | ||||||
| source: []const u8, | ||||||
| project_includes: bool = false, | ||||||
| sdl: bool = false, | ||||||
| imports: []const ZigImport = &.{}, | ||||||
| }{ | ||||||
| .{ .source = "src/app/state.zig" }, | ||||||
| .{ .source = "src/catalog/catalog_parser.zig" }, | ||||||
| .{ .source = "src/catalog/catalog_search.zig" }, | ||||||
| .{ .source = "src/input/wire_encoder.zig" }, | ||||||
| .{ .source = "src/input/guide_chord.zig" }, | ||||||
| .{ .source = "src/session/message_protocol.zig" }, | ||||||
| .{ .source = "src/ui/keyboard.zig" }, | ||||||
| .{ .source = "src/ui/control_icons.zig" }, | ||||||
| .{ .source = "src/ui/navigation_repeat.zig" }, | ||||||
| .{ .source = "src/ui/persistent_settings.zig" }, | ||||||
| .{ .source = "src/ui/stream_dimensions.zig" }, | ||||||
| .{ .source = "src/media/rtp/h264_depacketizer.zig" }, | ||||||
| .{ .source = "src/net/json_reader.zig" }, | ||||||
| .{ .source = "src/net/json_writer.zig" }, | ||||||
| .{ .source = "src/net/form_writer.zig" }, | ||||||
| .{ .source = "src/util/uuid.zig" }, | ||||||
| .{ .source = "src/provider/geforce_now/input_protocol.zig" }, | ||||||
| .{ .source = "src/provider/geforce_now/pointer_input.zig" }, | ||||||
| .{ .source = "src/provider/geforce_now/endpoint.zig" }, | ||||||
| .{ .source = "src/provider/geforce_now/cloudmatch_protocol.zig" }, | ||||||
| .{ .source = "src/provider/geforce_now/subscription_protocol.zig" }, | ||||||
| .{ .source = "src/provider/geforce_now/provider_protocol.zig" }, | ||||||
| .{ .source = "src/provider/geforce_now/signaling_protocol.zig" }, | ||||||
| .{ .source = "src/provider/geforce_now/sdp_protocol.zig" }, | ||||||
| .{ | ||||||
| .source = "src/provider/geforce_now/auth_protocol.zig", | ||||||
| .imports = &.{.{ .name = "form_writer", .path = "src/net/form_writer.zig" }}, | ||||||
| }, | ||||||
| .{ | ||||||
| .source = "src/provider/geforce_now/auth_client.zig", | ||||||
| .project_includes = true, | ||||||
| .sdl = true, | ||||||
| .imports = &.{ | ||||||
| .{ .name = "gfn_http_fake", .path = "tests/gfn_http_fake.zig" }, | ||||||
| .{ .name = "form_writer", .path = "src/net/form_writer.zig" }, | ||||||
| .{ .name = "uuid", .path = "src/util/uuid.zig" }, | ||||||
| }, | ||||||
| }, | ||||||
| .{ | ||||||
| .source = "src/provider/geforce_now/catalog_protocol.zig", | ||||||
| .imports = &.{.{ .name = "catalog_parser", .path = "src/catalog/catalog_parser.zig" }}, | ||||||
| }, | ||||||
| .{ | ||||||
| .source = "src/provider/geforce_now/catalog_service.zig", | ||||||
| .project_includes = true, | ||||||
| .sdl = true, | ||||||
| .imports = &.{ | ||||||
| .{ .name = "gfn_http_fake", .path = "tests/gfn_http_fake.zig" }, | ||||||
| .{ .name = "form_writer", .path = "src/net/form_writer.zig" }, | ||||||
| .{ .name = "catalog_parser", .path = "src/catalog/catalog_parser.zig" }, | ||||||
| .{ .name = "uuid", .path = "src/util/uuid.zig" }, | ||||||
| }, | ||||||
| }, | ||||||
| .{ | ||||||
| .source = "src/provider/geforce_now/session_client.zig", | ||||||
| .project_includes = true, | ||||||
| .sdl = true, | ||||||
| .imports = &.{ | ||||||
| .{ .name = "gfn_http_fake", .path = "tests/gfn_http_fake.zig" }, | ||||||
| .{ .name = "form_writer", .path = "src/net/form_writer.zig" }, | ||||||
| .{ .name = "uuid", .path = "src/util/uuid.zig" }, | ||||||
| }, | ||||||
| }, | ||||||
| .{ | ||||||
| .source = "src/provider/geforce_now/webrtc_session.zig", | ||||||
| .project_includes = true, | ||||||
| .sdl = true, | ||||||
| }, | ||||||
| }; | ||||||
| for (test_roots) |root| { | ||||||
| const unit_tests = b.addTest(.{ | ||||||
| .root_source_file = b.path(root), | ||||||
| .target = b.graph.host, | ||||||
| .optimize = .Debug, | ||||||
| }); | ||||||
| test_step.dependOn(&b.addRunArtifact(unit_tests).step); | ||||||
| } | ||||||
| for (tests) |test_config| | ||||||
| addHostUnitTest( | ||||||
| b, | ||||||
| test_step, | ||||||
| test_config.source, | ||||||
| test_config.project_includes, | ||||||
| test_config.sdl, | ||||||
| test_config.imports, | ||||||
| ); | ||||||
|
|
||||||
| const video_decoder_object = | ||||||
| addHostZigObject(b, "video-decoder", "src/media/video/video_decoder.zig"); | ||||||
|
|
@@ -536,6 +650,20 @@ pub fn build(b: *std.Build) void { | |||||
|
|
||||||
| const fake_cedar_valid = | ||||||
| addHostCFakeLibrary(b, "fake-cedar-valid", "tests/cedar_fake_valid.c"); | ||||||
| const cedar_list_test = b.addExecutable(.{ | ||||||
| .name = "cedar-list-test", | ||||||
| .root_source_file = null, | ||||||
| .target = b.graph.host, | ||||||
| .optimize = .ReleaseSafe, | ||||||
| }); | ||||||
| cedar_list_test.addIncludePath(b.path("vendor/cedarx/base/include")); | ||||||
| cedar_list_test.addCSourceFile(.{ | ||||||
| .file = b.path("tests/cedar_list_test.c"), | ||||||
| .flags = &.{ "-std=gnu11", "-Wall", "-Wextra", "-Werror" }, | ||||||
| }); | ||||||
| cedar_list_test.linkLibC(); | ||||||
| test_step.dependOn(&b.addRunArtifact(cedar_list_test).step); | ||||||
|
|
||||||
| const cedar_decoder_test = addHostCExecutable( | ||||||
| b, | ||||||
| "video-decoder-cedar-test", | ||||||
|
|
||||||
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.
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.
Uh oh!
There was an error while loading. Please reload this page.