// STL includes #include #include // QT includes #include // getoptPlusPLus includes #include #include "V4L2Grabber.h" using namespace vlofgren; int main(int argc, char** argv) { try { // create the option parser and initialize all parameters OptionsParser optionParser("Simple application to send a command to hyperion using the Json interface"); ParameterSet & parameters = optionParser.getParameters(); SwitchParameter<> & argHelp = parameters.add >('h', "help", "Show this help message and exit"); // parse all options optionParser.parse(argc, const_cast(argv)); // check if we need to display the usage. exit if we do. if (argHelp.isSet()) { optionParser.usage(); return 0; } } catch (const std::runtime_error & e) { // An error occured. Display error and quit std::cerr << e.what() << std::endl; return 1; } V4L2Grabber grabber("/dev/video0", 0, V4L2Grabber::PAL, 25, 8); grabber.start(); grabber.capture(250); grabber.stop(); return 0; }