ref:44bf39be75adc063a4a35f8b0f065404c6c9971d

fix: Resolve minimum_fps_target related issues on all platforms (#4967)

SHA: 44bf39be75adc063a4a35f8b0f065404c6c9971d
Author: Conn O'Griofa <connogriofa@gmail.com>
Date: 2026-04-19 17:49
Parents: 7228c25
4 files changed +9 -22
Type
src/platform/common.h +0 −4
@@ -535,10 +535,6 @@
return true;
}
virtual bool is_event_driven() {
return false;
}
virtual ~display_t() = default;
// Offsets for when streaming a specific monitor. By default, they are 0.
src/platform/linux/pipewire.cpp +0 −5
@@ -858,11 +858,6 @@
return 0;
}
// This capture method is event driven; don't insert duplicate frames
bool is_event_driven() override {
return true;
}
private:
bool is_buffer_redundant(const egl::img_descriptor_t *img) {
// Check for corrupted frame
src/thread_safe.h +6 −9
@@ -60,21 +60,18 @@
}
// pop and view should not be used interchangeably
template<class Rep, class Period>
template<typename Rep, typename Period>
status_t pop(std::chrono::duration<Rep, Period> delay) {
std::unique_lock ul {_lock};
if (!_continue) {
if (bool success = _cv.wait_for(ul, delay, [this] {
return (bool) _status || !_continue;
});
!success || !_continue) {
return util::false_v<status_t>;
}
while (!_status) {
if (!_continue || _cv.wait_for(ul, delay) == std::cv_status::timeout) {
return util::false_v<status_t>;
}
}
auto val = std::move(_status);
_status.reset();
_status = util::false_v<status_t>;
return val;
}
src/video.cpp +3 −4
@@ -2048,11 +2048,10 @@
}
});
// set max frame time based on client-requested target framerate (or 0.5fps/2000ms for event-driven capture)
double def_fps_target = (disp->is_event_driven() ? 1 : config.framerate);
// set max frame time based on client-requested target framerate.
double minimum_fps_target = (config::video.minimum_fps_target > 0.0) ? config::video.minimum_fps_target : (config.framerate / 2);
double minimum_fps_target = (config::video.minimum_fps_target > 0.0) ? config::video.minimum_fps_target : def_fps_target;
std::chrono::duration<double, std::milli> max_frametime {1000.0 / minimum_fps_target};
BOOST_LOG(info) << "Minimum FPS target set to ~"sv << minimum_fps_target << "fps ("sv << max_frametime.count() << "ms)"sv;
BOOST_LOG(info) << "Minimum FPS target set to ~"sv << (minimum_fps_target / 2) << "fps ("sv << max_frametime.count() * 2 << "ms)"sv;
auto shutdown_event = mail->event<bool>(mail::shutdown);
auto packets = mail::man->queue<packet_t>(mail::video_packets);