Recently, I discovered the RPI examples in /opt/vc/src/hello_pi. One in particular that caught my eye was the "hello_font" example which painted text on the screen in a "subtitle" sort of fashion. At first, I could not get it to build but then I discovered that if I add -lGLESv2 to the LDFLAGS in /opt/vc/src/hello_pi/Makefile.include ....
I imagine these were originally for Raspbian because not all of them build. Most of them do but not all.
I've been meaning to experiment with Mono's native C lib interoperability and I thought that I could reshape this example to provide OSD functionality for tomxplayer. After a couple of days of tinkering, tomxplayer now has OSD functionality and I have learned quite a bit about how to interop with C native libraries in C#/MonoDevelop.
- Show the filename, over the video, when the video begins to play.
- Show, over the video, "VOL +", "VOL -", "Paused" etc when these actions occur.
- Show, over the video, playback position during ff/rewind and slider positioning.
Currently, it is possible for the osd text to go outside the window bounds given the window size and length of displayed text. So, some calculation for sizes are still needed. Something to work on.
Also, currently the osd text is displayed in a static position relative to the render window (bottom left corner) instead of being bottom centered.
@Wimpy, Thanks for the tip about the InhibitAPI. I decided to wrap execution using mate-session-inhibit and alternatively systemd-inhibit (if mate-session-inhibit is not available). This will prevent "idle:sleep:switch-user:logout" while tomxplayer is running. Technically, the inhibition should be lifted if the video is paused but this will suffice until I discover how to get notified of system events like "logout" so I can get rid of the video window.