Fawkes API  Fawkes Development Version
qa_fwcam.cpp
1 
2 /***************************************************************************
3  * qa_fvcam.cpp - QA for Firewire camera
4  *
5  * Created: Tue Apr 08 16:40:30 2008
6  * Copyright 2005-2008 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 /// @cond QA
25 
26 #include <cams/firewire.h>
27 #include <cams/factory.h>
28 
29 #include <cstdio>
30 
31 int
32 main(int argc, char **argv)
33 {
34  Camera *cam;
35  if ( argc > 1 ) {
36  printf("Opening from camera argument string '%s'\n", argv[1]);
37  cam = CameraFactory::instance(argv[1]);
38  } else {
39  printf("Opening plain Firewire camera\n");
40  cam = new FirewireCamera();
41  }
42  cam->open();
43  cam->start();
44  cam->print_info();
45 
46  for (unsigned int i = 0; i < 100; ++i) {
47  printf("Capturing\n");
48  cam->capture();
49  cam->dispose_buffer();
50  }
51 
52  printf("Closing\n");
53  cam->close();
54  delete cam;
55 
56  return 0;
57 }
58 
59 /// @endcond