如何使用C ++处理MediaEngine中的playready [英] How to handle playready in MediaEngine with C++

查看:54
本文介绍了如何使用C ++处理MediaEngine中的playready的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨:全部


我想使用Media Engine播放DRM内容,


根据Java的playready示例脚本,


我使用 < span style ="font-size:small"> MediaProtectionManager
我使用 类作为媒体引擎的保护管理器


这些是我的代码:


 void MEPlayer :: componentLoadFailed(MediaProtectionManager ^ sender,ComponentLoadFailedEventArgs ^ e)
{
.... 。

}
void MEPlayer :: serviceRequested(MediaProtectionManager ^ sender,ServiceRequestedEventArgs ^ e)
{
.....
}

void MEPlayer :: Initialize()
{

......

MediaProtectionManager ^ mediaProtectionManager = ref new MediaProtectionManager();


mediaProtectionManager-> ComponentLoadFailed + = ref new ComponentLoadFailedEventHandler(this,& MEPlayer :: test);
mediaProtectionManager-> ServiceRequested + = ref new ServiceRequestedEventHandler(this,& ; MEPlayer :: test2);
mediaProtectionManager-> Properties-> Insert(" Windows.Media.Protection.MediaProtectionSystemId"," {F4637010-03C3-42CD-B932-B48ADF3A6A54}");

MFCreateAttributes(& spAttributes,1)

spAttributes-> SetUINT32(MF_MEDIA _ENGINE_CONTENT_PROTECTION_FLAGS,1);

spAttributes-> SetUnknown(MF_MEDIA_ENGINE_CONTENT_PROTECTION_MANAGER,(IUnknown *)mediaProtectionManager);

spFactory-> CreateInstance(flags,spAttributes.Get(),& m_spMediaEngine);

......

}




我已经安装了Microsoft.Media.PlayReadyClient.vsix并在我的应用程序中调用这些代码


< span style ="font-size:small">

_extensions-> RegisterByteStreamHandler( "Microsoft.Media.PlayReadyClient.PlayReadyByteStreamHandler"
"。 pyv"
" video / pyv" );


_extensions-> RegisterByteStreamHandler( " Microsoft.Media.PlayReadyClient.PlayReadyByteStreamHandler"
" .pya"
" audio / pya" ) ;




运行时,媒体引擎通知MEDIA_ENGINE _ERR_SRC_NOT_SU PPORTED,函数componentLoadFailed()和serviceRequested()未被调用。


问题出在哪里?






 







解决方案

Hello Pitt,


您的MEDIA_ENGINE _ERR_SRC_NOT_SU PPORTED错误看到的是通用的,并不一定意味着您在准备好游戏时遇到问题。首先,我建议您验证PlayReady编码文件的来源。请记住,
如果您的文件源位于本地网络中,则需要添加该功能。如果您的PlayReady服务器位于本地网络中,则需要添加相同的功能。以下是我建议您帮助您调试应用程序的内容。确保您可以
播放以与PR文件相同的格式录制的不受保护的文件。一旦您对可以播放未受保护的文件感到满意,请使用Silverlight MediaElement验证您是否可以接收许可证并可以播放受保护的文件。我建议您使用持久许可证
。一旦您知道自己拥有开发计算机上内容的许可,并且已经验证可以使用Silverlight播放该文件,请尝试在Metro风格应用中播放相同的文件。如果该文件播放,您知道
您有许可证获取问题。许可证获取期间的快速netmon跟踪可以帮助理清正在发生的事情。如果您在完成此测试后仍然遇到问题,请告诉我,我会尽我所能帮助。


谢谢,


James


Hi: All

I want to use Media Engine to play the DRM contents,

According to the playready sample of Java script,

I use the MediaProtectionManager I use the class as the protection manager of the Media Engine

These is my codes:

void MEPlayer::componentLoadFailed(MediaProtectionManager^ sender, ComponentLoadFailedEventArgs^ e)
{ 
	.....

}
void MEPlayer::serviceRequested(MediaProtectionManager^ sender, ServiceRequestedEventArgs^ e)
{
	.....
}

void MEPlayer::Initialize()
{
	
	......
	
	MediaProtectionManager ^mediaProtectionManager = ref new MediaProtectionManager();


	mediaProtectionManager->ComponentLoadFailed += ref new ComponentLoadFailedEventHandler(this, &MEPlayer::test);
	mediaProtectionManager->ServiceRequested += ref new ServiceRequestedEventHandler(this, &MEPlayer::test2);
	mediaProtectionManager->Properties->Insert("Windows.Media.Protection.MediaProtectionSystemId","{F4637010-03C3-42CD-B932-B48ADF3A6A54}");	

	MFCreateAttributes(&spAttributes, 1)

    spAttributes->SetUINT32(MF_MEDIA_ENGINE_CONTENT_PROTECTION_FLAGS, 1);

    spAttributes->SetUnknown(MF_MEDIA_ENGINE_CONTENT_PROTECTION_MANAGER, (IUnknown*) mediaProtectionManager);

	spFactory->CreateInstance(flags, spAttributes.Get(), &m_spMediaEngine);

	......

}


I have installed the Microsoft.Media.PlayReadyClient.vsix and call these codes in my app

_extensions->RegisterByteStreamHandler("Microsoft.Media.PlayReadyClient.PlayReadyByteStreamHandler", ".pyv", "video/pyv");

_extensions->RegisterByteStreamHandler("Microsoft.Media.PlayReadyClient.PlayReadyByteStreamHandler", ".pya", "audio/pya");

While running, the Media Engine notify MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED , the functions componentLoadFailed() and serviceRequested() were not called .

Where is the problem?


 

解决方案

Hello Pitt,

The MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED error that you are seeing is generic and does not necessarily mean that you are having an issue with play ready. First I would recommend that you verify the source of your PlayReady encoded file. Keep in mind that if you file source is in your local network you need to add that capability. If your PlayReady server is in your local network you need to add the same capability. Here is what I would suggest to help you debug your application. Make sure that you can play an unprotected file recorded in the same format as you PR file. Once you are satisfied that you can play unprotected files, use the Silverlight MediaElement to verify that you can receive a license and can playback the protected file. I would recommend that you use a persistent license. Once you know that you have a license for the content on your development machine and have verified that you can play the file using Silverlight, try playing the same file in your Metro style app. If the file plays you know that you are having a license acquisition issue. A quick netmon trace during the license acquisition can help to sort out what is happening. If you are still having problems after completing this testing please let me know and I will do what I can to help.

Thanks,

James


这篇关于如何使用C ++处理MediaEngine中的playready的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