Ejemplo n.º 1
0
    public void TestManagedReferences()
    {
        Caps tmp  = VideoUtil.FormatToTemplateCaps(Gst.Video.VideoFormat.RGBX);
        Caps caps = tmp.Copy();

        caps[0]["width"]  = 640;
        caps[0]["height"] = 480;

        caps.Append(tmp);
        Caps any = Caps.NewAny();

        caps.Merge(any);
    }
Ejemplo n.º 2
0
        public MyBin() : base()
        {
            Element filesrc = ElementFactory.Make("filesrc");

            Add(filesrc);
            CollectionAssert.IsEmpty(Pads);

            GhostPad pad1 = new GhostPad("ghost-sink", PadDirection.Sink);
            GhostPad pad2 = new GhostPad("ghost-src", new PadTemplate("src-template", PadDirection.Src, PadPresence.Request, Caps.NewAny()));

            Assert.IsFalse(pad1.SetTarget(filesrc.GetStaticPad("src")));
            Assert.IsTrue(pad2.SetTarget(filesrc.GetStaticPad("src")));

            AddPad(pad1);
            AddPad(pad2);

            CollectionAssert.Contains(Pads, pad1);
            CollectionAssert.Contains(Pads, pad2);
            CollectionAssert.Contains(SinkPads, pad1);
            CollectionAssert.Contains(SrcPads, pad2);
        }
Ejemplo n.º 3
0
    static void Init(GType gType, Type type)
    {
        var ptr = gType.GetClassPtr();

        gst_element_class_set_metadata(ptr, LONGNAME, CLASSIFICATION, DESCRIPTION, AUTHOR);
        PadTemplate srcTmpl  = new PadTemplate("src", PadDirection.Src, PadPresence.Always, Caps.NewAny());
        PadTemplate sinkTmpl = new PadTemplate("sink", PadDirection.Sink, PadPresence.Always, Caps.NewAny());

        gst_element_class_add_pad_template(ptr, srcTmpl.OwnedHandle);
        gst_element_class_add_pad_template(ptr, sinkTmpl.OwnedHandle);
    }