Merge pull request #73 from lobocobra/patch-1

Fix error in start script


Former-commit-id: 6a02b865c86befa29e970a7465b256cde5335e95
This commit is contained in:
poljvd
2014-03-31 17:36:36 +02:00
committed by johan
11 changed files with 198 additions and 55 deletions

View File

@@ -0,0 +1,36 @@
#pragma once
#include <string>
#include <algorithm>
/**
* Enumeration of the possible pixel formats the grabber can be set to
*/
enum PixelFormat {
PIXELFORMAT_YUYV,
PIXELFORMAT_UYVY,
PIXELFORMAT_RGB32,
PIXELFORMAT_NO_CHANGE
};
inline PixelFormat parsePixelFormat(std::string pixelFormat)
{
// convert to lower case
std::transform(pixelFormat.begin(), pixelFormat.end(), pixelFormat.begin(), ::tolower);
if (pixelFormat == "yuyv")
{
return PIXELFORMAT_YUYV;
}
else if (pixelFormat == "uyvy")
{
return PIXELFORMAT_UYVY;
}
else if (pixelFormat == "rgb32")
{
return PIXELFORMAT_RGB32;
}
// return the default NO_CHANGE
return PIXELFORMAT_NO_CHANGE;
}

View File

@@ -15,6 +15,7 @@
// grabber includes
#include <grabber/VideoStandard.h>
#include <grabber/PixelFormat.h>
/// Capture class for V4L2 devices
///
@@ -26,7 +27,7 @@ class V4L2Grabber : public QObject
public:
V4L2Grabber(const std::string & device,
int input,
VideoStandard videoStandard,
VideoStandard videoStandard, PixelFormat pixelFormat,
int width,
int height,
int frameDecimation,
@@ -104,7 +105,7 @@ private:
int _fileDescriptor;
std::vector<buffer> _buffers;
uint32_t _pixelFormat;
PixelFormat _pixelFormat;
int _width;
int _height;
int _cropLeft;

View File

@@ -18,6 +18,7 @@ public:
V4L2Wrapper(const std::string & device,
int input,
VideoStandard videoStandard,
PixelFormat pixelFormat,
int width,
int height,
int frameDecimation,