On each re/init, query the active monitor refresh rate via
DwmGetCompositionTimingInfo. If the client requested framerate exceeds
the host monitor refresh, automatically disable DwmFlush.
This avoids the problem by which DwmFlush would constrain the client
FPS if the host monitor runs at a lower refresh rate, thus allowing
the feature to be enabled by default.
If there are other issues caused by DwmFlush for certain systems,
it can still be disabled via configuration.
Invoke DwmFlush() before acquiring the next frame to alleviate visual stutter
during mouse movement at the cost of constraining the capture rate to the host's
monitor refresh.
Disabled by default; enable via "dwmflush" boolean configuration parameter.
This commit introduces initial support for MacOS as third major host platform.
It relies on the VideoToolbox framework for audio and video processing, which
enables hardware accelerated processing of the stream on most platforms.
Audio capturing requires third party tools as MacOS does not offer the
recording of the audio output like the other platforms do. The commit enables
most features offered by Sunshine for MacOS with the big exception of gamepad
support. The patch sets was tested by a few volunteers, which allowed to remove
some of the early bugs. However, several bugs especially regarding corner
cases have probably not surfaced yet.
Besides instructions how to build from source, the commit also adds a Portfile
that allows a more easy installation. After available on the release branch,
a pull request for the Portfile in the MacPorts project is planned.
Signed-off-by: Anselm Busse <anselm.busse@outlook.com>
* Increase vbv-bufsize to 1/10 of requested bitrate. The previous value
was too low, which was resulting in poor encoding quality and failure to
stabilize at the requested bitrate. Setting to 1/10 of bitrate is a
good compromise, as it avoids quality loss but also prevents bandwidth
spikes far above the bitrate/vbv-maxrate.
* With vbv-bufsize set to a more appropriate value, testing shows that
the average bitrate vs client-requested bandwidth overshoots by ~20%.
Adjust for this scenario in the software encoding case only.