Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 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;
 }