调试媒体基金会 [英] Debug Media Foundation

查看:125
本文介绍了调试媒体基金会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试编写 ByteStreamHandler 和音频 decoder 来添加对不支持的编解码器的支持。 Windows存储应用程序。

I'm currently trying to write a ByteStreamHandler and an audio decoder to add support for an unsupported codec in a windows store app.

我关注了 MPEG1示例,并根据我的需要进行了调整。

I followed this MPEG1 sample and adjusted it for my needs.

但是我不确定它是否正确加载,因为我总是得到错误 MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED HRESULT E_FAIL

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.

我已经在代码中使用的所有 E_FAIL 结果中添加了值,不幸的是它似乎没有发生在哪里在我的代码中。

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.

现在,我想知道是否有任何方法可以找出包含ActivatableClasses的dll是否正确加载,以及如何调试其中的代码

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.

更多信息:
我将dll添加到了package.appxmanifest

More Info: I added the dll to the project by adding this to my package.appxmanifest

<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>

我在MainPage中创建了MediaExtensionManager作为私有类变量

I created the MediaExtensionManager in the MainPage as private class variable

MediaExtensionManager mediaExtensionManager = new MediaExtensionManager();

我在OnNavigatedTo中注册了处理程序和解码器

I registered the handler and the decoder in the 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;
 }

ByteStreamHandler和Decoder在一个项目中。

The ByteStreamHandler and the Decoder are in one project.

侧面问题:当我通过 FileOpenPicker 选择文件时, StorageFile ContentType (MIME类型)属性是一个空字符串。我可以以某种方式解决此问题吗?

Side-Question: When I pick the file via FileOpenPicker the StorageFile's ContentType (MIME Type) property is an empty string. Can I fix this somehow and should I fix this?

推荐答案

您可以使用MFTrace工具(在Windows SDK中)获取来自Media Foundation的事件日志。这应该可以帮助您确定故障点会发生什么。

You can use the MFTrace tool (in the Windows SDK) to get an event log from Media Foundation. This should help you figure out what happens at the point of failure.

http://msdn.microsoft.com/zh-cn/library/windows/desktop/ff685116(v = vs.85)。 aspx

这篇关于调试媒体基金会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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