Infognition forum
February 08, 2012, 09:20:41 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Last GraphEditPlus version: 1.4.0   Last Video Enhancer version: 1.9.7
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Generated C++ code fails to enumerate pins  (Read 1591 times)
equinox
Newbie
*

Karma: +0/-0
Posts: 1


View Profile
« on: November 09, 2008, 12:59:22 AM »

Hi,

My filter graph works great in GraphEditPlus 1.2.2.
However, the generated C++ code always fail to enumerate pins

pPin is always 0x00000000 in the function GetPin(...) so while(pEnum->Next(1, &pPin, 0) == S_OK) returns immediately and goes to printf("Pin not found!\n");

This scenario repeats itself for any C++ code I generate, no matter what the filter graph is.

Any idea what is wrong?

Thanks,
Equinox
Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 512



View Profile WWW
« Reply #1 on: November 12, 2008, 11:42:57 AM »

You should see what pEnum->Next returns, this may show the reason.
Logged
Vittorio
Newbie
*

Karma: +2/-0
Posts: 13


View Profile
« Reply #2 on: November 24, 2008, 05:34:33 PM »

This sort of problem can occure for example if the development and deployment happen in the different language environments. E.g. if the Windows version you use for development is the English one, the GraphEdit generates the pin name "Capture" or whatever. If you run the generated program in the Italian run-time environment, the name of the pin exposed by the same filter will be totally different and the lookup for the pin called "Captuer" fails.
Logged
JohnC
Newbie
*

Karma: +2/-0
Posts: 2


View Profile
« Reply #3 on: December 01, 2008, 12:18:27 PM »

Wasn't aware of the issue raised by Vittorio. but the following code may help. It uses the IGraphbuilder2 FindPin to look explicitly for the Capture pin on a base filter.

Code:
CComPtr<IPin> GetCapturePin(ICaptureGraphBuilder2* pGraphBuilder, IBaseFilter* pFilter)
{
CComPtr<IPin> pPin;

HRESULT hr = pGraphBuilder->FindPin(pFilter, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,FALSE, 0, &pPin);
CHECK_HR(hr, _T("Unable to Create the FilterGraph"))

return pPin;
}

« Last Edit: December 01, 2008, 09:41:36 PM by JohnC » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!