added missing files
authorKhaled Mohammed <khaled.mohammed@gmail.com>
Thu, 7 Sep 2006 16:24:30 +0000 (16:24 +0000)
committerKhaled Mohammed <khaled.mohammed@gmail.com>
Thu, 7 Sep 2006 16:24:30 +0000 (16:24 +0000)
git-svn-id: svn://anonsvn.mono-project.com/source/branches/abock/gstreamer-sharp@65068 e3ebcda4-bce8-0310-ba0a-eca2169e7518

gstreamer-sharp/Buffer.custom [new file with mode: 0644]
gstreamer-sharp/Caps.custom [new file with mode: 0644]
gstreamer-sharp/Gstreamer.metadata
gstreamer-sharp/Object.custom [new file with mode: 0644]
gstreamer-sharp/gstreamer-api.raw
sample/Makefile.am
sample/MetaData.cs
source/gstreamer-sharp-source.xml

diff --git a/gstreamer-sharp/Buffer.custom b/gstreamer-sharp/Buffer.custom
new file mode 100644 (file)
index 0000000..63e61a6
--- /dev/null
@@ -0,0 +1,25 @@
+       [DllImport("gstreamer-0.10")]
+       static extern IntPtr gst_mini_object_ref (IntPtr buf);
+
+       public void Ref() 
+       {
+               IntPtr tmp = gst_mini_object_ref(this.Handle);
+       }
+
+       [DllImport("gstreamer-0.10")]
+       static extern void gst_mini_object_unref(IntPtr buf);
+
+       public void Unref()
+       {
+               gst_mini_object_unref(this.Handle);
+       } 
+
+       [DllImport("gstreamersharpglue-0.10")]
+       static extern uint gstsharp_gst_buffer_refcount(IntPtr buf);
+
+       public uint Refcount 
+       {
+               get { 
+                       return gstsharp_gst_buffer_refcount(this.Handle);
+               }
+       }
diff --git a/gstreamer-sharp/Caps.custom b/gstreamer-sharp/Caps.custom
new file mode 100644 (file)
index 0000000..e69de29
index b83939d..1a1a41a 100644 (file)
@@ -5,6 +5,14 @@
   <attr path="/api/namespace/object[@cname='GstPipeline']/method[@name='GetBus']/return-type" name="owned">true</attr>
   <attr path="/api/namespace/object[@name='ElementFactory']/method[@name='Make']/return-type" name="owned">true</attr>
 
+  <!-- for GstController's object func -->
+  <attr path="/api/namespace/object[@name='Object']/method[@cname='gst_object_control_properties']" name="hidden">true</attr>
+  <attr path="/api/namespace/object[@name='Object']/method[@cname='gst_object_get_controller']" name="hidden">true</attr>
+  <attr path="/api/namespace/object[@name='Object']/method[@cname='gst_object_get_value_array']" name="hidden">true</attr>
+  <attr path="/api/namespace/object[@name='Object']/method[@cname='gst_object_get_value_arrays']" name="hidden">true</attr>
+  <attr path="/api/namespace/object[@name='Object']/method[@cname='gst_object_set_controller']" name="hidden">true</attr>
+  <attr path="/api/namespace/object[@name='Object']/method[@cname='gst_object_sync_values']" name="hidden">true</attr>
+
   <attr path="/api/namespace/boxed[@name='Caps']/method[@name='FromString']/return-type" name="owned">true</attr>
   <attr path="/api/namespace/object[@name='Buffer']/method[@name='GetCaps']/return-type" name="owned">true</attr>
   <attr path="/api/namespace/object[@name='Object']/field[@name='Refcount']" name="hidden">1</attr>
diff --git a/gstreamer-sharp/Object.custom b/gstreamer-sharp/Object.custom
new file mode 100644 (file)
index 0000000..940ee23
--- /dev/null
@@ -0,0 +1,13 @@
+
+       public int Refcount {
+               get { return this.RefCount; }
+       }
+
+
+       public override void Dispose() {
+               if(this.Handle != IntPtr.Zero) {
+                       Gst.Object.Unref(this.Handle);
+                       this.Raw = IntPtr.Zero;
+               }
+       }
+
index 816930d..b940914 100644 (file)
@@ -1,11 +1,12 @@
 <?xml version="1.0"?>
-<api
-  ><!--
+<api>
+  <!--
 
         This file was automatically generated.
         Please DO NOT MODIFY THIS FILE, modify .metadata files instead.
 
