ViSP
test1394TwoResetBus.cpp
1 /****************************************************************************
2  *
3  * $Id: test1394TwoResetBus.cpp 4574 2014-01-09 08:48:51Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Firewire cameras video capture.
36  *
37  * Authors:
38  * Fabien Spindler
39  *
40  *****************************************************************************/
41 
42 
52 #include <visp/vpConfig.h>
53 #include <visp/vpDebug.h>
54 
55 #include <iostream>
56 
57 #if defined(VISP_HAVE_DC1394_2)
58 
59 #include <visp/vp1394TwoGrabber.h>
60 #include <visp/vpImage.h>
61 #include <visp/vpImageIo.h>
62 
63 
76 int
77 main()
78 {
79  try {
80  std::cout << "IEEE1394 bus reset in progress..." << std::endl;
82  g.resetBus(); // Reset the bus attached to the first camera found
83  std::cout << "IEEE1394 bus was reset." << std::endl;
84 
86  g.acquire(I);
87  // std::cout << "write /tmp/test.pgm" << std::endl;
88  // vpImageIo::write(I, "/tmp/test.pgm");
89  }
90  catch (...) {
91  vpCERROR << "Failure: exit" << std::endl;
92  }
93 }
94 #else
95 int
96 main()
97 {
98  vpTRACE("Ieee 1394 grabber capabilities are not available...\n"
99  "You should install libdc1394-2 to use this binary.") ;
100 }
101 
102 #endif
103 
104 /*
105  * Local variables:
106  * c-basic-offset: 2
107  * End:
108  */
#define vpTRACE
Definition: vpDebug.h:418
#define vpCERROR
Definition: vpDebug.h:369
void acquire(vpImage< unsigned char > &I)
Class for firewire ieee1394 video devices using libdc1394-2.x api.