locked
How to apply the protection output system? RRS feed

  • Question

  • Hello, i have some question.

    I developed the custom media source (IMFMediaSource). 

    That class is exposed IMFTrustInput interface.

    As a result, i confirmed that calling GetPolicy method in my custom class (IMFInputTrustAuthority).

    And then, i create the instance of IMFOutputPolicy, and call GenerateRequiredSchemas method (applied HDCP protection).

    BUT!!! Not applied protection output systems. 

    In conclusion, my question is following: I must implement both ITA and OTA for applied protection output systems? or implement either ITA or OTA?

    Tuesday, October 1, 2013 1:46 AM

Answers

  • You do not need to implement the OTA. However, you should be the one implementing IMFOutputPolicy.  You should not be calling GenerateRequiredSchemas in the ITA, you should be implementing GenerateRequiredSchemas for the OTA to call.  Make sure that one of the schemas you return from GenerateRequiredSchemas is MFPROTECTION_HDCP if you want to enforce HDCP.
    • Marked as answer by Mr.Joo Friday, October 11, 2013 2:49 AM
    Thursday, October 10, 2013 11:09 PM

All replies

  • Hello?

    I want implement IMFInputTrustAuthority::GetPolicy method. But, i don't know that how to create the IMFOutputPolicy instance.

    Following code is mine. if it has wrong point, tell me about that. Thanks.

    HRESULT STDMETHODCALLTYPE CNcgInputTrustAuthority::GetPolicy( MFPOLICYMANAGER_ACTION Action, __out IMFOutputPolicy **ppPolicy )
    {
    	
    	ATLTRACE("CNcgInputTrustAuthority::GetPolicy = %s", GetActionMsg(Action).c_str());
    	
    	HRESULT hr = S_OK;
    	CComPtr<IMFOutputPolicy> pPolicy;
    	
    	hr = MFCreateAttributes((IMFAttributes**)&pPolicy, 1);
    	if (FAILED(hr)) {
    		return E_NOTIMPL;
    	}
    	
    	/*DWORD dwAttribute = MFOUTPUTATTRIBUTE_BUS | MFOUTPUTATTRIBUTE_VIDEO | MFOUTPUTATTRIBUTE_DIGITAL;
    	GUID guidOutputSubType = MFCONNECTOR_PCI_Express;
    	GUID rgGuidProtectionSchemasSupported[] = {MFPROTECTION_HDCP, MFPROTECTION_CONSTRICTVIDEO, MFPROTECTION_DISABLE};*/
    	DWORD dwAttribute = MFOUTPUTATTRIBUTE_DIGITAL;
    	GUID guidOutputSubType = MFCONNECTOR_HDMI;
    	GUID rgGuidProtectionSchemasSupported[] = {MFPROTECTION_HDCP};
    	DWORD dwSupported = sizeof(rgGuidProtectionSchemasSupported)/sizeof(GUID);
    	CComPtr<IMFCollection> pRequiredProtectionSchemas;
    
    	ATLTRACE("Protection schemas support count = %d", sizeof(rgGuidProtectionSchemasSupported)/sizeof(GUID));
    	hr = pPolicy->GenerateRequiredSchemas(dwAttribute, guidOutputSubType, rgGuidProtectionSchemasSupported, dwSupported, &pRequiredProtectionSchemas);
    	ATLTRACE("CNcgInputTrustAuthority----> GenerateRequiredSchemas hresult = %x", hr);
    	if (FAILED(hr)) {
    		return E_NOTIMPL;
    	}
    
    	if (pRequiredProtectionSchemas == NULL) {
    		ATLTRACE("CNcgInputTrustAuthority---> Required Protection Schemas is NULL");
    		return E_FAIL;
    	}
    	DWORD dwElementCount = -1;
    	pRequiredProtectionSchemas->GetElementCount(&dwElementCount);
    	for(int i=0; i<dwElementCount; i++) {
    		IMFOutputSchema* tmp = NULL;
    		pRequiredProtectionSchemas->GetElement(i, (IUnknown**)&tmp);
    
    		DWORD dwValue;
    		GUID guidOriginatorID;
    		GUID guidType;
    
    		tmp->GetConfigurationData(&dwValue);
    		tmp->GetOriginatorID(&guidOriginatorID);
    		tmp->GetSchemaType(&guidType);
    
    		ATLTRACE("Required Protection Schemas Value = %d", dwValue);
    		if (guidType == MFPROTECTION_ACP ) { ATLTRACE("MFPROTECTION_ACP"); }
    		if (guidType == MFPROTECTION_CGMSA ) { ATLTRACE("MFPROTECTION_CGMSA"); }
    		if (guidType == MFPROTECTION_CONSTRICTAUDIO ) { ATLTRACE("MFPROTECTION_CONSTRICTAUDIO"); }
    		if (guidType == MFPROTECTION_CONSTRICTVIDEO ) { ATLTRACE("MFPROTECTION_CONSTRICTVIDEO"); }
    		if (guidType == MFPROTECTION_DISABLE ) { ATLTRACE("MFPROTECTION_DISABLE"); }
    		if (guidType == MFPROTECTION_FFT ) { ATLTRACE("MFPROTECTION_FFT"); }
    		if (guidType == MFPROTECTION_HDCP ) { ATLTRACE("MFPROTECTION_HDCP"); }
    		if (guidType == MFPROTECTION_TRUSTEDAUDIODRIVERS ) { ATLTRACE("MFPROTECTION_TRUSTEDAUDIODRIVERS"); }
    		if (guidType == MFPROTECTION_WMDRMOTA ) { ATLTRACE("MFPROTECTION_WMDRMOTA"); }
    	}
    
    	hr = pPolicy->QueryInterface(IID_PPV_ARGS(ppPolicy));
    	if (FAILED(hr)) {
    		return E_NOTIMPL;
    	}
    
    	return S_OK;
    }


    Friday, September 27, 2013 7:24 AM
  • You do not need to implement the OTA. However, you should be the one implementing IMFOutputPolicy.  You should not be calling GenerateRequiredSchemas in the ITA, you should be implementing GenerateRequiredSchemas for the OTA to call.  Make sure that one of the schemas you return from GenerateRequiredSchemas is MFPROTECTION_HDCP if you want to enforce HDCP.
    • Marked as answer by Mr.Joo Friday, October 11, 2013 2:49 AM
    Thursday, October 10, 2013 11:09 PM
  • Thank for your answer. Thank~!!

    Friday, October 11, 2013 2:49 AM