protected virtual void ConnectAllOutputFiltersFrom(IBaseFilter fromFilter, IFilterGraph2 graph)
{
// Get the pin enumerator
IEnumPins ppEnum;
int hr = fromFilter.EnumPins(out ppEnum);
DsError.ThrowExceptionForHR(hr);
try
{
// Walk the pins looking for a match
IPin[] pPins = new IPin[1];
//22 int lFetched;
//22 while ((ppEnum.Next(1, pPins, out lFetched) >= 0) && (lFetched == 1))
while (ppEnum.Next(1, pPins, IntPtr.Zero) >= 0)
{
// Read the direction
PinDirection ppindir;
hr = pPins[0].QueryDirection(out ppindir);
DsError.ThrowExceptionForHR(hr);
// Is it the right direction?
if (ppindir == PinDirection.Output)
{
if (pPins[0] != null)
{
hr = graph.Render(pPins[0]);
//DsError.ThrowExceptionForHR(hr);
}
}
Marshal.ReleaseComObject(pPins[0]);
}
}
finally
{
Marshal.ReleaseComObject(ppEnum);
}
}