2009-05-25 10:09:52 +00:00
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
2009-04-30 11:10:15 +00:00
|
|
|
static extern IntPtr gst_type_find_peek (IntPtr raw, long offset, uint size);
|
|
|
|
|
|
|
|
public byte[] Peek (long offset, uint size) {
|
|
|
|
IntPtr raw_ret = gst_type_find_peek (Handle, offset, size);
|
|
|
|
if (raw_ret == IntPtr.Zero)
|
|
|
|
return null;
|
|
|
|
|
|
|
|
byte[] ret = new byte[size];
|
|
|
|
Marshal.Copy (raw_ret, ret, 0, (int) size);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
private GstSharp.TypeFindPeekFunctionWrapper peek;
|
|
|
|
private GstSharp.TypeFindSuggestFunctionWrapper suggest;
|
|
|
|
private GstSharp.TypeFindGetLengthFunctionWrapper get_length;
|
|
|
|
|
2009-05-25 10:12:35 +00:00
|
|
|
[DllImport ("gstreamersharpglue-0.10.dll") ]
|
2009-04-30 11:10:15 +00:00
|
|
|
static extern IntPtr gstsharp_gst_type_find_new (GstSharp.TypeFindPeekFunctionNative peek, GstSharp.TypeFindSuggestFunctionNative suggest, GstSharp.TypeFindGetLengthFunctionNative get_length);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TypeFind (TypeFindPeekFunction peek, TypeFindSuggestFunction suggest, TypeFindGetLengthFunction get_length) : base () {
|
|
|
|
this.peek = new GstSharp.TypeFindPeekFunctionWrapper (peek);
|
|
|
|
this.suggest = new GstSharp.TypeFindSuggestFunctionWrapper (suggest);
|
|
|
|
this.get_length = new GstSharp.TypeFindGetLengthFunctionWrapper (get_length);
|
|
|
|
|
|
|
|
Raw = gstsharp_gst_type_find_new (this.peek.NativeDelegate, this.suggest.NativeDelegate, this.get_length.NativeDelegate);
|
|
|
|
Owned = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void Free (IntPtr raw) {
|
2009-08-05 14:57:20 +00:00
|
|
|
Gst.GLib.Marshaller.Free (raw);
|
2009-04-30 11:10:15 +00:00
|
|
|
}
|