public void ReleaseMedia() { var media = new Media(new Instance(), Path.GetTempFileName(), Media.FromType.FromPath); media.Dispose(); Assert.AreEqual(IntPtr.Zero, media.NativeReference); }
public void FreedMedia() { var media = new Media(new Instance(), RealMediaPath, Media.FromType.FromPath); var eventCalled = false; media.EventManager.MediaFreed += (sender, args) => { eventCalled = true; }; media.Dispose(); Assert.True(eventCalled); }
public static int Main(string[] args) { string[] argv = new string[]{ "-vv", "-I", "dummy", "--plugin-path=../../modules" }; Console.WriteLine ("Running on LibVLC {0} ({1})", VLC.Version, VLC.ChangeSet); Console.WriteLine (" (compiled with {0})", VLC.Compiler); VLC vlc = new VLC (argv); foreach (string mrl in args) { Media media = new Media (vlc, mrl); Player player = new Player (media); DumpMedia (media); DumpMedia ((Media)media.Clone ()); media.StateChanged += WriteMediaState; /*foreach (MetaType type in Enum.GetValues (typeof (MetaType))) { string meta = media.GetMeta (type); if (meta != null) Console.WriteLine (" {0}: {1}", type, meta); }*/ player.Play (); do { DumpPlayer (player); Sleep (500); } while (player.IsPlaying); player.Stop (); media.Dispose (); player.Dispose (); } vlc.Dispose (); return 0; }