displays: changed api for mainloop

- removed `needs_mainloop` attribute and deduce if mainloop is needed
  from the presence of _run callback (the information is now redundant
  only displays needing/running mainloop should announce _run callback)

- run the custom mainloop (currently only Syphon!) only when display
  doesn't run its mainloop. This allows running Syphon and GL/SDL
  display because it connects to the display mainloop.
This commit is contained in:
Martin Pulec
2023-03-27 13:47:36 +02:00
parent dd0c38b01d
commit a3daa89ef6
31 changed files with 20 additions and 82 deletions

View File

@@ -827,6 +827,11 @@ void print_video_codecs(void) {
cout << "\nLegend:\n" << " I - interframe codec\n";
}
/**
* Registers mainloop that will be run if display-owned mainloop isn't run.
* Currently this is only used by Syphon, that either connects to display event
* loop and if there isn't any, it runs its own.
*/
bool register_mainloop(mainloop_t m, void *u)
{
if (mainloop) {