[Gtk-sharp-list] Re: LinkMany patch
Peter Johanson
latexer@gentoo.org
Fri, 14 May 2004 19:25:07 -0400
--6zdv2QT/q3FMhpsV
Content-Type: multipart/mixed; boundary="CUfgB8w4ZwR/yMy5"
Content-Disposition: inline
--CUfgB8w4ZwR/yMy5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
would help if i actually attached the d*mn patch...
-pete
On Fri, May 14, 2004 at 07:24:18PM -0400, Peter Johanson wrote:
> Hey all,
>=20
> attached is a patch implementing the Element.LinkMany method for
> chaining together a set of Element instances, and a change to one of the
> sampmles to show how it is used.
>=20
> This had been wrapped using the gapi stuff a while ago, from what i can
> find, but it no longer was working due to using an apparently outdated
> <parameter ellipses=3D"true"> style setup. If there actually is a way to
> go from a params -> va_list, that method would probably be preferable,
> but I've not found any, so I implemented it this way.
>=20
> -pete
> =20
> PS - Changelog addition included in the patch as requested.
>=20
> PPS - I've started work on creating a Gst# backend for muine, and it's
> been really helpful in finding which tidbits of Gst# need some
> massaging. I had a working (mostly) backend using the Gst.Play stuff,
> but was advised by Company in #gstreamer that it'd be better to create
> my own Pipeline and individual components, so i've got stuff close
> to back to working with that layout.
>=20
> --=20
> Peter Johanson
> <latexer@gentoo.org>
>=20
> Key ID =3D 0x6EFA3917
> Key fingerprint =3D A90A 2518 57B1 9D20 9B71 A2FF 8649 439B 6EFA 3917
--=20
Peter Johanson
<latexer@gentoo.org>
Key ID =3D 0x6EFA3917
Key fingerprint =3D A90A 2518 57B1 9D20 9B71 A2FF 8649 439B 6EFA 3917
--CUfgB8w4ZwR/yMy5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gst-sharp-LinkMany.diff"
Content-Transfer-Encoding: quoted-printable
Index: ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/gst-sharp/ChangeLog,v
retrieving revision 1.11
diff -u -b -B -r1.11 ChangeLog
--- ChangeLog 8 May 2004 19:45:53 -0000 1.11
+++ ChangeLog 15 May 2004 00:36:13 -0000
@@ -1,3 +1,9 @@
+2004-05-14 Peter Johanson <latexer@gentoo.org>
+
+ * gst-sharp/Element.custom: Implement LinkMany shortcut for
+ chaining up a bunch of Elements.
+ * sample/PlayMp3.cs: Change to use new LinkMany
+
2004-05-08 John Luke <jluke@cfl.rr.com>
=20
* gst-sharp/Element.custom: add overloads for bool and
Index: gst-sharp/Element.custom
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/gst-sharp/gst-sharp/Element.custom,v
retrieving revision 1.2
diff -u -b -B -r1.2 Element.custom
--- gst-sharp/Element.custom 8 May 2004 19:18:36 -0000 1.2
+++ gst-sharp/Element.custom 15 May 2004 00:36:13 -0000
@@ -26,3 +26,19 @@
GLib.Value val =3D new GLib.Value (value);
gst_element_set_property (Handle, property_name, ref val);
}
+
+ // Used to chain together a set of Elements in order.
+ public bool LinkMany(Element second, params Element[] args) {
+ if(second =3D=3D null)
+ return false;
+ Link(second);
+ Element tmp =3D second;
+ foreach(Element element in args) {
+ if(element =3D=3D null)
+ return false;
+ if(tmp.Link(element) =3D=3D false)
+ return false;
+ tmp =3D element;
+ }
+ return true;
+ }
Index: sample/PlayMp3.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/gst-sharp/sample/PlayMp3.cs,v
retrieving revision 1.2
diff -u -b -B -r1.2 PlayMp3.cs
--- sample/PlayMp3.cs 8 May 2004 19:18:36 -0000 1.2
+++ sample/PlayMp3.cs 15 May 2004 00:36:13 -0000
@@ -36,8 +36,7 @@
bin.Add (sink);
=20
// connect the elements
- filesrc.Link (mad);
- mad.Link (sink);
+ filesrc.LinkMany (mad, sink);
=09
// start playing
bin.SetState (ElementState.Playing);
--CUfgB8w4ZwR/yMy5--
--6zdv2QT/q3FMhpsV
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFApVVThklDm276ORcRAhsJAJsG8WcWLjImS+bShvQfwfkTrfcTEgCgokmT
Y7rBf2AZhtT8b5Dnen87uto=
=I3IU
-----END PGP SIGNATURE-----
--6zdv2QT/q3FMhpsV--