Drop StaticCaps bindings and let the StaticPadTemplate bindings be autogenerated

Also fix some reference ownership issues in the StaticPadTemplate bindings
and make them a read-only container without any way to create new instances.

We don't need StaticCaps anywhere and StaticPadTemplates only for reading
the static pad templates of an element factory.
This commit is contained in:
Sebastian Dröge 2009-04-15 13:26:54 +02:00
parent 65b728234f
commit b24a603570
10 changed files with 7 additions and 184 deletions

View file

@ -1,33 +0,0 @@
<Type Name="StaticCaps" FullName="Gst.StaticCaps">
<TypeSignature Language="C#" Value="public class StaticCaps : GLib.Opaque" />
<AssemblyInfo>
<AssemblyName>gstreamer-sharp</AssemblyName>
<AssemblyVersion>0.9.5.99</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>GLib.Opaque</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
<Member MemberName=".ctor"><MemberSignature Language="C#" Value="public StaticCaps (Gst.Caps caps);" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="caps" Type="Gst.Caps" /></Parameters><Docs><param name="caps">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public StaticCaps (IntPtr raw);" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="raw" Type="System.IntPtr" /></Parameters><Docs><param name="raw">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public StaticCaps (string caps);" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="caps" Type="System.String" /></Parameters><Docs><param name="caps">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Any"><MemberSignature Language="C#" Value="public static Gst.StaticCaps Any { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>Gst.StaticCaps</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="Caps">
<MemberSignature Language="C#" Value="public Gst.Caps Caps { get; }" />
<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></Member><Member MemberName="Empty"><MemberSignature Language="C#" Value="public static Gst.StaticCaps Empty { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>Gst.StaticCaps</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><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="String"><MemberSignature Language="C#" Value="public string String { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.String</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member>
</Members>
</Type>

View file

@ -17,7 +17,7 @@
<Member MemberName=".ctor"><MemberSignature Language="C#" Value="public StaticPadTemplate (IntPtr raw);" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="raw" Type="System.IntPtr" /></Parameters><Docs><param name="raw">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public StaticPadTemplate (string name_template, Gst.PadDirection direction, Gst.PadPresence presence, Gst.Caps caps);" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="name_template" Type="System.String" /><Parameter Name="direction" Type="Gst.PadDirection" /><Parameter Name="presence" Type="Gst.PadPresence" /><Parameter Name="caps" Type="Gst.Caps" /></Parameters><Docs><param name="name_template">To be added.</param><param name="direction">To be added.</param><param name="presence">To be added.</param><param name="caps">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Caps">
<Member MemberName=".ctor"><MemberSignature Language="C#" Value="public StaticPadTemplate (IntPtr raw);" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="raw" Type="System.IntPtr" /></Parameters><Docs><param name="raw">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Caps">
<MemberSignature Language="C#" Value="public Gst.Caps Caps { get; }" />
<MemberType>Property</MemberType>
<ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue>

View file

@ -167,7 +167,6 @@
<Type Name="State" Kind="Enumeration" />
<Type Name="StateChange" Kind="Enumeration" />
<Type Name="StateChangeReturn" Kind="Enumeration" />
<Type Name="StaticCaps" Kind="Class" />
<Type Name="StaticPadTemplate" Kind="Class" />
<Type Name="Structure" Kind="Class" />
<Type Name="StructureChangeType" Kind="Enumeration" />

View file

@ -356,15 +356,16 @@
<attr path="/api/namespace/enum[@name='StateChange']/member[@cname='GST_STATE_CHANGE_PAUSED_TO_READY']" name="value">(State.Paused &lt;&lt; 3) | State.Ready</attr>
<attr path="/api/namespace/enum[@name='StateChange']/member[@cname='GST_STATE_CHANGE_READY_TO_NULL']" name="value">(State.Ready &lt;&lt; 3) | State.Null</attr>
<change-node-type path="/api/namespace/struct[@name='StaticCaps']">boxed</change-node-type>
<attr path="/api/namespace/boxed[@name='StaticCaps']" name="opaque">true</attr>
<attr path="/api/namespace/boxed[@name='StaticCaps']/method[@cname='gst_static_caps_get']" name="name">GetCaps</attr>
<attr path="/api/namespace/boxed[@name='StaticCaps']/method[@cname='gst_static_caps_get']/return-type" name="owned">true</attr>
<attr path="/api/namespace/struct[@name='StaticCaps']" name="hidden">1</attr>
<change-node-type path="/api/namespace/struct[@name='StaticPadTemplate']">boxed</change-node-type>
<attr path="/api/namespace/boxed[@name='StaticPadTemplate']" name="opaque">true</attr>
<attr path="/api/namespace/boxed[@name='StaticPadTemplate']/method[@cname='gst_static_pad_template_get']" name="name">GetPadTemplate</attr>
<attr path="/api/namespace/boxed[@name='StaticPadTemplate']/method[@cname='gst_static_pad_template_get']" name="owned">true</attr>
<attr path="/api/namespace/boxed[@name='StaticPadTemplate']/method[@cname='gst_static_pad_template_get']/return-type" name="owned">true</attr>
<attr path="/api/namespace/boxed[@name='StaticPadTemplate']/method[@cname='gst_static_pad_template_get_caps']/return-type" name="owned">true</attr>
<attr path="/api/namespace/boxed[@name='StaticPadTemplate']/field[@name='Direction']" name="access">public</attr>
<attr path="/api/namespace/boxed[@name='StaticPadTemplate']/field[@name='Presence']" name="access">public</attr>
<attr path="/api/namespace/boxed[@name='StaticPadTemplate']/field[@name='NameTemplate']" name="access">public</attr>
<attr path="/api/namespace/boxed[@name='Structure']" name="opaque">true</attr>
<attr path="/api/namespace/boxed[@name='Structure']/field[@name='ParentRefcount']" name="hidden">1</attr>

