ofVidePlayer refactor first pass

I’ve been playing around with various ways to refactor ofVideoPlayer such that the details of say the QuickTime implementation are separated from the gstreamer implementation. My motivations were to work toward keeping the logic of the player separate from the details of a particular API and as a result make things more maintainable and manageable.

This is a rough first pass, but gets the idea across. In doing this, I found the logic to be tightly intertwined with the various APIs, so before I put in the fairly large effort it will take to complete the refactor and make it really clean, I want to see if this approach to x-platform/x-api design is viable within the OF project.

I’ve tested this on OSX and Ubuntu. I’m not sure about Windows, but I assume with QT is being used on windows, it will work.

What I implemented is the “pointer to implementation” design pattern aka PIMPL. The design keeps ofVideoPlayer as a generic interface so no code using it need change. Inside ofVideoPlayer, there’s a pointer to an ofVideoPlayerImpl which is specific to QT or gst. All ofVideoPlayer functions dependent on API-specific calls follow a naming convention like implLoadMovie, etc. I zipped up the entire modified OF Video folder and it can be downloaded here if you want to take a look: http://mat.ucsb.edu/whsmith/temp/ofVideo.zip

lian created branch whsmith at lian/ofx-dev less than a minute ago
New branch is at lian/ofx-dev/tree/whsmith

hey otherside, this looks like a great start. i created/push a new branch to my repository, for testing, and its looking good so far.

your branch is at:
http://github.com/lian/ofx-dev/tree/whsmith

this is the usual master/trunk:
http://github.com/lian/ofx-dev/tree/master

and the latest commit of your branch is:
http://github.com/lian/ofx-dev/commit/f-…-69371fb3c0

and here is a general overview of ofx-dev forks/branches:
http://github.com/lian/ofx-dev/network

hopes this helps someone who tries to use/test the ‘ofVideoPlayer refactor’

-lian

thanks. I’m going to keep tinkering with it. After digesting it for a few days, I’m thinking that at this point the refactor doesn’t reach the point of paying off in terms of readability etc., but I see a lot of room for improvement. When I’m able to move more of the logic into the generic class, I’ll post it again as that’s when it starts to payoff.