Discussion:
Cannot connect Video Mixing Renderer 9
(too old to reply)
J.P. de Ruiter
2006-04-27 09:39:02 UTC
Permalink
Hello,

I have a problem connecting a Video Mixing Renderer 9.
I use the following code:

int ConnectPreviewFilter(IGraphBuilder *pGraph, IPin *pPreviewPin, HWND
hPreviewWindow)
{
char out[40];
HRESULT hr;
RECT rc;
IBaseFilter *pColorSpaceFilter;
pColorSpaceFilter=NULL;
hr=CoCreateInstance(CLSID_Colour,NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void **)&pColorSpaceFilter);
if(FAILED(hr))
{
sprintf(out,"Create pColorSpaceFilter failed.\nError: 0x%x",hr);
AfxMessageBox(out);
}
hr=pGraph->AddFilter(pColorSpaceFilter,L"ColorSpace Converter");
if(FAILED(hr))
{
sprintf(out,"AddFilter pColorSpaceFilter failed.\nError: 0x%x",hr);
AfxMessageBox(out);
}
hr=CoCreateInstance(CLSID_VideoMixingRenderer9,NULL,CLSCTX_INPROC,IID_IBaseFilter,(void**)&pVideoMixFilter);
if(SUCCEEDED(hr))
{
hr=pGraph->AddFilter(pVideoMixFilter,L"Video Mixing Filter");
if(SUCCEEDED(hr))
{
IVMRFilterConfig9 *pVMRConfig;
pVMRConfig=NULL;
pVideoMixFilter->QueryInterface(IID_IVMRFilterConfig9,(void**)&pVMRConfig);
pVMRConfig->SetRenderingMode(VMR9Mode_Windowless);
pVMRConfig->SetNumberOfStreams(1);
SAFE_RELEASE(pVMRConfig);
pVideoMixFilter->QueryInterface(IID_IVMRWindowlessControl9,(void**)&pVMRControl);
hr=pVMRControl->SetVideoClippingWindow(hPreviewWindow);
if(FAILED(hr))AfxMessageBox("SetVideoClippingWindow failed");
}
else
{
sprintf(out,"AddFilter pVideoMixFilter failed.\nError: 0x%x",hr);
AfxMessageBox(out);
}
}
else
{
sprintf(out,"Create pVideoMixFilter failed.\nError: 0x%x",hr);
AfxMessageBox(out);
}
SaveGraphFile(pGraph,L"C:\\temp2.grf");
hr=pGraph->Connect(pPreviewPin,GetPin(pVideoMixFilter,PINDIR_INPUT));
if(FAILED(hr))
{
sprintf(out,"ConnectDirect pColorSpaceFilter and pVideoMixFilter
failed.\nError: 0x%x",hr);
AfxMessageBox(out);
}
SaveGraphFile(pGraph,L"C:\\temp3.grf");
GetClientRect(hPreviewWindow, &rc);

hr=pVMRControl->SetVideoPosition(NULL, &rc);
if(FAILED(hr))AfxMessageBox("pVMRControl->SetVideoPosition failed");
return 0;
}

The function creates a Videomixingrendererfilter and connects it with a
supplied pin (Smart tee preview pin).
On my development computer with DXSDK installed all works fine.
But on another computer with only installed DirectX 9 (Apr 2006) the error
0x80040217 occures, which meanes it cannot connect.
When I look at both created .grf files, temp2.grf is opened corectly and all
filters and connections are ok (Except ofcourse the connection between the
previewpin and the renderer filter).
And I can connect the smart tee filter and the renderer filter manually in
GraphEdit as well.
But when I try to open temp3.grf graphedit says it cannot open the file.
And when I open the file in Notepad, the first part is ok, until "R o o t
E n t r y".
But after that the file is filled with spaces.

Anyone an ide what's the problem.
I'm now going to install DXSDK on the other computer, but that can't be the
real solution.

Thanks in advance,

Jan Pieter de Ruiter
Nucletron B.V.
Netherlands
J.P. de Ruiter
2006-04-27 10:07:02 UTC
Permalink
Oops, the error I get is 0x80040207 instead of 0x80040217.
Still the same problem...

