webosbrew / hyperion-webos

hyperion.ng video grabber for webOS
MIT License
153 stars 30 forks source link

WIP uni{fied,versal} capture library/module #43

Closed Informatic closed 2 years ago

Informatic commented 2 years ago

This is a work in progress branch with "new" synchronous capture backend interface, unified for both UI and Video layer capture, where all pixel format conversion, scaling and blending is extracted into a common "unicapture" module.

Notable changes:

Known issues:

Supersedes:

chbartsch commented 2 years ago

FYI: You can find my work in progress on the halgal/vtcapture side here.

If I can help with stuff or test things just let me know. ;)

TBSniller commented 2 years ago

@Informatic: Hope its okay for you, I have commited a change in your pull request. If the service is not running as root, but graphic capture is enabled the process crashes while initiating, because its not running as root. This is the case after very first PicCap start.

tuxuser commented 2 years ago

~~- Do we want to enable the -S (--no-service) switch again? https://github.com/webosbrew/hyperion-webos/blob/6025215d450c0aaf731f0f8d22872e5addbf9ce7/src/main.c#L46 https://github.com/webosbrew/hyperion-webos/blob/6025215d450c0aaf731f0f8d22872e5addbf9ce7/src/main.c#L90-L92~~

- -s/--save-conf argument still needed? https://github.com/webosbrew/hyperion-webos/blob/6025215d450c0aaf731f0f8d22872e5addbf9ce7/src/main.c#L58 https://github.com/webosbrew/hyperion-webos/blob/6025215d450c0aaf731f0f8d22872e5addbf9ce7/src/main.c#L114-L116

Longer log snippet for context:

     0.082s [WARN capture_init        ] [DILE_VT] DISPLAY dump location failed, attempting SCALER...
     0.082s [ ERR capture_init        ] [DILE_VT] SetVideoFrameOutputDeviceDumpLocation failed!
     0.084s [ ERR unicapture_init_backend] libdile_vt_backend.so: init failure, code: -2
     0.084s [WARN unicapture_try_backends] try_backends: backend: libdile_vt_backend.so failed with code: -2
     0.084s [ ERR unicapture_try_backends] Try backends failed!
     0.089s [ DBG unicapture_run      ] Attempting UI capture init...
     0.089s [ DBG main                ] Going into main loop..
     0.089s [ DBG connection_loop     ] Starting connection loop
     0.089s [INFO unicapture_vsync_handler] vsync thread starting...
     0.089s [INFO unicapture_run      ] UI capture started
     0.089s [INFO connection_loop     ] Connecting hyperion-client..
     0.093s [INFO power_callback      ] Power status callback message: { "subscribed": true, "returnValue": true, "state": "Active" }
     0.175s [INFO unicapture_run      ] Buffer dumped to: /tmp/hyperion-webos-dump.000.data
     0.213s [INFO connection_loop     ] hyperion-client connected!
     2.478s [INFO power_callback      ] Power status callback message: { "returnValue": true, "state": "Active", "processing": "Request Screen Saver" }
     2.478s [INFO power_callback      ] Pausing due to power event...
     2.495s [INFO unicapture_run      ] Shutting down...
     2.495s [ DBG unicapture_run      ] Waiting for vsync thread to finish...
     2.533s [INFO unicapture_vsync_handler] vsync thread finished
     2.534s [ DBG unicapture_run      ] Terminating UI capture...
     2.534s [ DBG unicapture_run      ] Done!
     2.537s [INFO connection_loop     ] Ending connection loop
     2.537s [ DBG connection_loop     ] Connection loop exiting
     2.538s [INFO power_callback      ] Power status callback message: { "returnValue": true, "state": "Active", "processing": "Screen On" }
     2.538s [INFO power_callback      ] Power status callback message: { "returnValue": true, "state": "Active" }
     2.538s [INFO power_callback      ] Resuming after power pause...
     2.538s [ DBG connection_loop     ] Starting connection loop
     2.538s [INFO unicapture_vsync_handler] vsync thread starting...
     2.538s [ DBG unicapture_run      ] Attempting UI capture init...
     2.538s [INFO connection_loop     ] Connecting hyperion-client..
     2.538s [INFO unicapture_run      ] UI capture started
     2.557s [INFO connection_loop     ] hyperion-client connected!
     2.623s [INFO unicapture_run      ] Buffer dumped to: /tmp/hyperion-webos-dump.000.data
     6.149s [INFO unicapture_run      ] Buffer dumped to: /tmp/hyperion-webos-dump.001.data
     9.031s [INFO unicapture_run      ] Framerate: 9.240378 FPS; timings - wait: 10721us, acquire: 3047us, convert: 40502us, process; 475us, send: 38036us, release: 2us
     9.031s [INFO unicapture_run      ]         UI: pixfmt: 11; 320x180
     9.031s [INFO unicapture_run      ]      VIDEO: pixfmt: 0; 0x0
     9.031s [INFO unicapture_run      ] CONV    UI: pixfmt: 12; 320x180
     9.031s [INFO unicapture_run      ] CONV VIDEO: pixfmt: 0; 0x0

Update: point 1 and 2 make no sense anymore with the way unicapture works :) Update 2: Changes done, PR sent.

tuxuser commented 2 years ago

When following PRs are merged, unicapture could be merged too:

TBSniller commented 2 years ago

@Informatic @tuxuser @chbartsch after almost one year it's done. Thank you all! <3