如何对 DirectShow 图形进行逆向工程? [英] How can I reverse engineer a DirectShow graph?

查看:31
本文介绍了如何对 DirectShow 图形进行逆向工程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 DirectShow 图来渲染来自网络流的 MPEG2/4 电影.当我通过手动连接引脚来组装图形时,它不会呈现.但是当我在 GraphBuilder 上调用 Render 时,它呈现得很好.

I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine.

显然有一些设置步骤我没有在 GraphBuilder 正在执行的图中的某个过滤器上执行.

Obviously there is some setup step that I'm not performing on some filter in the graph that GraphBuilder is performing.

有没有什么办法可以在 GraphBuilder 组装图形时查看 GraphBuilder 的调试输出?

Is there any way to see debug output from GraphBuilder when it assembles a graph?

有没有办法转储工作图以查看它是如何组合在一起的?

Is there a way to dump a working graph to see how it was put together?

还有其他解开 DirectShow 盒子中的谜团的想法吗?

Any other ideas for unraveling the mystery that lives in the DirectShow box?

谢谢!-Z

推荐答案

您可以观看使用 GraphEdit 创建的图形,GraphEdit 是 DirectShow SDK 中的一个工具.在GraphEdit中,选择File->Connect to remote Graph...

You can watch the graph you created using GraphEdit, a tool from the DirectShow SDK. In GraphEdit, select File->Connect to remote Graph...

为了在列表中找到你的图,你必须在运行对象表中注册它:

In order to find your graph in the list, you have to register it in the running object table:

void AddToRot( IUnknown *pUnkGraph, DWORD *pdwRegister ) 
{
    IMoniker* pMoniker;
    IRunningObjectTable* pROT;
    GetRunningObjectTable( 0, &pROT );

    WCHAR wsz[256];     
    swprintf_s( wsz, L"FilterGraph %08p pid %08x", (DWORD_PTR)pUnkGraph, GetCurrentProcessId() );
    CreateItemMoniker( L"!", wsz, &pMoniker );

    pROT->Register( 0, pUnkGraph, pMoniker, pdwRegister );

    // Clean up any COM stuff here ...
}

销毁图形后,您应该通过调用 IRunningObjectTable::Revoke 将其从 ROT 中删除

After destroying your graph, you should remove it from the ROT by calling IRunningObjectTable::Revoke

这篇关于如何对 DirectShow 图形进行逆向工程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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