mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Improve Platform Grabber UI (#1073)
This commit is contained in:
parent
e2c8735fde
commit
758d9a70c5
@ -298,7 +298,6 @@
|
|||||||
"edt_conf_fbs_heading_title": "Flatbuffers Server",
|
"edt_conf_fbs_heading_title": "Flatbuffers Server",
|
||||||
"edt_conf_fbs_timeout_expl": "If no data are received for the given period, the component will be (soft) disabled.",
|
"edt_conf_fbs_timeout_expl": "If no data are received for the given period, the component will be (soft) disabled.",
|
||||||
"edt_conf_fbs_timeout_title": "Timeout",
|
"edt_conf_fbs_timeout_title": "Timeout",
|
||||||
"edt_conf_fg_device_title": "Device",
|
|
||||||
"edt_conf_fg_display_expl": "Select which desktop should be captured (multi monitor setup)",
|
"edt_conf_fg_display_expl": "Select which desktop should be captured (multi monitor setup)",
|
||||||
"edt_conf_fg_display_title": "Display",
|
"edt_conf_fg_display_title": "Display",
|
||||||
"edt_conf_fg_frequency_Hz_expl": "How fast new pictures are captured",
|
"edt_conf_fg_frequency_Hz_expl": "How fast new pictures are captured",
|
||||||
|
@ -1,45 +1,45 @@
|
|||||||
$(document).ready( function() {
|
$(document).ready(function () {
|
||||||
performTranslation();
|
performTranslation();
|
||||||
var conf_editor_v4l2 = null;
|
var conf_editor_v4l2 = null;
|
||||||
var conf_editor_fg = null;
|
var conf_editor_fg = null;
|
||||||
var conf_editor_instCapt = null;
|
var conf_editor_instCapt = null;
|
||||||
var V4L2_AVAIL = window.serverInfo.grabbers.available.includes("v4l2");
|
var V4L2_AVAIL = window.serverInfo.grabbers.available.includes("v4l2");
|
||||||
|
|
||||||
if(V4L2_AVAIL) {
|
if (V4L2_AVAIL) {
|
||||||
// Dynamic v4l2 enum schema
|
// Dynamic v4l2 enum schema
|
||||||
var v4l2_dynamic_enum_schema = {
|
var v4l2_dynamic_enum_schema = {
|
||||||
"available_devices":
|
"available_devices":
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_conf_v4l2_device_title",
|
"title": "edt_conf_v4l2_device_title",
|
||||||
"propertyOrder" : 1,
|
"propertyOrder": 1,
|
||||||
"required" : true
|
"required": true
|
||||||
},
|
},
|
||||||
"device_inputs":
|
"device_inputs":
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_conf_v4l2_input_title",
|
"title": "edt_conf_v4l2_input_title",
|
||||||
"propertyOrder" : 3,
|
"propertyOrder": 3,
|
||||||
"required" : true
|
"required": true
|
||||||
},
|
},
|
||||||
"resolutions":
|
"resolutions":
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_conf_v4l2_resolution_title",
|
"title": "edt_conf_v4l2_resolution_title",
|
||||||
"propertyOrder" : 6,
|
"propertyOrder": 6,
|
||||||
"required" : true
|
"required": true
|
||||||
},
|
},
|
||||||
"framerates":
|
"framerates":
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_conf_v4l2_framerate_title",
|
"title": "edt_conf_v4l2_framerate_title",
|
||||||
"propertyOrder" : 9,
|
"propertyOrder": 9,
|
||||||
"required" : true
|
"required": true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Build dynamic v4l2 enum schema parts
|
// Build dynamic v4l2 enum schema parts
|
||||||
var buildSchemaPart = function(key, schema, device) {
|
var buildSchemaPart = function (key, schema, device) {
|
||||||
if (schema[key]) {
|
if (schema[key]) {
|
||||||
var enumVals = [];
|
var enumVals = [];
|
||||||
var enumTitelVals = [];
|
var enumTitelVals = [];
|
||||||
@ -76,31 +76,31 @@ $(document).ready( function() {
|
|||||||
"type": schema[key].type,
|
"type": schema[key].type,
|
||||||
"title": schema[key].title,
|
"title": schema[key].title,
|
||||||
"enum": [].concat(["auto"], enumVals, ["custom"]),
|
"enum": [].concat(["auto"], enumVals, ["custom"]),
|
||||||
"options" :
|
"options":
|
||||||
{
|
{
|
||||||
"enum_titles" : [].concat(["edt_conf_enum_automatic"], enumTitelVals, ["edt_conf_enum_custom"]),
|
"enum_titles": [].concat(["edt_conf_enum_automatic"], enumTitelVals, ["edt_conf_enum_custom"]),
|
||||||
},
|
},
|
||||||
"propertyOrder" : schema[key].propertyOrder,
|
"propertyOrder": schema[key].propertyOrder,
|
||||||
"required" : schema[key].required
|
"required": schema[key].required
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Switch between visible states
|
// Switch between visible states
|
||||||
function toggleOption(option, state) {
|
function toggleOption(option, state) {
|
||||||
$('[data-schemapath="root.grabberV4L2.'+option+'"]').toggle(state);
|
$('[data-schemapath="root.grabberV4L2.' + option + '"]').toggle(state);
|
||||||
if (state) (
|
if (state) (
|
||||||
$('[data-schemapath="root.grabberV4L2.'+option+'"]').addClass('col-md-12'),
|
$('[data-schemapath="root.grabberV4L2.' + option + '"]').addClass('col-md-12'),
|
||||||
$('label[for="root_grabberV4L2_'+option+'"]').css('left','10px'),
|
$('label[for="root_grabberV4L2_' + option + '"]').css('left', '10px'),
|
||||||
$('[id="root_grabberV4L2_'+option+'"]').css('left','10px')
|
$('[id="root_grabberV4L2_' + option + '"]').css('left', '10px')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Watch all v4l2 dynamic fields
|
// Watch all v4l2 dynamic fields
|
||||||
var setWatchers = function(schema) {
|
var setWatchers = function (schema) {
|
||||||
var path = 'root.grabberV4L2.';
|
var path = 'root.grabberV4L2.';
|
||||||
Object.keys(schema).forEach(function(key) {
|
Object.keys(schema).forEach(function (key) {
|
||||||
conf_editor_v4l2.watch(path + key, function() {
|
conf_editor_v4l2.watch(path + key, function () {
|
||||||
var ed = conf_editor_v4l2.getEditor(path + key);
|
var ed = conf_editor_v4l2.getEditor(path + key);
|
||||||
var val = ed.getValue();
|
var val = ed.getValue();
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ $(document).ready( function() {
|
|||||||
var V4L2properties = ['device_inputs', 'resolutions', 'framerates'];
|
var V4L2properties = ['device_inputs', 'resolutions', 'framerates'];
|
||||||
if (val == 'custom') {
|
if (val == 'custom') {
|
||||||
var grabberV4L2 = ed.parent;
|
var grabberV4L2 = ed.parent;
|
||||||
V4L2properties.forEach(function(item) {
|
V4L2properties.forEach(function (item) {
|
||||||
buildSchemaPart(item, v4l2_dynamic_enum_schema, 'none');
|
buildSchemaPart(item, v4l2_dynamic_enum_schema, 'none');
|
||||||
grabberV4L2.original_schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
grabberV4L2.original_schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
||||||
grabberV4L2.schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
grabberV4L2.schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
||||||
@ -123,9 +123,8 @@ $(document).ready( function() {
|
|||||||
|
|
||||||
conf_editor_v4l2.getEditor(path + 'standard').enable();
|
conf_editor_v4l2.getEditor(path + 'standard').enable();
|
||||||
toggleOption('device', true);
|
toggleOption('device', true);
|
||||||
|
|
||||||
} else if (val == 'auto') {
|
} else if (val == 'auto') {
|
||||||
V4L2properties.forEach(function(item) {
|
V4L2properties.forEach(function (item) {
|
||||||
conf_editor_v4l2.getEditor(path + item).setValue('auto');
|
conf_editor_v4l2.getEditor(path + item).setValue('auto');
|
||||||
conf_editor_v4l2.getEditor(path + item).disable();
|
conf_editor_v4l2.getEditor(path + item).disable();
|
||||||
});
|
});
|
||||||
@ -134,12 +133,11 @@ $(document).ready( function() {
|
|||||||
conf_editor_v4l2.getEditor(path + 'standard').disable();
|
conf_editor_v4l2.getEditor(path + 'standard').disable();
|
||||||
|
|
||||||
(toggleOption('device', false), toggleOption('input', false),
|
(toggleOption('device', false), toggleOption('input', false),
|
||||||
toggleOption('width', false), toggleOption('height', false),
|
toggleOption('width', false), toggleOption('height', false),
|
||||||
toggleOption('fps', false));
|
toggleOption('fps', false));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var grabberV4L2 = ed.parent;
|
var grabberV4L2 = ed.parent;
|
||||||
V4L2properties.forEach(function(item) {
|
V4L2properties.forEach(function (item) {
|
||||||
buildSchemaPart(item, v4l2_dynamic_enum_schema, val);
|
buildSchemaPart(item, v4l2_dynamic_enum_schema, val);
|
||||||
grabberV4L2.original_schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
grabberV4L2.original_schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
||||||
grabberV4L2.schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
grabberV4L2.schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
||||||
@ -176,12 +174,12 @@ $(document).ready( function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Insert dynamic v4l2 enum schema parts
|
// Insert dynamic v4l2 enum schema parts
|
||||||
Object.keys(v4l2_dynamic_enum_schema).forEach(function(key) {
|
Object.keys(v4l2_dynamic_enum_schema).forEach(function (key) {
|
||||||
buildSchemaPart(key, v4l2_dynamic_enum_schema, window.serverConfig.grabberV4L2.device);
|
buildSchemaPart(key, v4l2_dynamic_enum_schema, window.serverConfig.grabberV4L2.device);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(window.showOptHelp) {
|
if (window.showOptHelp) {
|
||||||
// Instance Capture
|
// Instance Capture
|
||||||
$('#conf_cont').append(createRow('conf_cont_instCapt'));
|
$('#conf_cont').append(createRow('conf_cont_instCapt'));
|
||||||
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
|
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
|
||||||
@ -193,7 +191,7 @@ $(document).ready( function() {
|
|||||||
$('#conf_cont_fg').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
|
$('#conf_cont_fg').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
|
||||||
|
|
||||||
// V4L2 - hide if not available
|
// V4L2 - hide if not available
|
||||||
if(V4L2_AVAIL) {
|
if (V4L2_AVAIL) {
|
||||||
$('#conf_cont').append(createRow('conf_cont_v4l'));
|
$('#conf_cont').append(createRow('conf_cont_v4l'));
|
||||||
$('#conf_cont_v4l').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
$('#conf_cont_v4l').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
||||||
$('#conf_cont_v4l').append(createHelpTable(window.schema.grabberV4L2.properties, $.i18n("edt_conf_v4l2_heading_title")));
|
$('#conf_cont_v4l').append(createHelpTable(window.schema.grabberV4L2.properties, $.i18n("edt_conf_v4l2_heading_title")));
|
||||||
@ -202,7 +200,7 @@ $(document).ready( function() {
|
|||||||
$('#conf_cont').addClass('row');
|
$('#conf_cont').addClass('row');
|
||||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
|
||||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
|
||||||
if(V4L2_AVAIL) {
|
if (V4L2_AVAIL) {
|
||||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -212,11 +210,11 @@ $(document).ready( function() {
|
|||||||
instCapture: window.schema.instCapture
|
instCapture: window.schema.instCapture
|
||||||
}, true, true);
|
}, true, true);
|
||||||
|
|
||||||
conf_editor_instCapt.on('change',function() {
|
conf_editor_instCapt.on('change', function () {
|
||||||
conf_editor_instCapt.validate().length || window.readOnlyMode ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
|
conf_editor_instCapt.validate().length || window.readOnlyMode ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btn_submit_instCapt').off().on('click',function() {
|
$('#btn_submit_instCapt').off().on('click', function () {
|
||||||
requestWriteConfig(conf_editor_instCapt.getValue());
|
requestWriteConfig(conf_editor_instCapt.getValue());
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -225,24 +223,46 @@ $(document).ready( function() {
|
|||||||
framegrabber: window.schema.framegrabber
|
framegrabber: window.schema.framegrabber
|
||||||
}, true, true);
|
}, true, true);
|
||||||
|
|
||||||
conf_editor_fg.on('change',function() {
|
conf_editor_fg.on('change', function () {
|
||||||
|
//Remove Grabbers which are not supported
|
||||||
|
var grabbers = window.serverInfo.grabbers.available;
|
||||||
|
|
||||||
|
var selector = "root_framegrabber_type";
|
||||||
|
var options = $("#" + selector + " option");
|
||||||
|
|
||||||
|
for (var i = 0; i < options.length; i++) {
|
||||||
|
var type = options[i].value;
|
||||||
|
if (grabbers.indexOf(type) === -1) {
|
||||||
|
$("#" + selector + " option[value='" + type + "']").remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.serverInfo.grabbers.active)
|
||||||
|
{
|
||||||
|
var activegrabber = window.serverInfo.grabbers.active.toLowerCase();
|
||||||
|
$("#" + selector + " option[value='" + activegrabber + "']").attr('selected', 'selected');
|
||||||
|
}
|
||||||
|
|
||||||
|
var selectedType = $("#root_framegrabber_type").val();
|
||||||
|
filerFgGrabberOptions(selectedType);
|
||||||
|
|
||||||
conf_editor_fg.validate().length || window.readOnlyMode ? $('#btn_submit_fg').attr('disabled', true) : $('#btn_submit_fg').attr('disabled', false);
|
conf_editor_fg.validate().length || window.readOnlyMode ? $('#btn_submit_fg').attr('disabled', true) : $('#btn_submit_fg').attr('disabled', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btn_submit_fg').off().on('click',function() {
|
$('#btn_submit_fg').off().on('click', function () {
|
||||||
requestWriteConfig(conf_editor_fg.getValue());
|
requestWriteConfig(conf_editor_fg.getValue());
|
||||||
});
|
});
|
||||||
|
|
||||||
if(V4L2_AVAIL) {
|
if (V4L2_AVAIL) {
|
||||||
conf_editor_v4l2 = createJsonEditor('editor_container_v4l2', {
|
conf_editor_v4l2 = createJsonEditor('editor_container_v4l2', {
|
||||||
grabberV4L2 : window.schema.grabberV4L2
|
grabberV4L2: window.schema.grabberV4L2
|
||||||
}, true, true);
|
}, true, true);
|
||||||
|
|
||||||
conf_editor_v4l2.on('change',function() {
|
conf_editor_v4l2.on('change', function () {
|
||||||
conf_editor_v4l2.validate().length || window.readOnlyMode ? $('#btn_submit_v4l2').attr('disabled', true) : $('#btn_submit_v4l2').attr('disabled', false);
|
conf_editor_v4l2.validate().length || window.readOnlyMode ? $('#btn_submit_v4l2').attr('disabled', true) : $('#btn_submit_v4l2').attr('disabled', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
conf_editor_v4l2.on('ready', function() {
|
conf_editor_v4l2.on('ready', function () {
|
||||||
setWatchers(v4l2_dynamic_enum_schema);
|
setWatchers(v4l2_dynamic_enum_schema);
|
||||||
|
|
||||||
if (window.serverConfig.grabberV4L2.available_devices == 'custom' && window.serverConfig.grabberV4L2.device != 'auto')
|
if (window.serverConfig.grabberV4L2.available_devices == 'custom' && window.serverConfig.grabberV4L2.device != 'auto')
|
||||||
@ -252,7 +272,7 @@ $(document).ready( function() {
|
|||||||
conf_editor_v4l2.getEditor('root.grabberV4L2.available_devices').setValue('auto');
|
conf_editor_v4l2.getEditor('root.grabberV4L2.available_devices').setValue('auto');
|
||||||
|
|
||||||
if (window.serverConfig.grabberV4L2.available_devices == 'auto') {
|
if (window.serverConfig.grabberV4L2.available_devices == 'auto') {
|
||||||
['device_inputs', 'standard', 'resolutions', 'framerates'].forEach(function(item) {
|
['device_inputs', 'standard', 'resolutions', 'framerates'].forEach(function (item) {
|
||||||
conf_editor_v4l2.getEditor('root.grabberV4L2.' + item).setValue('auto');
|
conf_editor_v4l2.getEditor('root.grabberV4L2.' + item).setValue('auto');
|
||||||
conf_editor_v4l2.getEditor('root.grabberV4L2.' + item).disable();
|
conf_editor_v4l2.getEditor('root.grabberV4L2.' + item).disable();
|
||||||
});
|
});
|
||||||
@ -266,10 +286,9 @@ $(document).ready( function() {
|
|||||||
|
|
||||||
if (window.serverConfig.grabberV4L2.framerates == 'custom' && window.serverConfig.grabberV4L2.device != 'auto')
|
if (window.serverConfig.grabberV4L2.framerates == 'custom' && window.serverConfig.grabberV4L2.device != 'auto')
|
||||||
toggleOption('fps', true);
|
toggleOption('fps', true);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btn_submit_v4l2').off().on('click',function() {
|
$('#btn_submit_v4l2').off().on('click', function () {
|
||||||
var v4l2Options = conf_editor_v4l2.getValue();
|
var v4l2Options = conf_editor_v4l2.getValue();
|
||||||
|
|
||||||
if (v4l2Options.grabberV4L2.available_devices != 'custom' && v4l2Options.grabberV4L2.available_devices != 'auto')
|
if (v4l2Options.grabberV4L2.available_devices != 'custom' && v4l2Options.grabberV4L2.available_devices != 'auto')
|
||||||
@ -304,31 +323,54 @@ $(document).ready( function() {
|
|||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
|
|
||||||
//create introduction
|
//create introduction
|
||||||
if(window.showOptHelp) {
|
if (window.showOptHelp) {
|
||||||
createHint("intro", $.i18n('conf_grabber_fg_intro'), "editor_container_fg");
|
createHint("intro", $.i18n('conf_grabber_fg_intro'), "editor_container_fg");
|
||||||
if(V4L2_AVAIL){
|
if (V4L2_AVAIL) {
|
||||||
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
|
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideEl(el) {
|
function toggleFgOptions(el, state) {
|
||||||
for(var i = 0; i<el.length; i++) {
|
for (var i = 0; i < el.length; i++) {
|
||||||
$('[data-schemapath*="root.framegrabber.'+el[i]+'"]').toggle(false);
|
$('[data-schemapath*="root.framegrabber.' + el[i] + '"]').toggle(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//hide specific options
|
function filerFgGrabberOptions(type) {
|
||||||
conf_editor_fg.on('ready',function() {
|
//hide specific options for grabbers found
|
||||||
var grabbers = window.serverInfo.grabbers.available;
|
|
||||||
|
|
||||||
if (grabbers.indexOf('dispmanx') > -1)
|
var grabbers = window.serverInfo.grabbers.available;
|
||||||
hideEl(["device","pixelDecimation"]);
|
if (grabbers.indexOf(type) > -1) {
|
||||||
else if (grabbers.indexOf('x11') > -1 || grabbers.indexOf('xcb') > -1)
|
toggleFgOptions(["width", "height", "pixelDecimation", "display"], true);
|
||||||
hideEl(["device","width","height"]);
|
|
||||||
else if (grabbers.indexOf('osx') > -1 )
|
switch (type) {
|
||||||
hideEl(["device","pixelDecimation"]);
|
case "dispmanx":
|
||||||
else if (grabbers.indexOf('amlogic') > -1)
|
toggleFgOptions(["pixelDecimation", "display"], false);
|
||||||
hideEl(["pixelDecimation"]);
|
break;
|
||||||
|
case "x11":
|
||||||
|
case "xcb":
|
||||||
|
toggleFgOptions(["width", "height", "display"], false);
|
||||||
|
break;
|
||||||
|
case "framebuffer":
|
||||||
|
toggleFgOptions(["display"], false);
|
||||||
|
break;
|
||||||
|
case "amlogic":
|
||||||
|
toggleFgOptions(["pixelDecimation", "display"], false);
|
||||||
|
break;
|
||||||
|
case "qt":
|
||||||
|
break;
|
||||||
|
case "dx":
|
||||||
|
break;
|
||||||
|
case "osx":
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$('#root_framegrabber_type').change(function () {
|
||||||
|
var selectedType = $("#root_framegrabber_type").val();
|
||||||
|
filerFgGrabberOptions(selectedType);
|
||||||
});
|
});
|
||||||
|
|
||||||
removeOverlay();
|
removeOverlay();
|
||||||
|
@ -165,10 +165,7 @@
|
|||||||
"pixelDecimation" : 8,
|
"pixelDecimation" : 8,
|
||||||
|
|
||||||
// valid for qt
|
// valid for qt
|
||||||
"display" 0,
|
"display" 0
|
||||||
|
|
||||||
// valid for framebuffer
|
|
||||||
"device" : "/dev/fb0"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/// The black border configuration, contains the following items:
|
/// The black border configuration, contains the following items:
|
||||||
|
@ -95,7 +95,7 @@
|
|||||||
"cropRight" : 0,
|
"cropRight" : 0,
|
||||||
"cropTop" : 0,
|
"cropTop" : 0,
|
||||||
"cropBottom" : 0,
|
"cropBottom" : 0,
|
||||||
"device" : "/dev/fb0"
|
"display" : 0
|
||||||
},
|
},
|
||||||
|
|
||||||
"blackborderdetector" :
|
"blackborderdetector" :
|
||||||
|
@ -37,12 +37,12 @@ public:
|
|||||||
static GrabberWrapper* getInstance(){ return instance; }
|
static GrabberWrapper* getInstance(){ return instance; }
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Starts the grabber wich produces led values with the specified update rate
|
/// Starts the grabber which produces led values with the specified update rate
|
||||||
///
|
///
|
||||||
virtual bool start();
|
virtual bool start();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Starts maybe the grabber wich produces led values with the specified update rate
|
/// Starts maybe the grabber which produces led values with the specified update rate
|
||||||
///
|
///
|
||||||
virtual void tryStart();
|
virtual void tryStart();
|
||||||
|
|
||||||
@ -90,6 +90,12 @@ public:
|
|||||||
///
|
///
|
||||||
virtual QStringList getFramerates(const QString& devicePath) const;
|
virtual QStringList getFramerates(const QString& devicePath) const;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// @brief Get active grabber name
|
||||||
|
/// @return Active grabber name
|
||||||
|
///
|
||||||
|
virtual QString getActive() const;
|
||||||
|
|
||||||
static QStringList availableGrabbers();
|
static QStringList availableGrabbers();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -467,8 +467,11 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
|
|||||||
|
|
||||||
#if defined(ENABLE_DISPMANX) || defined(ENABLE_V4L2) || defined(ENABLE_FB) || defined(ENABLE_AMLOGIC) || defined(ENABLE_OSX) || defined(ENABLE_X11) || defined(ENABLE_XCB) || defined(ENABLE_QT)
|
#if defined(ENABLE_DISPMANX) || defined(ENABLE_V4L2) || defined(ENABLE_FB) || defined(ENABLE_AMLOGIC) || defined(ENABLE_OSX) || defined(ENABLE_X11) || defined(ENABLE_XCB) || defined(ENABLE_QT)
|
||||||
|
|
||||||
|
if ( GrabberWrapper::getInstance() != nullptr )
|
||||||
|
{
|
||||||
|
grabbers["active"] = GrabberWrapper::getInstance()->getActive();
|
||||||
|
}
|
||||||
// get available grabbers
|
// get available grabbers
|
||||||
//grabbers["active"] = ????;
|
|
||||||
for (auto grabber : GrabberWrapper::availableGrabbers())
|
for (auto grabber : GrabberWrapper::availableGrabbers())
|
||||||
{
|
{
|
||||||
availableGrabbers.append(grabber);
|
availableGrabbers.append(grabber);
|
||||||
|
@ -65,6 +65,11 @@ bool GrabberWrapper::isActive() const
|
|||||||
return _timer->isActive();
|
return _timer->isActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString GrabberWrapper::getActive() const
|
||||||
|
{
|
||||||
|
return _grabberName;
|
||||||
|
}
|
||||||
|
|
||||||
QStringList GrabberWrapper::availableGrabbers()
|
QStringList GrabberWrapper::availableGrabbers()
|
||||||
{
|
{
|
||||||
QStringList grabbers;
|
QStringList grabbers;
|
||||||
@ -101,6 +106,10 @@ QStringList GrabberWrapper::availableGrabbers()
|
|||||||
grabbers << "qt";
|
grabbers << "qt";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_DX
|
||||||
|
grabbers << "dx";
|
||||||
|
#endif
|
||||||
|
|
||||||
return grabbers;
|
return grabbers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ SettingsManager::SettingsManager(quint8 instance, QObject* parent, bool readonly
|
|||||||
for (auto & schemaError : schemaChecker.getMessages())
|
for (auto & schemaError : schemaChecker.getMessages())
|
||||||
Warning(_log, "Config Fix: %s", QSTRING_CSTR(schemaError));
|
Warning(_log, "Config Fix: %s", QSTRING_CSTR(schemaError));
|
||||||
|
|
||||||
saveSettings(dbConfig);
|
saveSettings(dbConfig,true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_qconfig = dbConfig;
|
_qconfig = dbConfig;
|
||||||
|
@ -7,13 +7,13 @@
|
|||||||
{
|
{
|
||||||
"type" : "string",
|
"type" : "string",
|
||||||
"title" : "edt_conf_fg_type_title",
|
"title" : "edt_conf_fg_type_title",
|
||||||
"enum" : ["auto","dispmanx","amlogic","x11", "xcb", "framebuffer","qt","dx"],
|
"enum" : ["auto","amlogic","dispmanx","dx","framebuffer","osx","qt","x11", "xcb"],
|
||||||
"options":
|
"options":
|
||||||
{
|
{
|
||||||
"enum_titles": ["edt_conf_enum_automatic","DispmanX","AMLogic","X11", "XCB", "Framebuffer","QT", "DirectX9"]
|
"enum_titles": ["edt_conf_enum_automatic","AMLogic","DispmanX","DirectX9","Framebuffer","OSX","QT","X11","XCB"]
|
||||||
},
|
},
|
||||||
"default" : "auto",
|
"default" : "auto",
|
||||||
"propertyOrder" : 2
|
"propertyOrder" : 1
|
||||||
},
|
},
|
||||||
"width" :
|
"width" :
|
||||||
{
|
{
|
||||||
@ -22,7 +22,7 @@
|
|||||||
"minimum" : 10,
|
"minimum" : 10,
|
||||||
"default" : 80,
|
"default" : 80,
|
||||||
"append" : "edt_append_pixel",
|
"append" : "edt_append_pixel",
|
||||||
"propertyOrder" : 3
|
"propertyOrder" : 2
|
||||||
},
|
},
|
||||||
"height" :
|
"height" :
|
||||||
{
|
{
|
||||||
@ -49,7 +49,7 @@
|
|||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0,
|
"default" : 0,
|
||||||
"append" : "edt_append_pixel",
|
"append" : "edt_append_pixel",
|
||||||
"propertyOrder" : 6
|
"propertyOrder" : 5
|
||||||
},
|
},
|
||||||
"cropRight" :
|
"cropRight" :
|
||||||
{
|
{
|
||||||
@ -58,7 +58,7 @@
|
|||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0,
|
"default" : 0,
|
||||||
"append" : "edt_append_pixel",
|
"append" : "edt_append_pixel",
|
||||||
"propertyOrder" : 7
|
"propertyOrder" : 6
|
||||||
},
|
},
|
||||||
"cropTop" :
|
"cropTop" :
|
||||||
{
|
{
|
||||||
@ -67,7 +67,7 @@
|
|||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0,
|
"default" : 0,
|
||||||
"append" : "edt_append_pixel",
|
"append" : "edt_append_pixel",
|
||||||
"propertyOrder" : 8
|
"propertyOrder" : 7
|
||||||
},
|
},
|
||||||
"cropBottom" :
|
"cropBottom" :
|
||||||
{
|
{
|
||||||
@ -76,7 +76,7 @@
|
|||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0,
|
"default" : 0,
|
||||||
"append" : "edt_append_pixel",
|
"append" : "edt_append_pixel",
|
||||||
"propertyOrder" : 9
|
"propertyOrder" : 8
|
||||||
},
|
},
|
||||||
"pixelDecimation" :
|
"pixelDecimation" :
|
||||||
{
|
{
|
||||||
@ -85,35 +85,15 @@
|
|||||||
"minimum" : 1,
|
"minimum" : 1,
|
||||||
"maximum" : 30,
|
"maximum" : 30,
|
||||||
"default" : 8,
|
"default" : 8,
|
||||||
"propertyOrder" : 10
|
"propertyOrder" : 9
|
||||||
},
|
|
||||||
"device" :
|
|
||||||
{
|
|
||||||
"type" : "string",
|
|
||||||
"title" : "edt_conf_fg_device_title",
|
|
||||||
"default" : "/dev/fb0",
|
|
||||||
"propertyOrder" : 11
|
|
||||||
},
|
},
|
||||||
"display" :
|
"display" :
|
||||||
{
|
{
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"title" : "edt_conf_fg_display_title",
|
"title" : "edt_conf_fg_display_title",
|
||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"propertyOrder" : 12
|
|
||||||
},
|
|
||||||
"amlogic_grabber" :
|
|
||||||
{
|
|
||||||
"type" : "string",
|
|
||||||
"title" : "edt_conf_fg_amlogic_grabber_title",
|
|
||||||
"default" : "amvideocap0",
|
|
||||||
"propertyOrder" : 13
|
|
||||||
},
|
|
||||||
"ge2d_mode" :
|
|
||||||
{
|
|
||||||
"type" : "integer",
|
|
||||||
"title" : "edt_conf_fg_ge2d_mode_title",
|
|
||||||
"default" : 0,
|
"default" : 0,
|
||||||
"propertyOrder" : 14
|
"propertyOrder" : 10
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties" : false
|
"additionalProperties" : false
|
||||||
|
Loading…
Reference in New Issue
Block a user