This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 285bcbbe9881cbaa844b7bb0184ad794717c538c (commit) via 4b6af799b2564c6bad521bfd37affaaffbe22e9c (commit) from 9f976bc10006bdd76c3c4709fa6baeb1dda15f3f (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/285bcbbe9881cbaa844b7bb0184ad794717c5...
commit 285bcbbe9881cbaa844b7bb0184ad794717c538c Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 1 00:38:17 2013 +0200
pywrap: Add grabbers bindings + example.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pylib/gfxprim/Makefile b/pylib/gfxprim/Makefile index afcad67..a2b9700 100644 --- a/pylib/gfxprim/Makefile +++ b/pylib/gfxprim/Makefile @@ -1,4 +1,4 @@ TOPDIR=../.. -SUBDIRS=core loaders backends gfx filters text input +SUBDIRS=core loaders backends gfx filters text input grabbers CLEAN+=*.pyc include $(TOPDIR)/post.mk diff --git a/pylib/gfxprim/grabbers/Makefile b/pylib/gfxprim/grabbers/Makefile new file mode 100644 index 0000000..b001822 --- /dev/null +++ b/pylib/gfxprim/grabbers/Makefile @@ -0,0 +1,11 @@ +TOPDIR=../../.. +LIBNAME=grabbers +INCLUDE=core + +LDFLAGS+=$(shell $(TOPDIR)/gfxprim-config --libs-grabbers) + +include $(TOPDIR)/pre.mk +include $(TOPDIR)/pywrap.mk +include $(TOPDIR)/post.mk + +include ../silence_swig_warnings.mk diff --git a/pylib/gfxprim/grabbers/__init__.py b/pylib/gfxprim/grabbers/__init__.py new file mode 100644 index 0000000..a36f214 --- /dev/null +++ b/pylib/gfxprim/grabbers/__init__.py @@ -0,0 +1,50 @@ +""" +Module for GFXprim grabbers. +""" + +# Import the SWIG wrapper +from . import c_grabbers +from ..utils import extend + +def extend_grabber(_Grabber): + """ + Extends _grabber class with convenience methods. + Called once on module initialization. + """ + @extend(_Grabber) + def Start(self): + "Starts frame capture." + c_grabbers.GP_GrabberStart(self) + + @extend(_Grabber) + def Stop(self): + "Stops frame capture." + c_grabbers.GP_GrabberStop(self) + + @extend(_Grabber) + def Poll(self): + "Polls for a frame." + return c_grabbers.GP_GrabberPoll(self) + +# Pull GP_Grabber +Grabber = c_grabbers.GP_Grabber + +def _init(module): + # Extend GP_Grabber with convenience methods + extend_grabber(Grabber) + + # Imports from the SWIG module + import re + def strip_GP(s): + return re.sub('^GP_', '', s) + + # Import some members from the SWIG module + from ..utils import import_members + import_members(c_grabbers, module, sub=strip_GP, + exclude=[ + '^gfxprim$', + '^w+_swigregister$', + '^_w+$']) + +_init(locals()) +del _init diff --git a/pylib/gfxprim/grabbers/grabbers.i b/pylib/gfxprim/grabbers/grabbers.i new file mode 100644 index 0000000..a6f1d13 --- /dev/null +++ b/pylib/gfxprim/grabbers/grabbers.i @@ -0,0 +1,36 @@ +%include "../common.i" +%module(package="gfxprim.grabbers") c_grabbers + +%{ +#include "GP_Grabbers.h" +#include "core/GP_Debug.h" +%} + +/* %import ../core/core.i */ + +/* + * General grabber structure handling + */ +%extend GP_Grabber { + ~GP_Grabber() { + GP_DEBUG(2, "[wrapper] GP_GrabberExit (%p)", $self); + GP_GrabberExit($self); + } +}; + +%ignore GP_Grabber::priv; +%ignore GP_Grabber::fd; + +%ignore GP_Grabber::Start; +%ignore GP_Grabber::Stop; +%ignore GP_Grabber::Exit; +%ignore GP_Grabber::Poll; + +%include "GP_Grabber.h" + +/* + * Particular grabbers. + */ +ERROR_ON_NULL(GP_GrabberV4L2Init); +%newobject GP_GrabberV4L2Init; +%include "GP_V4L2.h"
http://repo.or.cz/w/gfxprim.git/commit/4b6af799b2564c6bad521bfd37affaaffbe22...
commit 4b6af799b2564c6bad521bfd37affaaffbe22e9c Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 1 00:25:50 2013 +0200
pywrap: backends: Fix typo.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pylib/gfxprim/backends/_extend_backend.py b/pylib/gfxprim/backends/_extend_backend.py index d2f22b5..b1fab72 100644 --- a/pylib/gfxprim/backends/_extend_backend.py +++ b/pylib/gfxprim/backends/_extend_backend.py @@ -5,7 +5,7 @@ from ..input import c_input def extend_backend(_backend): """ Extends _backend class with convenience methods. - Called once on module inicialization. + Called once on module initialization. """
@extend(_backend, name='__str__')
-----------------------------------------------------------------------
Summary of changes: pylib/gfxprim/Makefile | 2 +- pylib/gfxprim/backends/_extend_backend.py | 2 +- pylib/gfxprim/{backends => grabbers}/Makefile | 4 +- pylib/gfxprim/grabbers/__init__.py | 50 +++++++++++++++++++++++++ pylib/gfxprim/grabbers/grabbers.i | 36 ++++++++++++++++++ 5 files changed, 90 insertions(+), 4 deletions(-) copy pylib/gfxprim/{backends => grabbers}/Makefile (65%) create mode 100644 pylib/gfxprim/grabbers/__init__.py create mode 100644 pylib/gfxprim/grabbers/grabbers.i
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.