[aravis] buffer: fix gobject-introspection binding, at the expense of an API break.



commit fc567909e07b05cf5567fe86ae906dee9a145b75
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Thu May 2 19:22:03 2013 +0200

    buffer: fix gobject-introspection binding, at the expense of an API break.
    
    It's pretty minor (void * replaced by char *), but it can break
    compilations.

 src/arvbuffer.c                 |    4 ++--
 src/arvbuffer.h                 |    4 ++--
 tests/python/arv-buffer-test.py |    6 ++++--
 tests/python/arv-camera-test.py |   12 ++++++++----
 4 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/src/arvbuffer.c b/src/arvbuffer.c
index bd9d816..2347329 100644
--- a/src/arvbuffer.c
+++ b/src/arvbuffer.c
@@ -57,7 +57,7 @@ static GObjectClass *parent_class = NULL;
  */
 
 ArvBuffer *
-arv_buffer_new_full (size_t size, void *preallocated, void *user_data, GDestroyNotify user_data_destroy_func)
+arv_buffer_new_full (size_t size, char *preallocated, void *user_data, GDestroyNotify user_data_destroy_func)
 {
        ArvBuffer *buffer;
 
@@ -93,7 +93,7 @@ arv_buffer_new_full (size_t size, void *preallocated, void *user_data, GDestroyN
  */
 
 ArvBuffer *
-arv_buffer_new (size_t size, void *preallocated)
+arv_buffer_new (size_t size, char *preallocated)
 {
        return arv_buffer_new_full (size, preallocated, NULL, NULL);
 }
diff --git a/src/arvbuffer.h b/src/arvbuffer.h
index ae29613..e43853d 100644
--- a/src/arvbuffer.h
+++ b/src/arvbuffer.h
@@ -90,8 +90,8 @@ struct _ArvBufferClass {
 
 GType arv_buffer_get_type (void);
 
-ArvBuffer *    arv_buffer_new          (size_t size, void *preallocated);
-ArvBuffer *    arv_buffer_new_full     (size_t size, void *preallocated,
+ArvBuffer *    arv_buffer_new          (size_t size, char *preallocated);
+ArvBuffer *    arv_buffer_new_full     (size_t size, char *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 64d091b..484fa60 100644
--- a/tests/python/arv-buffer-test.py
+++ b/tests/python/arv-buffer-test.py
@@ -37,6 +37,8 @@ from gi.repository import Aravis
 buffer_a = Aravis.Buffer.new (1024, None)
 buffer_b = Aravis.Buffer.new (1024, None)
 
-print buffer_a.__grefcount__
-print buffer_b.__grefcount__
+print "Buffer a refcount :        %d" %(buffer_a.__grefcount__)
+print "Buffer a is preallocated : %d" %(buffer_a.is_preallocated)
+print "Buffer b refcount :        %d" %(buffer_b.__grefcount__)
+print "Buffer b is preallocated : %d" %(buffer_b.is_preallocated)
 
diff --git a/tests/python/arv-camera-test.py b/tests/python/arv-camera-test.py
index c9a7fd1..46074bd 100644
--- a/tests/python/arv-camera-test.py
+++ b/tests/python/arv-camera-test.py
@@ -36,10 +36,14 @@ from gi.repository import Aravis
 
 Aravis.enable_interface ("Fake")
 
-if len(sys.argv) > 1:
-       camera = Aravis.Camera.new (sys.argv[1])
-else:
-       camera = Aravis.Camera.new (None)
+try:
+       if len(sys.argv) > 1:
+               camera = Aravis.Camera.new (sys.argv[1])
+       else:
+               camera = Aravis.Camera.new (None)
+except:
+       print ("No camera found")
+       exit ()
 
 camera.set_region (0,0,128,128)
 camera.set_frame_rate (10.0)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]