Rose-Hulman Robotics Team
Show
Ignore:
Timestamp:
02/11/10 01:33:02 (2 years ago)
Author:
mosttw
Message:

Fixed issues with GStreamer camera driver

Files:
1 modified

Legend:

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

    r664 r665  
    11// rb.vision._camera -- Python interface to OpenCV camera functions 
    2 // Copyright (C) 2009 Andy Spencer, Tom Most 
     2// Copyright (C) 2009 Andy Spencer 
     3// Copyright (C) 2009-2010 Thomas W. Most 
    34//  
    45// This program is free software: you can redistribute it and/or modify 
     
    147148 
    148149 
    149  
    150150////// Camera OBJECT ////// 
    151151 
     
    230230        {"get_frame", (PyCFunction) Camera_get_frame, METH_NOARGS, 
    231231                "Capture a frame from the camera.  Returns an `IplImage`."}, 
    232         {NULL}  /* Sentinel */ 
     232        {NULL}  // Sentinel 
    233233}; 
    234234 
    235235static PyTypeObject CameraType = { 
    236236        PyObject_HEAD_INIT(NULL) 
    237         0,                                        /*ob_size*/ 
    238     "rb.vision._camera.Camera",               /*tp_name*/ 
    239     sizeof(Camera),                           /*tp_basicsize*/ 
    240     0,                                        /*tp_itemsize*/ 
    241     (destructor) Camera_dealloc,              /*tp_dealloc*/ 
    242     0,                                        /*tp_print*/ 
    243     0,                                        /*tp_getattr*/ 
    244     0,                                        /*tp_setattr*/ 
    245     0,                                        /*tp_compare*/ 
    246     0,                                        /*tp_repr*/ 
    247     0,                                        /*tp_as_number*/ 
    248     0,                                        /*tp_as_sequence*/ 
    249     0,                                        /*tp_as_mapping*/ 
    250     0,                                        /*tp_hash */ 
    251     0,                                        /*tp_call*/ 
    252     0,                                        /*tp_str*/ 
    253     0,                                        /*tp_getattro*/ 
    254     0,                                        /*tp_setattro*/ 
    255     0,                                        /*tp_as_buffer*/ 
    256     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ 
     237        0,                                        // ob_size 
     238    "rb.vision._camera.Camera",               // tp_name 
     239    sizeof(Camera),                           // tp_basicsize 
     240    0,                                        // tp_itemsize 
     241    (destructor) Camera_dealloc,              // tp_dealloc 
     242    0,                                        // tp_print 
     243    0,                                        // tp_getattr 
     244    0,                                        // tp_setattr 
     245    0,                                        // tp_compare 
     246    0,                                        // tp_repr 
     247    0,                                        // tp_as_number 
     248    0,                                        // tp_as_sequence 
     249    0,                                        // tp_as_mapping 
     250    0,                                        // tp_hash  
     251    0,                                        // tp_call 
     252    0,                                        // tp_str 
     253    0,                                        // tp_getattro 
     254    0,                                        // tp_setattro 
     255    0,                                        // tp_as_buffer 
     256    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, // tp_flags 
    257257    "Fetches images using OpenCV's camera capture functions.  " 
    258258    "The sole optional argument, `index`, is an integer indicating " 
    259259    "the camera to open (-1, the default, just opens some camera). " 
    260     "Throws `RuntimeError` if unable to open a camera.", /* tp_doc */ 
    261     0,                                            /* tp_traverse */ 
    262     0,                                            /* tp_clear */ 
    263     0,                                            /* tp_richcompare */ 
    264     0,                                            /* tp_weaklistoffset */ 
    265     0,                                            /* tp_iter */ 
    266     0,                                            /* tp_iternext */ 
    267     Camera_methods,                           /* tp_methods */ 
    268     0,                                        /* tp_members */ 
    269     0,                                        /* tp_getset */ 
    270     0,                                        /* tp_base */ 
    271     0,                                        /* tp_dict */ 
    272     0,                                        /* tp_descr_get */ 
    273     0,                                        /* tp_descr_set */ 
    274     0,                                        /* tp_dictoffset */ 
    275     (initproc) Camera_init,                   /* tp_init */ 
    276     0,                                        /* tp_alloc */ 
    277     Camera_new,                               /* tp_new */ 
     260    "Throws `RuntimeError` if unable to open a camera.", // tp_doc 
     261    0,                                            // tp_traverse 
     262    0,                                            // tp_clear 
     263    0,                                            // tp_richcompare 
     264    0,                                            // tp_weaklistoffset 
     265    0,                                            // tp_iter 
     266    0,                                            // tp_iternext 
     267    Camera_methods,                           // tp_methods 
     268    0,                                        // tp_members 
     269    0,                                        // tp_getset 
     270    0,                                        // tp_base 
     271    0,                                        // tp_dict 
     272    0,                                        // tp_descr_get 
     273    0,                                        // tp_descr_set 
     274    0,                                        // tp_dictoffset 
     275    (initproc) Camera_init,                   // tp_init 
     276    0,                                        // tp_alloc 
     277    Camera_new,                               // tp_new 
    278278}; 
    279279