Skip to content
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

Input extensions for controller touchpad, battery, RGB LEDs, and motion events #1435

Merged
merged 7 commits into from
Jul 11, 2023
Merged
Next Next commit
Send feature flags in RTSP DESCRIBE response
  • Loading branch information
cgutman committed Jul 11, 2023
commit bd62f3a99fd36fbd02808fd8a97dcfc459f90a1a
15 changes: 15 additions & 0 deletions src/platform/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"

Expand Down
9 changes: 9 additions & 0 deletions src/platform/linux/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions src/platform/macos/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions src/platform/windows/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions src/rtsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ namespace rtsp_stream {
option.content = const_cast<char *>(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;
}
Expand Down