コード例 #1
0
		DirectShowLib.AMMediaType[] GetOutputMediaTypes(DirectShowLib.IBaseFilter filter)
		{
			DirectShowLib.AMMediaType[] result = null;
			DirectShowLib.IPin outPin = DirectShowLib.DsFindPin.ByDirection(filter, DirectShowLib.PinDirection.Output, 0);
			if (outPin is DirectShowLib.IAMStreamConfig)
			{
				int count = 0;
				int size = 0;
				Exception.GraphError.Check((outPin as DirectShowLib.IAMStreamConfig).GetNumberOfCapabilities(out count, out size));
				Buffer.Vector<byte> buffer = new Buffer.Vector<byte>(size);
				result = new DirectShowLib.AMMediaType[count];
				for (int i = 0; i < count; i++)
					Exception.GraphError.Check((outPin as DirectShowLib.IAMStreamConfig).GetStreamCaps(i, out result[i], buffer));
			}
			return result;
		}
コード例 #2
0
 DirectShowLib.AMMediaType[] GetOutputMediaTypes(DirectShowLib.IBaseFilter filter)
 {
     DirectShowLib.AMMediaType[] result = null;
     DirectShowLib.IPin          outPin = DirectShowLib.DsFindPin.ByDirection(filter, DirectShowLib.PinDirection.Output, 0);
     if (outPin is DirectShowLib.IAMStreamConfig)
     {
         int count = 0;
         int size  = 0;
         Exception.GraphError.Check((outPin as DirectShowLib.IAMStreamConfig).GetNumberOfCapabilities(out count, out size));
         Buffer.Vector <byte> buffer = new Buffer.Vector <byte>(size);
         result = new DirectShowLib.AMMediaType[count];
         for (int i = 0; i < count; i++)
         {
             Exception.GraphError.Check((outPin as DirectShowLib.IAMStreamConfig).GetStreamCaps(i, out result[i], buffer));
         }
     }
     return(result);
 }