mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
gst_pad_template_new() takes ownership of the caps, reference them
Also rename and cleanup some PadTemplate members
This commit is contained in:
parent
b24a603570
commit
294b5df8f7
7 changed files with 54 additions and 31 deletions
|
@ -1,5 +1,5 @@
|
|||
<Type Name="HasPadCreatedArgs" FullName="Gst.HasPadCreatedArgs">
|
||||
<TypeSignature Language="C#" Value="public class HasPadCreatedArgs : GLib.SignalArgs" />
|
||||
<Type Name="PadCreatedArgs" FullName="Gst.PadCreatedArgs">
|
||||
<TypeSignature Language="C#" Value="public class PadCreatedArgs : GLib.SignalArgs" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>gstreamer-sharp</AssemblyName>
|
||||
<AssemblyVersion>0.9.5.99</AssemblyVersion>
|
||||
|
@ -15,15 +15,21 @@
|
|||
<Members>
|
||||
|
||||
<Member MemberName=".ctor">
|
||||
<MemberSignature Language="C#" Value="public HasPadCreatedArgs ();" />
|
||||
<MemberSignature Language="C#" Value="public PadCreatedArgs ();" />
|
||||
<MemberType>Constructor</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>0.9.5.99</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<Parameters />
|
||||
<Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs>
|
||||
<AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Pad">
|
||||
</Member><Member MemberName="Pad">
|
||||
<MemberSignature Language="C#" Value="public Gst.Pad Pad { get; }" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>0.9.5.99</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue><ReturnType>Gst.Pad</ReturnType></ReturnValue>
|
||||
<Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs>
|
||||
<AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
|
@ -1,5 +1,5 @@
|
|||
<Type Name="HasPadCreatedHandler" FullName="Gst.HasPadCreatedHandler">
|
||||
<TypeSignature Language="C#" Value="public delegate void HasPadCreatedHandler(object o, HasPadCreatedArgs args);" />
|
||||
<Type Name="PadCreatedHandler" FullName="Gst.PadCreatedHandler">
|
||||
<TypeSignature Language="C#" Value="public delegate void PadCreatedHandler(object o, PadCreatedArgs args);" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>gstreamer-sharp</AssemblyName>
|
||||
<AssemblyVersion>0.9.5.99</AssemblyVersion>
|
||||
|
@ -9,7 +9,7 @@
|
|||
</Base>
|
||||
<Parameters>
|
||||
<Parameter Name="o" Type="System.Object" />
|
||||
<Parameter Name="args" Type="Gst.HasPadCreatedArgs" />
|
||||
<Parameter Name="args" Type="Gst.PadCreatedArgs" />
|
||||
</Parameters>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
|
@ -42,28 +42,10 @@
|
|||
<MemberType>Property</MemberType>
|
||||
<ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue>
|
||||
<Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs>
|
||||
<AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.Property("caps")</AttributeName></Attribute></Attributes></Member><Member MemberName="Direction"><MemberSignature Language="C#" Value="public Gst.PadDirection Direction { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.Property("direction")</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>Gst.PadDirection</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="GType">
|
||||
<AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.Property("caps")</AttributeName></Attribute></Attributes></Member><Member MemberName="Direction"><MemberSignature Language="C#" Value="public Gst.PadDirection Direction { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.Property("direction")</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>Gst.PadDirection</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="EmitPadCreated"><MemberSignature Language="C#" Value="public void EmitPadCreated (Gst.Pad pad);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="pad" Type="Gst.Pad" /></Parameters><Docs><param name="pad">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="GType">
|
||||
<MemberSignature Language="C#" Value="public static GLib.GType GType { get; }" />
|
||||
<MemberType>Property</MemberType>
|
||||
<ReturnValue><ReturnType>GLib.GType</ReturnType></ReturnValue>
|
||||
<Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs>
|
||||
<AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="HasPadCreated">
|
||||
<MemberSignature Language="C#" Value="public event Gst.HasPadCreatedHandler HasPadCreated;" />
|
||||
<MemberType>Event</MemberType>
|
||||
<Attributes><Attribute><AttributeName>GLib.Signal("pad-created")</AttributeName></Attribute></Attributes>
|
||||
<ReturnValue><ReturnType>Gst.HasPadCreatedHandler</ReturnType></ReturnValue>
|
||||
<Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs>
|
||||
<AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="NameTemplate"><MemberSignature Language="C#" Value="public string NameTemplate { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.Property("name-template")</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.String</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="OnHasPadCreated">
|
||||
<MemberSignature Language="C#" Value="protected virtual void OnHasPadCreated (Gst.Pad pad);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue>
|
||||
<Parameters><Parameter Name="pad" Type="Gst.Pad" /></Parameters>
|
||||
<Docs><param name="pad">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs>
|
||||
<AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.DefaultSignalHandler(Type=typeof(Gst.PadTemplate), ConnectionMethod="OverrideHasPadCreated")</AttributeName></Attribute></Attributes></Member><Member MemberName="PadCreated">
|
||||
<MemberSignature Language="C#" Value="public void PadCreated (Gst.Pad pad);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue>
|
||||
<Parameters><Parameter Name="pad" Type="Gst.Pad" /></Parameters>
|
||||
<Docs><param name="pad">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs>
|
||||
<AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Presence"><MemberSignature Language="C#" Value="public Gst.PadPresence Presence { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.Property("presence")</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>Gst.PadPresence</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member></Members>
|
||||
<AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="NameTemplate"><MemberSignature Language="C#" Value="public string NameTemplate { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.Property("name-template")</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.String</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="OnPadCreated"><MemberSignature Language="C#" Value="protected virtual void OnPadCreated (Gst.Pad pad);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.DefaultSignalHandler(Type=typeof(Gst.PadTemplate), ConnectionMethod="OverridePadCreated")</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="pad" Type="Gst.Pad" /></Parameters><Docs><param name="pad">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="PadCreated"><MemberSignature Language="C#" Value="public event Gst.PadCreatedHandler PadCreated;" /><MemberType>Event</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.Signal("pad-created")</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>Gst.PadCreatedHandler</ReturnType></ReturnValue><Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Presence"><MemberSignature Language="C#" Value="public Gst.PadPresence Presence { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Attributes><Attribute><AttributeName>GLib.Property("presence")</AttributeName></Attribute></Attributes><ReturnValue><ReturnType>Gst.PadPresence</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member></Members>
|
||||
</Type>
|
||||
|
|
|
@ -69,8 +69,6 @@
|
|||
<Type Name="Fraction" Kind="Structure" />
|
||||
<Type Name="FractionRange" Kind="Structure" />
|
||||
<Type Name="GhostPad" Kind="Class" />
|
||||
<Type Name="HasPadCreatedArgs" Kind="Class" />
|
||||
<Type Name="HasPadCreatedHandler" Kind="Delegate" />
|
||||
<Type Name="HaveDataArgs" Kind="Class" />
|
||||
<Type Name="HaveDataHandler" Kind="Delegate" />
|
||||
<Type Name="HaveTypeArgs" Kind="Class" />
|
||||
|
@ -113,6 +111,8 @@
|
|||
<Type Name="PadBufferAllocFunction" Kind="Delegate" />
|
||||
<Type Name="PadChainFunction" Kind="Delegate" />
|
||||
<Type Name="PadCheckGetRangeFunction" Kind="Delegate" />
|
||||
<Type Name="PadCreatedArgs" Kind="Class" />
|
||||
<Type Name="PadCreatedHandler" Kind="Delegate" />
|
||||
<Type Name="PadDirection" Kind="Enumeration" />
|
||||
<Type Name="PadDispatcherFunction" Kind="Delegate" />
|
||||
<Type Name="PadEventFunction" Kind="Delegate" />
|
||||
|
|
|
@ -275,7 +275,9 @@
|
|||
<attr path="/api/namespace/enum[@name='PadFlags']/member[@cname='GST_PAD_BLOCKING']" name="value">ObjectFlags.Last << 4</attr>
|
||||
<attr path="/api/namespace/enum[@name='PadFlags']/member[@cname='GST_PAD_FLAG_LAST']" name="value">ObjectFlags.Last << 8</attr>
|
||||
|
||||
<attr path="/api/namespace/object[@name='PadTemplate']/signal[@name='PadCreated']" name="name">HasPadCreated</attr>
|
||||
<attr path="/api/namespace/object[@name='PadTemplate']/constructor[@cname='gst_pad_template_new']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@name='PadTemplate']" name="disable_void_ctor">1</attr>
|
||||
<attr path="/api/namespace/object[@name='PadTemplate']/method[@cname='gst_pad_template_pad_created']" name="name">EmitPadCreated</attr>
|
||||
|
||||
<attr path="/api/namespace/enum[@name='PadTemplateFlags']/member[@cname='GST_PAD_TEMPLATE_FLAG_LAST']" name="name">Last</attr>
|
||||
<attr path="/api/namespace/enum[@name='PadTemplateFlags']/member[@cname='GST_PAD_TEMPLATE_FIXED']" name="value">ObjectFlags.Last << 0</attr>
|
||||
|
|
|
@ -63,6 +63,7 @@ customs = \
|
|||
Pad.custom \
|
||||
Parse.custom \
|
||||
Object.custom \
|
||||
PadTemplate.custom \
|
||||
MiniObject.custom \
|
||||
Registry.custom \
|
||||
Structure.custom
|
||||
|
|
32
gstreamer-sharp/PadTemplate.custom
Normal file
32
gstreamer-sharp/PadTemplate.custom
Normal file
|
@ -0,0 +1,32 @@
|
|||
[DllImport("gstreamer-0.10.dll")]
|
||||
static extern IntPtr gst_pad_template_new(IntPtr name_template, int direction, int presence, IntPtr caps);
|
||||
|
||||
[DllImport("gstreamer-0.10.dll")]
|
||||
static extern IntPtr gst_caps_ref (IntPtr handle);
|
||||
|
||||
public PadTemplate (string name_template, Gst.PadDirection direction, Gst.PadPresence presence, Gst.Caps caps) : base (IntPtr.Zero)
|
||||
{
|
||||
if (GetType () != typeof (PadTemplate)) {
|
||||
ArrayList vals = new ArrayList();
|
||||
ArrayList names = new ArrayList();
|
||||
names.Add ("name_template");
|
||||
vals.Add (new GLib.Value (name_template));
|
||||
names.Add ("direction");
|
||||
vals.Add (new GLib.Value (direction));
|
||||
names.Add ("presence");
|
||||
vals.Add (new GLib.Value (presence));
|
||||
if (caps != null) {
|
||||
names.Add ("caps");
|
||||
vals.Add (new GLib.Value (caps));
|
||||
}
|
||||
CreateNativeObject ((string[])names.ToArray (typeof (string)), (GLib.Value[])vals.ToArray (typeof (GLib.Value)));
|
||||
return;
|
||||
}
|
||||
IntPtr native_name_template = GLib.Marshaller.StringToPtrGStrdup (name_template);
|
||||
if (caps != null)
|
||||
gst_caps_ref (caps.Handle);
|
||||
|
||||
Raw = gst_pad_template_new(native_name_template, (int) direction, (int) presence, caps == null ? IntPtr.Zero : caps.Handle);
|
||||
GLib.Marshaller.Free (native_name_template);
|
||||
}
|
||||
|
Loading…
Reference in a new issue