public void TestPushUnlinked() { Pad src = new Pad ("src", PadDirection.Src); Assert.IsNotNull (src, "Could not create src"); Caps caps = src.AllowedCaps; Assert.IsNull (caps); caps = Caps.FromString ("foo/bar"); src.SetCaps (caps); Gst.Buffer buffer = new Gst.Buffer(); Assert.AreEqual (src.Push (buffer), FlowReturn.NotLinked); ulong handler_id = src.AddBufferProbe (new PadBufferProbeCallback (ProbeHandler)); buffer = new Gst.Buffer (new byte[] {0}); FlowReturn flowreturn = src.Push (buffer); Assert.AreEqual (flowreturn, FlowReturn.Ok); }
public void TestGetAllowedCaps() { Caps caps; Pad sink = new Pad ("sink", PadDirection.Sink); caps = sink.AllowedCaps; Assert.IsNull (caps); Pad src = new Pad ("src", PadDirection.Src); caps = src.AllowedCaps; Assert.IsNull (caps); caps = Caps.FromString ("foo/bar"); src.SetCaps (caps); sink.SetCaps (caps); PadLinkReturn plr = src.Link (sink); Assert.AreEqual (plr, PadLinkReturn.Ok); Caps gotcaps = src.AllowedCaps; Assert.IsNotNull (gotcaps); Assert.IsTrue (gotcaps.IsEqual (caps)); }