This patch adds Linux support for PowerPoint / LibreOffice Impress presentations
using LibreOffice UNO and OpenSong's existing ExternalRenderer protocol.
Base revision: SVN r1825.
The main goal is to render presentation slides inside OpenSong instead of
displaying a separate LibreOffice Impress slideshow window.
Because the rendered presentation becomes part of OpenSong's normal picture
pipeline, PPT/PPTX slides can also be sent through OpenSong's NDI output.
The patch adds:
LibreOfficeHost.xojo_code
TCP client used by OpenSong to communicate with the LibreOffice helper.
LibreOfficePresentation.xojo_code
Linux implementation of the iPresentation interface.
PresentationFactory changes
Linux presentation objects are created through LibreOfficePresentation.
PresentWindow changes
Presentation slides carrying an "externalrenderid" are rendered through
ExternalRenderer instead of using an external Impress slideshow window.
opensong-libreoffice-host.py
Provides presentation metadata/control through LibreOffice UNO.
opensong-external-renderer.py
Implements the OpenSong ExternalRenderer protocol for presentations.
PPT/PPTX
|
LibreOffice -> PDF
|
pdftoppm -> PNG
|
OpenSong ExternalRenderer
|
PreviewPicture / CurrentPicture
|
Presentation output + NDI
The LibreOffice helper uses:
127.0.0.1:2002 LibreOffice UNO
127.0.0.1:2003 OpenSong LibreOffice helper
The ExternalRenderer listens on:
127.0.0.1:8083
During ExternalRenderer PREPARE:
Pre-rendering all pages during PREPARE avoids running pdftoppm on every slide
change. After preparation, RENDER only returns the already generated image.
Linux packages:
libreoffice
python3
python3-uno
poppler-utils
A separate LibreOffice user profile can be used for the headless UNO instance,
so it does not interfere with a user's normal LibreOffice session.
The first PREPARE may take several seconds because LibreOffice has to convert
the presentation and all pages are rendered.
The existing 3000 ms timeout may therefore be too short for the first load.
A timeout of approximately 15000 ms or higher is recommended, depending on the
presentation size and machine speed.
During testing a Linux segmentation fault occurred when leaving presentation
mode.
The problem was caused by re-entrant GUI event processing in the synchronous
LibreOffice TCP request path during presentation cleanup/destruction.
Removing App.DoEvents from this request path and using socket Poll directly
prevents the crash.
Tested successfully on Linux with current OpenSong trunk r1825.
Tested scenarios:
The patch was also applied with:
patch -p0 --dry-run
against a clean SVN export of r1825 and applied without rejected hunks.
The implementation intentionally uses OpenSong's existing ExternalRenderer
protocol rather than introducing a separate presentation output path.
The Python rendering backend is kept separate from the Xojo code so it can be
changed or extended independently from OpenSong's ExternalRenderer protocol.
I can provide additional test logs or adjust the integration/layout if the
maintainers prefer the helper scripts to live in a different location in the
source tree.
Anonymous