From: Sebastian Dröge Date: Sat, 4 Apr 2009 14:53:59 +0000 (+0200) Subject: Fix instanciation of GLib.SignalArgs subclasses from the BindingHelper and the samples X-Git-Tag: 1.19.3~483^2~770 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e8d19e2be49ee57501082b5662f4b968e310620;p=platform%2Fupstream%2Fgstreamer.git Fix instanciation of GLib.SignalArgs subclasses from the BindingHelper and the samples --- diff --git a/gstreamer-sharp/BindingHelper.cs b/gstreamer-sharp/BindingHelper.cs index a2af263..ef43e52 100644 --- a/gstreamer-sharp/BindingHelper.cs +++ b/gstreamer-sharp/BindingHelper.cs @@ -44,8 +44,11 @@ namespace Gst } if(raiseDelegate != null) { - raiseDelegate.DynamicInvoke(new object [] { o, - Activator.CreateInstance(type, new object [] { args }) }); + GLib.SignalArgs new_args = (GLib.SignalArgs) Activator.CreateInstance (type); + new_args.RetVal = args.RetVal; + new_args.Args = args.Args; + + raiseDelegate.DynamicInvoke(new object [] { o, new_args }); } } } diff --git a/gstreamer-sharp/plugins-base/DecodeBin.cs b/gstreamer-sharp/plugins-base/DecodeBin.cs index c9d6da5..705e166 100644 --- a/gstreamer-sharp/plugins-base/DecodeBin.cs +++ b/gstreamer-sharp/plugins-base/DecodeBin.cs @@ -16,16 +16,12 @@ namespace Gst public class NewDecodedPadArgs : GLib.SignalArgs { - public NewDecodedPadArgs(GLib.SignalArgs args) : base(args) - { - } - public Gst.Pad Pad { - get { return (Gst.Pad)Args[1]; } + get { return (Gst.Pad)Args[0]; } } public bool Last { - get { return (bool)Args[2]; } + get { return (bool)Args[1]; } } } diff --git a/gstreamer-sharp/plugins-base/TypeFindElement.cs b/gstreamer-sharp/plugins-base/TypeFindElement.cs index ca14a46..9ec6c42 100644 --- a/gstreamer-sharp/plugins-base/TypeFindElement.cs +++ b/gstreamer-sharp/plugins-base/TypeFindElement.cs @@ -15,18 +15,14 @@ namespace Gst public class HaveTypeArgs : GLib.SignalArgs { - public HaveTypeArgs(GLib.SignalArgs args) : base(args) - { - } - public uint Probability { get { return (uint)Args[0]; } } public Gst.Caps Caps { get { - return (Gst.Caps)Args[1]; - } + return (Gst.Caps)Args[1]; + } } } @@ -42,29 +38,21 @@ namespace Gst { return ElementFactory.Make("typefind", name) as TypeFindElement; } - /* + protected virtual void OnHaveType(object o, GLib.SignalArgs args) { BindingHelper.InvokeProxySignalDelegate(have_type_delegate, typeof(HaveTypeArgs), o, args); } - */ - public event GLib.DynamicSignalHandler HaveType { add { - /* have_type_delegate = BindingHelper.AddProxySignalDelegate(this, "have-type", OnHaveType, have_type_delegate, value); - */ - GLib.DynamicSignal.Connect(this, "have-type", value); } remove { - /* have_type_delegate = BindingHelper.RemoveProxySignalDelegate(this, "have-type", OnHaveType, have_type_delegate, value); - */ - GLib.DynamicSignal.Disconnect(this, "have-type", value); } } diff --git a/sample/DecodeBinTranscoder.cs b/sample/DecodeBinTranscoder.cs index c9d5826..bc85aa2 100644 --- a/sample/DecodeBinTranscoder.cs +++ b/sample/DecodeBinTranscoder.cs @@ -110,11 +110,11 @@ public class DecodeBinTranscoder : IDisposable private void OnNewDecodedPad(object o, NewDecodedPadArgs args) { Pad sinkpad = audioconvert.GetPad("sink"); - + if(sinkpad.IsLinked) { return; } - + Caps caps = args.Pad.Caps; Structure structure = caps.GetStructure(0);