From 196ad13ffbb0527c83cf0ac9d3869d27b3a53317 Mon Sep 17 00:00:00 2001 From: Khaled Mohammed Date: Thu, 7 Sep 2006 16:24:30 +0000 Subject: [PATCH] added missing files git-svn-id: svn://anonsvn.mono-project.com/source/branches/abock/gstreamer-sharp@65068 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- gstreamer-sharp/Buffer.custom | 25 +++++++++++++++++++++++++ gstreamer-sharp/Caps.custom | 0 gstreamer-sharp/Gstreamer.metadata | 8 ++++++++ gstreamer-sharp/Object.custom | 13 +++++++++++++ gstreamer-sharp/gstreamer-api.raw | 11 +++++++---- sample/Makefile.am | 3 +++ sample/MetaData.cs | 14 +++++++------- source/gstreamer-sharp-source.xml | 14 +++++++------- 8 files changed, 70 insertions(+), 18 deletions(-) create mode 100644 gstreamer-sharp/Buffer.custom create mode 100644 gstreamer-sharp/Caps.custom create mode 100644 gstreamer-sharp/Object.custom diff --git a/gstreamer-sharp/Buffer.custom b/gstreamer-sharp/Buffer.custom new file mode 100644 index 0000000000..63e61a655a --- /dev/null +++ b/gstreamer-sharp/Buffer.custom @@ -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 index 0000000000..e69de29bb2 diff --git a/gstreamer-sharp/Gstreamer.metadata b/gstreamer-sharp/Gstreamer.metadata index b83939db7a..1a1a41a592 100644 --- a/gstreamer-sharp/Gstreamer.metadata +++ b/gstreamer-sharp/Gstreamer.metadata @@ -5,6 +5,14 @@ true true + + true + true + true + true + true + true + true true 1 diff --git a/gstreamer-sharp/Object.custom b/gstreamer-sharp/Object.custom new file mode 100644 index 0000000000..940ee23ea1 --- /dev/null +++ b/gstreamer-sharp/Object.custom @@ -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; + } + } + diff --git a/gstreamer-sharp/gstreamer-api.raw b/gstreamer-sharp/gstreamer-api.raw index 816930d664..b940914ead 100644 --- a/gstreamer-sharp/gstreamer-api.raw +++ b/gstreamer-sharp/gstreamer-api.raw @@ -1,11 +1,12 @@ - +--> + @@ -5745,4 +5746,6 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/sample/Makefile.am b/sample/Makefile.am index d968ff6858..695f24a921 100644 --- a/sample/Makefile.am +++ b/sample/Makefile.am @@ -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 diff --git a/sample/MetaData.cs b/sample/MetaData.cs index 2778846267..eb28cffc0c 100644 --- a/sample/MetaData.cs +++ b/sample/MetaData.cs @@ -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]); diff --git a/source/gstreamer-sharp-source.xml b/source/gstreamer-sharp-source.xml index 6e0a64ebd1..352898433f 100644 --- a/source/gstreamer-sharp-source.xml +++ b/source/gstreamer-sharp-source.xml @@ -1,5 +1,12 @@ + gstreamer-0.10.3/gst @@ -7,12 +14,5 @@ gstreamer-0.10.3/gst/gsturi.h -