Include ofxOMXPlayer on Raspberry Pi, not on regular Linux, addons.make


Hi! I am facing an issue here. When using addons.make. Compile on Linux 64bit crashes, because ofxOMXPlayer is not for it. It is needed by Raspberry Pi Linux though. How to make it compile on both?


You could include the ofxOMXPlayer only if you are on the raspberry pi

    #include ofxOMXPlayer

Keep in mind that ofxOMXPlayer is not 100% drop in replacement for the ofVideoPlayer so you’ll have to put a lot of #ifdef all over your code…

If you want to keep compatibility on both platform I suggest using ofVideoPlayer instead of ofxOMXPlayer.
There is a trick to activate hardware acceleration described here :
play-video-controlling-speed-and-direction raspberry pi

Happy coding.


Thanks @gilmar! Yes, hardware acceleration might be exactly what I would need from ofVideoPlayer. Will try.


Gstreamer can already use the hardware acceleration, openmax technology.