using System;using System.Collections.Generic;using System.Text;using DexterLib;using System.Drawing;using System.Drawing.Imaging;using System.Runtime.InteropServices;namespace mediad{ class Program { public static Guid MEDIATYPE_Video = new Guid(0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); static void Main(string[] args) { System.Console.WriteLine("** MediaD test app //"); MediaDetClass md = new MediaDetClass(); _AMMediaType mt; bool found = false; md.Filename = "e:\\torrents\\Evanescence - Bring Me To Life.avi"; int streamsNumber = md.OutputStreams; for (int i = 0; i < streamsNumber; i++) { md.CurrentStream = i; mt = md.StreamMediaType; if (mt.majortype == MEDIATYPE_Video) found = true; } if (!found) Console.WriteLine("File \""+md.Filename+"\" does not have video stream."); else { Console.WriteLine("Video stream found. Moving forward..."); unsafe { int size = 0; byte* buff = null; try { md.GetBitmapBits(5.3, ref size, ref *buff, 640, 480); Console.WriteLine("Buffer size found: " + size.ToString()); } catch (Exception e) { Console.WriteLine(e.ToString()); } try { buff = (byte*)Marshal.AllocHGlobal(size); } catch (Exception e) { Console.WriteLine(e.ToString()); } try { md.GetBitmapBits(md.StreamLength * 0.3, ref size, ref *buff, 640, 480); Console.WriteLine("Frame loaded"); } catch (Exception e) { Console.WriteLine(e.ToString()); } } } } }}