Fix/complete the Caps bindings
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 14 Apr 2009 11:31:06 +0000 (13:31 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 14 Apr 2009 11:31:06 +0000 (13:31 +0200)
Also make sure in Gst.Structure that we're having a mutable structure
before changing any content.

12 files changed:
doc/en/Gst/Caps.xml
doc/en/Gst/CapsFlags.xml [deleted file]
doc/en/Gst/Structure.xml
doc/en/index.xml
gstreamer-sharp/Caps.custom
gstreamer-sharp/DynamicSignal.cs
gstreamer-sharp/Gstreamer.metadata
gstreamer-sharp/Structure.custom
gstreamer-sharp/glue/Makefile.am
gstreamer-sharp/glue/caps.c [new file with mode: 0644]
gstreamer-sharp/glue/gobject.c
gstreamer-sharp/glue/structure.c [new file with mode: 0644]

index 3966e57e4a83efa8c67305a2241caeee86a02e9b..633a462f0cab995186c75aab7ae0c1c8c7efb957 100644 (file)
@@ -1,5 +1,5 @@
 <Type Name="Caps" FullName="Gst.Caps">
-  <TypeSignature Language="C#" Value="public class Caps : GLib.Opaque" />
+  <TypeSignature Language="C#" Value="public class Caps : GLib.Opaque, System.Collections.IEnumerable" />
   <AssemblyInfo>
     <AssemblyName>gstreamer-sharp</AssemblyName>
     <AssemblyVersion>0.9.5.99</AssemblyVersion>
@@ -7,7 +7,11 @@
   <Base>
     <BaseTypeName>GLib.Opaque</BaseTypeName>
   </Base>
-  <Interfaces />
+  <Interfaces>
+    <Interface>
+      <InterfaceName>System.Collections.IEnumerable</InterfaceName>
+    </Interface>
+  </Interfaces>
   <Docs>
     <summary>To be added.</summary>
     <remarks>To be added.</remarks>
       <MemberType>Constructor</MemberType>
       <Parameters />
       <Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName=".ctor">
+    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public Caps (Gst.Structure s);" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="s" Type="Gst.Structure" /></Parameters><Docs><param name="s">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public Caps (Gst.Structure[] s);" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="s" Type="Gst.Structure[]" /></Parameters><Docs><param name="s">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName=".ctor">
       <MemberSignature Language="C#" Value="public Caps (IntPtr raw);" />
       <MemberType>Constructor</MemberType>
       <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>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName=".ctor">
-      <MemberSignature Language="C#" Value="public Caps (Gst.Structure structure, IntPtr var_args);" />
-      <MemberType>Constructor</MemberType>
-      <Parameters><Parameter Name="structure" Type="Gst.Structure" /><Parameter Name="var_args" Type="System.IntPtr" /></Parameters>
-      <Docs><param name="structure">To be added.</param><param name="var_args">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="Append">
-      <MemberSignature Language="C#" Value="public void Append (Gst.Caps caps2);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="caps2" Type="Gst.Caps" /></Parameters>
-      <Docs><param name="caps2">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="AppendStructure">
-      <MemberSignature Language="C#" Value="public void AppendStructure (Gst.Structure structure);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="structure" Type="Gst.Structure" /></Parameters>
-      <Docs><param name="structure">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="Copy">
+    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Append"><MemberSignature Language="C#" Value="public void Append (Gst.Caps caps);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><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="Append"><MemberSignature Language="C#" Value="public void Append (Gst.Structure s);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="s" Type="Gst.Structure" /></Parameters><Docs><param name="s">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Copy">
       <MemberSignature Language="C#" Value="public Gst.Caps Copy ();" />
       <MemberType>Method</MemberType>
       <ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue>
       <ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue>
       <Parameters><Parameter Name="nth" Type="System.UInt32" /></Parameters>
       <Docs><param name="nth">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="DoSimplify">
-      <MemberSignature Language="C#" Value="public bool DoSimplify ();" />
-      <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue>
-      <Parameters />
-      <Docs><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Flags">
-      <MemberSignature Language="C#" Value="public Gst.CapsFlags Flags { set; get; }" />
-      <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>Gst.CapsFlags</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="FromString">
-      <MemberSignature Language="C#" Value="public static Gst.Caps FromString (string str1ng);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="str1ng" Type="System.String" /></Parameters>
-      <Docs><param name="str1ng">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="GetStructure">
-      <MemberSignature Language="C#" Value="public Gst.Structure GetStructure (uint index);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>Gst.Structure</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="index" Type="System.UInt32" /></Parameters>
-      <Docs><param name="index">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="GType">
+    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="DoSimplify"><MemberSignature Language="C#" Value="public bool DoSimplify ();" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Parameters /><Docs><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs></Member><Member MemberName="GetEnumerator"><MemberSignature Language="C#" Value="public System.Collections.IEnumerator GetEnumerator ();" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Collections.IEnumerator</ReturnType></ReturnValue><Parameters /><Docs><summary>To be added.</summary><returns>To be added.</returns><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>
       <ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue>
       <Parameters><Parameter Name="superset" Type="Gst.Caps" /></Parameters>
       <Docs><param name="superset">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="MakeWritable">
-      <MemberSignature Language="C#" Value="public Gst.Caps MakeWritable ();" />
-      <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue>
-      <Parameters />
-      <Docs><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Merge"><MemberSignature Language="C#" Value="public void Merge (Gst.Caps caps2);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="caps2" Type="Gst.Caps" /></Parameters><Docs><param name="caps2">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="MergeStructure"><MemberSignature Language="C#" Value="public void MergeStructure (Gst.Structure structure);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="structure" Type="Gst.Structure" /></Parameters><Docs><param name="structure">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="NewEmpty">
+    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="IsWritable"><MemberSignature Language="C#" Value="public bool IsWritable { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="Item"><MemberSignature Language="C#" Value="public Gst.Structure this[uint index] { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>Gst.Structure</ReturnType></ReturnValue><Parameters><Parameter Name="index" Type="System.UInt32" /></Parameters><Docs><param name="index">To be added.</param><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="MakeWritable"><MemberSignature Language="C#" Value="public void MakeWritable ();" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Merge"><MemberSignature Language="C#" Value="public void Merge (Gst.Caps caps);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><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="Merge"><MemberSignature Language="C#" Value="public void Merge (Gst.Structure s);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="s" Type="Gst.Structure" /></Parameters><Docs><param name="s">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="NewAny"><MemberSignature Language="C#" Value="public static Gst.Caps NewAny ();" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue><Parameters /><Docs><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs></Member><Member MemberName="NewEmpty">
       <MemberSignature Language="C#" Value="public static Gst.Caps NewEmpty ();" />
       <MemberType>Method</MemberType>
       <ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue>
       <Parameters />
       <Docs><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Normalize">
+    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="NewFromString"><MemberSignature Language="C#" Value="public static Gst.Caps NewFromString (string str1ng);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue><Parameters><Parameter Name="str1ng" Type="System.String" /></Parameters><Docs><param name="str1ng">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs></Member><Member MemberName="Normalize">
       <MemberSignature Language="C#" Value="public Gst.Caps Normalize ();" />
       <MemberType>Method</MemberType>
       <ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue>
       <Parameters />
       <Docs><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Refcount">
-      <MemberSignature Language="C#" Value="public int Refcount { set; get; }" />
-      <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.Int32</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="RemoveStructure"><MemberSignature Language="C#" Value="public void RemoveStructure (uint idx);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="idx" Type="System.UInt32" /></Parameters><Docs><param name="idx">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Replace">
-      <MemberSignature Language="C#" Value="public void Replace (Gst.Caps newcaps);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="newcaps" Type="Gst.Caps" /></Parameters>
-      <Docs><param name="newcaps">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="SetSimpleValist">
-      <MemberSignature Language="C#" Value="public void SetSimpleValist (string field, IntPtr varargs);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="field" Type="System.String" /><Parameter Name="varargs" Type="System.IntPtr" /></Parameters>
-      <Docs><param name="field">To be added.</param><param name="varargs">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="Size">
+    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="RemoveStructure"><MemberSignature Language="C#" Value="public void RemoveStructure (uint index);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="index" Type="System.UInt32" /></Parameters><Docs><param name="index">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Size">
       <MemberSignature Language="C#" Value="public uint Size { get; }" />
       <MemberType>Property</MemberType>
       <ReturnValue><ReturnType>System.UInt32</ReturnType></ReturnValue>
       <ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue>
       <Parameters><Parameter Name="subtrahend" Type="Gst.Caps" /></Parameters>
       <Docs><param name="subtrahend">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Truncate">
-      <MemberSignature Language="C#" Value="public void Truncate ();" />
-      <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue>
-      <Parameters />
-      <Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Type">
-      <MemberSignature Language="C#" Value="public GLib.GType Type { set; 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="Union">
+    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Truncate"><MemberSignature Language="C#" Value="public void Truncate ();" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Union">
       <MemberSignature Language="C#" Value="public Gst.Caps Union (Gst.Caps caps2);" />
       <MemberType>Method</MemberType>
       <ReturnValue><ReturnType>Gst.Caps</ReturnType></ReturnValue>
     
     
   </Members>
+  <Attributes>
+    <Attribute>
+      <AttributeName>System.Reflection.DefaultMember("Item")</AttributeName>
+    </Attribute>
+  </Attributes>
 </Type>
diff --git a/doc/en/Gst/CapsFlags.xml b/doc/en/Gst/CapsFlags.xml
deleted file mode 100644 (file)
index 8363959..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<Type Name="CapsFlags" FullName="Gst.CapsFlags">
-  <TypeSignature Language="C#" Value="public enum CapsFlags" />
-  <AssemblyInfo>
-    <AssemblyName>gstreamer-sharp</AssemblyName>
-    <AssemblyVersion>0.9.5.99</AssemblyVersion>
-  </AssemblyInfo>
-  <Base>
-    <BaseTypeName>System.Enum</BaseTypeName>
-  </Base>
-  <Attributes>
-    <Attribute>
-      <AttributeName>System.Flags</AttributeName>
-    </Attribute>
-  </Attributes>
-  <Docs>
-    <summary>To be added.</summary>
-    <remarks>To be added.</remarks>
-  </Docs>
-  <Members>
-    <Member MemberName="Any">
-      <MemberSignature Language="C#" Value="Any" />
-      <MemberType>Field</MemberType>
-      <ReturnValue><ReturnType>Gst.CapsFlags</ReturnType></ReturnValue>
-      <Docs><summary>To be added.</summary></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member>
-  </Members>
-</Type>
index 0218827661e32c99ad8888a818acc72963299893..0ea00942e1a2e6e2353cb1fd655af39d4a40cf42 100644 (file)
@@ -74,7 +74,7 @@
       <ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue>
       <Parameters><Parameter Name="field_name" Type="System.String" /><Parameter Name="target" Type="System.Double" /></Parameters>
       <Docs><param name="field_name">To be added.</param><param name="target">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="FixateFieldNearestFraction">
+    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="FixateFieldNearestFraction"><MemberSignature Language="C#" Value="public bool FixateFieldNearestFraction (string field_name, Gst.Fraction target);" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Parameters><Parameter Name="field_name" Type="System.String" /><Parameter Name="target" Type="Gst.Fraction" /></Parameters><Docs><param name="field_name">To be added.</param><param name="target">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs></Member><Member MemberName="FixateFieldNearestFraction">
       <MemberSignature Language="C#" Value="public bool FixateFieldNearestFraction (string field_name, int target_numerator, int target_denominator);" />
       <MemberType>Method</MemberType>
       <ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue>
@@ -97,7 +97,7 @@
       <ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue>
       <Parameters><Parameter Name="fieldname" Type="System.String" /><Parameter Name="type" Type="GLib.GType" /></Parameters>
       <Docs><param name="fieldname">To be added.</param><param name="type">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
-    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Item"><MemberSignature Language="C#" Value="public object this[string field] { set; get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Object</ReturnType></ReturnValue><Parameters><Parameter Name="field" Type="System.String" /></Parameters><Docs><param name="field">To be added.</param><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="Name">
+    <AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo></Member><Member MemberName="IsMutable"><MemberSignature Language="C#" Value="public bool IsMutable { get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="Item"><MemberSignature Language="C#" Value="public object this[string field] { set; get; }" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>0.9.5.99</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Object</ReturnType></ReturnValue><Parameters><Parameter Name="field" Type="System.String" /></Parameters><Docs><param name="field">To be added.</param><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="Name">
       <MemberSignature Language="C#" Value="public string Name { set; get; }" />
       <MemberType>Property</MemberType>
       <ReturnValue><ReturnType>System.String</ReturnType></ReturnValue>
index a3c00dda1fa25d98e7aeda39c81e01404f97fa81..e0ec1cf0be22997280cdf5b36aa0618c9cf86252 100644 (file)
@@ -23,7 +23,6 @@
       <Type Name="BusSyncHandler" Kind="Delegate" />
       <Type Name="BusSyncReply" Kind="Enumeration" />
       <Type Name="Caps" Kind="Class" />
-      <Type Name="CapsFlags" Kind="Enumeration" />
       <Type Name="ChildAddedArgs" Kind="Class" />
       <Type Name="ChildAddedHandler" Kind="Delegate" />
       <Type Name="ChildProxy" Kind="Interface" />
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f2e2e69cf2f99a34a58d4ce97dd3866f266d8a10 100644 (file)
@@ -0,0 +1,164 @@
+public static Gst.Caps NewEmpty () {
+  return new Gst.Caps ();
+}
+
+public Caps (Structure s) : this () {
+  Append (s);
+}
+
+public Caps (Structure[] s) : this () {
+  foreach (Structure o in s)
+    Append (o);
+}
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_caps_get_refcount_offset ();
+
+static uint refcount_offset = gstsharp_gst_caps_get_refcount_offset ();
+private int Refcount {
+  get {
+    unsafe {
+      int* raw_ptr = (int*) ( ( (byte*) Handle) + refcount_offset);
+      return (*raw_ptr);
+    }
+  }
+}
+
+public bool IsWritable {
+  get {
+    return (Refcount == 1);
+  }
+}
+
+/* FIXME: This is not optimal! */
+public void MakeWritable() {
+  if (IsWritable)
+    return;
+
+  IntPtr copy = gst_caps_copy (Raw);
+  Raw = copy;
+  /* ^--- Takes a second ref, not good */
+  Unref (Raw);
+  /* ^--- Sets Owned = false, wrong! */
+  Owned = true;
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+private static extern IntPtr gst_caps_get_structure (IntPtr handle, uint index);
+
+public Structure this [uint index] {
+  get {
+    if (index >= Size)
+      throw new ArgumentOutOfRangeException ();
+
+    IntPtr raw_ptr = gst_caps_get_structure (Handle, (uint) index);
+
+    return (Gst.Structure) new Gst.Structure (raw_ptr);
+  }
+}
+
+private class StructureEnumerator : IEnumerator {
+  Gst.Caps caps;
+  long index;
+
+  public StructureEnumerator (Gst.Caps caps) {
+    this.caps = caps;
+    index = -1;
+  }
+
+  public object Current {
+    get {
+      if (index >= caps.Size)
+        throw new ArgumentOutOfRangeException ();
+      if (index == -1)
+        throw new ArgumentException ();
+
+      return caps[ (uint) index];
+    }
+  }
+
+  public bool MoveNext () {
+    index += 1;
+    return (index < caps.Size);
+  }
+
+  public void Reset () {
+    index = -1;
+  }
+}
+
+public IEnumerator GetEnumerator() {
+  return new StructureEnumerator (this);
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_caps_append_structure (IntPtr caps, IntPtr structure);
+
+public void Append (Structure s) {
+  if (!IsWritable)
+    throw new ApplicationException ();
+
+  gst_caps_append_structure (Handle, s.Copy().Handle);
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_caps_append (IntPtr caps, IntPtr caps2);
+
+public void Append (Caps caps) {
+  if (!IsWritable)
+    throw new ApplicationException ();
+
+  gst_caps_append (Handle, caps.Copy().Handle);
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_caps_merge_structure (IntPtr caps, IntPtr structure);
+
+public void Merge (Structure s) {
+  if (!IsWritable)
+    throw new ApplicationException ();
+
+  gst_caps_merge_structure (Handle, s.Copy().Handle);
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_caps_merge (IntPtr caps, IntPtr caps2);
+
+public void Merge (Caps caps) {
+  if (!IsWritable)
+    throw new ApplicationException ();
+
+  gst_caps_merge (Handle, caps.Copy().Handle);
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_caps_remove_structure (IntPtr caps, uint index);
+
+public void RemoveStructure (uint index) {
+  if (!IsWritable)
+    throw new ApplicationException ();
+  if (index >= Size)
+    throw new ArgumentOutOfRangeException ();
+
+  gst_caps_remove_structure (Handle, index);
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern bool gst_caps_do_simplify (IntPtr caps);
+
+public bool DoSimplify () {
+  if (!IsWritable)
+    throw new ApplicationException ();
+
+  return gst_caps_do_simplify (Handle);
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_caps_truncate (IntPtr caps);
+
+public void Truncate () {
+  if (!IsWritable)
+    throw new ApplicationException ();
+
+  gst_caps_truncate (Handle);
+}
index eb83a728e91d4f6fe4bcd0e96843ad9839df5e34..9d2718ee17168ac7812a28239aa83659283c3ccc 100644 (file)
@@ -130,9 +130,6 @@ namespace Gst {
       }
     }
 
-    [DllImport ("libgobject-2.0-0.dll") ]
-    static extern IntPtr g_value_peek_pointer (IntPtr ptr);
-
     static void OnMarshal (IntPtr closure, ref GLib.Value retval, uint argc, IntPtr argsPtr,
                            IntPtr ihint, IntPtr data) {
       object [] args = new object[argc - 1];
index 541cc082a285e01cb17c8b42dc67b5087c9a8e16..4eb766a8ad6a480cff9446fa9739557d7cd57516 100644 (file)
@@ -1,18 +1,5 @@
 <?xml version="1.0"?>
 <metadata>
-  <attr path="/api/namespace/boxed[@name='Caps']/method[@name='FromString']/return-type" name="owned">true</attr>
-
-  <attr path="/api/namespace/interface[@name='ChildProxy']/method[@name='ChildAdded']" name="name">EmitChildAdded</attr>
-  <attr path="/api/namespace/interface[@name='ChildProxy']/method[@name='ChildRemoved']" name="name">EmitChildRemoved</attr>
-
-  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC']" name="value">MiniObjectFlags.Last &lt;&lt; 0</attr>
-  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC']" name="value">MiniObjectFlags.Last &lt;&lt; 1</attr>
-  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC']" name="value">MiniObjectFlags.Last &lt;&lt; 2</attr>
-  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC']" name="value">MiniObjectFlags.Last &lt;&lt; 3</attr>
-  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_SET_RESOLUTION']" name="value">MiniObjectFlags.Last &lt;&lt; 4</attr>
-  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_SET_MASTER']" name="value">MiniObjectFlags.Last &lt;&lt; 5</attr>
-  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_LAST']" name="value">MiniObjectFlags.Last &lt;&lt; 8</attr>
-
   <attr path="/api/namespace/object[@name='Bin']" name="disable_gtype_ctor">1</attr>
   <attr path="/api/namespace/object[@name='Bin']/method[@name='AddMany']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@name='Bin']/method[@name='RemoveMany']" name="hidden">1</attr>
   <attr path="/api/namespace/enum[@name='BusFlags']/member[@cname='GST_BUS_FLUSHING']" name="value">MiniObjectFlags.Last &lt;&lt; 0</attr>
   <attr path="/api/namespace/enum[@name='BusFlags']/member[@cname='GST_BUS_FLAG_LAST']" name="value">MiniObjectFlags.Last &lt;&lt; 1</attr>
 
+  <add-node path="/api/namespace/boxed[@name='Caps']">
+    <implements>
+      <interface name="IEnumerable" />
+    </implements>
+  </add-node>
+  <attr path="/api/namespace/boxed[@name='Caps']/field[@name='Refcount']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/field[@name='Type']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/field[@name='Flags']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_from_string']/return-type" name="owned">true</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_from_string']" name="name">NewFromString</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_copy_nth']/return-type" name="owned">true</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_replace']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_make_writable']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_truncate']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_do_simplify']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_set_simple_valist']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_set_simple']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_get_structure']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_merge_structure']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_remove_structure']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_append_structure']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_append']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_merge']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_intersect']/return-type" name="owned">true</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_union']/return-type" name="owned">true</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_normalize']/return-type" name="owned">true</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_subtract']/return-type" name="owned">true</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/constructor[@cname='gst_caps_new_full_valist']" name="hidden">1</attr>
+  <change-node-type path="/api/namespace/boxed[@name='Caps']/constructor[@cname='gst_caps_new_any']">method</change-node-type>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_new_any']" name="name">NewAny</attr>
+  <attr path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_new_any']" name="shared">true</attr>
+  <add-node path="/api/namespace/boxed[@name='Caps']/method[@cname='gst_caps_new_any']">
+    <return-type type="GstCaps*" owned="true" />
+  </add-node>
+
+  <attr path="/api/namespace/enum[@name='CapsFlags']" name="hidden">1</attr>
+
+  <attr path="/api/namespace/interface[@name='ChildProxy']/method[@name='ChildAdded']" name="name">EmitChildAdded</attr>
+  <attr path="/api/namespace/interface[@name='ChildProxy']/method[@name='ChildRemoved']" name="name">EmitChildRemoved</attr>
+
+  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC']" name="value">MiniObjectFlags.Last &lt;&lt; 0</attr>
+  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC']" name="value">MiniObjectFlags.Last &lt;&lt; 1</attr>
+  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC']" name="value">MiniObjectFlags.Last &lt;&lt; 2</attr>
+  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC']" name="value">MiniObjectFlags.Last &lt;&lt; 3</attr>
+  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_SET_RESOLUTION']" name="value">MiniObjectFlags.Last &lt;&lt; 4</attr>
+  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_CAN_SET_MASTER']" name="value">MiniObjectFlags.Last &lt;&lt; 5</attr>
+  <attr path="/api/namespace/enum[@name='ClockFlags']/member[@cname='GST_CLOCK_FLAG_LAST']" name="value">MiniObjectFlags.Last &lt;&lt; 8</attr>
+
   <attr path="/api/namespace/object[@name='Element']/method[@name='LinkMany']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@name='Element']/method[@name='UnlinkMany']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@name='Element']/method[@cname='gst_element_add_pad']" name="hidden">1</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>
   <attr path="/api/namespace/boxed[@name='Structure']/method[@name='SetParentRefcount']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_name']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_set_name']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_set_value']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_fixate_field_boolean']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_fixate_field_boolean']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_remove_all_fields']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_remove_field']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_fixate_field_nearest_double']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_fixate_field_nearest_int']" name="hidden">1</attr>
+  <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_fixate_field_nearest_fraction']" name="hidden">1</attr>
   <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_set_valist']" name="hidden">1</attr>
   <attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_name_id']" name="hidden">1</attr>
   <change-node-type path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_empty_new']">constructor</change-node-type>
index 9ecdbd17895862ba434ed87d6bacc79e46344a17..4e1ffd0f15cd70e792df75b6a01200a661c60f63 100644 (file)
@@ -1,5 +1,120 @@
-public Structure (string name, params object[] fields) : this (name)
-{
+[DllImport ("gstreamer-0.10.dll") ]
+static extern IntPtr gst_structure_get_name (IntPtr raw);
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_structure_set_name (IntPtr raw, IntPtr name);
+
+public string Name {
+  get  {
+    IntPtr raw_ret = gst_structure_get_name (Handle);
+    string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
+    return ret;
+  }
+  set  {
+    if (!IsMutable)
+      throw new ApplicationException ();
+
+    IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
+    gst_structure_set_name (Handle, native_value);
+    GLib.Marshaller.Free (native_value);
+  }
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_structure_set_value (IntPtr raw, IntPtr fieldname, IntPtr value);
+
+public void SetValue (string fieldname, GLib.Value value) {
+  if (!IsMutable)
+    throw new ApplicationException ();
+
+  IntPtr native_fieldname = GLib.Marshaller.StringToPtrGStrdup (fieldname);
+  IntPtr native_value = GLib.Marshaller.StructureToPtrAlloc (value);
+  gst_structure_set_value (Handle, native_fieldname, native_value);
+  GLib.Marshaller.Free (native_fieldname);
+  value = (GLib.Value) Marshal.PtrToStructure (native_value, typeof (GLib.Value));
+  Marshal.FreeHGlobal (native_value);
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern bool gst_structure_fixate_field_boolean (IntPtr raw, IntPtr field_name, bool target);
+
+public bool FixateFieldBoolean (string field_name, bool target) {
+  if (!IsMutable)
+    throw new ApplicationException ();
+
+  IntPtr native_field_name = GLib.Marshaller.StringToPtrGStrdup (field_name);
+  bool raw_ret = gst_structure_fixate_field_boolean (Handle, native_field_name, target);
+  bool ret = raw_ret;
+  GLib.Marshaller.Free (native_field_name);
+  return ret;
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_structure_remove_all_fields (IntPtr raw);
+
+public void RemoveAllFields() {
+  if (!IsMutable)
+    throw new ApplicationException ();
+
+  gst_structure_remove_all_fields (Handle);
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_structure_remove_field (IntPtr raw, IntPtr fieldname);
+
+public void RemoveField (string fieldname) {
+  if (!IsMutable)
+    throw new ApplicationException ();
+
+  IntPtr native_fieldname = GLib.Marshaller.StringToPtrGStrdup (fieldname);
+  gst_structure_remove_field (Handle, native_fieldname);
+  GLib.Marshaller.Free (native_fieldname);
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern bool gst_structure_fixate_field_nearest_double (IntPtr raw, IntPtr field_name, double target);
+
+public bool FixateFieldNearestDouble (string field_name, double target) {
+  if (!IsMutable)
+    throw new ApplicationException ();
+
+  IntPtr native_field_name = GLib.Marshaller.StringToPtrGStrdup (field_name);
+  bool raw_ret = gst_structure_fixate_field_nearest_double (Handle, native_field_name, target);
+  bool ret = raw_ret;
+  GLib.Marshaller.Free (native_field_name);
+  return ret;
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern bool gst_structure_fixate_field_nearest_int (IntPtr raw, IntPtr field_name, int target);
+
+public bool FixateFieldNearestInt (string field_name, int target) {
+  if (!IsMutable)
+    throw new ApplicationException ();
+
+  IntPtr native_field_name = GLib.Marshaller.StringToPtrGStrdup (field_name);
+  bool raw_ret = gst_structure_fixate_field_nearest_int (Handle, native_field_name, target);
+  bool ret = raw_ret;
+  GLib.Marshaller.Free (native_field_name);
+  return ret;
+}
+
+[DllImport ("gstreamer-0.10.dll") ]
+static extern bool gst_structure_fixate_field_nearest_fraction (IntPtr raw, IntPtr field_name, int target_numerator, int target_denominator);
+
+public bool FixateFieldNearestFraction (string field_name, int target_numerator, int target_denominator) {
+  if (!IsMutable)
+    throw new ApplicationException ();
+
+  IntPtr native_field_name = GLib.Marshaller.StringToPtrGStrdup (field_name);
+  bool raw_ret = gst_structure_fixate_field_nearest_fraction (Handle, native_field_name, target_numerator, target_denominator);
+  bool ret = raw_ret;
+  GLib.Marshaller.Free (native_field_name);
+  return ret;
+}
+
+
+public Structure (string name, params object[] fields) : this (name) {
   Set (fields);
 }
 
@@ -34,7 +149,7 @@ public object this [string field] {
 
     v = Gst.Value.CreateValue (value);
 
-    Set (field, value);
+    Set (field, v);
   }
   get {
     if (field == null)
@@ -63,3 +178,28 @@ public static Structure NewFromString (string structure) {
 [DllImport ("gstreamer-0.10.dll") ]
 private static extern IntPtr gst_structure_from_string (string structure, IntPtr end);
 
+public bool FixateFieldNearestFraction (string field_name, Fraction target) {
+  return FixateFieldNearestFraction (field_name, target.Numerator, target.Denominator);
+}
+
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_structure_get_parent_refcount_offset ();
+
+static uint parent_refcount_offset = gstsharp_gst_structure_get_parent_refcount_offset ();
+
+public bool IsMutable {
+  get {
+    unsafe {
+      int **parent_refcount = (int **) ( ( (byte*) Handle) + parent_refcount_offset);
+
+      if (*parent_refcount == (int *) IntPtr.Zero)
+        return true;
+      if (**parent_refcount == 1)
+        return true;
+
+      return false;
+    }
+  }
+}
+
index c45e8d5551bac81e65ebabd3422573b29ccd2d02..80276a7820756b93c1dbf05c62bf41f44e861af3 100644 (file)
@@ -2,9 +2,11 @@ lib_LTLIBRARIES = libgstreamersharpglue-0.10.la
 
 libgstreamersharpglue_0_10_la_SOURCES =        \
        buffer.c        \
+       caps.c          \
        clock.c \
        message.c \
        bin.c \
+       structure.c \
        gerror.c \
        gobject.c
 
diff --git a/gstreamer-sharp/glue/caps.c b/gstreamer-sharp/glue/caps.c
new file mode 100644 (file)
index 0000000..fce67ef
--- /dev/null
@@ -0,0 +1,7 @@
+#include <gst/gst.h>
+
+guint
+gstsharp_gst_caps_get_refcount_offset (void)
+{
+  return (guint) G_STRUCT_OFFSET (GstCaps, refcount);
+}
index 8dbaafa03fbca87064a3ca1b7239d72d8cf87c25..db11d1ae5879392b11fb232c2daab21f2a1e2b24 100644 (file)
@@ -13,7 +13,7 @@ gstsharp_g_type_from_instance (GTypeInstance * instance)
 }
 
 GType
-gstsharp_g_value_type (const GValue *val) {
+gstsharp_g_value_type (const GValue * val)
+{
   return G_VALUE_TYPE (val);
 }
-
diff --git a/gstreamer-sharp/glue/structure.c b/gstreamer-sharp/glue/structure.c
new file mode 100644 (file)
index 0000000..1632a19
--- /dev/null
@@ -0,0 +1,7 @@
+#include <gst/gst.h>
+
+guint
+gstsharp_gst_structure_get_parent_refcount_offset (void)
+{
+  return (guint) G_STRUCT_OFFSET (GstStructure, parent_refcount);
+}