JP
Post by J.P. de Ruiter
Hello,
I have a problem connecting a Video Mixing Renderer 9.
int ConnectPreviewFilter(IGraphBuilder *pGraph, IPin *pPreviewPin, HWND
hPreviewWindow)
{
char out[40];
HRESULT hr;
RECT rc;
IBaseFilter *pColorSpaceFilter;
pColorSpaceFilter=NULL;
hr=CoCreateInstance(CLSID_Colour,NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void **)&pColorSpaceFilter);
if(FAILED(hr))
{
sprintf(out,"Create pColorSpaceFilter failed.\nError: 0x%x",hr);
AfxMessageBox(out);
}
hr=pGraph->AddFilter(pColorSpaceFilter,L"ColorSpace Converter");
if(FAILED(hr))
{
sprintf(out,"AddFilter pColorSpaceFilter failed.\nError: 0x%x",hr);
AfxMessageBox(out);
}
hr=CoCreateInstance(CLSID_VideoMixingRenderer9,NULL,CLSCTX_INPROC,IID_IBaseFilter,(void**)&pVideoMixFilter);
if(SUCCEEDED(hr))
{
hr=pGraph->AddFilter(pVideoMixFilter,L"Video Mixing Filter");
if(SUCCEEDED(hr))
{
IVMRFilterConfig9 *pVMRConfig;
pVMRConfig=NULL;
pVideoMixFilter->QueryInterface(IID_IVMRFilterConfig9,(void**)&pVMRConfig);
pVMRConfig->SetRenderingMode(VMR9Mode_Windowless);
pVMRConfig->SetNumberOfStreams(1);
SAFE_RELEASE(pVMRConfig);
pVideoMixFilter->QueryInterface(IID_IVMRWindowlessControl9,(void**)&pVMRControl);
hr=pVMRControl->SetVideoClippingWindow(hPreviewWindow);
if(FAILED(hr))AfxMessageBox("SetVideoClippingWindow failed");
}
else
{
sprintf(out,"AddFilter pVideoMixFilter failed.\nError: 0x%x",hr);
AfxMessageBox(out);
}
}
else
{
sprintf(out,"Create pVideoMixFilter failed.\nError: 0x%x",hr);
AfxMessageBox(out);
}
SaveGraphFile(pGraph,L"C:\\temp2.grf");
hr=pGraph->Connect(pPreviewPin,GetPin(pVideoMixFilter,PINDIR_INPUT));
if(FAILED(hr))
{
sprintf(out,"ConnectDirect pColorSpaceFilter and pVideoMixFilter
failed.\nError: 0x%x",hr);
AfxMessageBox(out);
}
SaveGraphFile(pGraph,L"C:\\temp3.grf");
GetClientRect(hPreviewWindow, &rc);
hr=pVMRControl->SetVideoPosition(NULL, &rc);
if(FAILED(hr))AfxMessageBox("pVMRControl->SetVideoPosition failed");
return 0;
}
The function creates a Videomixingrendererfilter and connects it with a
supplied pin (Smart tee preview pin).
On my development computer with DXSDK installed all works fine.
But on another computer with only installed DirectX 9 (Apr 2006) the error
0x80040217 occures, which meanes it cannot connect.
When I look at both created .grf files, temp2.grf is opened corectly and all
filters and connections are ok (Except ofcourse the connection between the
previewpin and the renderer filter).
And I can connect the smart tee filter and the renderer filter manually in
GraphEdit as well.
But when I try to open temp3.grf graphedit says it cannot open the file.
And when I open the file in Notepad, the first part is ok, until "R o o t
E n t r y".
But after that the file is filled with spaces.
Anyone an ide what's the problem.
I'm now going to install DXSDK on the other computer, but that can't be the
real solution.
Thanks in advance,
Jan Pieter de Ruiter
Nucletron B.V.
Netherlands
The March Hare [MVP]
2006-04-27 14:16:32 UTC
Permalink
Post by J.P. de Ruiter
Oops, the error I get is 0x80040207 instead of 0x80040217.
Still the same problem...
HRESULT: 0x80040207 (2147746311)
Name: DIERR_NOTBUFFERED
VFW_E_NO_ACCEPTABLE_TYPES
Description: Attempted to read buffered device data from a device that is
not buffered. & There is no common media type between these pins.
Severity code: Failed
Facility Code: FACILITY_ITF (4)
Error Code: 0x0207 (519)
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
J.P. de Ruiter
2006-04-28 07:08:01 UTC
Permalink
Thanks for the extended info for this error code.
I'm not really shure what this "(not) buffered device data" means.
What I'm trying to do is:
- Get a video stream from a framegrabber card.
- Preview it on the screen with a bitmap overlay.
- If needed save some frames (without the bitmap overlay).
The complete graph i'm using is:

Crossbar filter->Capture filter->Smart tee filter->Color Space Conv->VMR9
Rend.

|->SampleGrabber->NULL Rend.

The strange thing is that it works on my development PC, but not on the
other PC (with exactly the same capture card)
And above all, how can you explain that I get an "NO_ACCEPTABLE_TYPES" error
while I can connect the filters manually in GraphEdit?

JP

