gnif / LookingGlass

An extremely low latency KVMFR (KVM FrameRelay) implementation for guests with VGA PCI Passthrough.
GNU General Public License v2.0
4.66k stars 257 forks source link

[obs] Allow the client to auto-recover #1016

Closed esibun closed 2 years ago

esibun commented 2 years ago

Finally decided to submit this for feedback.

Previously, if the client's subscription to the frame buffer becomes invalid for any reason, the video feed in OBS will freeze until the user goes in and changes any of the settings. This commit allows the plugin to automatically attempt to recover.

This also brings the OBS client in line with the behavior of the standalone client which will currently automatically restart in the same case.

You can see this in action by restarting the LG service while OBS is running - the client should resubscribe to the frame and pointer data automatically.

This won't solve underlying issues not caused by LG (driver crashes, etc.), just makes them less annoying to deal with while streaming.

gnif commented 2 years ago

Looks good but instead of duplicating code please create a function for the calls to pthread_create and pthread_join

esibun commented 2 years ago

Brought the pthread calls into two functions to avoid duplicate code.