Add SECAM video standard to v4l2

This commit is contained in:
brindosch 2017-10-04 21:23:45 +02:00
parent 6f443a48dd
commit 59ec767373
7 changed files with 26 additions and 9 deletions

View File

@ -416,6 +416,7 @@
"edt_conf_enum_linear" : "Linear", "edt_conf_enum_linear" : "Linear",
"edt_conf_enum_PAL" : "PAL", "edt_conf_enum_PAL" : "PAL",
"edt_conf_enum_NTSC" : "NTSC", "edt_conf_enum_NTSC" : "NTSC",
"edt_conf_enum_SECAM" : "SECAM",
"edt_conf_enum_logsilent" : "Stille", "edt_conf_enum_logsilent" : "Stille",
"edt_conf_enum_logwarn" : "Warnung", "edt_conf_enum_logwarn" : "Warnung",
"edt_conf_enum_logverbose" : "Ausführlich", "edt_conf_enum_logverbose" : "Ausführlich",

View File

@ -417,6 +417,7 @@
"edt_conf_enum_linear" : "Linear", "edt_conf_enum_linear" : "Linear",
"edt_conf_enum_PAL" : "PAL", "edt_conf_enum_PAL" : "PAL",
"edt_conf_enum_NTSC" : "NTSC", "edt_conf_enum_NTSC" : "NTSC",
"edt_conf_enum_SECAM" : "SECAM",
"edt_conf_enum_logsilent" : "Silent", "edt_conf_enum_logsilent" : "Silent",
"edt_conf_enum_logwarn" : "Warning", "edt_conf_enum_logwarn" : "Warning",
"edt_conf_enum_logverbose" : "Verbose", "edt_conf_enum_logverbose" : "Verbose",

View File

@ -102,7 +102,7 @@
/// * enable : Enable or disable the v4lgrabber (true/false) /// * enable : Enable or disable the v4lgrabber (true/false)
/// * device : V4L2 Device to use [default="/dev/video0"] /// * device : V4L2 Device to use [default="/dev/video0"]
/// * input : V4L2 input to use [default=0] /// * 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] /// * width : V4L2 width to set [default=-1]
/// * height : V4L2 height to set [default=-1] /// * height : V4L2 height to set [default=-1]
/// * frameDecimation : Frame decimation factor [default=2] /// * frameDecimation : Frame decimation factor [default=2]

View File

@ -6,6 +6,7 @@
enum VideoStandard { enum VideoStandard {
VIDEOSTANDARD_PAL, VIDEOSTANDARD_PAL,
VIDEOSTANDARD_NTSC, VIDEOSTANDARD_NTSC,
VIDEOSTANDARD_SECAM,
VIDEOSTANDARD_NO_CHANGE VIDEOSTANDARD_NO_CHANGE
}; };
@ -22,6 +23,10 @@ inline VideoStandard parseVideoStandard(QString videoStandard)
{ {
return VIDEOSTANDARD_NTSC; return VIDEOSTANDARD_NTSC;
} }
else if (videoStandard == "secam")
{
return VIDEOSTANDARD_SECAM;
}
// return the default NO_CHANGE // return the default NO_CHANGE
return VIDEOSTANDARD_NO_CHANGE; return VIDEOSTANDARD_NO_CHANGE;

View File

@ -462,6 +462,15 @@ void V4L2Grabber::init_device(VideoStandard videoStandard, int input)
} }
} }
break; 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: case VIDEOSTANDARD_NO_CHANGE:
default: default:
// No change to device settings // No change to device settings

View File

@ -40,10 +40,10 @@
{ {
"type" : "string", "type" : "string",
"title" : "edt_conf_v4l2_standard_title", "title" : "edt_conf_v4l2_standard_title",
"enum" : ["PAL","NTSC"], "enum" : ["PAL","NTSC","SECAM"],
"default" : "PAL", "default" : "PAL",
"options" : { "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, "required" : true,
"propertyOrder" : 4 "propertyOrder" : 4

View File

@ -57,7 +57,7 @@ int main(int argc, char** argv)
Parser parser("V4L capture application for Hyperion"); Parser parser("V4L capture application for Hyperion");
Option & argDevice = parser.add<Option> ('d', "device", "The device to use [default: %1]", "auto"); 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"); 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 & 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"); 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("pal", VIDEOSTANDARD_PAL);
argVideoStandard.addSwitch("ntsc", VIDEOSTANDARD_NTSC); argVideoStandard.addSwitch("ntsc", VIDEOSTANDARD_NTSC);
argVideoStandard.addSwitch("secam", VIDEOSTANDARD_SECAM);
argVideoStandard.addSwitch("no-change", VIDEOSTANDARD_NO_CHANGE); argVideoStandard.addSwitch("no-change", VIDEOSTANDARD_NO_CHANGE);
argPixelFormat.addSwitch("yuyv", PIXELFORMAT_YUYV); argPixelFormat.addSwitch("yuyv", PIXELFORMAT_YUYV);