-
Notifications
You must be signed in to change notification settings - Fork 8
Feature/delia 70176 #1228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev_sprint_25_2
Are you sure you want to change the base?
Feature/delia 70176 #1228
Changes from 6 commits
19db08d
c9af2ff
41135c4
9af90a0
32bb1bf
bc1ad7d
77be84b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -104,7 +104,7 @@ void OCDMSessionAdapter::initDRMSystem() | |||||||||
|
|
||||||||||
| OCDMSessionAdapter::~OCDMSessionAdapter() | ||||||||||
| { | ||||||||||
| MW_LOG_WARN("[HHH]OCDMSessionAdapter destructor called! keySystem %s", m_keySystem.c_str()); | ||||||||||
| MW_LOG_WARN("VRN [HHH]OCDMSessionAdapter destructor called! keySystem %s", m_keySystem.c_str()); | ||||||||||
| clearDecryptContext(); | ||||||||||
|
|
||||||||||
| if (m_pOpenCDMSystem) { | ||||||||||
|
|
@@ -120,7 +120,7 @@ OCDMSessionAdapter::~OCDMSessionAdapter() | |||||||||
| void OCDMSessionAdapter::generateDRMSession(const uint8_t *f_pbInitData, | ||||||||||
| uint32_t f_cbInitData, std::string &customData) | ||||||||||
| { | ||||||||||
| MW_LOG_INFO("at %p, with %p, %p", this , m_pOpenCDMSystem, m_pOpenCDMSession); | ||||||||||
| MW_LOG_WARN("at %p, with %p, %p", this , m_pOpenCDMSystem, m_pOpenCDMSession); | ||||||||||
|
||||||||||
| MW_LOG_WARN("at %p, with %p, %p", this , m_pOpenCDMSystem, m_pOpenCDMSession); | |
| MW_LOG_INFO("generateDRMSession called (system=%s, session=%s)", | |
| m_pOpenCDMSystem ? "set" : "null", | |
| m_pOpenCDMSession ? "set" : "null"); |
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These callbacks now emit WARN logs on key update events. Key update/keys updated can be frequent during playback; WARN-level will spam logs and may impact performance. Please downgrade to DEBUG/TRACE and consider including minimal, actionable context (or rate-limit) instead of a constant string.
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes routine session tracing from INFO to WARN. If it’s needed for debugging, prefer DEBUG/TRACE to avoid raising log severity for normal execution (and avoid pointer address logging at WARN).
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -519,7 +519,10 @@ static GstFlowReturn gst_cdmidecryptor_transform_ip( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // call decrypt even for clear samples in order to copy it to a secure buffer. If secure buffers are not supported | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // decrypt() call will return without doing anything | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (cdmidecryptor->drmSession != NULL) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| errorCode = cdmidecryptor->drmSession->decrypt(keyIDBuffer, ivBuffer, buffer, subSampleCount, subsamplesBuffer, cdmidecryptor->sinkCaps); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MW_LOG_WARN("VRN drmSession->decrypt returns[%d]",errorCode); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MW_LOG_WARN("VRN drmSession->decrypt returns[%d]",errorCode); | |
| if (errorCode != 0) | |
| { | |
| MW_LOG_WARN("VRN drmSession->decrypt returns[%d]", errorCode); | |
| } |
Copilot
AI
Mar 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New logging lines introduce inconsistent indentation (mixed spaces/tabs) and missing spaces after commas in function calls (e.g., ...,errorCode). Please align indentation with the surrounding block and apply consistent spacing to keep this hot-path code readable and consistent with the project's formatting rules.
| errorCode = cdmidecryptor->drmSession->decrypt(keyIDBuffer, ivBuffer, buffer, subSampleCount, subsamplesBuffer, cdmidecryptor->sinkCaps); | |
| MW_LOG_WARN("VRN drmSession->decrypt returns[%d]",errorCode); | |
| errorCode = cdmidecryptor->drmSession->decrypt(keyIDBuffer, ivBuffer, buffer, subSampleCount, subsamplesBuffer, cdmidecryptor->sinkCaps); | |
| MW_LOG_WARN("VRN drmSession->decrypt returns[%d]", errorCode); |
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MW_LOG_WARN is emitted on every decrypt call regardless of success/failure. Since gst_cdmidecryptor_transform_ip() is called per buffer, this is likely to flood logs and affect playback performance; prefer GST_TRACE/DEBUG, or log only on non-zero errorCode (optionally rate-limited).
| MW_LOG_WARN("VRN drmSession->decrypt returns[%d]",errorCode); | |
| GST_TRACE_OBJECT(cdmidecryptor, "VRN drmSession->decrypt returns[%d]", errorCode); |
Copilot
AI
Mar 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added WARN line at the start of the error-handling block is followed by control flow that is not indented consistently (if(errorCode == ...) is at the same indentation as the parent block). Since this region is already complex, please re-indent (and add missing spaces around parentheses/keywords) so the nesting is unambiguous.
Copilot
AI
Mar 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "VRN" prefix in these new log messages doesn't match other logging in this element (which uses GST_*_OBJECT messages without per-developer tags). Consider removing the tag or replacing it with a consistent component prefix so logs remain searchable and standardized.
| MW_LOG_WARN("VRN drmSession->decrypt returns[%d]",errorCode); | |
| cdmidecryptor->streamEncrypted = true; | |
| if (errorCode != 0 || cdmidecryptor->hdcpOpProtectionFailCount) | |
| { | |
| MW_LOG_WARN("VRN Enters errorcode[%d]",errorCode); | |
| if(errorCode == HDCP_OUTPUT_PROTECTION_FAILURE) | |
| { | |
| MW_LOG_WARN("VRN Enters HDCP O/P PROTEC errorcode[%d]",errorCode); | |
| cdmidecryptor->hdcpOpProtectionFailCount++; | |
| } | |
| else if(cdmidecryptor->hdcpOpProtectionFailCount) | |
| { | |
| MW_LOG_WARN("VRN Enters HDCP PROTEC FAIL COUNT[%d] T[%d]",cdmidecryptor->hdcpOpProtectionFailCount,DECRYPT_FAILURE_THRESHOLD); | |
| GST_WARNING_OBJECT(cdmidecryptor, "drmSession->decrypt returns[%d]", errorCode); | |
| cdmidecryptor->streamEncrypted = true; | |
| if (errorCode != 0 || cdmidecryptor->hdcpOpProtectionFailCount) | |
| { | |
| GST_WARNING_OBJECT(cdmidecryptor, "Decrypt error code[%d]", errorCode); | |
| if(errorCode == HDCP_OUTPUT_PROTECTION_FAILURE) | |
| { | |
| GST_WARNING_OBJECT(cdmidecryptor, "HDCP output protection error code[%d]", errorCode); | |
| cdmidecryptor->hdcpOpProtectionFailCount++; | |
| } | |
| else if(cdmidecryptor->hdcpOpProtectionFailCount) | |
| { | |
| GST_WARNING_OBJECT(cdmidecryptor, "HDCP protection failure count[%d] threshold[%d]", cdmidecryptor->hdcpOpProtectionFailCount, DECRYPT_FAILURE_THRESHOLD); |
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These statements introduce a lot of extra WARN-level logging in the hot decryption path (e.g., "Enters errorcode..."). Several messages duplicate the existing GST_ERROR_OBJECT and don’t add actionable context. Consider removing them or downgrading to DEBUG, and keep WARN/ERROR for genuinely actionable, infrequent events.
Copilot
AI
Mar 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid logging raw pointer values (Err[%p]) in production logs, since this can leak memory addresses and reduce the effectiveness of ASLR. Prefer omitting the pointer or logging structured error details (domain/code/message) instead.
| MW_LOG_WARN("VRN g_error_new HDCP Compliance Check Failure[%d] Err[%p]",errorCode,error); | |
| } | |
| else | |
| { | |
| error = g_error_new(GST_STREAM_ERROR , GST_STREAM_ERROR_FAILED, "Decrypt Error: code %d", errorCode); | |
| MW_LOG_WARN("VRN g_error_new Decrypt Error:[%d] Err[%p]",errorCode, error); | |
| MW_LOG_WARN("VRN g_error_new HDCP Compliance Check Failure[%d] domain:%u code:%d message:%s", | |
| errorCode, error->domain, error->code, error->message); | |
| } | |
| else | |
| { | |
| error = g_error_new(GST_STREAM_ERROR , GST_STREAM_ERROR_FAILED, "Decrypt Error: code %d", errorCode); | |
| MW_LOG_WARN("VRN g_error_new Decrypt Error:[%d] domain:%u code:%d message:%s", | |
| errorCode, error->domain, error->code, error->message); |
Copilot
AI
Mar 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These newly added MW_LOG_WARN calls will execute for every encrypted buffer (including success path via "Else Scenario"). Since this function runs per-sample, WARN-level logging here risks severe log spam and performance regression; consider removing these or gating them to error conditions / threshold events, and using DEBUG/TRACE for routine diagnostics.
| MW_LOG_WARN("VRN Else Scenario [%d]",errorCode); | |
| MW_LOG_DEBUG("VRN Else Scenario [%d]",errorCode); |
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The success path logs "VRN Else Scenario" at WARN level for every decrypted buffer, which is high-frequency and will overwhelm logs in normal playback. Please remove this log or downgrade it to TRACE/DEBUG behind a feature flag / build-time guard.
| MW_LOG_WARN("VRN Else Scenario [%d]",errorCode); | |
| cdmidecryptor->decryptFailCount = 0; | |
| cdmidecryptor->hdcpOpProtectionFailCount = 0; | |
| #ifdef FUNCTION_DEBUG | |
| MW_LOG_WARN("VRN Else Scenario [%d]",errorCode); | |
| #endif | |
| cdmidecryptor->decryptFailCount = 0; | |
| cdmidecryptor->hdcpOpProtectionFailCount = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
printf()in the decrypt path will write to stdout/stderr outside the project logging framework and is very expensive in a per-buffer hot path. Please remove it or replace with the existing logging macros at an appropriate level (e.g., TRACE/DEBUG), ideally gated/rate-limited.