Commit Graph

1031 Commits

Author SHA1 Message Date
Cameron Gutman
435bc6a5a4 Fix pthread_attr leak 2026-01-11 01:46:30 -06:00
Cameron Gutman
3a377e7d7b Only set an explicit pthread stack size on Vita 2026-01-05 00:23:31 -06:00
Cameron Gutman
0586f3d65f Fix thread context leak on non-Vita platforms 2026-01-05 00:21:35 -06:00
Cameron Gutman
b126e481a1 Improve locking for batched mouse and gamepad sensor events
By unlocking the mutex before we enqueue the new entry, we can avoid the input thread immediately contending on the mutex after the new item wakes it up.
2025-11-25 17:30:01 -06:00
Cameron Gutman
20c05eda6a Don't lock the ENet mutex when querying for RTT information 2025-11-25 17:26:01 -06:00
Cameron Gutman
2d984f4b0d Update ENet for improved FreeBSD support 2025-11-09 20:36:42 -06:00
Cameron Gutman
e59a5f5b53 Rewrite gamepad input batching to batch on the enqueue-side
- Allows successful batching of interleaved input from multiple controllers
- Avoids enqueue/dequeue overhead and memory allocation when batching
2025-11-09 15:47:12 -06:00
AorsiniYT
1c86405fd0 Fix: Add inclusion of <psp2/kernel/processmgr.h> for Vita compatibility 2025-11-07 00:37:14 -06:00
Andy Grundman
e356b2cfde Change presentationTimeMs to presentationTimeUs: retain more resolution when dealing with RTP video timestamps from Sunshine. Include raw rtpTimestamp value for use with integer time APIs. 2025-11-06 20:27:01 -06:00
Andy Grundman
fdd026518c macOS/iOS: use clock_gettime_nsec_np(CLOCK_UPTIME_RAW) instead of mach_absolute_time() per Apple's recommendation.
Move has_monotonic_time variable into the final variant of platform-specific time code (used by Linux/Unix).
2025-11-06 20:27:01 -06:00
Andy Grundman
a3ebaaf015 Use uint64_t for DECODE_UNIT presentationTimeMs
This still holds a millisecond value sourced from RTP timestamp, but since we're changing the API anyway, now is a good time to future-proof this field.
2025-11-06 20:27:01 -06:00
Andy Grundman
82ee2d6590 Improve support for high-resolution stats
* This patch adds a new microsecond-resolution function call, LiGetMicroseconds(), to complement
the existing LiGetMillis(). Many variables used by stats have been updated to work at this
higher resolution and now provide better results when displaying e.g. sub-millisecond frametime stats.
To try and avoid confusion, variables that now contain microseconds have been renamed with a suffix
of 'Us', and those ending in 'Ms' contain milliseconds. I originally experimented with nanoseconds but it
felt like overkill for our needs.

Public API in Limelight.h:
uint64_t LiGetMicroseconds(void);
uint64_t LiGetMillis(void);
const RTP_AUDIO_STATS* LiGetRTPAudioStats(void);  // provides access to RTP data for the overlay stats
const RTP_VIDEO_STATS* LiGetRTPVideoStats(void);

