mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Add SECAM video standard to v4l2
This commit is contained in:
parent
6f443a48dd
commit
59ec767373
@ -416,6 +416,7 @@
|
||||
"edt_conf_enum_linear" : "Linear",
|
||||
"edt_conf_enum_PAL" : "PAL",
|
||||
"edt_conf_enum_NTSC" : "NTSC",
|
||||
"edt_conf_enum_SECAM" : "SECAM",
|
||||
"edt_conf_enum_logsilent" : "Stille",
|
||||
"edt_conf_enum_logwarn" : "Warnung",
|
||||
"edt_conf_enum_logverbose" : "Ausführlich",
|
||||
|
@ -417,6 +417,7 @@
|
||||
"edt_conf_enum_linear" : "Linear",
|
||||
"edt_conf_enum_PAL" : "PAL",
|
||||
"edt_conf_enum_NTSC" : "NTSC",
|
||||
"edt_conf_enum_SECAM" : "SECAM",
|
||||
"edt_conf_enum_logsilent" : "Silent",
|
||||
"edt_conf_enum_logwarn" : "Warning",
|
||||
"edt_conf_enum_logverbose" : "Verbose",
|
||||
|
@ -102,7 +102,7 @@
|
||||
/// * enable : Enable or disable the v4lgrabber (true/false)
|
||||
/// * device : V4L2 Device to use [default="/dev/video0"]
|
||||
/// * input : V4L2 input to use [default=0]
|
||||
/// * standard : Video standard (no-change/PAL/NTSC) [default="no-change"]
|
||||
/// * standard : Video standard (PAL/NTSC/SECAM) [default="PAL"]
|
||||
/// * width : V4L2 width to set [default=-1]
|
||||
/// * height : V4L2 height to set [default=-1]
|
||||
/// * frameDecimation : Frame decimation factor [default=2]
|
||||
|
@ -6,6 +6,7 @@
|
||||
enum VideoStandard {
|
||||
VIDEOSTANDARD_PAL,
|
||||
VIDEOSTANDARD_NTSC,
|
||||
VIDEOSTANDARD_SECAM,
|
||||
VIDEOSTANDARD_NO_CHANGE
|
||||
};
|
||||
|
||||
@ -22,6 +23,10 @@ inline VideoStandard parseVideoStandard(QString videoStandard)
|
||||
{
|
||||
return VIDEOSTANDARD_NTSC;
|
||||
}
|
||||
else if (videoStandard == "secam")
|
||||
{
|
||||
return VIDEOSTANDARD_SECAM;
|
||||
}
|
||||
|
||||
// return the default NO_CHANGE
|
||||
return VIDEOSTANDARD_NO_CHANGE;
|
||||
|
@ -90,7 +90,7 @@ bool V4L2Grabber::init()
|
||||
{
|
||||
getV4Ldevices();
|
||||
QString v4lDevices_str;
|
||||
|
||||
|
||||
// show list only once
|
||||
if ( ! QString(QSTRING_CSTR(_deviceName)).startsWith("/dev/") )
|
||||
{
|
||||
@ -153,7 +153,7 @@ bool V4L2Grabber::init()
|
||||
ErrorIf( !_deviceAutoDiscoverEnabled, _log, "V4l2 init failed (%s)", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return _initialized;
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ void V4L2Grabber::getV4Ldevices()
|
||||
{
|
||||
QDirIterator it("/sys/class/video4linux/", QDirIterator::NoIteratorFlags);
|
||||
while(it.hasNext())
|
||||
{
|
||||
{
|
||||
//_v4lDevices
|
||||
QString dev = it.next();
|
||||
if (it.fileName().startsWith("video"))
|
||||
@ -462,6 +462,15 @@ void V4L2Grabber::init_device(VideoStandard videoStandard, int input)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case VIDEOSTANDARD_SECAM:
|
||||
{
|
||||
v4l2_std_id std_id = V4L2_STD_SECAM;
|
||||
if (-1 == xioctl(VIDIOC_S_STD, &std_id))
|
||||
{
|
||||
throw_errno_exception("VIDIOC_S_STD");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case VIDEOSTANDARD_NO_CHANGE:
|
||||
default:
|
||||
// No change to device settings
|
||||
@ -768,7 +777,7 @@ int V4L2Grabber::read_frame()
|
||||
emit readError(e.what());
|
||||
rc = false;
|
||||
}
|
||||
|
||||
|
||||
return rc ? 1 : 0;
|
||||
}
|
||||
|
||||
@ -810,7 +819,7 @@ void V4L2Grabber::process_image(const uint8_t * data)
|
||||
unsigned xMax = image.width() * _x_frac_max;
|
||||
unsigned yMax = image.height() * _y_frac_max;
|
||||
|
||||
|
||||
|
||||
for (unsigned x = xOffset; noSignal && x < xMax; ++x)
|
||||
{
|
||||
for (unsigned y = yOffset; noSignal && y < yMax; ++y)
|
||||
|
@ -40,10 +40,10 @@
|
||||
{
|
||||
"type" : "string",
|
||||
"title" : "edt_conf_v4l2_standard_title",
|
||||
"enum" : ["PAL","NTSC"],
|
||||
"enum" : ["PAL","NTSC","SECAM"],
|
||||
"default" : "PAL",
|
||||
"options" : {
|
||||
"enum_titles" : ["edt_conf_enum_PAL", "edt_conf_enum_NTSC"]
|
||||
"enum_titles" : ["edt_conf_enum_PAL", "edt_conf_enum_NTSC", "edt_conf_enum_SECAM"]
|
||||
},
|
||||
"required" : true,
|
||||
"propertyOrder" : 4
|
||||
|
@ -57,7 +57,7 @@ int main(int argc, char** argv)
|
||||
Parser parser("V4L capture application for Hyperion");
|
||||
|
||||
Option & argDevice = parser.add<Option> ('d', "device", "The device to use [default: %1]", "auto");
|
||||
SwitchOption<VideoStandard> & argVideoStandard= parser.add<SwitchOption<VideoStandard>>('v', "video-standard", "The used video standard. Valid values are PAL, NTSC or no-change. [default: %1]", "no-change");
|
||||
SwitchOption<VideoStandard> & argVideoStandard= parser.add<SwitchOption<VideoStandard>>('v', "video-standard", "The used video standard. Valid values are PAL, NTSC, SECAM or no-change. [default: %1]", "no-change");
|
||||
SwitchOption<PixelFormat> & argPixelFormat = parser.add<SwitchOption<PixelFormat>> (0x0, "pixel-format", "The use pixel format. Valid values are YUYV, UYVY, RGB32 or no-change. [default: %1]", "no-change");
|
||||
IntOption & argInput = parser.add<IntOption> (0x0, "input", "Input channel (optional)", "-1");
|
||||
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Try to set the width of the video input [default: %1]", "-1");
|
||||
@ -92,6 +92,7 @@ int main(int argc, char** argv)
|
||||
|
||||
argVideoStandard.addSwitch("pal", VIDEOSTANDARD_PAL);
|
||||
argVideoStandard.addSwitch("ntsc", VIDEOSTANDARD_NTSC);
|
||||
argVideoStandard.addSwitch("secam", VIDEOSTANDARD_SECAM);
|
||||
argVideoStandard.addSwitch("no-change", VIDEOSTANDARD_NO_CHANGE);
|
||||
|
||||
argPixelFormat.addSwitch("yuyv", PIXELFORMAT_YUYV);
|
||||
|
Loading…
Reference in New Issue
Block a user