简体   繁体   English

调试媒体基金会

[英]Debug Media Foundation

I'm currently trying to write a ByteStreamHandler and an audio decoder to add support for an unsupported codec in a windows store app. 我目前正在尝试编写ByteStreamHandler和音频decoder以在Windows应用商店应用中添加对不受支持的编解码器的支持。

I followed this MPEG1 sample and adjusted it for my needs. 我遵循了这个 MPEG1示例,并根据需要对其进行了调整。

However I'm not sure if it is loaded correctly since I always get the error MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED with the HRESULT E_FAIL . 但是我不确定它是否正确加载,因为我总是通过HRESULT E_FAIL收到错误MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED

I've added values to all E_FAIL results I use in my code to figure out where it happens unfortunately it doesnt seem to happen in my code. 我已经在我的代码中使用的所有E_FAIL结果中添加了值,以找出不幸发生的地方,但不幸的是我的代码似乎没有发生。

Now I'd like to know if there's any way to find out if the dll containing the ActivatableClasses was loaded correctly and how I could debug the code in the dll. 现在,我想知道是否有任何方法可以找出包含ActivatableClasses的dll是否正确加载,以及如何调试dll中的代码。

More Info: I added the dll to the project by adding this to my package.appxmanifest 更多信息:通过将其添加到package.appxmanifest中,我将dll添加到了项目中

<Extensions>
    <Extension Category="windows.activatableClass.inProcessServer">
        <InProcessServer>
            <Path>MyDecoder.Windows.dll</Path>
            <ActivatableClass ActivatableClassId="MyDecoder.MyDecoder" ThreadingModel="both"/>
        </InProcessServer>
    </Extension>
    <Extension Category="windows.activatableClass.inProcessServer">
        <InProcessServer>
            <Path>MyDecoder.Windows.dll</Path>
            <ActivatableClass ActivatableClassId="MyDecoder.MyByteStreamHandler" ThreadingModel="both"/>
        </InProcessServer>
    </Extension>
</Extensions>

I created the MediaExtensionManager in the MainPage as private class variable 我在MainPage中创建了MediaExtensionManager作为私有类变量

MediaExtensionManager mediaExtensionManager = new MediaExtensionManager();

I registered the handler and the decoder in the OnNavigatedTo 我在OnNavigatedTo中注册了处理程序和解码器

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    base.OnNavigatedTo(e);

    mediaExtensionManager.RegisterByteStreamHandler("MyDecoder.MyByteStreamHandler", FILE_TYPE, MIME_TYPE);
    mediaExtensionManager.RegisterAudioDecoder("MyDecoder.MyDecoder", MF_SUBTYPE, Guid.Empty);
    mediaElement.MediaFailed += mediaElement_MediaFailed;
 }

The ByteStreamHandler and the Decoder are in one project. ByteStreamHandler和Decoder在一个项目中。

Side-Question: When I pick the file via FileOpenPicker the StorageFile 's ContentType (MIME Type) property is an empty string. 附带问题:当我通过FileOpenPicker选择文件时, StorageFileContentType (MIME类型)属性为空字符串。 Can I fix this somehow and should I fix this? 我可以以某种方式解决此问题吗?

You can use the MFTrace tool (in the Windows SDK) to get an event log from Media Foundation. 您可以使用MFTrace工具(在Windows SDK中)从Media Foundation获取事件日志。 This should help you figure out what happens at the point of failure. 这应该可以帮助您确定故障点会发生什么。

http://msdn.microsoft.com/en-us/library/windows/desktop/ff685116(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ff685116(v=vs.85).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM