Rose-Hulman Robotics Team

Changeset 667 for trunk/software

Show
Ignore:
Timestamp:
02/11/10 02:14:30 (2 years ago)
Author:
mosttw
Message:

Fix for refcounting bug causing nasty memory leak

Location:
trunk/software
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/software/rb/vision/_camera.c

    r665 r667  
    1717 
    1818#include <Python.h> 
     19#include <glib.h> 
    1920#include <pygobject.h> 
    2021#include <pygtk/pygtk.h> 
     
    9091                if (pixbuf != NULL) { 
    9192                        PyObject *py_pixbuf = pygobject_new((GObject*) pixbuf); 
     93                        g_object_unref(G_OBJECT(pixbuf)); 
    9294                        return py_pixbuf; 
    9395                } else { 
  • trunk/software/rb/vision/gstcam.py

    r665 r667  
    1616import time 
    1717import logging 
     18import gobject 
    1819from rb.vision._camera import ipl_image_from_rgb_buffer, save_image 
    1920 
    2021import gst 
    21  
    2222 
    2323 
     
    4848                 
    4949                self.pipeline.set_state(gst.STATE_PLAYING) 
     50 
     51                if self.controller is not None: 
     52                        gobject.timeout_add(100, self._send_image) 
    5053         
     54        def _send_image(self): 
     55                image = self.get_last_image() 
     56                if image is not None: 
     57                        self.controller.send('camera_image', (self.source, image)) 
     58                return True # Call me again 
     59 
    5160        def get_last_image(self): 
    5261                buffer = self.appsink.get_last_buffer() 
  • trunk/software/rb/vision/makefile

    r605 r667  
    1 CFLAGS   = -p -pg -g -Wall -Werror -Wno-unused -pedantic -fPIC --std=gnu99 -fgnu89-inline -O3 $(shell pkg-config --cflags opencv gsl) 
     1CFLAGS   = -p -pg -g -Wall -Werror -Wno-unused -pedantic -fPIC --std=gnu99 -fgnu89-inline -O3 $(shell pkg-config --cflags opencv gsl glib-2.0 gobject-2.0) 
    22#CFLAGS   = -p -pg -g -Wall -Werror -pedantic -fPIC -O3 $(shell pkg-config --cflags opencv gsl) 
    33CPPFLAGS = -p -pg -g -Wall -Werror -Wno-unused -pedantic -fPIC -O3 $(shell pkg-config --cflags opencv gsl) 
  • trunk/software/scripts

    • Property svn:ignore set to
      capture.mkv
  • trunk/software/scripts/calib

    • Property svn:ignore set to
      calibrate
      corners.*.png