Fawkes API  Fawkes Development Version
v4l1.h
1 
2 /***************************************************************************
3  * v4l1.h - This header defines a Video4Linux cam
4  *
5  * Generated: Fri Mar 11 17:46:31 2005
6  * Copyright 2005 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _FIREVISION_CAMS_V4L1_H_
25 #define _FIREVISION_CAMS_V4L1_H_
26 
27 #include <fvcams/camera.h>
28 
29 namespace firevision {
30 
31 class CameraArgumentParser;
32 class V4L1CameraData;
33 class V4LCamera;
34 
35 class V4L1Camera : public Camera
36 {
37  friend V4LCamera;
38 
39 public:
40  V4L1Camera(const char *device_name = "/dev/video0");
41  V4L1Camera(const CameraArgumentParser *cap);
42  virtual ~V4L1Camera();
43 
44  virtual void open();
45  virtual void start();
46  virtual void stop();
47  virtual void close();
48  virtual void flush();
49  virtual void capture();
50  virtual void print_info();
51  virtual bool ready();
52 
53  virtual unsigned char *buffer();
54  virtual unsigned int buffer_size();
55  virtual void dispose_buffer();
56 
57  virtual unsigned int pixel_width();
58  virtual unsigned int pixel_height();
59  virtual colorspace_t colorspace();
60 
61  virtual void set_image_number(unsigned int n);
62 
63 protected:
64  V4L1Camera(const char *device_name, int dev);
65 
66 private:
67  virtual void post_open();
68 
69 private:
70  static const int MMAP = 1;
71  static const int READ = 2;
72 
73  V4L1CameraData *data_;
74 
75  bool opened;
76  bool started;
77 
78  int capture_method;
79 
80  int dev;
81  unsigned char *frame_buffer;
82 };
83 
84 } // end namespace firevision
85 
86 #endif
firevision::V4L1Camera::open
virtual void open()
Definition: v4l1.cpp:141
firevision::V4L1Camera::buffer_size
virtual unsigned int buffer_size()
Definition: v4l1.cpp:407
firevision::V4L1Camera::ready
virtual bool ready()
Definition: v4l1.cpp:452
firevision::V4L1Camera::colorspace
virtual colorspace_t colorspace()
Definition: v4l1.cpp:441
firevision::V4L1Camera::close
virtual void close()
Definition: v4l1.cpp:413
firevision::V4L1Camera::flush
virtual void flush()
Definition: v4l1.cpp:447
firevision::V4L1Camera::set_image_number
virtual void set_image_number(unsigned int n)
Definition: v4l1.cpp:458
firevision::V4L1Camera::dispose_buffer
virtual void dispose_buffer()
Definition: v4l1.cpp:389
firevision::V4L1Camera::start
virtual void start()
Definition: v4l1.cpp:206
firevision::V4L1Camera::pixel_height
virtual unsigned int pixel_height()
Definition: v4l1.cpp:431
firevision::V4L1Camera::stop
virtual void stop()
Definition: v4l1.cpp:217
firevision::V4L1Camera::capture
virtual void capture()
Definition: v4l1.cpp:360
firevision::V4L1Camera::print_info
virtual void print_info()
Definition: v4l1.cpp:223
firevision::CameraArgumentParser
Definition: camargp.h:39
firevision::V4L1Camera::buffer
virtual unsigned char * buffer()
Definition: v4l1.cpp:401
firevision::V4L1Camera::~V4L1Camera
virtual ~V4L1Camera()
Destructor.
Definition: v4l1.cpp:135
firevision::V4L1Camera::V4L1Camera
V4L1Camera(const char *device_name="/dev/video0")
Constructor.
Definition: v4l1.cpp:92
firevision::V4L1Camera::pixel_width
virtual unsigned int pixel_width()
Definition: v4l1.cpp:421