Tutorial

From Theora Playback Library
Revision as of 10:29, 3 January 2010 by Kspes (talk | contribs) (initial)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The first thing you need to do is download the latest compiled sdk or source tarball from the Releases page.

Init

To initialise the library, create an instance of the TheoraVideoManager class:

TheoraVideoManager *mgr=new TheoraVideoManager();

Loading video

TheoraVideoClip *clip=mgr->createVideoClip("path/to/video/file.ogg");

Grabbing frames

TheoraVideoFrame *frame=clip->getNextFrame();
if (frame)
{
    // transfer the frame pixels to your display device, texure, graphical context or whatever you use.
    clip->popFrame(); // be sure to pop the frame from the frame queue when you're done
}


Audio

Theora Playback Library features an abstracted audio interface, see Audio/Video Player demo for more information.

Destruction

When you destroy the TheoraVideoManager, all video clip objects get destroyed along with it.

delete mgr;