diff --git a/.gitignore b/.gitignore index aeba5a7..78c6538 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,6 @@ service/led-interpolation.txt test-autostart test-retry + +test-playback +test-handover diff --git a/HyperDRM.manifest.json b/HyperDRM.manifest.json index 59a3744..4dc0c89 100644 --- a/HyperDRM.manifest.json +++ b/HyperDRM.manifest.json @@ -1,15 +1,15 @@ { "id": "org.webosbrew.histogramhyperion", - "version": "0.6.4", + "version": "0.7.0", "type": "web", "title": "HyperDRM", "appDescription": "Ambient lighting for webOS and Hyperion", "iconUri": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/app/icon.png", "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM", "rootRequired": true, - "ipkUrl": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/HyperDRM_0.6.4_arm.ipk", + "ipkUrl": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/HyperDRM_0.7.0_arm.ipk", "ipkHash": { - "sha256": "53762efd7e8d915d570fed96dbd1844d18ca825c21a9bc53f3aa28fea0f823ae" + "sha256": "0668d8abab98d81d51368863c7bc920f85f6107ec3872ea1810a332c2ddc87f5" }, - "ipkSize": 1164794 + "ipkSize": 1169660 } diff --git a/HyperDRM_0.6.4_arm.ipk b/HyperDRM_0.7.0_arm.ipk similarity index 91% rename from HyperDRM_0.6.4_arm.ipk rename to HyperDRM_0.7.0_arm.ipk index 4b6779d..33fe629 100644 Binary files a/HyperDRM_0.6.4_arm.ipk and b/HyperDRM_0.7.0_arm.ipk differ diff --git a/README.md b/README.md index 27204a1..76b591b 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,11 @@ DRM playback color output was confirmed on the test TV. Support depends on LG's The 16 histogram samples are independent measurements; interpolation produces smoother transitions without adding independently captured detail. Sample positions are approximate G4 calibration values. Top/bottom bar detection is supported; side bars, arbitrary bar thickness and HDR color calibration remain limited. -Only the own service is modified. No Hue, LG library, driver or firmware binaries are included. For histogram initialization, the service temporarily creates LG's developer marker and uses a guardian process to remove its own marker afterward; an existing marker is preserved. +Only the own service is modified. Optional Auto PicCap can start and stop the installed PicCap service through its existing API. No Hue, LG library, driver or firmware binaries are included. For histogram initialization, the service temporarily creates LG's developer marker and uses a guardian process to remove its own marker afterward; an existing marker is preserved. ## Installation -The current package is [HyperDRM_0.6.4_arm.ipk](HyperDRM_0.6.4_arm.ipk). Install it using the TV's webOS/Homebrew package installation workflow. +The current package is [HyperDRM_0.7.0_arm.ipk](HyperDRM_0.7.0_arm.ipk). Install it using the TV's webOS/Homebrew package installation workflow. Elevate the installed own service through Homebrew Channel: @@ -85,3 +85,13 @@ The logo master is `app/logo.png`, with 80 px and 130 px installation icons. See [the publishing review](docs/publishing-review.md) for the requirements audit and unresolved submission conditions. This repository is not a claim that webOSbrew has approved the app. Remote navigation regression tests: `node tests/remote-navigation.test.js`. + +## Optional automatic PicCap handover + +Version 0.7.0 adds **Auto PicCap**, disabled by default. The switch is available when PicCap is installed. Keep PicCap's own autostart disabled and configure its output for your Hyperion instance. HyperDRM does not change PicCap's configuration or autostart preference. + +When the session is started, the controller polls LG's active media resources. Two consecutive foreground media-decoder samples without a Secure Video Path resource allow PicCap to start. HyperDRM releases its histogram capture and clears priority 149 first, allowing PicCap's configured input priority to take over. Any `SVP_CPB` resource selects protected playback; missing, stale, malformed, idle or HDMI state selects the conservative HyperDRM fallback. PicCap must confirm that it has stopped before histogram capture resumes. Detection is specific to the tested G4 resource model, not a universal DRM-state API. + +The switch is saved in the own service container and applies after reboot when Autostart is enabled. Stop pauses both managed capture paths until Start. Turning Auto PicCap off stops a PicCap session started by this controller and restores HyperDRM. Avoid starting another capture service independently while automatic handover is active. + +The app displays the selected source and PicCap's Hyperion connection status. Histogram region swatches are hidden while PicCap supplies the colors. Playback classification and isolated controller tests are in `native/test_playback.c` and `native/test_handover.c`; link both with `-ldl`. diff --git a/app/app.js b/app/app.js index d40bfd4..f1d7852 100644 --- a/app/app.js +++ b/app/app.js @@ -9,9 +9,17 @@ function call(method,done,data){ bridge.call('luna://org.webosbrew.histogramhyperion.service/'+method,JSON.stringify(data||{})); } function display(result){ + var handover=document.getElementById('handover');handover.disabled=!result.piccapInstalled; + handover.setAttribute('aria-checked',String(!!result.piccapHandover)); + handover.textContent=result.piccapInstalled?'Auto PicCap: '+(result.piccapHandover?'On':'Off'):'Auto PicCap: Not installed'; if(typeof result.autostart==='boolean'){var toggle=document.getElementById('autostart');toggle.setAttribute('aria-checked',String(result.autostart));toggle.textContent='Autostart: '+(result.autostart?'On':'Off');} document.getElementById('error').textContent=result.errorText||result.error||''; document.getElementById('status').textContent=result.returnValue===false?'Service unavailable':(result.running?'Running':'Stopped')+' · '+(result.frames||0)+' acknowledged color updates'; + if(result.activeSource==='PicCap'){ + document.getElementById('status').textContent='PicCap · '+(result.running?'Running':'Switching capture source')+' · '+(result.piccapConnected?'Hyperion connected':'Waiting for Hyperion'); + document.getElementById('regions').textContent='';return; + } + if(result.piccapHandover)document.getElementById('status').textContent+=' · HyperDRM · '+result.playbackProtection; if(result.colorValid)document.getElementById('status').textContent+=result.spatialOutput?' · '+result.ledCount+' LEDs from 16 color regions':' · Output RGB: '+result.outputColor.join(', '); else if(result.returnValue!==false)document.getElementById('status').textContent+=' · No current color output'; if(result.blackBarDetection && result.running)document.getElementById('status').textContent+=result.letterboxDetected?' · Top/bottom black bars detected':' · Full-screen capture'; @@ -29,4 +37,5 @@ document.getElementById('start').focus(); document.getElementById('autostart').onclick=function(){var button=this;var enabled=button.getAttribute('aria-checked')!=='true';button.disabled=true;call('autostart',function(r){button.disabled=false;if(r.returnValue===false)document.getElementById('error').textContent=r.errorText;else call('status',display);},{enabled:enabled});}; -setupRemoteNavigation(['start','stop','refresh','autostart'].map(function(id){return document.getElementById(id);}),document,window); +document.getElementById('handover').onclick=function(){var button=this;button.disabled=true;call('handover',function(r){button.disabled=false;if(r.returnValue===false)document.getElementById('error').textContent=r.errorText;else call('status',display);},{enabled:button.getAttribute('aria-checked')!=='true'});}; +setupRemoteNavigation(['start','stop','refresh','autostart','handover'].map(function(id){return document.getElementById(id);}),document,window); diff --git a/app/appinfo.json b/app/appinfo.json index b427af9..de4f062 100644 --- a/app/appinfo.json +++ b/app/appinfo.json @@ -1 +1 @@ -{"id": "org.webosbrew.histogramhyperion", "version": "0.6.4", "vendor": "Local development", "type": "web", "main": "index.html", "title": "HyperDRM", "icon": "icon.png", "resolution": "1920x1080", "disableBackHistoryAPI": true, "largeIcon": "large-icon.png", "appDescription": "Ambient lighting for webOS and Hyperion", "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM"} \ No newline at end of file +{"id": "org.webosbrew.histogramhyperion", "version": "0.7.0", "vendor": "Local development", "type": "web", "main": "index.html", "title": "HyperDRM", "icon": "icon.png", "resolution": "1920x1080", "disableBackHistoryAPI": true, "largeIcon": "large-icon.png", "appDescription": "Ambient lighting for webOS and Hyperion", "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM"} diff --git a/app/index.html b/app/index.html index f9e67a3..36d2543 100644 --- a/app/index.html +++ b/app/index.html @@ -2,7 +2,8 @@
HyperDRMAmbient lighting for webOS and Hyperion.
Checking service …
Use the arrow buttons to select a control and OK to activate it.
Starts the service when the TV boots. Stop ends only the current session.
+ +Use the arrow buttons to select a control and OK to activate it.
Autostart starts the service when the TV boots. Stop ends the current session. Auto PicCap uses installed PicCap for non-secure video and HyperDRM for protected or unknown playback. Keep PicCap's own autostart off.
127.0.0.1:19444 · Priority 149 · 10 updates per second
The Hyperion layout determines the number and positions of LEDs. Colors come from 16 LG histogram regions with interpolated edge colors. Restart the service after changing the LED layout.