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