mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
V4L2 enhanced (#766)
* fix v4l2 standard * ignore v4l2 meta devices * added resolution, framerate and device dropdown list to WebUI (thx to @Lord-Grey & @b1rdhous3) * Fix for kernels prior to v4.16 * Device names added & WebUI adapted
This commit is contained in:
@@ -431,6 +431,7 @@
|
||||
"edt_conf_enum_bbclassic": "Klasický",
|
||||
"edt_conf_enum_bbosd": "OSD",
|
||||
"edt_conf_enum_automatic": "",
|
||||
"edt_conf_enum_custom": "",
|
||||
"edt_conf_gen_heading_title": "Obecné nastavení",
|
||||
"edt_conf_gen_name_title": "Název konfigurace",
|
||||
"edt_conf_gen_name_expl": "Uživatelské jméno, které se používá k detekci Hyperionu. (Užitečné s více než jednou instancí Hyperion)",
|
||||
@@ -492,6 +493,10 @@
|
||||
"edt_conf_v4l2_device_expl": "Cesta k Zachycení/Graber usb.",
|
||||
"edt_conf_v4l2_standard_title": "Video standard",
|
||||
"edt_conf_v4l2_standard_expl": "Vyberte standard videa pro vaši oblast.",
|
||||
"edt_conf_v4l2_resolution_title": "",
|
||||
"edt_conf_v4l2_resolution_expl": "",
|
||||
"edt_conf_v4l2_framerate_title": "",
|
||||
"edt_conf_v4l2_framerate_expl": "",
|
||||
"edt_conf_v4l2_sizeDecimation_title": "Velikost decimace",
|
||||
"edt_conf_v4l2_sizeDecimation_expl": "Faktor velikosti decimace",
|
||||
"edt_conf_v4l2_cropLeft_title": "Ořezat zleva",
|
||||
@@ -809,4 +814,4 @@
|
||||
"edt_eff_ledtest_header_desc": "",
|
||||
"update_no_updates_for_branch": "",
|
||||
"general_speech_sv": ""
|
||||
}
|
||||
}
|
||||
|
@@ -470,7 +470,7 @@
|
||||
"edt_conf_enum_PAL": "PAL",
|
||||
"edt_conf_enum_NTSC": "NTSC",
|
||||
"edt_conf_enum_SECAM": "SECAM",
|
||||
"edt_conf_enum_NO_CHANGE": "Auto",
|
||||
"edt_conf_enum_NO_CHANGE": "Automatisch",
|
||||
"edt_conf_enum_logsilent": "Stille",
|
||||
"edt_conf_enum_logwarn": "Warnung",
|
||||
"edt_conf_enum_logverbose": "Ausführlich",
|
||||
@@ -479,6 +479,7 @@
|
||||
"edt_conf_enum_bbclassic": "Klassisch",
|
||||
"edt_conf_enum_bbosd": "OSD",
|
||||
"edt_conf_enum_automatic": "Automatisch",
|
||||
"edt_conf_enum_custom": "Benutzerdefiniert",
|
||||
"edt_conf_gen_heading_title": "Allgemeine Einstellungen",
|
||||
"edt_conf_gen_name_title": "Name der Konfiguration",
|
||||
"edt_conf_gen_name_expl": "Der Name wird verwendet, um Hyperion besser zu identifizieren. (Hilfreich bei mehreren Instanzen)",
|
||||
@@ -539,9 +540,13 @@
|
||||
"edt_conf_smooth_continuousOutput_expl": "Aktualisiere die LEDs, auch wenn das Bild sich nicht geändert hat.",
|
||||
"edt_conf_v4l2_heading_title": "USB Aufnahme",
|
||||
"edt_conf_v4l2_device_title": "Gerät",
|
||||
"edt_conf_v4l2_device_expl": "Der Pfad zum USB (v4l) Aufnahmegerät. Wähle 'auto' für automatische Erkennung. Beispiel: '/dev/video0'",
|
||||
"edt_conf_v4l2_device_expl": "Eine Liste von USB (v4l) Aufnahmegeräten. Wähle 'Automatisch' für automatische Erkennung. Benutzerdefiniert z.b.: '/dev/video0'",
|
||||
"edt_conf_v4l2_standard_title": "Videoformat",
|
||||
"edt_conf_v4l2_standard_expl": "Wähle das passende Videoformat deiner Region. Auf 'Auto' wird der gewählte Modus vom v4l interface beibehalten.",
|
||||
"edt_conf_v4l2_standard_expl": "Wähle das passende Videoformat deiner Region. Auf 'Automatisch' wird der gewählte Modus vom v4l interface beibehalten.",
|
||||
"edt_conf_v4l2_resolution_title": "Auflösung",
|
||||
"edt_conf_v4l2_resolution_expl": "Eine Liste von unterstützten Auflösungen des aktiven Gerätes. Auf 'Automatisch' wird der gewählte Modus vom v4l interface beibehalten.",
|
||||
"edt_conf_v4l2_framerate_title": "Bilder pro Sekunde",
|
||||
"edt_conf_v4l2_framerate_expl": "Die unterstützten Bilder pro Sekunde des aktiven Gerätes. Auf 'Automatisch' wird der gewählte Modus vom v4l interface beibehalten.",
|
||||
"edt_conf_v4l2_sizeDecimation_title": "Bildverkleinerung Faktor",
|
||||
"edt_conf_v4l2_sizeDecimation_expl": "Der Faktor der Bildverkleinerung ausgehend von der ursprünglichen Größe, 1 bedeutet keine Änderung (originales Bild).",
|
||||
"edt_conf_v4l2_cropLeft_title": "Entferne links",
|
||||
@@ -570,9 +575,9 @@
|
||||
"edt_conf_v4l2_sDHOffsetMax_expl": "Signal Erkennungs-Bereich horizontal maximum (0.0-1.0)",
|
||||
"edt_conf_instCapture_heading_title": "Instance Aufnahme",
|
||||
"edt_conf_instC_systemEnable_title": "Aktiviere Plattform Aufnahme",
|
||||
"edt_conf_instC_systemEnable_expl": "Aktiviert die Plattform Aufnahme für diese LED Hardware Instanz",
|
||||
"edt_conf_instC_systemEnable_expl": "Aktiviert die Plattform Aufnahme für diese LED Hardware Instanz.",
|
||||
"edt_conf_instC_v4lEnable_title": "Aktiviere USB Aufnahme",
|
||||
"edt_conf_instC_v4lEnable_expl": "Aktiviert die USB Aufnahme für diese LED Hardware Instanz",
|
||||
"edt_conf_instC_v4lEnable_expl": "Aktiviert die USB Aufnahme für diese LED Hardware Instanz.",
|
||||
"edt_conf_fg_heading_title": "Plattform Aufnahme",
|
||||
"edt_conf_fg_type_title": "Typ",
|
||||
"edt_conf_fg_type_expl": "Art der Plattform Aufnahme, standard ist 'auto'",
|
||||
|
@@ -469,7 +469,7 @@
|
||||
"edt_conf_enum_PAL" : "PAL",
|
||||
"edt_conf_enum_NTSC" : "NTSC",
|
||||
"edt_conf_enum_SECAM" : "SECAM",
|
||||
"edt_conf_enum_NO_CHANGE" : "Auto",
|
||||
"edt_conf_enum_NO_CHANGE" : "Automatic",
|
||||
"edt_conf_enum_logsilent" : "Silent",
|
||||
"edt_conf_enum_logwarn" : "Warning",
|
||||
"edt_conf_enum_logverbose" : "Verbose",
|
||||
@@ -478,6 +478,7 @@
|
||||
"edt_conf_enum_bbclassic" : "Classic",
|
||||
"edt_conf_enum_bbosd" : "OSD",
|
||||
"edt_conf_enum_automatic" : "Automatic",
|
||||
"edt_conf_enum_custom": "Custom",
|
||||
"edt_conf_gen_heading_title" : "General Settings",
|
||||
"edt_conf_gen_name_title" : "Configuration name",
|
||||
"edt_conf_gen_name_expl" : "A user defined name which is used to identify Hyperion. (Helpful if you have more than one Hyperion instance)",
|
||||
@@ -538,9 +539,13 @@
|
||||
"edt_conf_smooth_continuousOutput_expl" : "Update the leds even if there is no change in the picture.",
|
||||
"edt_conf_v4l2_heading_title" : "USB Capture",
|
||||
"edt_conf_v4l2_device_title" : "Device",
|
||||
"edt_conf_v4l2_device_expl" : "The path to the USB capture interface. Set to 'auto' for automatic detection. Example: '/dev/video0'",
|
||||
"edt_conf_v4l2_device_expl" : "The path to the USB capture interface. Set to 'Automatic' for automatic detection. Example: '/dev/video0'",
|
||||
"edt_conf_v4l2_standard_title" : "Video standard",
|
||||
"edt_conf_v4l2_standard_expl" : "Select the video standard for your region. 'Auto' keeps the value chosen by the v4l2 interface",
|
||||
"edt_conf_v4l2_standard_expl" : "Select the video standard for your region. 'Automatic' keeps the value chosen by the v4l2 interface",
|
||||
"edt_conf_v4l2_resolution_title" : "Device Resolution",
|
||||
"edt_conf_v4l2_resolution_expl" : "A list of supported resolutions of the active device",
|
||||
"edt_conf_v4l2_framerate_title": "Frames per second",
|
||||
"edt_conf_v4l2_framerate_expl": "The supported frames per second of the active device",
|
||||
"edt_conf_v4l2_sizeDecimation_title" : "Size decimation",
|
||||
"edt_conf_v4l2_sizeDecimation_expl" : "The factor of size decimation. 1 means no decimation (keep original size)",
|
||||
"edt_conf_v4l2_cropLeft_title" : "Crop left",
|
||||
|
@@ -431,6 +431,7 @@
|
||||
"edt_conf_enum_bbclassic": "Clásico",
|
||||
"edt_conf_enum_bbosd": "OSD",
|
||||
"edt_conf_enum_automatic": "Automático",
|
||||
"edt_conf_enum_custom": "",
|
||||
"edt_conf_gen_heading_title": "Configuración General",
|
||||
"edt_conf_gen_name_title": "Nombre de configuración",
|
||||
"edt_conf_gen_name_expl": "Un nombre definido por el usuario que se utiliza para detectar Hyperion. (Útil con más de una instancia de Hyperion)",
|
||||
@@ -492,6 +493,10 @@
|
||||
"edt_conf_v4l2_device_expl": "La ruta a la captura USB.",
|
||||
"edt_conf_v4l2_standard_title": "Estándar de vídeo",
|
||||
"edt_conf_v4l2_standard_expl": "Selecciona el estándar de vídeo para tu región.",
|
||||
"edt_conf_v4l2_resolution_title": "",
|
||||
"edt_conf_v4l2_resolution_expl": "",
|
||||
"edt_conf_v4l2_framerate_title": "",
|
||||
"edt_conf_v4l2_framerate_expl": "",
|
||||
"edt_conf_v4l2_sizeDecimation_title": "Diezmación de tamaño",
|
||||
"edt_conf_v4l2_sizeDecimation_expl": "El factor de diezmación del tamaño",
|
||||
"edt_conf_v4l2_cropLeft_title": "Cortar izquierda",
|
||||
@@ -809,4 +814,4 @@
|
||||
"edt_eff_ledtest_header_desc": "Salida giratoria: Rojo, Azul, Verde, Blanco, Negro",
|
||||
"update_no_updates_for_branch": "",
|
||||
"general_speech_sv": ""
|
||||
}
|
||||
}
|
||||
|
@@ -431,6 +431,7 @@
|
||||
"edt_conf_enum_bbclassic": "Classico",
|
||||
"edt_conf_enum_bbosd": "OSD",
|
||||
"edt_conf_enum_automatic": "Automatico",
|
||||
"edt_conf_enum_custom": "",
|
||||
"edt_conf_gen_heading_title": "impostazioni Generali",
|
||||
"edt_conf_gen_name_title": "Nome configurazione",
|
||||
"edt_conf_gen_name_expl": "Un nome definito dall'utente che viene utilizzato per riconoscere Hyperion. (Utile con più di un'istanza di Hyperion)",
|
||||
@@ -492,6 +493,10 @@
|
||||
"edt_conf_v4l2_device_expl": "Percorso del dispositivo di cattura usb.",
|
||||
"edt_conf_v4l2_standard_title": "Standard video",
|
||||
"edt_conf_v4l2_standard_expl": "Seleziona lo standard video per la tua regione",
|
||||
"edt_conf_v4l2_resolution_title": "",
|
||||
"edt_conf_v4l2_resolution_expl": "",
|
||||
"edt_conf_v4l2_framerate_title": "",
|
||||
"edt_conf_v4l2_framerate_expl": "",
|
||||
"edt_conf_v4l2_sizeDecimation_title": "Decimazione dimensione",
|
||||
"edt_conf_v4l2_sizeDecimation_expl": "Il fattore di decimazione della dimensione",
|
||||
"edt_conf_v4l2_cropLeft_title": "Ritaglia sinistra",
|
||||
@@ -809,4 +814,4 @@
|
||||
"edt_eff_ledtest_header_desc": "",
|
||||
"update_no_updates_for_branch": "",
|
||||
"general_speech_sv": ""
|
||||
}
|
||||
}
|
||||
|
@@ -431,6 +431,7 @@
|
||||
"edt_conf_enum_bbclassic": "",
|
||||
"edt_conf_enum_bbosd": "",
|
||||
"edt_conf_enum_automatic": "",
|
||||
"edt_conf_enum_custom": "",
|
||||
"edt_conf_gen_heading_title": "",
|
||||
"edt_conf_gen_name_title": "",
|
||||
"edt_conf_gen_name_expl": "",
|
||||
@@ -492,6 +493,10 @@
|
||||
"edt_conf_v4l2_device_expl": "",
|
||||
"edt_conf_v4l2_standard_title": "",
|
||||
"edt_conf_v4l2_standard_expl": "",
|
||||
"edt_conf_v4l2_resolution_title": "",
|
||||
"edt_conf_v4l2_resolution_expl": "",
|
||||
"edt_conf_v4l2_framerate_title": "",
|
||||
"edt_conf_v4l2_framerate_expl": "",
|
||||
"edt_conf_v4l2_sizeDecimation_title": "",
|
||||
"edt_conf_v4l2_sizeDecimation_expl": "",
|
||||
"edt_conf_v4l2_cropLeft_title": "",
|
||||
@@ -809,4 +814,4 @@
|
||||
"edt_eff_ledtest_header_desc": "",
|
||||
"update_no_updates_for_branch": "",
|
||||
"general_speech_sv": ""
|
||||
}
|
||||
}
|
||||
|
@@ -431,6 +431,7 @@
|
||||
"edt_conf_enum_bbclassic": "",
|
||||
"edt_conf_enum_bbosd": "",
|
||||
"edt_conf_enum_automatic": "",
|
||||
"edt_conf_enum_custom": "",
|
||||
"edt_conf_gen_heading_title": "",
|
||||
"edt_conf_gen_name_title": "",
|
||||
"edt_conf_gen_name_expl": "",
|
||||
@@ -492,6 +493,10 @@
|
||||
"edt_conf_v4l2_device_expl": "",
|
||||
"edt_conf_v4l2_standard_title": "",
|
||||
"edt_conf_v4l2_standard_expl": "",
|
||||
"edt_conf_v4l2_resolution_title": "",
|
||||
"edt_conf_v4l2_resolution_expl": "",
|
||||
"edt_conf_v4l2_framerate_title": "",
|
||||
"edt_conf_v4l2_framerate_expl": "",
|
||||
"edt_conf_v4l2_sizeDecimation_title": "",
|
||||
"edt_conf_v4l2_sizeDecimation_expl": "",
|
||||
"edt_conf_v4l2_cropLeft_title": "",
|
||||
@@ -809,4 +814,4 @@
|
||||
"edt_eff_ledtest_header_desc": "",
|
||||
"update_no_updates_for_branch": "",
|
||||
"general_speech_sv": ""
|
||||
}
|
||||
}
|
||||
|
@@ -431,6 +431,7 @@
|
||||
"edt_conf_enum_bbclassic": "",
|
||||
"edt_conf_enum_bbosd": "",
|
||||
"edt_conf_enum_automatic": "",
|
||||
"edt_conf_enum_custom": "",
|
||||
"edt_conf_gen_heading_title": "",
|
||||
"edt_conf_gen_name_title": "",
|
||||
"edt_conf_gen_name_expl": "",
|
||||
@@ -492,6 +493,10 @@
|
||||
"edt_conf_v4l2_device_expl": "",
|
||||
"edt_conf_v4l2_standard_title": "",
|
||||
"edt_conf_v4l2_standard_expl": "",
|
||||
"edt_conf_v4l2_resolution_title": "",
|
||||
"edt_conf_v4l2_resolution_expl": "",
|
||||
"edt_conf_v4l2_framerate_title": "",
|
||||
"edt_conf_v4l2_framerate_expl": "",
|
||||
"edt_conf_v4l2_sizeDecimation_title": "",
|
||||
"edt_conf_v4l2_sizeDecimation_expl": "",
|
||||
"edt_conf_v4l2_cropLeft_title": "",
|
||||
@@ -809,4 +814,4 @@
|
||||
"edt_eff_ledtest_header_desc": "",
|
||||
"update_no_updates_for_branch": "",
|
||||
"general_speech_sv": ""
|
||||
}
|
||||
}
|
||||
|
@@ -431,6 +431,7 @@
|
||||
"edt_conf_enum_bbclassic": "Klassisk",
|
||||
"edt_conf_enum_bbosd": "OSD",
|
||||
"edt_conf_enum_automatic": "Automatisk",
|
||||
"edt_conf_enum_custom": "",
|
||||
"edt_conf_gen_heading_title": "Allmänna Inställningar",
|
||||
"edt_conf_gen_name_title": "Konfigurationsnamn",
|
||||
"edt_conf_gen_name_expl": "Ett användardefinierat namn som används för att identifiera Hyperion. (Hjälpsamt om du har mer än en Hyperion-instans)",
|
||||
@@ -492,6 +493,10 @@
|
||||
"edt_conf_v4l2_device_expl": "Sökvägen till USB-fångstgränssnittet. Ställ in på 'auto' för automatisk upptäckt. Exempel: '/dev/video0'",
|
||||
"edt_conf_v4l2_standard_title": "Videostandard",
|
||||
"edt_conf_v4l2_standard_expl": "Välj videostandard för din region. 'Auto' behåller det värde som väljs av v4l2-gränssnittet",
|
||||
"edt_conf_v4l2_resolution_title": "",
|
||||
"edt_conf_v4l2_resolution_expl": "",
|
||||
"edt_conf_v4l2_framerate_title": "",
|
||||
"edt_conf_v4l2_framerate_expl": "",
|
||||
"edt_conf_v4l2_sizeDecimation_title": "Bildreduktionsfaktor",
|
||||
"edt_conf_v4l2_sizeDecimation_expl": "Faktorn för bildminskning baserad på originalstorleken, 1 betyder ingen förändring (originalbild).",
|
||||
"edt_conf_v4l2_cropLeft_title": "Beskär vänster",
|
||||
|
@@ -4,39 +4,171 @@ $(document).ready( function() {
|
||||
var conf_editor_fg = null;
|
||||
var conf_editor_instCapt = null;
|
||||
|
||||
function hideEl(el)
|
||||
{
|
||||
for(var i = 0; i<el.length; i++)
|
||||
// Dynamic v4l2 enum schema
|
||||
var v4l2_dynamic_enum_schema = {
|
||||
"available_devices":
|
||||
{
|
||||
$('[data-schemapath*="root.framegrabber.'+el[i]+'"]').toggle(false);
|
||||
"type": "string",
|
||||
"title": "edt_conf_v4l2_device_title",
|
||||
"propertyOrder" : 1,
|
||||
"required" : true
|
||||
},
|
||||
"resolutions":
|
||||
{
|
||||
"type": "string",
|
||||
"title": "edt_conf_v4l2_resolution_title",
|
||||
"propertyOrder" : 4,
|
||||
"required" : true
|
||||
},
|
||||
"framerates":
|
||||
{
|
||||
"type": "string",
|
||||
"title": "edt_conf_v4l2_framerate_title",
|
||||
"propertyOrder" : 7,
|
||||
"required" : true
|
||||
}
|
||||
};
|
||||
|
||||
// Build dynamic v4l2 enum schema parts
|
||||
var buildSchemaPart = function(key, schema, device) {
|
||||
if (schema[key]) {
|
||||
var enumVals = [];
|
||||
var enumTitelVals = [];
|
||||
var v4l2_properties = JSON.parse(JSON.stringify(window.serverInfo.grabbers.v4l2_properties));
|
||||
|
||||
if (key === 'available_devices') {
|
||||
for (var i = 0; i < v4l2_properties.length; i++) {
|
||||
enumVals.push(v4l2_properties[i]['device']);
|
||||
|
||||
v4l2_properties[i].hasOwnProperty('name')
|
||||
? enumTitelVals.push(v4l2_properties[i]['name'])
|
||||
: enumTitelVals.push(v4l2_properties[i]['device']);
|
||||
}
|
||||
} else if (key == 'resolutions' || key == 'framerates') {
|
||||
for (var i = 0; i < v4l2_properties.length; i++) {
|
||||
if (v4l2_properties[i]['device'] == device) {
|
||||
enumVals = enumTitelVals = v4l2_properties[i][key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.schema.grabberV4L2.properties[key] = {
|
||||
"type": schema[key].type,
|
||||
"title": schema[key].title,
|
||||
"enum": [].concat(["auto"], enumVals, ["custom"]),
|
||||
"options" :
|
||||
{
|
||||
"enum_titles" : [].concat(["edt_conf_enum_automatic"], enumTitelVals, ["edt_conf_enum_custom"]),
|
||||
},
|
||||
"propertyOrder" : schema[key].propertyOrder,
|
||||
"required" : schema[key].required
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// Switch between visible states
|
||||
function toggleOption(option, state) {
|
||||
$('[data-schemapath*="root.grabberV4L2.'+option+'"]').toggle(state);
|
||||
if (state) (
|
||||
$('[data-schemapath*="root.grabberV4L2.'+option+'"]').addClass('col-md-12'),
|
||||
$('label[for="root_grabberV4L2_'+option+'"]').css('left','10px'),
|
||||
$('[id="root_grabberV4L2_'+option+'"]').css('left','10px')
|
||||
);
|
||||
}
|
||||
|
||||
if(window.showOptHelp)
|
||||
{
|
||||
//fg
|
||||
// Watch all v4l2 dynamic fields
|
||||
var setWatchers = function(schema) {
|
||||
var path = 'root.grabberV4L2.';
|
||||
Object.keys(schema).forEach(function(key) {
|
||||
conf_editor_v4l2.watch(path + key, function() {
|
||||
var ed = conf_editor_v4l2.getEditor(path + key);
|
||||
var val = ed.getValue();
|
||||
|
||||
if (key == 'available_devices') {
|
||||
var V4L2properties = ['resolutions', 'framerates'];
|
||||
if (val == 'custom') {
|
||||
var grabberV4L2 = ed.parent;
|
||||
V4L2properties.forEach(function(item) {
|
||||
buildSchemaPart(item, v4l2_dynamic_enum_schema, 'none');
|
||||
grabberV4L2.original_schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
||||
grabberV4L2.schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
||||
|
||||
grabberV4L2.removeObjectProperty(item);
|
||||
delete grabberV4L2.cached_editors[item];
|
||||
grabberV4L2.addObjectProperty(item);
|
||||
|
||||
conf_editor_v4l2.getEditor(path + item).enable();
|
||||
});
|
||||
|
||||
toggleOption('device', true);
|
||||
} else if (val == 'auto') {
|
||||
V4L2properties.forEach(function(item) {
|
||||
conf_editor_v4l2.getEditor(path + item).setValue('auto');
|
||||
conf_editor_v4l2.getEditor(path + item).disable();
|
||||
});
|
||||
|
||||
(toggleOption('device', false), toggleOption('width', false),
|
||||
toggleOption('height', false), toggleOption('fps', false));
|
||||
} else {
|
||||
var grabberV4L2 = ed.parent;
|
||||
V4L2properties.forEach(function(item) {
|
||||
buildSchemaPart(item, v4l2_dynamic_enum_schema, val);
|
||||
grabberV4L2.original_schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
||||
grabberV4L2.schema.properties[item] = window.schema.grabberV4L2.properties[item];
|
||||
|
||||
grabberV4L2.removeObjectProperty(item);
|
||||
delete grabberV4L2.cached_editors[item];
|
||||
grabberV4L2.addObjectProperty(item);
|
||||
|
||||
conf_editor_v4l2.getEditor(path + item).enable();
|
||||
});
|
||||
|
||||
toggleOption('device', false);
|
||||
}
|
||||
}
|
||||
|
||||
if (key == 'resolutions')
|
||||
val != 'custom'
|
||||
? (toggleOption('width', false), toggleOption('height', false))
|
||||
: (toggleOption('width', true), toggleOption('height', true));
|
||||
|
||||
if (key == 'framerates')
|
||||
val != 'custom'
|
||||
? toggleOption('fps', false)
|
||||
: toggleOption('fps', true);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// Insert dynamic v4l2 enum schema parts
|
||||
Object.keys(v4l2_dynamic_enum_schema).forEach(function(key) {
|
||||
buildSchemaPart(key, v4l2_dynamic_enum_schema, window.serverConfig.grabberV4L2.device);
|
||||
});
|
||||
|
||||
if(window.showOptHelp) {
|
||||
// Instance Capture
|
||||
$('#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(createHelpTable(window.schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
|
||||
|
||||
//fg
|
||||
// Framegrabber
|
||||
$('#conf_cont').append(createRow('conf_cont_fg'));
|
||||
$('#conf_cont_fg').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
|
||||
$('#conf_cont_fg').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
|
||||
|
||||
//v4l
|
||||
// V4L2
|
||||
$('#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(createHelpTable(window.schema.grabberV4L2.properties, $.i18n("edt_conf_v4l2_heading_title")));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$('#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_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
|
||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
||||
}
|
||||
//instCapt
|
||||
|
||||
// Instance Capture
|
||||
conf_editor_instCapt = createJsonEditor('editor_container_instCapt', {
|
||||
instCapture: window.schema.instCapture
|
||||
}, true, true);
|
||||
@@ -49,8 +181,7 @@ $(document).ready( function() {
|
||||
requestWriteConfig(conf_editor_instCapt.getValue());
|
||||
});
|
||||
|
||||
|
||||
//fg
|
||||
// Framegrabber
|
||||
conf_editor_fg = createJsonEditor('editor_container_fg', {
|
||||
framegrabber: window.schema.framegrabber
|
||||
}, true, true);
|
||||
@@ -63,7 +194,6 @@ $(document).ready( function() {
|
||||
requestWriteConfig(conf_editor_fg.getValue());
|
||||
});
|
||||
|
||||
//vl4
|
||||
conf_editor_v4l2 = createJsonEditor('editor_container_v4l2', {
|
||||
grabberV4L2 : window.schema.grabberV4L2
|
||||
}, true, true);
|
||||
@@ -72,28 +202,80 @@ $(document).ready( function() {
|
||||
conf_editor_v4l2.validate().length ? $('#btn_submit_v4l2').attr('disabled', true) : $('#btn_submit_v4l2').attr('disabled', false);
|
||||
});
|
||||
|
||||
$('#btn_submit_v4l2').off().on('click',function() {
|
||||
requestWriteConfig(conf_editor_v4l2.getValue());
|
||||
conf_editor_v4l2.on('ready', function() {
|
||||
setWatchers(v4l2_dynamic_enum_schema);
|
||||
|
||||
if (window.serverConfig.grabberV4L2.available_devices == 'custom' && window.serverConfig.grabberV4L2.device != 'auto')
|
||||
toggleOption('device', true);
|
||||
|
||||
if (window.serverConfig.grabberV4L2.device == 'auto')
|
||||
conf_editor_v4l2.getEditor('root.grabberV4L2.available_devices').setValue('auto');
|
||||
|
||||
if (window.serverConfig.grabberV4L2.available_devices == 'auto') {
|
||||
['resolutions', 'framerates'].forEach(function(item) {
|
||||
conf_editor_v4l2.getEditor('root.grabberV4L2.' + item).setValue('auto');
|
||||
conf_editor_v4l2.getEditor('root.grabberV4L2.' + item).disable();
|
||||
});
|
||||
}
|
||||
|
||||
if (window.serverConfig.grabberV4L2.resolutions == 'custom' && window.serverConfig.grabberV4L2.device != 'auto')
|
||||
(toggleOption('width', true), toggleOption('height', true));
|
||||
|
||||
if (window.serverConfig.grabberV4L2.framerates == 'custom' && window.serverConfig.grabberV4L2.device != 'auto')
|
||||
toggleOption('fps', true);
|
||||
|
||||
});
|
||||
|
||||
$('#btn_submit_v4l2').off().on('click',function() {
|
||||
var v4l2Options = conf_editor_v4l2.getValue()
|
||||
|
||||
if (v4l2Options.grabberV4L2.available_devices != 'custom' && v4l2Options.grabberV4L2.available_devices != 'auto')
|
||||
v4l2Options.grabberV4L2.device = v4l2Options.grabberV4L2.available_devices;
|
||||
|
||||
if (v4l2Options.grabberV4L2.available_devices == 'auto')
|
||||
v4l2Options.grabberV4L2.device = 'auto';
|
||||
|
||||
if (v4l2Options.grabberV4L2.resolutions != 'custom' && v4l2Options.grabberV4L2.resolutions != 'auto' && v4l2Options.grabberV4L2.available_devices != 'auto')
|
||||
(v4l2Options.grabberV4L2.width = parseInt(v4l2Options.grabberV4L2.resolutions.split('x')[0]),
|
||||
v4l2Options.grabberV4L2.height = parseInt(v4l2Options.grabberV4L2.resolutions.split('x')[1]));
|
||||
|
||||
if (v4l2Options.grabberV4L2.resolutions == 'auto')
|
||||
(v4l2Options.grabberV4L2.width = 0, v4l2Options.grabberV4L2.height = 0);
|
||||
|
||||
if (v4l2Options.grabberV4L2.framerates != 'custom' && v4l2Options.grabberV4L2.framerates != 'auto' && v4l2Options.grabberV4L2.available_devices != 'auto')
|
||||
v4l2Options.grabberV4L2.fps = parseInt(v4l2Options.grabberV4L2.framerates);
|
||||
|
||||
if (v4l2Options.grabberV4L2.framerates == 'auto')
|
||||
v4l2Options.grabberV4L2.fps = 15;
|
||||
|
||||
requestWriteConfig(v4l2Options);
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
//create introduction
|
||||
if(window.showOptHelp)
|
||||
{
|
||||
if(window.showOptHelp) {
|
||||
createHint("intro", $.i18n('conf_grabber_fg_intro'), "editor_container_fg");
|
||||
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
|
||||
}
|
||||
|
||||
function hideEl(el) {
|
||||
for(var i = 0; i<el.length; i++) {
|
||||
$('[data-schemapath*="root.framegrabber.'+el[i]+'"]').toggle(false);
|
||||
}
|
||||
}
|
||||
|
||||
//hide specific options
|
||||
conf_editor_fg.on('ready',function() {
|
||||
var grabbers = window.serverInfo.grabbers.available;
|
||||
|
||||
if(grabbers.indexOf('dispmanx') > -1)
|
||||
if (grabbers.indexOf('dispmanx') > -1)
|
||||
hideEl(["device","pixelDecimation"]);
|
||||
else if(grabbers.indexOf('x11') > -1)
|
||||
else if (grabbers.indexOf('x11') > -1)
|
||||
hideEl(["device","width","height"]);
|
||||
else if(grabbers.indexOf('osx') > -1 )
|
||||
else if (grabbers.indexOf('osx') > -1 )
|
||||
hideEl(["device","pixelDecimation"]);
|
||||
else if(grabbers.indexOf('amlogic') > -1)
|
||||
else if (grabbers.indexOf('amlogic') > -1)
|
||||
hideEl(["pixelDecimation"]);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user