ofxOMXplayer: unable to compile project on OS X

Hello all

I’m trying to create a program that makes use of ofxOMXplayer in hopes of then making it work on a Raspberry PI. I want to develop it on OS X (Xcode), as I’m kind of a newbie to openFrameworks, and afaik compiling on the PI takes a lot longer, so my frequent trial-and-error will end up taking lots of time.
I’ve been so far successful in including ofxGUI and compiling a series of simple draw tests, as well as some audio analysis fiddling.

My problem is that including the ofxOMXplayer addon produces a lot of compile errors. If I just include it and try to compile, I get several errors relating to time.h, like:
“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ctime:59:9: No member named ‘tm’ in the global namespace”

I found that libavutil has a time.h file, which might be causing clashes with the system include.
If I change libavutil’s time.h filename to mytime.h, those errors go away.

However, I then get a number of library include errors like
“/Users/user/Documents/openFrameworks_v0.9.0/addons/ofxOMXPlayer/src/OMX_Maps.h:15:10: ‘IL/OMX_Core.h’ file not found”
“/Users/user/Documents/openFrameworks_v0.9.0/addons/ofxOMXPlayer/src/LIBAV_INCLUDES.h:21:11: ‘libswresample/swresample.h’ file not found”

I created the project using the included project generator, so I’m guessing all addon inclusions are done correctly.

Any help is greatly appreciated!


I’m pretty sure the OMX player is Raspberry Pi only.
There will be minor differences in the syntax to use them, but what I have done in the past is something like:

   ofxOMXplayer videoPlayer;
   ofVideoPlayer videoPlayer;

To allow me to have a codebase that compiles and runs on both the Pi and my desktop. You’ll need to do frequent tests on the Pi of course, but it makes for faster dev.


1 Like

Hummm I feared as much…
I thought, since openMax is also available on OS X, that ofxOMXplayer would work as well, I guess no luck for me…

I read somewhere that using ofVideoPlayer with “setPixelFormat(OF_PIXELS_NATIVE);” option got performances similar to using ofxOMXplayer, any idea if that’s true?

You mean on the Pi, no idea I’m afraid. I imagine the OMX player is going to be faster as it’s using a very custom path designed for the various chips in the Pi.

Resurrecting this thread.

Like stated, working on xcode, now with conditional code for includes and video player creation.

Conditionally using ofxOMXPlayer or ofVideoPlayer depending on current target platform with:

#include “ofxOMXPlayer.h”
#include “ofVideoPlayer.h”

Whenever I try to compile on Xcode, I get the error:

/Users/user/Documents/openFrameworks_v0.9.0/addons/ofxOMXPlayer/src/LIBAV_INCLUDES.h:21:11: ‘libswresample/swresample.h’ file not found

I included the addon’s path in User Header Search Path ($(OF_ROOT)/addons/ofxOMXPlayer/libs) but still get the error.

Haven’t tried compiling on the RasPI yet, so can’t check if there are include problems, but this particular one does seem to be related to Xcode rather than the library in itself (hopefully).


Your Xcode project should not be including (and trying to compile) OMXPlayer, I would try removing any mention of it from your Xcode project, aside from stuff you have #ifdef’ed out.

So for the OSX version I should just remove the addon?

The rest of the code can remain the same, since the preprocessor statements will get ignored when they target the RasPI, right?

Thanks again!


Yup! Code stays the same, the Pi includes the ofxOMXPlayer via addons.make and Xcode gets whatever other cross platform addons you are using.

1 Like

Ok, great!

Thanks a bunch, will get it running on the PI as soon as I get home and hopefully will only come here to mark it as solved and thank you once again hehe