mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
558ad6a11f
Former-commit-id: aee087b65b122e34e46b15854b94c720cbbec6b2
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
|
|
// STL includes
|
|
#include <csignal>
|
|
#include <iomanip>
|
|
|
|
// QT includes
|
|
#include <QImage>
|
|
|
|
// getoptPlusPLus includes
|
|
#include <getoptPlusPlus/getoptpp.h>
|
|
|
|
#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<SwitchParameter<> >('h', "help", "Show this help message and exit");
|
|
|
|
// parse all options
|
|
optionParser.parse(argc, const_cast<const char **>(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, 10.0);
|
|
grabber.start();
|
|
grabber.capture();
|
|
grabber.stop();
|
|
|
|
return 0;
|
|
}
|