Beispiel #1
0
    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);
    }