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

查看:134
本文介绍了如何对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的调试输出?

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

Thanks! -Z

推荐答案

您可以观看使用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天全站免登陆