Exemple #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);
    }
    static bool Register()
    {
        GLib.GType gtype = (GLib.GType) typeof(TransformSample);
        SetDetails(gtype, "Transform Sample", "Filter/Effect/Video",
                   "Draws a moving line on top of a video stream and handles mouse clicks",
                   "Sebastian Dröge <*****@*****.**>");

        Caps tmp  = VideoUtil.FormatToTemplateCaps((BitConverter.IsLittleEndian) ? VideoFormat.BGRX : VideoFormat.XRGB);
        Caps caps = tmp.Copy();

        caps[0]["width"]  = 640;
        caps[0]["height"] = 480;
        caps.Append(tmp);

        AddPadTemplate(gtype, new PadTemplate("src", PadDirection.Src, PadPresence.Always, caps));
        AddPadTemplate(gtype, new PadTemplate("sink", PadDirection.Sink, PadPresence.Always, caps));
        return(ElementFactory.Register(null, "transformsample", (uint)Gst.Rank.None, gtype));
    }