Now I would like to connect up the file source to my renderer, again using
intelligent connect by calling ICaptureGraphBuilder2::RenderStream(
pCategory, pType, fFileSource, NULL, fRenderer )
I thought (perhaps naively) that I could set pCategory to
PIN_CATEGORY_CAPTURE and pType to MEDIATYPE_Video but that returns an error
0x80070057. In fact a bunch of combinations of these two arguments all
return this error (all I want is to get video / rgb24 or rgb32 hooked up to
my renderer):
category type
PIN_CATEGORY_CAPTURE MEDIATYPE_Video
PIN_CATEGORY_PREVIEW MEDIATYPE_Video
PIN_CATEGORY_CAPTURE NULL
PIN_CATEGORY_PREVIEW NULL
NULL NULL => returns S_OK, see
(1)
NULL MEDIATYPE_Video => returns
S_OK, see (2)
QUESTION 1: shouldn't the first type of call w CAPTURE / Video work ? Or do
file source filters not have capture pins and thats why it fails ? What is
that error code anyway ?
(1) this seems to hook up the graph right, my render filters CheckMediaType
gets called a number of times (with various audio and video types) until it
agrees to a favourable video type and things work for avi files, mpgs,
quicktime movies, DV files (in avis). Cool.
However, when I try to call it on a wmv file, my CheckMediaType gets called
with 228 different types of Audio (yowser!), no video types at all, and the
RenderStream call returns w an error ("No combination of intermediate
filters could be found...") The same wmv (which has both an audio and a
video stream) loads fine into WMP9 and Graphedit (using Render Media file)
QUESTION 2: Why wouldn't my CMyRenderFilter::CheckMediaType be called in the
wmv scenario with at least a few video types ????
(2) It gets weirder. When I do explicitly say I want MEDIATYPE_Video, the
RenderStream call return S_OK (happy) but my CMyRenderFilter::CheckMediaType
is not even called once (sad). Needless to say it is not connected up.
QUESTION 3: What is going on here ?
It gets weirder, although I think this is unrelated. I have the DivX 5.0.5
decoder installed. When I call RenderStream with a NULL,NULL for the first
two args,this is what I get:
Proposed format types coming in to TSampleRenderer::CheckMediaType:
0: format/major/sub ??? / MEDIATYPE_Stream / MEDIASUBTYPE_AVI
1: format/major/sub ??? / MEDIATYPE_Stream / MEDIASUBTYPE_AVI
2: format/major/sub FORMAT_VideoInfo / MEDIATYPE_Video / DivX (w=352,
h=240, biBitCount=24)
3: format/major/sub FORMAT_VideoInfo / MEDIATYPE_Video / DivX (w=352,
h=240, biBitCount=24)
Loaded 'C:\WINDOWS\SYSTEM32\divxdec.ax', no matching symbolic information
found.
where DivX == {30355844-0000-0010-8000-00AA00389B71}
I dont like any of these, so they all return S_FALSE. And then, we get an
access violation (0x00000005) deep down in DirectX (presumably in the DivX
codec since this crash only occurs with DivX coded files)
If you are still reading this: thanks - and it gets even weirder still: I
can cause the same crash without invoking any DirectShow code, simply by
mousing over my Divx encoded avi file in the FILE OPEN DIALOG
(CFileDialog::DoModal) !!!! I.e. long before I do things like RenderStream
or CheckMediaType. Just before crashing, I see this in my debug output
window:
Loaded 'C:\WINDOWS\SYSTEM32\shmedia.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\ICCVID.DLL', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\msh263.drv', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\IR32_32.DLL', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\IR32_32.DLL', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\ir41_32.ax', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\iyuv_32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\msrle32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\MSVIDC32.DLL', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\msyuv.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\msyuv.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\tsbyuv.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\msyuv.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\msh263.drv', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\msh261.drv', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\ir50_32.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\i263_32.drv', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\divx.dll', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM32\winspool.drv', no matching symbolic information
found.
Notice the divx.dll (rather than the divxdec.ax) this time. I suspect the
standard file open dialog box does some "sniffing" into files without my
asking (but why?) and walks down the same fatal code path as the divxdec.ax
filter did.
QUESTION 4: why is there sniffing and is it correct to suspect that the DivX
library (rather than my code) has a bug?
File source filters do not have capture pins.
0x80070057: You can look up error codes with DXGetErrorString8. Or using
Google:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&q=0x80070057&sa=N&tab=wg
> QUESTION 2: Why wouldn't my CMyRenderFilter::CheckMediaType be called in
the
> wmv scenario with at least a few video types ????
With WMV, you need to explicitly add the AsfReader to the graph
(CLSID_WMAsfReader). IIRC, there is a sample in the docs or SDK.
> QUESTION 4: why is there sniffing and is it correct to suspect that the
DivX
> library (rather than my code) has a bug?
Can't help here. I don't use DivX.
And when I call the RenderStream with - what seems to me more obvious
parameters -
RenderStream( NULL, &MEDIATYPE_Video, ...)
DShow does not call my filters CheckMediaType AT ALL, not even for the audio
any more....
Needless to say it loads fine with GraphEdit (but uses a Ligos MPEG
Splitter - is that a nonstandard filter ?) How come it can be smart about
that and I cant (aside from the obvious implication :)
I am calling AddSourceFilter and RenderStream, I assume GraphEdit is calling
RenderFile - are the two approaches not equivalent in terms of finding the
right decoders (The IGraphBuilder::RenderFile docs say that it uses the same
process as IGraphBuilder::AddSourceFilter) ?
Thanks for all your help !
Robert
"Robert Seidl" <micr...@canoma.com> wrote in message
news:e51jRnqI...@tk2msftngp13.phx.gbl...