[aravis] introspection: avoid a crash in python binding.



commit b8cdbb5272fc12a7d12b78cbbf0e69be98b8e5d8
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Fri Oct 11 10:36:49 2013 +0200

    introspection: avoid a crash in python binding.
    
    Tests seems to indicate that the array annotation is completely broken.
    
    Fix https://bugzilla.gnome.org/show_bug.cgi?id=709173.

 src/arvdevice.c                  |    2 +-
 tests/python/arv-genicam-test.py |   51 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletions(-)
---
diff --git a/src/arvdevice.c b/src/arvdevice.c
index 9253d46..dbe1e94 100644
--- a/src/arvdevice.c
+++ b/src/arvdevice.c
@@ -210,7 +210,7 @@ _get_genicam_xml (ArvDevice *device, size_t *size)
  *
  * Gets the Genicam XML data stored in the device memory.
  *
- * Returns: (transfer none) (array length=size): a pointer to the Genicam XML data, owned by the device.
+ * Returns: (transfer none): a pointer to the Genicam XML data, owned by the device.
  *
  * Since: 0.2.0
  **/
diff --git a/tests/python/arv-genicam-test.py b/tests/python/arv-genicam-test.py
new file mode 100644
index 0000000..936317d
--- /dev/null
+++ b/tests/python/arv-genicam-test.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+
+# Aravis - Digital camera library
+#
+# Copyright (c) 2011 Emmanuel Pacaud
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General
+# Public License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+# Author: Emmanuel Pacaud <emmanuel gnome org>
+
+#  If you have installed aravis in a non standard location, you may need
+#   to make GI_TYPELIB_PATH point to the correct location. For example:
+#
+#   export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/opt/bin/lib/girepositry-1.0/
+#
+#  You may also have to give the path to libaravis.so, using LD_PRELOAD or
+#  LD_LIBRARY_PATH.
+
+import sys
+import time
+
+from gi.repository import Aravis
+
+Aravis.enable_interface ("Fake")
+
+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 ()
+
+device = camera.get_device ()
+genicam = device.get_genicam_xml ();
+
+print genicam;


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