View file

@ -65,8 +65,6 @@ customs = \
Object.custom \
MiniObject.custom \
Registry.custom \
StaticCaps.custom \
StaticPadTemplate.custom \
Structure.custom

View file

@ -1,48 +0,0 @@
[DllImport ("gstreamersharpglue-0.10") ]
static extern IntPtr gstsharp_gst_static_caps_get_string (IntPtr caps);
public string String {
get {
IntPtr raw_ptr = gstsharp_gst_static_caps_get_string (Handle);
if (raw_ptr == IntPtr.Zero)
return null;
return GLib.Marshaller.Utf8PtrToString (raw_ptr);
}
}
protected override void Free (IntPtr raw) {
GLib.Marshaller.Free (raw);
}
[DllImport ("gstreamersharpglue-0.10") ]
static extern IntPtr gstsharp_gst_static_caps_new (string caps);
public StaticCaps (Caps caps) {
Raw = gstsharp_gst_static_caps_new (caps.ToString ());
}
public StaticCaps (string caps) {
Raw = gstsharp_gst_static_caps_new (caps.ToString ());
}
private static StaticCaps empty = new StaticCaps ("EMPTY");
private static StaticCaps any = new StaticCaps ("ANY");
public static StaticCaps Empty {
get {
return empty;
}
}
public static StaticCaps Any {
get {
return any;
}
}
public override string ToString () {
return String;
}

View file

@ -1,40 +0,0 @@
[DllImport ("gstreamersharpglue-0.10") ]
static extern IntPtr gstsharp_gst_static_pad_template_get_name_template (IntPtr handle);
public string NameTemplate {
get {
IntPtr raw_ret = gstsharp_gst_static_pad_template_get_name_template (Handle);
if (raw_ret == IntPtr.Zero)
return null;
return GLib.Marshaller.Utf8PtrToString (raw_ret);
}
}
[DllImport ("gstreamersharpglue-0.10") ]
static extern Gst.PadDirection gstsharp_gst_static_pad_template_get_pad_direction (IntPtr handle);
public Gst.PadDirection Direction {
get {
return gstsharp_gst_static_pad_template_get_pad_direction (Handle);
}
}
[DllImport ("gstreamersharpglue-0.10") ]
static extern Gst.PadPresence gstsharp_gst_static_pad_template_get_pad_presence (IntPtr handle);
public Gst.PadPresence Presence {
get {
return gstsharp_gst_static_pad_template_get_pad_presence (Handle);
}
}
[DllImport ("gstreamersharpglue-0.10") ]
static extern IntPtr gstsharp_gst_static_pad_template_new (string name_template, Gst.PadDirection direction, Gst.PadPresence presence, string caps);
public StaticPadTemplate (string name_template, Gst.PadDirection direction, Gst.PadPresence presence, Gst.Caps caps) {
Raw = gstsharp_gst_static_pad_template_new (name_template, direction, presence, caps.ToString ());
}
protected override void Free (IntPtr raw) {
GLib.Marshaller.Free (raw);
}

View file

@ -7,8 +7,6 @@ libgstreamersharpglue_0_10_la_SOURCES = \
message.c \
bin.c \
structure.c \
staticcaps.c \
staticpadtemplate.c \
gerror.c \
gobject.c

View file

@ -1,17 +0,0 @@
#include <gst/gst.h>
const gchar *
gstsharp_gst_static_caps_get_string (const GstStaticCaps * caps)
{
return caps->string;
}
GstStaticCaps *
gstsharp_gst_static_caps_new (const gchar * string)
{
GstStaticCaps *caps = g_new0 (GstStaticCaps, 1);
caps->string = g_strdup (string);
return caps;
}

View file

@ -1,35 +0,0 @@
#include <gst/gst.h>
const gchar *
gstsharp_gst_static_pad_template_get_name_template (const GstStaticPadTemplate *
templ)
{
return templ->name_template;
}
GstPadDirection
gstsharp_gst_static_pad_template_get_direction (const GstStaticPadTemplate *
templ)
{
return templ->direction;
}
GstPadPresence
gstsharp_gst_static_pad_template_get_presence (const GstStaticPadTemplate *
templ)
{
return templ->presence;
}
GstStaticPadTemplate *
gstsharp_gst_static_pad_template_new (const gchar * name_template,
GstPadDirection direction, GstPadPresence presence, const gchar * caps)
{
GstStaticPadTemplate *ret = g_new0 (GstStaticPadTemplate, 1);
ret->name_template = g_strdup (name_template);
ret->direction = direction;
ret->presence = presence;
ret->static_caps.string = g_strdup (caps);
return ret;
}