Merge branch components into mediafoundation

This commit is contained in:
Paulchen Panther 2021-05-04 21:30:29 +02:00
commit 561fabeba6
13 changed files with 117 additions and 36 deletions

17
.vs/launch.vs.json Normal file
View File

@ -0,0 +1,17 @@
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "hyperiond.exe (bin\\hyperiond.exe)",
"name": "Run hyperion with debug option and external console",
"args": [
"-d",
"-c"
],
"externalConsole": true
}
]
}

View File

@ -16,6 +16,28 @@
<span id="dash_config_status">Status</span>
</div>
<div class="panel-body">
<table class="table borderless">
<thead>
<tr>
<th colspan="3">
<i class="mdi mdi-camera"></i>
<span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td data-i18n="edt_conf_fg_heading_title">Screen-Grabber</td>
<td id="dash_screen_grabber" style="text-align:right">disabled</td>
</tr>
<tr>
<td></td>
<td data-i18n="edt_conf_v4l2_heading_title">Video-Grabber</td>
<td id="dash_video_grabber" style="text-align:right">disabled</td>
</tr>
</tbody>
</table>
<table class="table borderless">
<thead>
<tr>
@ -28,22 +50,22 @@
<tbody>
<tr>
<td></td>
<td data-i18n="dashboard_infobox_label_port_proto">proto</td>
<td><a onclick="SwitchToMenuItem('MenuItemNetwork', 'editor_container_protoserver')" href="#" data-i18n="dashboard_infobox_label_port_proto" style="text-decoration: none">proto</a></td>
<td id="dash_pbPort" style="text-align:right">unknown</td>
</tr>
<tr>
<td></td>
<td data-i18n="dashboard_infobox_label_port_flat">flat</td>
<td><a onclick="SwitchToMenuItem('MenuItemNetwork', 'editor_container_fbserver')" href="#" data-i18n="dashboard_infobox_label_port_flat" style="text-decoration: none">flat</a></td>
<td id="dash_fbPort" style="text-align:right">unknown</td>
</tr>
<tr>
<td></td>
<td data-i18n="dashboard_infobox_label_port_json">json</td>
<td><a onclick="SwitchToMenuItem('MenuItemNetwork', 'editor_container_jsonserver')" href="#" data-i18n="dashboard_infobox_label_port_json" style="text-decoration: none">json</a></td>
<td id="dash_jsonPort" style="text-align:right">unknown</td>
</tr>
<tr>
<td></td>
<td data-i18n="dashboard_infobox_label_ports_websocket">websocket</td>
<td><a onclick="SwitchToMenuItem('MenuItemWeb')" href="#" data-i18n="dashboard_infobox_label_ports_websocket" style="text-decoration: none">websocket</a></td>
<td id="dash_wsPorts" style="text-align:right">unknown</td>
</tr>
</tbody>

View File

@ -76,9 +76,11 @@ table.input-group{width:100%}
/*table*/
table.borderless td,table.borderless th{border: none !important;}
table.borderless td:first-child{width: 25px !important;}
.borderless {margin-bottom:0px}
table label{margin:0}
table.first_cell_borderless td:first-child,table.first_cell_borderless th:first-child{border: none !important;}
table.first_cell_borderless td:first-child{width: 25px !important;}
/*Header*/
.navbar-brand{padding-top:4px;padding-bottom:0px;padding-left:2;}

View File

