Add initial video playback support for Ogg Theora videos (resolves issue #66.)

The basic APIs are:

video = love.graphics.newVideo("myvideo.ogv")

love.graphics.draw(video, ...) -- Video objects are Drawables.

video:play(), video:pause()

video:getDuration(), video:tell(), video:rewind(), video:seek(seconds)

video:getSource()

video:getWidth(), video:getHeight(), video:setFilter(min, mag)

More advanced APIs include video:setSource(source), video:getStream(), and videostream:setSync.

To use a custom pixel shader when drawing a Video, call the new TexelVideo(texcoords) function instead of Texel(texture, texcoords) in order to get the pixel colors of a video frame.
This commit is contained in:
Bart van Strien
2015-12-08 22:41:19 -04:00
parent a1dab12117
commit 22f2175bec
41 changed files with 2241 additions and 20 deletions
+9 -2
View File
@@ -56,7 +56,6 @@ Timer::Timer()
, fpsUpdateFrequency(1)
, frames(0)
, dt(0)
, timerPeriod(getTimerPeriod())
{
prevFpsUpdate = currTime = getTime();
}
@@ -115,8 +114,11 @@ double Timer::getTimerPeriod()
return 0;
}
double Timer::getTime() const
double Timer::getTimeSinceEpoch()
{
// The timer period (reciprocal of the frequency.)
static const double timerPeriod = getTimerPeriod();
#if defined(LOVE_LINUX)
double mt;
// Check for POSIX timers and monotonic clocks. If not supported, use the gettimeofday fallback.
@@ -143,5 +145,10 @@ double Timer::getTime() const
#endif
}
double Timer::getTime() const
{
return getTimeSinceEpoch();
}
} // timer
} // love
+1 -3
View File
@@ -77,6 +77,7 @@ public:
* @return The time (in seconds)
**/
virtual double getTime() const;
static double getTimeSinceEpoch();
private:
@@ -98,9 +99,6 @@ private:
// The current timestep.
double dt;
// The timer period (reciprocal of the frequency.)
const double timerPeriod;
// Returns the timer period on some platforms.
static double getTimerPeriod();