问题描述
在DirectShow的C ++实现中,我在Graph Manager中添加了两个图形(为简单起见,删除了响应检查)。当我尝试使用ConnectDirect连接它们时,我得到一个E_POINTER无效指针。我做错了什么?
In a C++ Implementation of DirectShow, I have added two graphs the the Graph Manager (response checks removed for simplicity). When I try to connect them using ConnectDirect and I get a "E_POINTER Invalid Pointer as a result". What am I doing wrong?
CComPtr<IBaseFilter> peconsCX3RDKwithOV5640;
hr = peconsCX3RDKwithOV5640.CoCreateInstance(CLSID_econsCX3RDKwithOV5640);
hr = pGraph->AddFilter(peconsCX3RDKwithOV5640, L"e-con's CX3 RDK with OV5640");
CComPtr<IBaseFilter> pAVIDecompressor;
hr = pAVIDecompressor.CoCreateInstance(CLSID_AVIDec);
hr = pGraph->AddFilter(pAVIDecompressor, L"AVI Decompressor");
// ConnectDirect give an Invalid pointer response
hr = pGraph->ConnectDirect(GetPin(peconsCX3RDKwithOV5640, L"Capture"), GetPin(pAVIDecompressor, L"XForm In"), NULL);
我的尝试:
我使用GraphEdit作为模型,它可以正常工作。我验证了名称引脚是正确的,并尝试在XForm和In(XForm_In)之间放置一个下划线(_)。我检查并重新检查了语法,但看不到我的错误。
What I have tried:
I used GraphEdit for the model,and it works correctly. I verified the designations pin are correct and tried putting an underscore (_) between XForm and In (XForm_In). I have checked and re-checked the syntax and cannot see my mistake.
推荐答案
hr = pGraph->AddFilter(peconsCX3RDKwithOV5640,"e-con's CX3 RDK with OV5640");
并拆分ConnectDirect调用以检查GetPin调用第一。也许它们是你问题的根源。
分开代码并检查所有结果。
And split the ConnectDirect call to check the GetPin calls at first. Maybe they are the source of your problem.
Separate the code and check all results.
这篇关于这个connectdirect()调用有问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!