[aravis] python: add a debug launcher.



commit 4aa345d8bd266e15262b8cbf13a76acddbfb028a
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Tue Dec 18 22:22:39 2012 +0100

    python: add a debug launcher.

 tests/python/arv-buffer-test.py |   42 +++++++++++++++++++++++++++++++++++++++
 tests/python/arv-camera-test.py |   11 ++++++++-
 tests/python/launch-dbg         |    6 +++++
 3 files changed, 57 insertions(+), 2 deletions(-)
---
diff --git a/tests/python/arv-buffer-test.py b/tests/python/arv-buffer-test.py
new file mode 100644
index 0000000..64d091b
--- /dev/null
+++ b/tests/python/arv-buffer-test.py
@@ -0,0 +1,42 @@
+#!/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
+
+buffer_a = Aravis.Buffer.new (1024, None)
+buffer_b = Aravis.Buffer.new (1024, None)
+
+print buffer_a.__grefcount__
+print buffer_b.__grefcount__
+
diff --git a/tests/python/arv-camera-test.py b/tests/python/arv-camera-test.py
index e1cdf81..c9a7fd1 100644
--- a/tests/python/arv-camera-test.py
+++ b/tests/python/arv-camera-test.py
@@ -34,6 +34,8 @@ import time
 
 from gi.repository import Aravis
 
+Aravis.enable_interface ("Fake")
+
 if len(sys.argv) > 1:
 	camera = Aravis.Camera.new (sys.argv[1])
 else:
@@ -56,7 +58,7 @@ print "Pixel format  :", camera.get_pixel_format_as_string ()
 
 stream = camera.create_stream (None, None)
 
-for i in range(0,100):
+for i in range(0,10):
 	stream.push_buffer (Aravis.Buffer.new (payload, None))
 
 print "Start acquisition"
@@ -65,8 +67,13 @@ camera.start_acquisition ()
 
 print "Acquisition"
 
-buffer = stream.pop_buffer ()
+for i in range(0,20):
+	buffer = stream.pop_buffer ()
+	print buffer
+	if buffer:
+		stream.push_buffer (buffer)
 
 print "Stop acquisition"
 
 camera.stop_acquisition ()
+
diff --git a/tests/python/launch-dbg b/tests/python/launch-dbg
new file mode 100755
index 0000000..4ce78a8
--- /dev/null
+++ b/tests/python/launch-dbg
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:../../src
+export LD_LIBRARY_PATH=../../src/.libs
+
+gdb -ex run --args python $*



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