From dba0f53b37fe351da6e0e84db8ac8895f92b7ca1 Mon Sep 17 00:00:00 2001 From: Stephan Sundermann Date: Wed, 6 Aug 2014 15:19:16 +0200 Subject: [PATCH] Buffer: Fix byte[] methods --- sources/custom/MapInfo.cs | 42 ++++++++++++++++++++++++++++++++ sources/gstreamer-sharp.metadata | 10 +++++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 sources/custom/MapInfo.cs diff --git a/sources/custom/MapInfo.cs b/sources/custom/MapInfo.cs new file mode 100644 index 0000000000..40841f883b --- /dev/null +++ b/sources/custom/MapInfo.cs @@ -0,0 +1,42 @@ +// +// MapInfo.cs +// +// Authors: +// Stephan Sundermann +// +// Copyright (C) 2014 Stephan Sundermann +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +// 02110-1301 USA + +namespace Gst { + using System; + using System.Runtime.InteropServices; + + partial struct MapInfo + { + byte[] Data { + get { + byte[] data = new byte[Size]; + Marshal.Copy (_data, data, 0, (int)Size); + return data; + } + set { + Marshal.Copy (Data, 0, _data, Data.Length); + } + } + + } +} diff --git a/sources/gstreamer-sharp.metadata b/sources/gstreamer-sharp.metadata index 87794ac15a..fbb36abe7c 100644 --- a/sources/gstreamer-sharp.metadata +++ b/sources/gstreamer-sharp.metadata @@ -207,7 +207,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA true guint64 true - + gpointer + false + + guint8* + n_length + guint8* + n_length + guint8* + n_length true