mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-20 06:08:14 +00:00
Fix instanciation of GLib.SignalArgs subclasses from the BindingHelper and the samples
This commit is contained in:
parent
22b082ed9c
commit
5e8d19e2be
4 changed files with 12 additions and 25 deletions
|
@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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]; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue