public void TestBufferOwnership () { MyTransformIp.Register (); Pipeline pipeline = new Pipeline (); Element src = ElementFactory.Make ("fakesrc"); src["num-buffers"] = 10; Element transform = new MyTransformIp (); Element sink = ElementFactory.Make ("fakesink"); pipeline.Add (src, transform, sink); Element.Link (src, transform, sink); Gst.GLib.MainLoop loop = new Gst.GLib.MainLoop (); pipeline.Bus.AddWatch (delegate (Bus bus, Message message) { switch (message.Type) { case MessageType.Error: Enum err; string msg; message.ParseError (out err, out msg); Assert.Fail (String.Format ("Error message: {0}", msg)); loop.Quit (); break; case MessageType.Eos: loop.Quit (); break; } return true; }); pipeline.SetState (State.Playing); loop.Run (); pipeline.SetState (State.Null); }
public void TestBufferOwnership() { MyTransformIp.Register(); Pipeline pipeline = new Pipeline(); Element src = ElementFactory.Make("fakesrc"); src["num-buffers"] = 10; Element transform = new MyTransformIp(); Element sink = ElementFactory.Make("fakesink"); pipeline.Add(src, transform, sink); Element.Link(src, transform, sink); GLib.MainLoop loop = new GLib.MainLoop(); pipeline.Bus.AddWatch(delegate(Bus bus, Message message) { switch (message.Type) { case MessageType.Error: Enum err; string msg; message.ParseError(out err, out msg); Assert.Fail(String.Format("Error message: {0}", msg)); loop.Quit(); break; case MessageType.Eos: loop.Quit(); break; } return(true); }); pipeline.SetState(State.Playing); loop.Run(); pipeline.SetState(State.Null); }