本文整理汇总了C#中DirectShow.AMMediaType.Free方法的典型用法代码示例。如果您正苦于以下问题:C# AMMediaType.Free方法的具体用法?C# AMMediaType.Free怎么用?C# AMMediaType.Free使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DirectShow.AMMediaType
的用法示例。
在下文中一共展示了AMMediaType.Free方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImageOverFilter
public ImageOverFilter()
: base("CSharp Image Overlay Filter")
{
vid.DSplugin = true;
AllocConsole();
IntPtr stdHandle = GetStdHandle(STD_OUTPUT_HANDLE);
SafeFileHandle safeFileHandle = new SafeFileHandle(stdHandle, true);
FileStream fileStream = new FileStream(safeFileHandle, FileAccess.Write);
Encoding encoding = System.Text.Encoding.GetEncoding(MY_CODE_PAGE);
StreamWriter standardOutput = new StreamWriter(fileStream, encoding);
standardOutput.AutoFlush = true;
Console.SetOut(standardOutput);
Console.WriteLine("This text you can see in console window.");
AMMediaType pmt = new AMMediaType() { majorType = MediaType.Video, subType = MediaSubType.YUY2, formatType = MediaType.Video, formatPtr = IntPtr.Zero };
SetMediaType(PinDirection.Input, pmt);
pmt.Free();
pmt = new AMMediaType() { majorType = MediaType.Video, subType = MediaSubType.RGB24, formatType = MediaType.Video, formatPtr = IntPtr.Zero };
SetMediaType(PinDirection.Output, pmt);
pmt.Free();
}
示例2: GetNumberOfCapabilities
public int GetNumberOfCapabilities(out int iCount, out int iSize)
{
iCount = 0;
AMMediaType mt = new AMMediaType();
while (GetMediaType(iCount, ref mt) == S_OK) { mt.Free(); iCount++; };
iSize = Marshal.SizeOf(typeof(VideoStreamConfigCaps));
return NOERROR;
}