From 15532cc8c67fb425ff86451349e0c3dd168cad59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 21 May 2009 21:47:17 +0200 Subject: [PATCH] Update the element bindings to use GTypeNameAttribute --- gstreamer-sharp/baseplugins/DecodeBin.cs | 5 +---- gstreamer-sharp/baseplugins/PlayBin.cs | 3 +-- gstreamer-sharp/coreplugins/TypeFindElement.cs | 7 ++----- samples/DecodeBinTranscoder.cs | 2 +- samples/PlayBinPlayer.cs | 2 +- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/gstreamer-sharp/baseplugins/DecodeBin.cs b/gstreamer-sharp/baseplugins/DecodeBin.cs index e7b946cd2c..08049c86a2 100644 --- a/gstreamer-sharp/baseplugins/DecodeBin.cs +++ b/gstreamer-sharp/baseplugins/DecodeBin.cs @@ -25,6 +25,7 @@ namespace Gst.BasePlugins } } + [GTypeName("GstDecodeBin")] public class DecodeBin : Bin { private Delegate new_decoded_pad_delegate; @@ -33,10 +34,6 @@ namespace Gst.BasePlugins { } - public DecodeBin (GLib.Object o) : base (o.Handle) - { - } - protected virtual void OnNewDecodedPad(object o, GLib.SignalArgs args) { BindingHelper.InvokeProxySignalDelegate(new_decoded_pad_delegate, diff --git a/gstreamer-sharp/baseplugins/PlayBin.cs b/gstreamer-sharp/baseplugins/PlayBin.cs index a3de5a4bb7..f31f13337d 100644 --- a/gstreamer-sharp/baseplugins/PlayBin.cs +++ b/gstreamer-sharp/baseplugins/PlayBin.cs @@ -13,14 +13,13 @@ using System.Runtime.InteropServices; namespace Gst.BasePlugins { + [GTypeName("GstPlayBin")] public class PlayBin : Pipeline { public PlayBin(IntPtr raw) : base(raw) { } - public PlayBin(GLib.Object o) : base (o.Handle) {} - [GLib.Property("uri")] public string Uri { get { diff --git a/gstreamer-sharp/coreplugins/TypeFindElement.cs b/gstreamer-sharp/coreplugins/TypeFindElement.cs index cf1b0f9dd5..594b1d1a99 100644 --- a/gstreamer-sharp/coreplugins/TypeFindElement.cs +++ b/gstreamer-sharp/coreplugins/TypeFindElement.cs @@ -26,6 +26,7 @@ namespace Gst.CorePlugins } } + [GTypeName("GstTypeFindElement")] public class TypeFindElement : Element { private Delegate have_type_delegate; @@ -34,13 +35,9 @@ namespace Gst.CorePlugins { } - public TypeFindElement(GLib.Object o) : base(o.Handle) - { - } - public static TypeFindElement Make(string name) { - return new TypeFindElement (ElementFactory.Make("typefind", name)); + return ElementFactory.Make("typefind", name) as TypeFindElement; } protected virtual void OnHaveType(object o, GLib.SignalArgs args) diff --git a/samples/DecodeBinTranscoder.cs b/samples/DecodeBinTranscoder.cs index dbae8e94a0..3849bb74df 100644 --- a/samples/DecodeBinTranscoder.cs +++ b/samples/DecodeBinTranscoder.cs @@ -96,7 +96,7 @@ public class DecodeBinTranscoder : IDisposable filesink = ElementFactory.Make("filesink", "filesink"); audioconvert = ElementFactory.Make("audioconvert", "audioconvert"); encoder = ElementFactory.Make("wavenc", "wavenc"); - decodebin = new DecodeBin (ElementFactory.Make("decodebin", "decodebin")); + decodebin = ElementFactory.Make("decodebin", "decodebin") as DecodeBin; decodebin.NewDecodedPad += OnNewDecodedPad; pipeline.Add (filesrc, decodebin, audioconvert, encoder, filesink); diff --git a/samples/PlayBinPlayer.cs b/samples/PlayBinPlayer.cs index da5af69c9f..daff707086 100644 --- a/samples/PlayBinPlayer.cs +++ b/samples/PlayBinPlayer.cs @@ -26,7 +26,7 @@ public class PlayBinPlayer Gst.Application.Init (); loop = new MainLoop (); - play = new PlayBin (ElementFactory.Make ("playbin", "play")); + play = ElementFactory.Make ("playbin", "play") as PlayBin; if (play == null) { Console.WriteLine ("error creating a playbin gstreamer object");