Flaming Moe
2009-01-09 18:10:29 UTC
Hello.
I am building an application which main task is to display a WMV3
video on
two screens simultaneously.
Therefor I created a filtergraph that worked fine as long as I used
Windows
Media Format 9.5:
[WM ASF Reader] -> [WMAudio Decoder DMO] -> [DefaultDirectSoundDevice]
-> [Inf Pin Tee Filter] -> [WMVideo Decoder DMO] -
VMR7]
I connected the Pins using intelligent connect (GraphBuilder.Connect
(...)).
Afterwards I tested the application on a different computer using
WMP11 and WMF11.
The result was two black screens without HResult Error.
So I rebuilt the graph with graphedit and compared it with my own.
Both were completely connected, sometimes playable, but still with
black screens.
And sometimes I received the Error:
VFW_E_TYPE_NOT_ACCEPTED (HResult: 0x8004022a)
This pin cannot use the supplied media type.
The GraphBuilder used VideoInfo as FormatType to connect the Pins,
although, as I think, it is said in the docs somewhere that VideoInfo2
is the
preferred FormatType when using intelligent connect.
But I could be mistaken at that point.
I tried reconnecting the graph with GraphEdit and found out that the
graph starts connecting with VideoInfo2 till the second WMVideo
Decoder
is connected to the Infinite Pin Tee Filter.
[WM ASF Reader] -> [WMAudio Decoder DMO] -> [DefaultDirectSoundDevice]
-> [Inf Pin Tee Filter] -> [WMVideo Decoder DMO] -
but when I connect the second Decoder all FormatTypes change to
VideoInfo.
The funny thing is that the WMF9.5 Version of the WMVideo Decoder
accepts VideoInfo
as a valid FormatType, whereas the WMF11 WMVideo Decoder apparently
doesn't.
From the docs:
Infinite Pin Tee Filter
Because this filter does not change the data that it receives,
all pins must agree to the same media type.
During the connection process, the filter might reconnect
some pins in order to make the media types match.
Maybe someone can tell me why the Tee Filter switches the FormatType
to VideoInfo, when 2 decoders of the same Type connect to it!?
I tried out varying Direct Connect methods to determine a way
to solve that problem, but none of them worked the way I expected.
// the method enumerates the mediatypes of the passed pin and returns
the first mediatype
// containing VideoInfo2 as FormatType
AMMediaType videoInfo2 = DsUtils.GetMediaTypeByFormatType(outputPin,
FormatType.VideoInfo2);
Methods I tried out to connect the pins directly:
// from IPin
int hr = outputPin.Connect(inputPin, videoInfo2);
int hr = outputPin.ReceiveConnection(inputPin, videoInfo2);
// from IGraphBuilder
int hr = mGraphBuilder.ConnectDirect(outputPin, inputPin, videoInfo2);
// from IGraphConfig
int hr = graphConfig.Reconnect(outputPin, inputPin, videoInfo2, null,
IntPtr.Zero, AMGraphConfigReconnect.DirectConnect);
// from IFilterGraph2
int hr = filterGraph.ReconnectEx(outputPin, videoInfo2);
I used different ways to connect with certain MediaTypes:
1. I used the GetMediaTypeByFormatType(...) method for each outputPin
of each filter
and connected them with IGraphBuilder.ConnectDirect(...) or
IPin.Connect(...).
2. I Used the GetMediaTypeByFormatType(...) method for getting the
MediaType of the WM ASF Reader,
connected to the Infinite Pin Tee Filter and used the same MediaType
to connect both WMVideo Decoders.
3. I Connected the whole Graph by Intelligent Connect and tried
reconnecting the WM ASF Reader and
the Infinite Pin Tee Filter. For that I tried IGraphConfig.Reconnect
(...) and IFilterGraph.ReconnectEx(...)
with the MediaType of the WM ASF Reader.
The methods from the IPin and IGraphBuilder Interfaces connected,
but the result was the same as before.
I also tried all that with the WMVideo9 Decoder DMO instead of the
WMVideo Decoder.
I'm getting out of Ideas and I can't find any information about
differences between the WMVideo Decoder
of WMF11 and WMF9.5. All I could find out is that the dlls differ.
WMF9.5 : wmvdmod.dll
WMF11 : wmvdecod.dll or wmv9dmod.dll -> which decoder should I use?
I hope someone can help me out a little :)
I am building an application which main task is to display a WMV3
video on
two screens simultaneously.
Therefor I created a filtergraph that worked fine as long as I used
Windows
Media Format 9.5:
[WM ASF Reader] -> [WMAudio Decoder DMO] -> [DefaultDirectSoundDevice]
-> [Inf Pin Tee Filter] -> [WMVideo Decoder DMO] -
[VMR9 or VMR7]
-> [WMVideo Decoder DMO] -> [VMR9 orVMR7]
I connected the Pins using intelligent connect (GraphBuilder.Connect
(...)).
Afterwards I tested the application on a different computer using
WMP11 and WMF11.
The result was two black screens without HResult Error.
So I rebuilt the graph with graphedit and compared it with my own.
Both were completely connected, sometimes playable, but still with
black screens.
And sometimes I received the Error:
VFW_E_TYPE_NOT_ACCEPTED (HResult: 0x8004022a)
This pin cannot use the supplied media type.
The GraphBuilder used VideoInfo as FormatType to connect the Pins,
although, as I think, it is said in the docs somewhere that VideoInfo2
is the
preferred FormatType when using intelligent connect.
But I could be mistaken at that point.
I tried reconnecting the graph with GraphEdit and found out that the
graph starts connecting with VideoInfo2 till the second WMVideo
Decoder
is connected to the Infinite Pin Tee Filter.
[WM ASF Reader] -> [WMAudio Decoder DMO] -> [DefaultDirectSoundDevice]
-> [Inf Pin Tee Filter] -> [WMVideo Decoder DMO] -
[VMR9 or VMR7]
This graph is fully playable,but when I connect the second Decoder all FormatTypes change to
VideoInfo.
The funny thing is that the WMF9.5 Version of the WMVideo Decoder
accepts VideoInfo
as a valid FormatType, whereas the WMF11 WMVideo Decoder apparently
doesn't.
From the docs:
Infinite Pin Tee Filter
Because this filter does not change the data that it receives,
all pins must agree to the same media type.
During the connection process, the filter might reconnect
some pins in order to make the media types match.
Maybe someone can tell me why the Tee Filter switches the FormatType
to VideoInfo, when 2 decoders of the same Type connect to it!?
I tried out varying Direct Connect methods to determine a way
to solve that problem, but none of them worked the way I expected.
// the method enumerates the mediatypes of the passed pin and returns
the first mediatype
// containing VideoInfo2 as FormatType
AMMediaType videoInfo2 = DsUtils.GetMediaTypeByFormatType(outputPin,
FormatType.VideoInfo2);
Methods I tried out to connect the pins directly:
// from IPin
int hr = outputPin.Connect(inputPin, videoInfo2);
int hr = outputPin.ReceiveConnection(inputPin, videoInfo2);
// from IGraphBuilder
int hr = mGraphBuilder.ConnectDirect(outputPin, inputPin, videoInfo2);
// from IGraphConfig
int hr = graphConfig.Reconnect(outputPin, inputPin, videoInfo2, null,
IntPtr.Zero, AMGraphConfigReconnect.DirectConnect);
// from IFilterGraph2
int hr = filterGraph.ReconnectEx(outputPin, videoInfo2);
I used different ways to connect with certain MediaTypes:
1. I used the GetMediaTypeByFormatType(...) method for each outputPin
of each filter
and connected them with IGraphBuilder.ConnectDirect(...) or
IPin.Connect(...).
2. I Used the GetMediaTypeByFormatType(...) method for getting the
MediaType of the WM ASF Reader,
connected to the Infinite Pin Tee Filter and used the same MediaType
to connect both WMVideo Decoders.
3. I Connected the whole Graph by Intelligent Connect and tried
reconnecting the WM ASF Reader and
the Infinite Pin Tee Filter. For that I tried IGraphConfig.Reconnect
(...) and IFilterGraph.ReconnectEx(...)
with the MediaType of the WM ASF Reader.
The methods from the IPin and IGraphBuilder Interfaces connected,
but the result was the same as before.
I also tried all that with the WMVideo9 Decoder DMO instead of the
WMVideo Decoder.
I'm getting out of Ideas and I can't find any information about
differences between the WMVideo Decoder
of WMF11 and WMF9.5. All I could find out is that the dlls differ.
WMF9.5 : wmvdmod.dll
WMF11 : wmvdecod.dll or wmv9dmod.dll -> which decoder should I use?
I hope someone can help me out a little :)