@ -207,22 +207,22 @@
<li> <a class="inactive mnava" href="#dashboard"><i class="fa fa-dashboard fa-fw"></i><span data-i18n="main_menu_dashboard_token">Dashboard</span></a> </li>
<li> <a class="inactive mnava" href="#conf_general"><i class="fa fa-wrench fa-fw"></i><span data-i18n="main_menu_general_conf_token">General</span></a> </li>
<li>
<a class="inactive"><i class="fa fa-cog fa-fw"></i><span data-i18n="main_menu_configuration_token">Configuration</span><span class="fa arrow"></span></a>
<a class="inactive"><i class="fa fa-cog fa-fw"></i><span data-i18n="main_menu_configuration_token">LED-Instances</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li> <a class="inactive mnava" href="#conf_leds"><i class="mdi mdi-lightbulb-on fa-fw"></i><span data-i18n="main_menu_leds_conf_token">LED Hardware</span></a> </li>
<li> <a class="inactive mnava" id="MenuItemLeds" href="#conf_leds"><i class="mdi mdi-lightbulb-on fa-fw"></i><span data-i18n="main_menu_leds_conf_token">LED Hardware</span></a> </li>
<li> <a class="inactive mnava" href="#conf_effect"><i class="fa fa-spinner fa-fw"></i><span data-i18n="main_menu_effect_conf_token">Effects</span></a> </li>
<li> <a class="inactive mnava" href="#conf_colors"><i class="fa fa-photo fa-fw"></i><span data-i18n="main_menu_colors_conf_token">Image Processing</span></a> </li>
</ul>
</li>
<li> <a class="inactive mnava" href="#conf_grabber"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></a> </li>
<li> <a class="inactive mnava" href="#conf_network"><i class="fa fa-sitemap fa-fw"></i><span data-i18n="main_menu_network_conf_token">Network</span></a> </li>
<li> <a class="inactive mnava" id="MenuItemGrabber" href="#conf_grabber"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></a> </li>
<li> <a class="inactive mnava" id="MenuItemNetwork" href="#conf_network"><i class="fa fa-sitemap fa-fw"></i><span data-i18n="main_menu_network_conf_token">Network</span></a> </li>
<li> <a class="inactive mnava" href="#remote"><i class="fa fa-wifi fa-fw"></i><span data-i18n="main_menu_remotecontrol_token">Remote Control</span></a> </li>
<li> <a class="inactive mnava" href="#effects_configurator"><i class="fa fa-cogs fa-fw"></i><span data-i18n="main_menu_effectsconfigurator_token">Effects Configurator</span></a> </li>
<li> <a class="inactive mnava" href="#support"><i class="fa fa-info fa-fw"></i><span data-i18n="main_menu_support_token">Support</span></a> </li>
<li>
<a class="inactive"><i class="fa fa-industry fa-fw"></i><span data-i18n="main_menu_system_token">System</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li> <a class="inactive mnava" href="#conf_webconfig" id="load_webconfig"><i class="fa fa-wrench fa-fw"></i><span data-i18n="main_menu_webconfig_token">Webconfiguration</span></a> </li>
<li> <a class="inactive mnava" id="MenuItemWeb" href="#conf_webconfig" id="load_webconfig"><i class="fa fa-wrench fa-fw"></i><span data-i18n="main_menu_webconfig_token">Webconfiguration</span></a> </li>
<li> <a class="inactive mnava" id="MenuItemLogging" href="#conf_logging"><i class="fa fa-reorder fa-fw"></i><span data-i18n="main_menu_logging_token">Log</span></a> </li>
<li> <a class="inactive mnava" href="#update"><i class="fa fa-download fa-fw"></i><span data-i18n="main_menu_update_token">Update</span></a> </li>
<li> <a class="inactive mnava" href="#about"><i class="fa fa-info-circle fa-fw"></i><span data-i18n="main_menu_about_token">About</span></a> </li>

View File