Note: Users of this library may need to make changes. If using LiGetMillis() to track the duration of
something that is shown to the user, consider switching to LiGetMicroseconds(). Remember to divide by
1000 at time of display to show in milliseconds.
2025-11-06 20:27:01 -06:00
Cameron Gutman
5f2280183c Fix CGN subnet mask 2025-07-15 09:59:57 -05:00
Cameron Gutman
0975a8684f Implement workaround for bad synthesized IPv6 addresses when connecting through a v4-only VPN on iOS 2025-07-14 22:27:54 -05:00
ns6089
ab6e21ff5b Specify cmake max version to support cmake-4.0 (#112) 2025-07-14 20:49:47 -05:00
camelcx
c86e0537d1 Fix some edge case on small MTU devices using qsv codec (#107)
Add fall back logic to prevent edge case where SPS SPP is not included in the same packet and key IDR frame is mislabeled as P frame causing assertion error at validation.
2025-07-05 19:13:06 -05:00
armin-25689
29f298ec88 build: Add __FreeBSD__ compilation condition for pthread_setname_np() 2025-07-05 18:58:07 -05:00
dependabot[bot]
1176ca6409 Bump enet from 44c85e1 to 115a10b
Bumps [enet](https://github.com/cgutman/enet) from `44c85e1` to `115a10b`.
- [Commits](44c85e1627...115a10baa1)

---
updated-dependencies:
- dependency-name: enet
  dependency-version: 115a10baa1d7f291ff5b870765610fd3b4a6e43c
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-05 18:57:52 -05:00
AorsiniYT
34074c9ec0 Fixes for Moonlight compatibility on the PS Vita. (#110)
* Use pthread for vita thread managment

* Add thread name to pthread and remove ipv6 from vita

* Fix inclusion of pthread.h so that it is only included on specific platforms (__vita__)

* Fix memory release in ThreadProc for psvita platform

---------

Co-authored-by: MetalfaceScout <logan.mathis@utahtech.edu>
Co-authored-by: Logan Mathis <33127568+MetalfaceScout@users.noreply.github.com>
2025-07-05 18:57:33 -05:00
Cameron Gutman
262537959f Create dependabot.yml 2025-07-05 18:53:47 -05:00
Cameron Gutman
58902e342f Zero output parameters when BbGet*() fails 2025-06-08 15:49:52 -05:00
Cameron Gutman
84f37631c2 Add ByteBuffer APIs for reading/writing multiple bytes 2025-06-08 15:46:47 -05:00
ReenigneArcher
22a190bdd5 ci(code-ql): use no build mode
CodeQL now supports no build mode for C++ analysis. See: https://github.blog/changelog/2025-06-03-codeql-can-be-enabled-at-scale-on-c-c-repositories-in-public-preview-using-build-free-scanning/
2025-06-08 13:41:53 -05:00
ReenigneArcher
f2f85efa33 ci(workflows): move to github workflows 2025-03-26 23:05:26 -05:00
ABeltramo
e95feaf495 Protocol extension: DualSense adaptive trigger support (#102) 2025-03-25 18:16:11 -05:00
Cameron Gutman
d3d3e6cf01 Port improved ping interval logic into the control receive loop 2024-10-20 17:34:35 -05:00
Cameron Gutman
12e603eceb Further improve ENet ping interval wait logic 2024-10-20 17:15:04 -05:00
Cameron Gutman
04a2f1131c Update ENet with improved wakeup logic for enet_host_service() 2024-10-20 16:36:12 -05:00
Cameron Gutman
dff1690fe1 Validate channel count before parsing Opus param string 2024-10-15 23:00:16 -05:00
ns6089
0fa805d973 Guard against rtsp response with no content 2024-10-15 22:48:59 -05:00
Cameron Gutman
8599b6042a Use SO_NONBLOCK on Haiku 2024-06-10 23:45:51 -05:00
Cameron Gutman
e49637d153 Bump enet submodule for Haiku support 2024-06-10 23:45:10 -05:00
ns6089
907110c4ec Support YUV 4:4:4 formats 2024-06-06 02:31:32 -05:00
Cameron Gutman
c245fe599d Use higher packet size for remote streaming over end-to-end IPv6 connection
The IPv6 spec guarantees a minimum of 1280 byte MTUs
2024-05-29 13:57:50 -04:00
Cameron Gutman
5e75d4e1f1 Fix -Wsign-compare warning 2024-05-25 18:31:43 -05:00
Cameron Gutman
a3e57feadd Update CI images 2024-05-25 18:31:09 -05:00
Cameron Gutman
eb21561541 Don't depend on outputDataLength to be initialized with mbedTLS
OpenSSL has no such requirement, so MbedTLS breakages snuck in.
2024-03-05 21:09:57 -06:00
Cameron Gutman
48d7f1ace1 Fix incorrect function definition 2024-02-25 15:52:04 -06:00
Cameron Gutman
ba1fc33672 Fix spurious asserts in the unencrypted audio path with Sunshine 2024-02-20 18:03:50 -06:00
Cameron Gutman
046c231b33 Update ENet submodule to use Wii U userbuffers 2024-02-18 13:41:31 -06:00
GaryOderNichts
3d99869c0c Implement support for userbuffers on Wii U
The Wii U socket implementation has limited memory available. To support larger receive buffers, application memory needs to be provided.
To make sockets use this user memory the `SO_RUSRBUF` option needs to be set on the socket.
2024-02-18 13:39:17 -06:00
Cameron Gutman
8af4562af6 Assert that active objects exist in deleters 2024-02-17 18:20:24 -06:00
Cameron Gutman
59f7f62b62 Fix thread detachment on Vita 2024-02-17 18:14:49 -06:00
Cameron Gutman
9686f6942f Consolidate PltCloseThread() and PltJoinThread() 2024-02-17 18:14:03 -06:00
GaryOderNichts
9545dd7603 Implement detached threads (#88)
The `AsyncTerm` thread is never joined but its handle is immediately closed. This works fine on Windows, but causes issues on other platforms where threads need to be explicitly detached if never joined (pthread, wiiu).

This adds a new `PltDetachThread` function, which can be used instead of `PltCloseThread` to explictly detach a thread, requiring it to no longer be closed.
2024-02-17 17:54:32 -06:00
Cameron Gutman
ec171fd7ca Don't use VersionHelpers.h on UWP 2024-02-03 17:20:13 -06:00
Cameron Gutman
cbd0ec1b25 Fix signed/unsigned mismatch warnings 2024-02-03 15:20:56 -06:00
Cameron Gutman
92abf6e11d Update ENet with ECN/L4S support for Windows too 2024-02-03 15:19:13 -06:00
Cameron Gutman
dc71a16bae Update ENet with ECN/L4S support 2024-02-03 15:14:47 -06:00
Cameron Gutman
7ab34e709a Improve encrypted RTSP message validation 2024-02-03 14:39:12 -06:00