Mir
|
Creator of timeout-based FrameDroppingPolicies. More...
#include <timeout_frame_dropping_policy_factory.h>
Public Member Functions | |
TimeoutFrameDroppingPolicyFactory (std::shared_ptr< mir::time::Timer > const &timer, std::chrono::milliseconds timeout) | |
std::unique_ptr< FrameDroppingPolicy > | create_policy (std::function< void()> const &drop_frame, std::function< void()> const &lock, std::function< void()> const &unlock) const override |
Create a FrameDroppingPolicy that will call drop_frame when it decides to drop a frame. More... | |
![]() | |
FrameDroppingPolicyFactory ()=default | |
virtual | ~FrameDroppingPolicyFactory ()=default |
FrameDroppingPolicyFactory (FrameDroppingPolicyFactory const &)=delete | |
FrameDroppingPolicyFactory & | operator= (FrameDroppingPolicyFactory const &)=delete |
Creator of timeout-based FrameDroppingPolicies.
mir::compositor::TimeoutFrameDroppingPolicyFactory::TimeoutFrameDroppingPolicyFactory | ( | std::shared_ptr< mir::time::Timer > const & | timer, |
std::chrono::milliseconds | timeout | ||
) |
timer | Timer that the policies constructed will schedule alarms on |
timeout | Milliseconds that the policies will wait before dropping a frame |
|
overridevirtual |
Create a FrameDroppingPolicy that will call drop_frame when it decides to drop a frame.
The lock/unlock functions allow the user to preserve lock ordering in situations where FrameDroppingPolicy methods need to be called under external lock and the callback implementation needs to run code protected by the same lock. A FrameDroppingPolicy implementation may have internal locks of its own, which maybe acquired during callback dispatching; to preserve lock ordering the given lock function will be invoked during callback dispatch before any internal locks are acquired.
drop_frame | Function to call when a frame needs to be dropped |
lock | Function called within the callback dispatcher context before any internal locks are acquired. |
unlock | Function called within the callback dispatcher context after any internal locks are released. |
Implements mir::compositor::FrameDroppingPolicyFactory.
Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015