Merge branch 'mediafoundation' of https://github.com/Paulchen-Panther/hyperion.ng into mediafoundation

This commit is contained in:
Lord-Grey 2021-02-17 23:26:49 +01:00
commit 3a2a101658
6 changed files with 26 additions and 14 deletions

View File

@ -93,11 +93,11 @@ $(document).ready(function() {
if (sys.cpuRevision) if (sys.cpuRevision)
info += 'CPU Revision: ' + sys.cpuRevision + '\n'; info += 'CPU Revision: ' + sys.cpuRevision + '\n';
if (sys.cpuHardware) if (sys.cpuHardware)
info += 'CPU Hardware: ' + sys.cpuHardware + '\n'; info += 'CPU Hardware: ' + sys.cpuHardware + '\n';
info += 'Kernel: ' + sys.kernelType+' ('+sys.kernelVersion+' (WS: '+sys.wordSize+'))' + '\n'; info += 'Kernel: ' + sys.kernelType+' ('+sys.kernelVersion+' (WS: '+sys.wordSize+'))' + '\n';
info += 'Qt Version: ' + sys.qtVersion + '\n'; info += 'Qt Version: ' + sys.qtVersion + '\n';
info += 'Python Version: ' + sys.pyVersion + '\n'; info += 'Python Version: ' + sys.pyVersion + '\n';
info += 'Browser/OS: ' + navigator.userAgent + '\n\n'; info += 'Browser/OS: ' + navigator.userAgent + '\n\n';
//create prios //create prios
@ -169,12 +169,24 @@ $(document).ready(function() {
messages = (event.response.result.messages); messages = (event.response.result.messages);
if(messages.length != 0 && !createdCont) if(messages.length != 0 && !createdCont)
{ {
$('#log_content').html('<pre><div id="logmessages" style="overflow:scroll;max-height:400px"></div></pre><button class="btn btn-primary" id="btn_autoscroll"><i class="fa fa-long-arrow-down fa-fw"></i>'+$.i18n('conf_logging_btn_autoscroll')+'</button>'); $('#log_content').html('\
<pre><div id="logmessages" style="overflow:scroll;max-height:400px"></div></pre>\
<button class="btn btn-danger" id="btn_autoscroll"><i class="fa fa-long-arrow-down fa-fw"></i>'+$.i18n('conf_logging_btn_autoscroll')+'</button>\
<button class="btn btn-primary" id="btn_clipboard"><i class="fa fa-clipboard fa-fw"></i>Copy Log to Clipboard</button>');
createdCont = true; createdCont = true;
$('#btn_autoscroll').off().on('click',function() { $('#btn_autoscroll').off().on('click',function() {
toggleClass('#btn_autoscroll', "btn-success", "btn-danger"); toggleClass('#btn_autoscroll', "btn-success", "btn-danger");
}); });
$('#btn_clipboard').off().on('click',function() {
const temp = document.createElement('textarea');
temp.textContent = document.getElementById("logmessages").textContent;
document.body.append(temp);
temp.select();
document.execCommand("copy");
temp.remove();
});
} }
for(var idx = 0; idx < messages.length; idx++) for(var idx = 0; idx < messages.length; idx++)

View File

@ -68,7 +68,6 @@
"width" : 0, "width" : 0,
"height" : 0, "height" : 0,
"fps" : 15, "fps" : 15,
"standard" : "NO_CHANGE",
"flip" : "NO_CHANGE", "flip" : "NO_CHANGE",
"fpsSoftwareDecimation" : 0, "fpsSoftwareDecimation" : 0,
"sizeDecimation" : 8, "sizeDecimation" : 8,

View File

@ -435,11 +435,12 @@ void MFGrabber::enumVideoCaptureDevices()
{ {
QList<DeviceProperties> devicePropertyList; QList<DeviceProperties> devicePropertyList;
QString dev = QString::fromUtf16((const ushort*)name); QString dev = QString::fromUtf16((const ushort*)name);
Debug(_log, "Found capture device: %s", QSTRING_CSTR(dev));
IMFMediaSource *pSource = nullptr; IMFMediaSource *pSource = nullptr;
if(SUCCEEDED(devices[i]->ActivateObject(IID_PPV_ARGS(&pSource)))) if(SUCCEEDED(devices[i]->ActivateObject(IID_PPV_ARGS(&pSource))))
{ {
Debug(_log, "Found capture device: %s", QSTRING_CSTR(dev));
IMFMediaType *pType = nullptr; IMFMediaType *pType = nullptr;
IMFSourceReader* reader; IMFSourceReader* reader;
if(SUCCEEDED(MFCreateSourceReaderFromMediaSource(pSource, NULL, &reader))) if(SUCCEEDED(MFCreateSourceReaderFromMediaSource(pSource, NULL, &reader)))
@ -481,7 +482,8 @@ void MFGrabber::enumVideoCaptureDevices()
pSource->Release(); pSource->Release();
} }
_deviceProperties.insert(dev, devicePropertyList); if (!devicePropertyList.isEmpty())
_deviceProperties.insert(dev, devicePropertyList);
} }
CoTaskMemFree(symlink); CoTaskMemFree(symlink);

View File

@ -127,7 +127,7 @@ void MFWrapper::handleSettingsUpdate(settings::type type, const QJsonDocument& c
_grabber.setPixelDecimation(obj["sizeDecimation"].toInt(8)); _grabber.setPixelDecimation(obj["sizeDecimation"].toInt(8));
// flip mode // flip mode
_grabber.setFlipMode(obj["flip"].toString("no-change")); _grabber.setFlipMode(obj["flip"].toString("NO_CHANGE"));
// image cropping // image cropping
_grabber.setCropping( _grabber.setCropping(

View File

@ -151,6 +151,6 @@ void V4L2Wrapper::handleSettingsUpdate(settings::type type, const QJsonDocument&
obj["blueSignalThreshold"].toDouble(0.0)/100.0); obj["blueSignalThreshold"].toDouble(0.0)/100.0);
_grabber.setDeviceVideoStandard( _grabber.setDeviceVideoStandard(
obj["device"].toString("auto"), obj["device"].toString("auto"),
parseVideoStandard(obj["standard"].toString("no-change"))); parseVideoStandard(obj["standard"].toString("NO_CHANGE")));
} }
} }

View File

@ -7,7 +7,7 @@
"type": "string", "type": "string",
"title": "edt_conf_v4l2_device_title", "title": "edt_conf_v4l2_device_title",
"propertyOrder": 1, "propertyOrder": 1,
"required": true "required": false
}, },
"device": { "device": {
"type": "string", "type": "string",
@ -23,7 +23,7 @@
"type": "string", "type": "string",
"title": "edt_conf_v4l2_input_title", "title": "edt_conf_v4l2_input_title",
"propertyOrder": 3, "propertyOrder": 3,
"required": true "required": false
}, },
"input": { "input": {
"type": "integer", "type": "integer",
@ -40,8 +40,7 @@
"standard": { "standard": {
"type": "string", "type": "string",
"title": "edt_conf_v4l2_standard_title", "title": "edt_conf_v4l2_standard_title",
"default": "auto", "required": false,
"required": true,
"propertyOrder": 5 "propertyOrder": 5
}, },
"encoding": { "encoding": {
@ -56,7 +55,7 @@
"type": "string", "type": "string",
"title": "edt_conf_v4l2_resolution_title", "title": "edt_conf_v4l2_resolution_title",
"propertyOrder": 7, "propertyOrder": 7,
"required": true "required": false
}, },
"width": { "width": {
"type": "integer", "type": "integer",
@ -88,7 +87,7 @@
"type": "string", "type": "string",
"title": "edt_conf_v4l2_framerate_title", "title": "edt_conf_v4l2_framerate_title",
"propertyOrder": 10, "propertyOrder": 10,
"required": true "required": false
}, },
"fps": { "fps": {
"type": "integer", "type": "integer",