Merge branch 'master' into merge_v4l2

Former-commit-id: 97b281cc14b3bc239fc5eab1f66c9d15e67f753f
This commit is contained in:
johan
2014-02-23 21:36:39 +01:00
10 changed files with 75 additions and 20 deletions

View File

@@ -1,10 +1,13 @@
// getoptPlusPLus includes
#include <getoptPlusPlus/getoptpp.h>
// grabber includes
#include <grabber/VideoStandard.h>
using namespace vlofgren;
/// Data parameter for the video standard
typedef vlofgren::PODParameter<V4L2Grabber::VideoStandard> VideoStandardParameter;
typedef vlofgren::PODParameter<VideoStandard> VideoStandardParameter;
namespace vlofgren {
/// Translates a string (as passed on the commandline) to a color standard
@@ -13,24 +16,24 @@ namespace vlofgren {
/// @return The color standard
/// @throws Parameter::ParameterRejected If the string did not result in a video standard
template<>
V4L2Grabber::VideoStandard VideoStandardParameter::validate(const std::string& s) throw (Parameter::ParameterRejected)
VideoStandard VideoStandardParameter::validate(const std::string& s) throw (Parameter::ParameterRejected)
{
QString input = QString::fromStdString(s).toLower();
if (input == "pal")
{
return V4L2Grabber::PAL;
return VIDEOSTANDARD_PAL;
}
else if (input == "ntsc")
{
return V4L2Grabber::NTSC;
return VIDEOSTANDARD_NTSC;
}
else if (input == "no-change")
{
return V4L2Grabber::NO_CHANGE;
return VIDEOSTANDARD_NO_CHANGE;
}
throw Parameter::ParameterRejected("Invalid value for video standard. Valid values are: PAL, NTSC, and NO-CHANGE");
return V4L2Grabber::NO_CHANGE;
return VIDEOSTANDARD_NO_CHANGE;
}
}

View File

@@ -69,7 +69,7 @@ int main(int argc, char** argv)
// set defaults
argDevice.setDefault("/dev/video0");
argVideoStandard.setDefault(V4L2Grabber::NO_CHANGE);
argVideoStandard.setDefault(VIDEOSTANDARD_NO_CHANGE);
argInput.setDefault(-1);
argWidth.setDefault(-1);
argHeight.setDefault(-1);

View File

@@ -179,13 +179,13 @@ int main(int argc, char** argv)
v4l2Grabber = new V4L2Grabber(
grabberConfig.get("device", "/dev/video0").asString(),
grabberConfig.get("input", 0).asInt(),
grabberConfig.get("standard", V4L2Grabber::NONE),
parseVideoStandard(grabberConfig.get("standard", "NONE").asString()),
grabberConfig.get("width", -1).asInt(),
grabberConfig.get("height", -1).asInt(),
grabberConfig.get("frameDecimation", 2).asInt(),
grabberConfig.get("sizeDecimation", 8).asInt(),
grabberConfig.get("sizeDecimation", 8).asInt());
v4l2Grabber->set3D(grabberConfig.get("mode", VIDEO_2D));
v4l2Grabber->set3D(parse3DMode(grabberConfig.get("mode", "2D").asString()));
v4l2Grabber->setCropping(
grabberConfig.get("cropLeft", 0).asInt(),
grabberConfig.get("cropRight", 0).asInt(),