---><namespace name="Gst" library="gstreamer-0.10.dll">
+-->
+  <namespace name="Gst" library="gstreamer-0.10.dll">
     <enum name="ActivateMode" cname="GstActivateMode" type="enum">
       <member cname="GST_ACTIVATE_NONE" name="None" />
       <member cname="GST_ACTIVATE_PUSH" name="Push" />
           <parameter type="const-GValue*" name="value2" />
         </parameters>
       </method>
-    </class></namespace></api>
\ No newline at end of file
+    </class>
+  </namespace>
+</api>
\ No newline at end of file
index d968ff6..695f24a 100644 (file)
@@ -25,6 +25,9 @@ queueexample.exe: $(srcdir)/QueueExample.cs $(assemblies)
 metadata.exe: $(srcdir)/MetaData.cs $(assemblies)
        $(CSC) -out:$@ $(GLIBSHARP_LIBS) $(references) $(srcdir)/MetaData.cs
 
+mp3launchparse.exe: $(srcdir)/MP3LaunchParse.cs $(assemblies)
+       $(CSC) -out:$@ $(GLIBSHARP_LIBS) $(references) $(srcdir)/MP3LaunchParse.cs
+
 link:
        ln -sf $(top_builddir)/gstreamer-sharp/gstreamer-sharp.dll gstreamer-sharp.dll
        ln -sf $(top_builddir)/gstreamer-sharp/gstreamer-sharp.dll.config gstreamer-sharp.dll.config
index 2778846..eb28cff 100644 (file)
@@ -16,7 +16,7 @@ public class MetaData
 
        static void PrintTag( TagList list, string tag) {
                uint count = list.GetTagSize(tag);
-
+               Console.WriteLine("Tags found = " + count);
                for(uint i =0; i < count; i++) 
                {
                        string str;
@@ -34,7 +34,7 @@ public class MetaData
                }
        }
 
-       static bool MessageLoop(Element element, TagList tags) 
+       static bool MessageLoop(Element element, ref TagList tags) 
        {
                Bus bus = element.Bus;
                bool done = false;
@@ -48,7 +48,6 @@ public class MetaData
                                case MessageType.Error:
                                        string error;
                                        message.ParseError(out error);
-                                       Console.Error.WriteLine("Error: {0}", error);
                                        message.Dispose();
                                        return true;
                                case MessageType.Eos:
@@ -63,7 +62,8 @@ public class MetaData
                                        else {
                                                tags = new_tags;
                                        }
-                                       new_tags.Dispose();
+                                       //tags.Foreach(PrintTag);
+                                       //new_tags.Dispose();
                                        break;
                                }
                                default:
@@ -95,7 +95,7 @@ public class MetaData
                bin.AddMany(source, decodebin);
                if(!source.Link(decodebin))
                        Console.Error.WriteLine("filesrc could not be linked with decodebin");
-               //decodebin.Dispose();
+               decodebin.Dispose();
        }
 
        public static void Main(string [] args) 
@@ -131,13 +131,13 @@ public class MetaData
                                continue;
                        }
 
-                       if(!MessageLoop(pipeline, tags)) {
+                       if(!MessageLoop(pipeline, ref tags)) {
                                Console.Error.WriteLine("Failed in message reading for {0}", args[i]);
                        }
 
                        if(tags != null) {
                                Console.WriteLine("Metadata for {0}:", args[i]);
-                               tags.Foreach(PrintTag);
+                               tags.Foreach(new TagForeachFunc(PrintTag));
                                tags.Dispose();
                                tags = null;
                        } else Console.Error.WriteLine("No metadata found for {0}", args[0]);
index 6e0a64e..3528984 100644 (file)
@@ -1,5 +1,12 @@
 <gapi-parser-input>
   <api filename="../gstreamer-sharp/gstreamer-api.raw">
+<!--
+       <library name="gstcontroller-0.10.dll">
+         <namespace name="Gst">
+        <dir>gstreamer-0.10.3/libs/gst/controller</dir>
+      </namespace>
+    </library>
+-->    
     <library name="gstreamer-0.10.dll">
       <namespace name="Gst">
         <dir>gstreamer-0.10.3/gst</dir>
@@ -7,12 +14,5 @@
         <exclude>gstreamer-0.10.3/gst/gsturi.h</exclude>
       </namespace>
        </library>
-<!--
-       <library name="gstcontroller-0.10.dll">
-      <namespace name="Gst">
-        <dir>gstreamer-0.10.3/libs/gst/controller</dir>
-      </namespace>
-    </library>
--->
   </api>
 </gapi-parser-input>