blob: 9b00b26f69d2c5efe94233596b4631f76bb7d192 [file] [edit]
From d7c772a41d323b0c5c60b5ed988c1026aebb41fa Mon Sep 17 00:00:00 2001
From: kkanag314 <krishnapriya_kanagaraj@comcast.com>
Date: Wed, 13 Sep 2023 10:59:38 +0000
Subject: [PATCH] Add a new metrics punch through on the OCDM framework
---
OpenCDMi/FrameworkRPC.cpp | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/OpenCDMi/FrameworkRPC.cpp b/OpenCDMi/FrameworkRPC.cpp
index 2e64995e..2448e697 100644
--- a/OpenCDMi/FrameworkRPC.cpp
+++ b/OpenCDMi/FrameworkRPC.cpp
@@ -637,6 +637,18 @@ namespace Plugin {
return (_cencData.Status());
}
+ Exchange::OCDM_RESULT Metricdata(uint32_t& bufferSize, uint8_t buffer[]) const override {
+ Exchange::OCDM_RESULT result = Exchange::OCDM_INTERFACE_NOT_IMPLEMENTED;
+
+ CDMi::IMediaSessionMetrics* extension = dynamic_cast<CDMi::IMediaSessionMetrics*>(_mediaKeySession);
+
+ if (extension != nullptr) {
+ result = static_cast<Exchange::OCDM_RESULT>(extension->Metrics(bufferSize, buffer));
+ }
+
+ return(result);
+ }
+
Exchange::ISession::KeyStatus Status(const uint8_t keyId[], const uint8_t length) const override
{
return (_cencData.Status(CommonEncryptionData::KeyId(static_cast<CommonEncryptionData::systemType>(0), keyId, length)));
@@ -837,6 +849,23 @@ namespace Plugin {
return result;
}
+ Exchange::OCDM_RESULT Metricdata(const string& keySystem, uint32_t& bufferSize, uint8_t buffer[]) const override {
+ Exchange::OCDM_RESULT result = Exchange::OCDM_KEYSYSTEM_NOT_SUPPORTED;
+
+ CDMi::IMediaKeys* system = _parent.KeySystem(keySystem);
+ if (system != nullptr) {
+ CDMi::IMediaSystemMetrics* extension = dynamic_cast<CDMi::IMediaSystemMetrics*>(system);
+ if (extension != nullptr) {
+ result = static_cast<Exchange::OCDM_RESULT>(extension->Metrics(bufferSize, buffer));
+ }
+ else {
+ result = Exchange::OCDM_INTERFACE_NOT_IMPLEMENTED;
+ }
+ }
+
+ return(result);
+ }
+
uint32_t DefaultSize() const {
return _defaultSize;
}
--
2.17.1