[aravis] buffer: unbreak API caused by the python binding fix.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] buffer: unbreak API caused by the python binding fix.
- Date: Thu, 9 May 2013 19:44:45 +0000 (UTC)
commit a5edf7e1f165b607a3eafe2640d55566e27c4238
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Thu May 9 21:42:36 2013 +0200
buffer: unbreak API caused by the python binding fix.
src/arvbuffer.c | 27 +++++++++++++++++++++++----
src/arvbuffer.h | 5 +++--
tests/python/arv-buffer-test.py | 4 ++--
tests/python/arv-camera-test.py | 2 +-
4 files changed, 29 insertions(+), 9 deletions(-)
---
diff --git a/src/arvbuffer.c b/src/arvbuffer.c
index 2347329..459c8ee 100644
--- a/src/arvbuffer.c
+++ b/src/arvbuffer.c
@@ -39,7 +39,7 @@ static GObjectClass *parent_class = NULL;
/**
* arv_buffer_new_full:
* @size: payload size
- * @preallocated: (transfer none) (allow-none): preallocated memory buffer
+ * @preallocated: (transfer none): preallocated memory buffer
* @user_data: (transfer none): a pointer to user data associated to this buffer
* @user_data_destroy_func: an optional user data destroy callback
*
@@ -57,7 +57,7 @@ static GObjectClass *parent_class = NULL;
*/
ArvBuffer *
-arv_buffer_new_full (size_t size, char *preallocated, void *user_data, GDestroyNotify user_data_destroy_func)
+arv_buffer_new_full (size_t size, void *preallocated, void *user_data, GDestroyNotify user_data_destroy_func)
{
ArvBuffer *buffer;
@@ -80,7 +80,7 @@ arv_buffer_new_full (size_t size, char *preallocated, void *user_data, GDestroyN
/**
* arv_buffer_new:
* @size: payload size
- * @preallocated: (allow-none) (transfer none): preallocated memory buffer
+ * @preallocated: (transfer none): preallocated memory buffer
*
* Creates a new buffer for the storage of the video stream images.
* The data space can be either preallocated, and the caller is responsible
@@ -93,12 +93,31 @@ arv_buffer_new_full (size_t size, char *preallocated, void *user_data, GDestroyN
*/
ArvBuffer *
-arv_buffer_new (size_t size, char *preallocated)
+arv_buffer_new (size_t size, void *preallocated)
{
return arv_buffer_new_full (size, preallocated, NULL, NULL);
}
/**
+ * arv_buffer_new_allocate:
+ * @size: payload size
+ *
+ * Creates a new buffer for the storage of the video stream images.
+ * The data space is allocated by this function, and will
+ * be freed when the buffer is destroyed.
+ *
+ * Returns: a new #ArvBuffer object
+ *
+ * Since: 0.2.3
+ */
+
+ArvBuffer *
+arv_buffer_new_allocate (size_t size)
+{
+ return arv_buffer_new_full (size, NULL, NULL, NULL);
+}
+
+/**
* arv_buffer_clear:
* @buffer: a #ArvBuffer
*
diff --git a/src/arvbuffer.h b/src/arvbuffer.h
index e43853d..983ab15 100644
--- a/src/arvbuffer.h
+++ b/src/arvbuffer.h
@@ -90,8 +90,9 @@ struct _ArvBufferClass {
GType arv_buffer_get_type (void);
-ArvBuffer * arv_buffer_new (size_t size, char *preallocated);
-ArvBuffer * arv_buffer_new_full (size_t size, char *preallocated,
+ArvBuffer * arv_buffer_new_allocate (size_t size);
+ArvBuffer * arv_buffer_new (size_t size, void *preallocated);
+ArvBuffer * arv_buffer_new_full (size_t size, void *preallocated,
void *user_data, GDestroyNotify user_data_destroy_func);
G_END_DECLS
diff --git a/tests/python/arv-buffer-test.py b/tests/python/arv-buffer-test.py
index 484fa60..3f3d20a 100644
--- a/tests/python/arv-buffer-test.py
+++ b/tests/python/arv-buffer-test.py
@@ -34,8 +34,8 @@ import time
from gi.repository import Aravis
-buffer_a = Aravis.Buffer.new (1024, None)
-buffer_b = Aravis.Buffer.new (1024, None)
+buffer_a = Aravis.Buffer.new_allocate (1024)
+buffer_b = Aravis.Buffer.new_allocate (1024)
print "Buffer a refcount : %d" %(buffer_a.__grefcount__)
print "Buffer a is preallocated : %d" %(buffer_a.is_preallocated)
diff --git a/tests/python/arv-camera-test.py b/tests/python/arv-camera-test.py
index 1492eae..db4290f 100644
--- a/tests/python/arv-camera-test.py
+++ b/tests/python/arv-camera-test.py
@@ -63,7 +63,7 @@ print "Pixel format : %s" %(camera.get_pixel_format_as_string ())
stream = camera.create_stream (None, None)
for i in range(0,10):
- stream.push_buffer (Aravis.Buffer.new (payload, None))
+ stream.push_buffer (Aravis.Buffer.new_allocate (payload))
print "Start acquisition"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]