这个connectdirect()调用有问题吗? [英] Wat is wrong with this connectdirect() call?

查看:375
本文介绍了这个connectdirect()调用有问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

推荐答案

COM已经过时,但错误对你有帮助。您的消息表示输入指针无效或无法正确执行所需操作。



您确定以前所有通话都没问题。我不喜欢行
COM is weired, but the errors are helping you. Your message means that the input pointer is invalid or not correct for the desired action.

Are you sure, that all calls before are OK. I dont like the line
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()调用有问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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