bin.AddMany(e1, e2);
Assert.AreEqual(bin.ChildrenCount, 2);
-
- e2.Dispose();
- e1.Dispose();
- bin.Dispose();
}
Assert.IsNotNull(e1);
Assert.AreEqual(e1.Name, "element-name");
-
- e1.Dispose();
- bin.Dispose();
}
[Test]
for(int i = 0; i < elements.Length; i++) {
Assert.AreEqual(elements[elements.Length - i - 1], children[i]);
}
-
- bin.Dispose();
-
- foreach(Element e in elements)
- e.Dispose();
}
[Test]
Assert.IsNotNull(filesrc, "Could not create filesrc");
bin.Add(filesrc);
-
- filesrc.Dispose();
- bin.Dispose();
}
}
Gst.Buffer sub = buffer.CreateSub(1, 2);
Assert.IsNotNull(sub);
Assert.AreEqual(sub.Size, 2, "subbuffer has wrong size");
-
- //sub.Dispose();
- buffer.Dispose();
}
[Test]
Assert.IsFalse(buffer.IsSpanFast(sub2), "a parent buffer can not be SpanFasted");
Assert.IsFalse(sub1.IsSpanFast(buffer), "a parent buffer can not be SpanFasted");
Assert.IsTrue(sub1.IsSpanFast(sub2), "two subbuffers next to each other should be SpanFast");
-
- buffer.Dispose();
}
}
Caps caps = new Caps();
Assert.IsNotNull(caps);
Assert.IsFalse(caps.Handle == IntPtr.Zero, "Ooops, null handle");
-
- caps.Dispose();
}
[Test]
Assert.IsTrue(caps.IsFixed, "Caps should be FIXED!");
Assert.IsFalse(caps.IsEmpty, "Caps shouldn't be EMPTY!");
Assert.IsFalse(caps.IsAny, "Caps shouldn't be ANY!");
-
- caps.Dispose();
}
[Test]
Assert.IsFalse(caps3.IsEmpty, "How come caps are EMPTY?!");
Assert.AreEqual(caps2.ToString() + ", framerate=(fraction)[ 0/1, 100/1 ]", caps3.ToString());
-
- caps1.Dispose();
- caps2.Dispose();
- caps3.Dispose();
}
[Test]
"format=(fourcc)I420, " +
"height=(int)480",
caps3.ToString());
-
- caps1.Dispose();
- caps2.Dispose();
- caps3.Dispose();
}
}
public void TestErrorNoBus()
{
Element e = ElementFactory.Make("fakesrc", "source");
- e.Dispose();
}
[Test]
Element sink = new Bin("sink");
Assert.IsFalse(src.Link(sink));
-
- src.Dispose();
- sink.Dispose();
}
}
Assert.IsNotNull(message);
Assert.AreEqual(message.Type, MessageType.Eos);
Assert.IsNull(message.Src);
- message.Dispose();
message = new Message(null, "error string");
Assert.IsNotNull(message);
Assert.AreEqual(message.Type, MessageType.Error);
Assert.IsNull(message.Src);
- message.Dispose();
}
}
Assert.AreEqual(PadDirection.Src, src.Direction);
Assert.AreEqual(PadDirection.Sink, sink.Direction);
-
- src.Dispose();
- sink.Dispose();
}
public static Caps PadGetCapsStub(Pad pad)
Assert.IsNotNull(caps, "Ooops, returned caps is null");
Assert.IsFalse(caps.IsEmpty == true, "Ooops, returned caps are empty");
Assert.AreEqual("video/x-raw-yuv", caps.ToString ());
-
- caps.Dispose();
- src.Dispose();
}
[Test]
Caps sinkcaps = sink.Caps;
Assert.IsTrue(sinkcaps.IsAny, "How come sink pad caps is not ANY?");
-
- element.Dispose();
- src.Dispose();
- sink.Dispose();
- srccaps.Dispose();
- sinkcaps.Dispose();
}
[Test]
Assert.IsTrue(hassink, "Sink pad not found in the list");
Assert.IsTrue(hassrc, "Src pad not found in the list");
-
- element.Dispose();
}
[Test]
Assert.IsNotNull(sink, "Pad could not be created");
Assert.AreEqual(src.Link(sink), PadLinkReturn.Noformat);
-
- sink.Dispose();
- src.Dispose();
}
[Test]
catch (Exception ex) {
Assert.Fail("buffer.AllowedCaps failed");
}
-
- buffer.Dispose();
*/
Pad sink = new Pad("sink", PadDirection.Sink);
// try { Caps tcaps = sink.AllowedCaps; }
Caps gotcaps = src.AllowedCaps;
Assert.IsNotNull(gotcaps);
Assert.IsTrue(gotcaps.IsEqual(caps));
-
- gotcaps.Dispose();
-
- src.Unlink(sink);
-
- src.Dispose();
- sink.Dispose();
-
- caps.Dispose();
}
bool ProbeHandler(Pad pad, Gst.Buffer buffer)
Gst.Buffer buffer = new Gst.Buffer();
Assert.AreEqual(src.Push(buffer), FlowReturn.NotLinked);
- buffer.Dispose();
ulong handler_id = src.AddBufferProbe(new Pad.BufferProbeDelegate(ProbeHandler));
buffer = new Gst.Buffer();
Assert.AreEqual(src.Push(buffer), FlowReturn.Ok);
- buffer.Dispose();
- src.RemoveBufferProbe((uint)handler_id);
-
- src.Dispose();
-
- caps.Dispose();
}
}
Assert.IsNotNull(pipeline, "Could not create pipeline");
Assert.AreEqual(((Element)pipeline).SetState(State.Playing), StateChangeReturn.Success);
-
- pipeline.Dispose();
}
[Test]
src.Link(sink);
Assert.AreEqual(((Element)pipeline).SetState(State.Ready), StateChangeReturn.Success);
-
- pipeline.Dispose();
- src.Dispose();
- sink.Dispose();
}
[Test]
//Console.WriteLine("state change from {0} to {1}", old, newState);
if(message.Src == (Gst.Object) pipeline && newState == State.Playing)
done = true;
- //message.Dispose();
}
}
Assert.AreEqual(((Element)pipeline).SetState(State.Null), StateChangeReturn.Success);
- //bus.Dispose();
- pipeline.Dispose();
}
Element pipeline;
State current, pending;
Assert.AreEqual(pipeline.GetState(out current, out pending, Clock.TimeNone), StateChangeReturn.Success);
Assert.AreEqual(current, State.Null, "state is not NULL but " + current);
-
- pipeline.Dispose();
}
[Test]
Assert.IsTrue(fakesrc.Link(fakesink));
Pad sink = fakesink.GetPad("sink");
-
- pipeline.Dispose();
- fakesrc.Dispose();
- fakesink.Dispose();
}
}