From 1ef8cb1111b63c06b2bd3cd567ab53195a38fac0 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 25 Jun 2023 17:40:25 -0500 Subject: [PATCH] Send feature flags in RTSP DESCRIBE response --- src/platform/common.h | 15 +++++++++++++++ src/platform/linux/input.cpp | 9 +++++++++ src/platform/macos/input.cpp | 9 +++++++++ src/platform/windows/input.cpp | 9 +++++++++ src/rtsp.cpp | 4 ++++ 5 files changed, 46 insertions(+) diff --git a/src/platform/common.h b/src/platform/common.h index 91fced16..4d2ba921 100644 --- a/src/platform/common.h +++ b/src/platform/common.h @@ -160,6 +160,14 @@ namespace platf { int width, height; }; + // These values must match Limelight-internal.h's SS_FF_* constants! + namespace platform_caps { + typedef uint32_t caps_t; + + constexpr caps_t pen_touch = 0x01; // Pen and touch events + constexpr caps_t controller_touch = 0x02; // Controller touch events + }; // namespace platform_caps + struct gamepad_state_t { std::uint32_t buttonFlags; std::uint8_t lt; @@ -475,6 +483,13 @@ namespace platf { void free_gamepad(input_t &input, int nr); + /** + * @brief Returns the supported platform capabilities to advertise to the client. + * @return Capability flags. + */ + platform_caps::caps_t + get_capabilities(); + #define SERVICE_NAME "Sunshine" #define SERVICE_TYPE "_nvstream._tcp" diff --git a/src/platform/linux/input.cpp b/src/platform/linux/input.cpp index d266ed5e..942d69e9 100644 --- a/src/platform/linux/input.cpp +++ b/src/platform/linux/input.cpp @@ -1833,4 +1833,13 @@ namespace platf { return gamepads; } + + /** + * @brief Returns the supported platform capabilities to advertise to the client. + * @return Capability flags. + */ + platform_caps::caps_t + get_capabilities() { + return 0; + } } // namespace platf diff --git a/src/platform/macos/input.cpp b/src/platform/macos/input.cpp index 0ca85e75..b9b5b9b4 100644 --- a/src/platform/macos/input.cpp +++ b/src/platform/macos/input.cpp @@ -500,4 +500,13 @@ const KeyCodeMap kKeyCodesMap[] = { return gamepads; } + + /** + * @brief Returns the supported platform capabilities to advertise to the client. + * @return Capability flags. + */ + platform_caps::caps_t + get_capabilities() { + return 0; + } } // namespace platf diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index c3067cb3..797c9d7e 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -825,4 +825,13 @@ namespace platf { return gps; } + + /** + * @brief Returns the supported platform capabilities to advertise to the client. + * @return Capability flags. + */ + platform_caps::caps_t + get_capabilities() { + return 0; + } } // namespace platf diff --git a/src/rtsp.cpp b/src/rtsp.cpp index a2e4a2fc..28a029c6 100644 --- a/src/rtsp.cpp +++ b/src/rtsp.cpp @@ -492,6 +492,10 @@ namespace rtsp_stream { option.content = const_cast(seqn_str.c_str()); std::stringstream ss; + + // Tell the client about our supported features + ss << "a=x-ss-general.featureFlags: " << (uint32_t) platf::get_capabilities(); + if (video::active_hevc_mode != 1) { ss << "sprop-parameter-sets=AAAAAU"sv << std::endl; }