Wire Up Max-Res Plumbing
(This is a port of http://go/wvgerrit/11556 from the Widevine CDM repo.) This wires up the new method on the crypto interface with the core code that handles the max-res decode. Bug: 16034599 Change-Id: Id2ea5635bf732eabf1fd33712ff8bab6cf1a1745
This commit is contained in:
@@ -114,6 +114,10 @@ class CdmEngine {
|
||||
virtual bool DetachEventListener(const CdmSessionId& session_id,
|
||||
WvCdmEventListener* listener);
|
||||
|
||||
// Used for notifying the Max-Res Engine of resolution changes
|
||||
virtual void NotifyResolution(const CdmSessionId& session_id, uint32_t width,
|
||||
uint32_t height);
|
||||
|
||||
// Timer expiration method
|
||||
virtual void OnTimerEvent();
|
||||
|
||||
|
||||
@@ -80,6 +80,9 @@ class CdmSession {
|
||||
virtual bool AttachEventListener(WvCdmEventListener* listener);
|
||||
virtual bool DetachEventListener(WvCdmEventListener* listener);
|
||||
|
||||
// Used for notifying the Policy Engine of resolution changes
|
||||
virtual void NotifyResolution(uint32_t width, uint32_t height);
|
||||
|
||||
virtual void OnTimerEvent(bool update_usage);
|
||||
virtual void OnKeyReleaseEvent(const CdmKeySetId& key_set_id);
|
||||
|
||||
|
||||
@@ -56,6 +56,9 @@ class PolicyEngine {
|
||||
virtual void UpdateLicense(
|
||||
const video_widevine_server::sdk::License& license);
|
||||
|
||||
// Used for notifying the Policy Engine of resolution changes
|
||||
virtual void NotifyResolution(uint32_t width, uint32_t height);
|
||||
|
||||
virtual CdmResponseType Query(CdmQueryMap* key_info);
|
||||
|
||||
virtual const LicenseIdentification& license_id() { return license_id_; }
|
||||
|
||||
@@ -760,7 +760,6 @@ bool CdmEngine::FindSessionForKey(
|
||||
bool CdmEngine::AttachEventListener(
|
||||
const CdmSessionId& session_id,
|
||||
WvCdmEventListener* listener) {
|
||||
|
||||
CdmSessionMap::iterator iter = sessions_.find(session_id);
|
||||
if (iter == sessions_.end()) {
|
||||
return false;
|
||||
@@ -772,7 +771,6 @@ bool CdmEngine::AttachEventListener(
|
||||
bool CdmEngine::DetachEventListener(
|
||||
const CdmSessionId& session_id,
|
||||
WvCdmEventListener* listener) {
|
||||
|
||||
CdmSessionMap::iterator iter = sessions_.find(session_id);
|
||||
if (iter == sessions_.end()) {
|
||||
return false;
|
||||
@@ -781,6 +779,14 @@ bool CdmEngine::DetachEventListener(
|
||||
return iter->second->DetachEventListener(listener);
|
||||
}
|
||||
|
||||
void CdmEngine::NotifyResolution(const CdmSessionId& session_id, uint32_t width,
|
||||
uint32_t height) {
|
||||
CdmSessionMap::iterator iter = sessions_.find(session_id);
|
||||
if (iter != sessions_.end()) {
|
||||
iter->second->NotifyResolution(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
bool CdmEngine::ValidateKeySystem(const CdmKeySystem& key_system) {
|
||||
return (key_system.find("widevine") != std::string::npos);
|
||||
}
|
||||
|
||||
@@ -548,6 +548,10 @@ bool CdmSession::DetachEventListener(WvCdmEventListener* listener) {
|
||||
return (listeners_.erase(listener) == 1);
|
||||
}
|
||||
|
||||
void CdmSession::NotifyResolution(uint32_t width, uint32_t height) {
|
||||
policy_engine_->NotifyResolution(width, height);
|
||||
}
|
||||
|
||||
void CdmSession::OnTimerEvent(bool update_usage) {
|
||||
bool event_occurred = false;
|
||||
CdmEventType event;
|
||||
|
||||
@@ -208,6 +208,10 @@ void PolicyEngine::DecryptionEvent() {
|
||||
last_playback_time_ = clock_->GetCurrentTime();
|
||||
}
|
||||
|
||||
void PolicyEngine::NotifyResolution(uint32_t width, uint32_t height) {
|
||||
max_res_engine_.SetResolution(width, height);
|
||||
}
|
||||
|
||||
CdmResponseType PolicyEngine::Query(CdmQueryMap* key_info) {
|
||||
std::stringstream ss;
|
||||
int64_t current_time = clock_->GetCurrentTime();
|
||||
|
||||
Reference in New Issue
Block a user