32 #ifdef DEBUG_FUNC_TRACE
33 #define DEBUG_FUNC fprintf(stdout, "%s --> %d\n", __FUNCTION__, __LINE__);
41 #define DISPLAY_WIDTH_UNKNOWN -1
42 #define DISPLAY_HEIGHT_UNKNOWN -1
43 #define DISPLAY_RESOLUTION_NA 0
54 , m_isHDCPEnabled(false)
60 pthread_mutex_init(&m_opProtectMutex,NULL);
63 #if defined(USE_PLAYREADY)
64 memset(&m_minOPLevels, 0,
sizeof(MinOPLevelsplayReady));
95 pthread_mutex_destroy(&m_opProtectMutex);
108 #ifdef CONTENT_4K_SUPPORTED
109 static gint sourceHeight = 0;
110 static gint sourceWidth = 0;
112 if(m_gstElement == NULL) {
119 g_object_get(m_gstElement,
"video_height", &sourceHeight, NULL);
120 g_object_get(m_gstElement,
"video_width", &sourceWidth, NULL);
122 if(sourceWidth != m_sourceWidth || sourceHeight != m_sourceHeight) {
123 AAMPLOG_WARN(
"viddec (%p) --> says width %d, height %d", m_gstElement, sourceWidth, sourceHeight);
124 m_sourceWidth = sourceWidth;
125 m_sourceHeight = sourceHeight;
127 if(sourceWidth != 0 && sourceHeight != 0 &&
128 (sourceWidth >= UHD_WITDH || sourceHeight >= UHD_HEIGHT) ) {
143 bool isConnected =
false;
144 bool isHDCPCompliant =
false;
145 bool isHDCPEnabled =
true;
158 hdcpProtocol = (dsHdcpProtocolVersion_t)vPort.getHDCPProtocol();
162 hdcpReceiverProtocol = (dsHdcpProtocolVersion_t)vPort.getHDCPReceiverProtocol();
163 hdcpCurrentProtocol = (dsHdcpProtocolVersion_t)vPort.getHDCPCurrentProtocol();
202 AAMPLOG_ERR(
" ERR parse failed for getResolution().getName():%s id:%d",(_res.empty() ?
"NULL" : _res.c_str()),iResID);
208 isHDCPCompliant =
false;
209 isHDCPEnabled =
false;
215 catch (
const std::exception e) {
216 AAMPLOG_WARN(
"DeviceSettings exception caught in ");
219 m_isHDCPEnabled = isHDCPEnabled;
221 if(m_isHDCPEnabled) {
223 m_hdcpCurrentProtocol = hdcpCurrentProtocol;
228 AAMPLOG_WARN(
" detected HDCP version %s", m_hdcpCurrentProtocol ==
dsHDCP_VERSION_2X ?
"2.x" :
"1.4");
231 AAMPLOG_WARN(
"DeviceSettings HDCP is not enabled");
236 AAMPLOG_WARN(
" GetHDCPVersion: Did not detect HDCP version defaulting to 1.4 (%d)", m_hdcpCurrentProtocol);
241 m_isHDCPEnabled =
true;
253 AAMPLOG_WARN(
" Resolution : width %d height:%d",width,height);
254 m_displayWidth = width;
255 m_displayHeight = height;
263 width = m_displayWidth;
264 height = m_displayHeight;
268 #if defined(USE_PLAYREADY)
278 DRM_RESULT DRM_CALL AampOutputProtection::PR_OP_Callback(
const DRM_VOID *f_pvOutputLevelsData,
279 DRM_POLICY_CALLBACK_TYPE f_dwCallbackType,
280 const DRM_VOID *data)
282 DRM_RESULT res = DRM_SUCCESS;
286 AAMPLOG_WARN(
"outputLevelsCallback outputLevels=%p callbackType=%u data=%p",
287 f_pvOutputLevelsData,
static_cast<uint32_t
>(f_dwCallbackType), data);
292 if (f_dwCallbackType != DRM_PLAY_OPL_CALLBACK)
296 DRM_PLAY_OPL_EX* pr_Levels = (DRM_PLAY_OPL_EX*)f_pvOutputLevelsData;
297 MinOPLevelsplayReady* pm_Levels = (MinOPLevelsplayReady*)data;
299 if(pm_Levels != NULL) {
300 pm_Levels->compressedDigitalVideo = pr_Levels->minOPL.wCompressedDigitalVideo;
301 pm_Levels->uncompressedDigitalVideo = pr_Levels->minOPL.wUncompressedDigitalVideo;
302 pm_Levels->analogVideo = pr_Levels->minOPL.wAnalogVideo;
303 pm_Levels->compressedDigitalAudio = pr_Levels->minOPL.wCompressedDigitalAudio;
304 pm_Levels->uncompressedDigitalAudio = pr_Levels->minOPL.wUncompressedDigitalAudio;
308 AAMPLOG_WARN(
" compressed digital %d, uncompressed digital %d, analog video %d",
309 pm_Levels->compressedDigitalVideo,
310 pm_Levels->uncompressedDigitalVideo,
311 pm_Levels->analogVideo);
314 if(pm_Levels->uncompressedDigitalVideo >= 270) {
316 if(pInstance->m_isHDCPEnabled) {
321 AAMPLOG_WARN(
" HDCP is enabled version --> %d", pInstance->m_hdcpCurrentProtocol);
326 AAMPLOG_WARN(
" HDCP --> is not connected", pInstance->m_hdcpCurrentProtocol);
331 AAMPLOG_WARN(
" HDCP --> is not required, current version %d, uncompressedDigitalVideo = %d",
332 pInstance->m_hdcpCurrentProtocol, pm_Levels->uncompressedDigitalVideo);
337 pInstance->Release();
350 void AampOutputProtection::HDMIEventHandler(
const char *owner, IARM_EventId_t eventId,
void *data,
size_t len)
360 int hdmi_hotplug_event = eventData->data.hdmi_hpd.event;
363 AAMPLOG_WARN(
" Received IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG event data:%d status: %s",
364 hdmi_hotplug_event, hdmihotplug);
373 int hdcpStatus = eventData->data.hdmi_hdcp.hdcpStatus;
375 AAMPLOG_WARN(
" Received IARM_BUS_DSMGR_EVENT_HDCP_STATUS event data:%d status:%s",
376 hdcpStatus, hdcpStatusStr);
382 AAMPLOG_WARN(
" Received unknown IARM bus event:%d", eventId);
386 pInstance->Release();
392 void AampOutputProtection::ResolutionHandler(
const char *owner, IARM_EventId_t eventId,
void *data,
size_t len)
400 AAMPLOG_WARN(
" Received IARM_BUS_DSMGR_EVENT_RES_PRECHANGE ");
408 width = eventData->data.resn.width ;
409 height = eventData->data.resn.height ;
411 AAMPLOG_WARN(
" Received IARM_BUS_DSMGR_EVENT_RES_POSTCHANGE event width : %d height : %d", width, height);
416 AAMPLOG_WARN(
" Received unknown resolution event %d", eventId);
420 pInstance->Release();
432 if(s_pAampOP != NULL) {
444 if(s_pAampOP == NULL) {