[perl-GStreamer] Add GStreamer::Buffer::data_ptr()
- From: Torsten SchÃnfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-GStreamer] Add GStreamer::Buffer::data_ptr()
- Date: Sun, 20 Jan 2013 13:27:12 +0000 (UTC)
commit bba112559a77ea3dc89c26b947892143184b6f9d
Author: Torsten SchÃnfeld <kaffeetisch gmx de>
Date: Sun Jan 20 14:26:31 2013 +0100
Add GStreamer::Buffer::data_ptr()
It enables access to the buffer's data without copying it. Based on a patch by
Egor Korablev.
https://rt.cpan.org/Ticket/Display.html?id=82826
NEWS | 6 ++++++
t/GstBuffer.t | 4 +++-
xs/GstBuffer.xs | 8 ++++++++
3 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 6b5ab87..a607769 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+Overview of changes in GStreamer <next>
+=====================================
+
+* Add GStreamer::Buffer::data_ptr() to access the buffer's data without copying
+ it. (RT#82826)
+
Overview of changes in GStreamer 0.17
=====================================
diff --git a/t/GstBuffer.t b/t/GstBuffer.t
index 0aab997..942d725 100644
--- a/t/GstBuffer.t
+++ b/t/GstBuffer.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
use warnings;
-use Test::More tests => 14;
+use Test::More tests => 16;
# $Id$
@@ -11,7 +11,9 @@ my $buffer = GStreamer::Buffer -> new();
isa_ok($buffer, "GStreamer::Buffer");
isa_ok($buffer, "GStreamer::MiniObject");
+ok (!$buffer -> data_ptr());
$buffer -> set_data("urgs");
+ok (defined $buffer -> data_ptr());
$buffer -> stamp(GStreamer::Buffer -> new());
my $caps = GStreamer::Caps::Simple -> new("audio/mpeg",
diff --git a/xs/GstBuffer.xs b/xs/GstBuffer.xs
index 10e20c5..4f77a45 100644
--- a/xs/GstBuffer.xs
+++ b/xs/GstBuffer.xs
@@ -41,6 +41,14 @@ data (buffer)
OUTPUT:
RETVAL
+void *
+data_ptr (buffer)
+ GstBuffer *buffer
+ CODE:
+ RETVAL = GST_BUFFER_DATA (buffer);
+ OUTPUT:
+ RETVAL
+
guint
size (buffer)
GstBuffer *buffer
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]