Buffer: Fix byte[] methods

This commit is contained in:
Stephan Sundermann 2014-08-06 15:19:16 +02:00
parent 60f672f209
commit dba0f53b37
2 changed files with 51 additions and 1 deletions

42
sources/custom/MapInfo.cs Normal file
View file

@ -0,0 +1,42 @@
//
// MapInfo.cs
//
// Authors:
// Stephan Sundermann <stephansundermann@gmail.com>
//
// 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);
}
}
}
}

View file

@ -207,7 +207,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
<attr path="//object/field[@cname='object' and @type='GstObject*']" name="hidden">true</attr>
<attr path="//constant[@name='CLOCK_TIME_NONE']" name="ctype">guint64</attr>
<attr path="//method[parameters/parameter[contains(@type, 'Class*')]]" name="hidden">true</attr>
<attr path="//struct[@cname='GstMapInfo']/field[@name='Data']" name="type">gpointer</attr>
<attr path="//struct[@cname='GstMapInfo']/field[@name='Data']" name="array">false</attr>
<!-- buffer fixes -->
<attr path="//constructor[@cname='gst_buffer_new_wrapped']/parameters/parameter[@name='data']" name="type">guint8*</attr>
<attr path="//constructor[@cname='gst_buffer_new_wrapped']/parameters/parameter[@name='size']" name="name">n_length</attr>
<attr path="//method[@cname='gst_buffer_fill']/parameters/parameter[@name='src']" name="type">guint8*</attr>
<attr path="//method[@cname='gst_buffer_fill']/parameters/parameter[@name='size']" name="name">n_length</attr>
<attr path="//method[@cname='gst_buffer_memcmp']/parameters/parameter[@name='mem']" name="type">guint8*</attr>
<attr path="//method[@cname='gst_buffer_memcmp']/parameters/parameter[@name='size']" name="name">n_length</attr>
<!-- No way to correctly generate these without the element type -->
<attr path="//boxed[@cname='GstMpegtsDescriptor']//method[parameters/parameter[@type='GArray***']]" name="hidden">true</attr>
</metadata>