Improve android MediaDrm property latency
[ Merge of http://go/wvgerrit/89848 ] Apps query a number of properties at initialization. The mediaDrm API getProperty allows the query of a single property at a time. This causes a series of requests. If no crypto sessions are concurrently open, a series of expensive OEMCrypto Initialization and Termination calls will occur. In this change OEMCrypto termination is delayed. If an OEMCrypto Terminate is followed in close succession by an Initialize, neither will occur avoiding the overhead. A timer enables a countdown process. If no session activity occurs, the timer will eventually terminate OEMCrypto and exit. Bug: 136282358 Test: Android unit/integration tests Change-Id: I442b7919b4e7835c52583516c8bc64d0c150241d
This commit is contained in:
@@ -184,14 +184,17 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
|
||||
|
||||
uint32_t GenerateSessionSharingId();
|
||||
|
||||
// timer related methods to drive policy decisions
|
||||
void EnablePolicyTimer();
|
||||
void DisablePolicyTimer();
|
||||
// Timer related methods to drive policy decisions
|
||||
void EnableTimer();
|
||||
void DisableTimer();
|
||||
// Call this method only if invoked from a thread other than the timer thread.
|
||||
// Otherwise this might result in deadlock.
|
||||
void DisableTimerAndWaitForExit();
|
||||
void OnTimerEvent();
|
||||
|
||||
static std::mutex session_sharing_id_generation_lock_;
|
||||
std::mutex policy_timer_lock_;
|
||||
Timer policy_timer_;
|
||||
std::mutex timer_lock_;
|
||||
Timer timer_;
|
||||
|
||||
// instance variables
|
||||
// This manages the lifetime of the CDM instances.
|
||||
|
||||
Reference in New Issue
Block a user