P.S.: Installing DXSDK didn't help.
Post by The March Hare [MVP]
HRESULT: 0x80040207 (2147746311)
Name: DIERR_NOTBUFFERED
VFW_E_NO_ACCEPTABLE_TYPES
Description: Attempted to read buffered device data from a device that is
not buffered. & There is no common media type between these pins.
Severity code: Failed
Facility Code: FACILITY_ITF (4)
Error Code: 0x0207 (519)
--
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
J.P. de Ruiter
2006-04-28 08:04:02 UTC
Permalink
Something went wrong with the graph visualization.
In fact both the Color Space converter and the Sample grabber are connected
to the smart tee filter
Post by J.P. de Ruiter
Crossbar filter->Capture filter->Smart tee filter->Color Space Conv->VMR9
Rend.
|->SampleGrabber->NULL Rend.
Peter Feldbaumer
2006-04-28 12:40:30 UTC
Permalink
Post by J.P. de Ruiter
Thanks for the extended info for this error code.
I'm not really shure what this "(not) buffered device data" means.
The error-text that applies to you is the second part of the string ( There
is no common media type between these pins.) - this error-nr. has been used
2 times by MS...
Post by J.P. de Ruiter
- Get a video stream from a framegrabber card.
- Preview it on the screen with a bitmap overlay.
- If needed save some frames (without the bitmap overlay).
Crossbar filter->Capture filter->Smart tee filter->Color Space Conv->VMR9
Rend.
Post by J.P. de Ruiter
->SampleGrabber->NULL Rend.
The strange thing is that it works on my development PC, but not on the
other PC (with exactly the same capture card)
And above all, how can you explain that I get an "NO_ACCEPTABLE_TYPES" error
while I can connect the filters manually in GraphEdit?
You seem to be using Mixing-Mode for the vmr? This might lead to differences
(since one pc might have HW that supports more sample-formats for
deinterlacing/mixing-mode than the other pc - this might also account for
you being able to connect in GE without mixing-mode)...
--
Peter Feldbaumer
p dot feldbaumer at utanet dot at
J.P. de Ruiter
2006-04-28 13:37:02 UTC
Permalink
Post by Peter Feldbaumer
The error-text that applies to you is the second part of the string ( There
is no common media type between these pins.) - this error-nr. has been used
2 times by MS...
OK, that explains that.
Post by Peter Feldbaumer
You seem to be using Mixing-Mode for the vmr? This might lead to differences
(since one pc might have HW that supports more sample-formats for
deinterlacing/mixing-mode than the other pc
OK, that might be an explaination.
Is it also possible that not the framegrabber but other hardware (like a VGA
card) cause this problem,
since I use exactly the same framegrabber, but different other hardware.
Post by Peter Feldbaumer
- this might also account for
you being able to connect in GE without mixing-mode)...
Well, I have to explain the situation further.
I'm working on an existing application, and have to add the framegrabber.
For flexability, I created a DLL.
Now when I use a (self written) test program which uses all functions from
this DLL, everything is OK. Also connecting the Color Space Converter to the
VMR9...
But with the application I am adapting it doesn't.
And this application does just the same with the framegrabber as the
testprogram.
It uses some more COM interfaces, but none from the framegrabber.

--------

But I tried a little further, and replaced all VMR9 interfaces with VMR7
interfaces.
and now all works fine!?!

So the next question is: is there any disadvantage using VMR7 instead of VMR9?
The only reason I use VMR is because I have to mix a bitmap with the preview
window.

Thanks in advance,
Jan Pieter de Ruiter
The March Hare [MVP]
2006-04-28 13:46:16 UTC
Permalink
Post by J.P. de Ruiter
So the next question is: is there any disadvantage using VMR7 instead of VMR9?
The only reason I use VMR is because I have to mix a bitmap with the preview
window.
VMR7 is only supported on XP forward. If that's not a problem for you, it
is likely a better solution.
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
J.P. de Ruiter
2006-04-28 23:53:01 UTC
Permalink
Post by The March Hare [MVP]
VMR7 is only supported on XP forward. If that's not a problem for you, it
is likely a better solution.
Well, since the application will only run on XP, I'll do that.

Thnks for your advices!
The March Hare [MVP]
2006-04-29 00:27:46 UTC
Permalink
Post by J.P. de Ruiter
Post by The March Hare [MVP]
VMR7 is only supported on XP forward. If that's not a problem for you, it
is likely a better solution.
Well, since the application will only run on XP, I'll do that.
It will likely work better with VMR7 since it uses DDraw which will be
supported by virtually every display card out there.
Post by J.P. de Ruiter
Thnks for your advices!
You're welcome.
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
Loading...