From 40159825e8938cda1201074ad4a6edc92a0bd126 Mon Sep 17 00:00:00 2001 From: Rahul Frias Date: Mon, 9 Jan 2017 20:58:52 -0800 Subject: [PATCH] Add Cdm::setVideoResolution() [ Merge of http://go/wvgerrit/22744 ] Pass resolution information into policy engine for constraint checking. b/33380824 Test: Reran unittests. All tests other than some oemcrypto, request_license_test passed. Those tests failed with or without this CL. Change-Id: I405099b1f66a47fa0c2579e2ae248dd78fa4e98a --- libwvdrmengine/cdm/core/include/cdm_engine.h | 5 +++-- libwvdrmengine/cdm/core/src/cdm_engine.cpp | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libwvdrmengine/cdm/core/include/cdm_engine.h b/libwvdrmengine/cdm/core/include/cdm_engine.h index f8501c11..453374cf 100644 --- a/libwvdrmengine/cdm/core/include/cdm_engine.h +++ b/libwvdrmengine/cdm/core/include/cdm_engine.h @@ -195,8 +195,9 @@ class CdmEngine { virtual bool IsKeyLoaded(const KeyId& key_id); virtual bool FindSessionForKey(const KeyId& key_id, CdmSessionId* sessionId); - // Used for notifying the Max-Res Engine of resolution changes - virtual void NotifyResolution(const CdmSessionId& session_id, uint32_t width, + // Used for notifying the Max-Res Engine of resolution changes. + // Return false if no match is found for session_id. + virtual bool NotifyResolution(const CdmSessionId& session_id, uint32_t width, uint32_t height); // Timer expiration method. This method is not re-entrant -- there can be diff --git a/libwvdrmengine/cdm/core/src/cdm_engine.cpp b/libwvdrmengine/cdm/core/src/cdm_engine.cpp index eb6859ee..7b13434b 100644 --- a/libwvdrmengine/cdm/core/src/cdm_engine.cpp +++ b/libwvdrmengine/cdm/core/src/cdm_engine.cpp @@ -1257,12 +1257,14 @@ bool CdmEngine::FindSessionForKey(const KeyId& key_id, return false; } -void CdmEngine::NotifyResolution(const CdmSessionId& session_id, uint32_t width, +bool 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); + return true; } + return false; } bool CdmEngine::ValidateKeySystem(const CdmKeySystem& key_system) {