mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge pull request #73 from lobocobra/patch-1
Fix error in start script Former-commit-id: 6a02b865c86befa29e970a7465b256cde5335e95
This commit is contained in:
36
include/grabber/PixelFormat.h
Normal file
36
include/grabber/PixelFormat.h
Normal 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;
|
||||
}
|
@@ -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;
|
||||
|
@@ -18,6 +18,7 @@ public:
|
||||
V4L2Wrapper(const std::string & device,
|
||||
int input,
|
||||
VideoStandard videoStandard,
|
||||
PixelFormat pixelFormat,
|
||||
int width,
|
||||
int height,
|
||||
int frameDecimation,
|
||||
|
Reference in New Issue
Block a user