@ -13,7 +13,6 @@ $(document).ready(function () {
instances_html += '</a><ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>'
instances_html += '</div></div>';
instances_html += '<div class="panel-body">';
instances_html += '<table class="table borderless">';
instances_html += '<thead><tr><th style="vertical-align:middle"><i class="mdi mdi-lightbulb-on fa-fw"></i>';
@ -40,7 +39,7 @@ $(document).ready(function () {
instances_html += '<span>' + $.i18n('dashboard_infobox_label_title') + '</span>';
instances_html += '</th></tr></thead>';
instances_html += '<tbody><tr><td></td>';
instances_html += '<td>' + $.i18n('conf_leds_contr_label_contrtype') + '</td>';
instances_html += '<td><a onclick="SwitchToMenuItem(\'MenuItemLeds\')" href="#" style="text-decoration:none">' + $.i18n('conf_leds_contr_label_contrtype') + '</a></td>';
instances_html += '<td style="text-align:right">' + window.serverConfig.device.type + '</td>';
instances_html += '</tr><tr></tbody></table>';
@ -50,28 +49,39 @@ $(document).ready(function () {
instances_html += '<span>' + $.i18n('dashboard_componentbox_label_title') + '</span>';
instances_html += '</th></tr></thead>';
var tab_components = "";
var componentBtn = "";
var instance_components = "";
for (var idx = 0; idx < components.length; idx++) {
if (components[idx].name != "ALL") {
var comp_enabled = components[idx].enabled ? "checked" : "";
const general_comp = "general_comp_" + components[idx].name;
var componentBtn = '<input ' +
'id="' + general_comp + '" ' + comp_enabled +
' type="checkbox" ' +
'data-toggle="toggle" ' +
'data-size="mini" ' +
'data-onstyle="success" ' +
'data-on="' + $.i18n('general_btn_on') + '" ' +
'data-off="' + $.i18n('general_btn_off') + '">';
if (components[idx].name === "FORWARDER" && window.currentHyperionInstance != 0)
continue;
tab_components += '<tr><td></td><td>' + $.i18n('general_comp_' + components[idx].name) + '</td><td style="text-align:right">' + componentBtn + '</td></tr>';
if ((components[idx].name === "GRABBER" && !window.serverConfig.instCapture.systemEnable) || (components[idx].name === "V4L" && !window.serverConfig.instCapture.v4lEnable))
{
componentBtn = '<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem(\'MenuItemGrabber\')" href="#" style="text-decoration: none"></a>';
} else {
var comp_enabled = components[idx].enabled ? "checked" : "";
const general_comp = "general_comp_" + components[idx].name;
componentBtn = '<input ' +
'id="' + general_comp + '" ' + comp_enabled +
' type="checkbox" ' +
'data-toggle="toggle" ' +
'data-size="mini" ' +
'data-onstyle="success" ' +
'data-on="' + $.i18n('general_btn_on') + '" ' +
'data-off="' + $.i18n('general_btn_off') + '">';
}
instance_components += '<tr><td></td><td>' + $.i18n('general_comp_' + components[idx].name) + '</td><td style="text-align:right">' + componentBtn + '</td></tr>';
}
}
instances_html += '<tbody>' + tab_components + '</tbody></table>';
instances_html += '<tbody>' + instance_components + '</tbody></table>';
instances_html += '</div></div></div>';
$('.instances').prepend(instances_html);
updateUiOnInstance(window.currentHyperionInstance);
updateHyperionInstanceListing();
@ -83,7 +93,7 @@ $(document).ready(function () {
for (var idx = 0; idx < components.length; idx++) {
if (components[idx].name != "ALL") {
$("#general_comp_" + components[idx].name).bootstrapToggle();
$("#general_comp_" + components[idx].name).bootstrapToggle(hyperion_enabled ? "enable" : "disable")
$("#general_comp_" + components[idx].name).bootstrapToggle(hyperion_enabled ? "enable" : "disable");
$("#general_comp_" + components[idx].name).change(e => {
requestSetComponentState(e.currentTarget.id.split('_')[2], e.currentTarget.checked);
});
@ -92,6 +102,11 @@ $(document).ready(function () {
}
// add more info
var screenGrabber = window.serverConfig.instCapture.systemEnable ? $.i18n('general_enabled') : $.i18n('general_disabled');
$('#dash_screen_grabber').html(screenGrabber);
var videoGrabber = window.serverConfig.instCapture.v4lEnable ? $.i18n('general_enabled') : $.i18n('general_disabled');
$('#dash_video_grabber').html(videoGrabber);
var fbPort = window.serverConfig.flatbufServer.enable ? window.serverConfig.flatbufServer.port : $.i18n('general_disabled');
$('#dash_fbPort').html(fbPort);
var pbPort = window.serverConfig.protoServer.enable ? window.serverConfig.protoServer.port : $.i18n('general_disabled');

View File

@ -24,10 +24,10 @@ $(document).ready(function () {
}
} 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_screengrabber', 'btn_submit_screengrabber'));
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt', 'panel-system'));
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_screengrabber', 'btn_submit_screengrabber', 'panel-system'));
if (VIDEOGRABBER_AVAIL) {
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_videograbber', 'btn_submit_videograbber'));
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_videograbber', 'btn_submit_videograbber', 'panel-system'));
}
}

View File

@ -307,12 +307,17 @@ $(document).ready(function () {
window.scrollTo(0, 0);
});
$(window).scroll(function(){
$(window).scroll(function() {
if ($(window).scrollTop() > 65)
$("#navbar_brand_logo").css("display", "none");
else
$("#navbar_brand_logo").css("display", "");
});
});
$('#side-menu li a, #side-menu li ul li a').click(function() {
$('#side-menu').find('.active').toggleClass('inactive'); // find all active classes and set inactive;
$(this).addClass('active');
});
});
function suppressDefaultPwWarning() {
@ -349,7 +354,7 @@ $("#btn_darkmode").off().on("click", function (e) {
});
// Menuitem toggle;
function SwitchToMenuItem(target) {
function SwitchToMenuItem(target, item) {
document.getElementById(target).click(); // Get <a href menu item;
let sidebar = $('#side-menu'); // Get sidebar menu;
sidebar.find('.active').toggleClass('inactive'); // find all active classes and set inactive;
@ -357,6 +362,21 @@ function SwitchToMenuItem(target) {
$('#' + target).removeClass('inactive'); // Remove inactive state by classname;
$('#' + target).addClass('active'); // Add active state by classname;
let cl_object = $('#' + target).closest('ul'); // Find closest ul sidemenu header;
cl_object.addClass('in'); // add class "in" to expand header in sidebar menu;
cl_object.addClass('in'); // Add class "in" to expand header in sidebar menu;
if (item) { // Jump to div "item" if available. Time limit 3 seconds
function scrollTo(counter) {
if(counter < 30) {
setTimeout(function() {
counter++;
if ($('#' + item).length)
$('#' + item)[0].scrollIntoView();
else
scrollTo(counter);
}, 100);
}
}
scrollTo(0);
}
};

View File

@ -201,7 +201,7 @@ $(document).ready(function () {
});
for (const comp of components) {
if (comp.name === "ALL")
if (comp.name === "ALL" || (comp.name === "FORWARDER" && window.currentHyperionInstance != 0))
continue;
const enable_style = (comp.enabled ? "checked" : "");

View File

@ -195,10 +195,12 @@ function updateUiOnInstance(inst) {
$('#btn_hypinstanceswitch').toggle(true);
$('#active_instance_dropdown').prop('disabled', false);
$('#active_instance_dropdown').css('cursor', 'pointer');
$("#active_instance_dropdown").css("pointer-events", "auto");
} else {
$('#btn_hypinstanceswitch').toggle(false);
$('#active_instance_dropdown').prop('disabled', true);
$("#active_instance_dropdown").css('cursor', 'default');
$("#active_instance_dropdown").css("pointer-events", "none");
}
}

View File

@ -48,11 +48,13 @@ bool QtGrabber::open()
{
bool rc = false;
#ifndef _WIN32
if (getenv("WAYLAND_DISPLAY") != nullptr)
{
_isWayland = true;
}
else
#endif
{
rc = true;
}

View File

@ -175,6 +175,9 @@ public:
if (MF_SOURCE_READERF_ENDOFSTREAM & dwStreamFlags)
_bEOS = TRUE; // Reached the end of the stream.
if (_pixelformat != PixelFormat::MJPEG && _pixelformat != PixelFormat::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
SAFE_RELEASE(pSample);
_isBusy = false;
LeaveCriticalSection(&_critsec);
return _hrStatus;

View File

@ -88,7 +88,6 @@ bool HyperionIManager::startInstance(quint8 inst, bool block, QObject* caller, i
// from Hyperion
connect(hyperion, &Hyperion::settingsChanged, this, &HyperionIManager::settingsChanged);
connect(hyperion, &Hyperion::videoMode, this, &HyperionIManager::requestVideoMode);
connect(hyperion, &Hyperion::compStateChangeRequest, this, &HyperionIManager::compStateChangeRequest);
// to Hyperion
connect(this, &HyperionIManager::newVideoMode, hyperion, &Hyperion::newVideoMode);

View File

@ -125,9 +125,8 @@ HyperionDaemon::HyperionDaemon(const QString& rootPath, QObject* parent, bool lo
//Cleaning up Hyperion before quit
connect(parent, SIGNAL(aboutToQuit()), this, SLOT(freeObjects()));
// pipe settings changes and component state changes from HyperionIManager to Daemon
// pipe settings changes from HyperionIManager to Daemon
connect(_instanceManager, &HyperionIManager::settingsChanged, this, &HyperionDaemon::settingsChanged);
connect(_instanceManager, &HyperionIManager::compStateChangeRequest, this, &HyperionDaemon::compStateChangeRequest);
// listen for setting changes of framegrabber and v4l2
connect(this, &HyperionDaemon::settingsChanged, this, &HyperionDaemon::handleSettingsUpdate);