gst_adapter_push(Handle, buf == null ? IntPtr.Zero : buf.OwnedHandle);
}
+
+ [DllImport ("gstreamersharpglue-0.10.dll") ]
+ static extern IntPtr gstsharp_gst_adapter_peek_buffer (IntPtr adapter, uint size);
+
+ public Gst.Buffer Peek (uint size) {
+ return (Gst.Buffer) Gst.MiniObject.GetObject (gstsharp_gst_adapter_peek_buffer (Handle, size), true);
+ }
--- /dev/null
+#include <gst/gst.h>
+#include <gst/base/gstadapter.h>
+
+GstBuffer *
+gstsharp_gst_adapter_peek_buffer (GstAdapter *adapter, guint size) {
+ GstBuffer *ret = gst_buffer_new_and_try_alloc (size);
+
+ if (ret == NULL)
+ return NULL;
+
+ gst_adapter_copy (adapter, GST_BUFFER_DATA (ret), 0, size);
+ return ret;
+}