From 8046a36bb47b415f8fa3fd8402abd35c8274e1f2 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Sat, 5 Dec 2009 20:30:55 +0100 Subject: [PATCH] Restore the simple Message.ParseTag overload In daa62493 the Message.ParseTag(out Pad pad, out TagList tags) method is added and the old one removed, but they can coexist peacefully. --- gstreamer-sharp/Message.custom | 16 ++++++++++++++++ samples/MetaData.cs | 3 +-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gstreamer-sharp/Message.custom b/gstreamer-sharp/Message.custom index 1cef4eadaa..893c0749eb 100644 --- a/gstreamer-sharp/Message.custom +++ b/gstreamer-sharp/Message.custom @@ -579,6 +579,22 @@ public static Message NewTag (Gst.Object src, Gst.Pad pad, TagList tags) { return msg; } +[DllImport("libgstreamer-0.10.dll") ] +static extern void gst_message_parse_tag (IntPtr msg, out IntPtr tags); + +public void ParseTag (out TagList tags) { + if (Type != MessageType.Tag) + throw new ArgumentException (); + + IntPtr raw_ptr; + + gst_message_parse_tag (Handle, out raw_ptr); + if (raw_ptr == IntPtr.Zero) + tags = null; + else + tags = (TagList) Gst.GLib.Opaque.GetOpaque (raw_ptr, typeof (TagList), true); +} + [DllImport ("libgstreamer-0.10.dll") ] static extern void gst_message_parse_tag_full (IntPtr msg, out IntPtr pad, out IntPtr tags); diff --git a/samples/MetaData.cs b/samples/MetaData.cs index 1bfdaf2582..4c92029be0 100644 --- a/samples/MetaData.cs +++ b/samples/MetaData.cs @@ -55,10 +55,9 @@ public class MetaData { return true; case MessageType.Tag: - Pad pad; TagList new_tags; - message.ParseTag (out pad, out new_tags); + message.ParseTag (out new_tags); if (tags != null) { tags = tags.Merge (new_tags, TagMergeMode.KeepAll);