Olive
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
olive::rendering Namespace Reference

Functions

GLuint compose_sequence (ComposeSequenceParams &params)
 Compose a frame of a given sequence. More...
 
void compose_audio (Viewer *viewer, Sequence *seq, int playback_speed, bool wait_for_mutexes)
 Convenience wrapper function for compose_sequence() to render audio. More...
 

Function Documentation

void olive::rendering::compose_audio ( Viewer viewer,
Sequence seq,
int  playback_speed,
bool  wait_for_mutexes 
)

Convenience wrapper function for compose_sequence() to render audio.

Much of the functionality provided (and parameters required) by compose_sequence() is only useful/necessary for video rendering. For audio rendering, this function is easier to handle and will correctly set up compose_sequence() to render audio without the cumbersome effort of setting up a ComposeSequenceParams object.

Parameters
viewerThe Viewer object calling this function
seqThe Sequence whose audio to render.
playback_speedThe current playback speed (controlled by Shuttle Left/Right)
Whetherto wait for media to open or simply fail if the media is not yet open. This should usually be FALSE.
GLuint olive::rendering::compose_sequence ( ComposeSequenceParams params)

Compose a frame of a given sequence.

For any given Sequence, this function will render the current frame indicated by Sequence::playhead. Will automatically open and close clips (memory allocation and file handles) as necessary, communicate with the Clip::cacher objects to retrieve upcoming frames and store them in memory, run Effect processing functions, and finally composite all the currently active clips together into a final texture.

Will sometimes render a frame incomplete or inaccurately, e.g. if a video file hadn't finished opening by the time of the render or a clip's cacher didn't have the requested frame available at the time of the render. If so, the texture_failed variable of params will be set to TRUE. Check this after calling compose_sequence() and if it is TRUE, compose_sequence() should be called again later to attempt another render (unless the Sequence is being played, in which case just play the next frame rather than redrawing an old frame).

Parameters
paramsA struct of parameters to use while rendering.
Returns
A reference to the OpenGL texture resulting from the render. Will usually be equal to ComposeSequenceParams::main_attachment unless it's rendering a nested sequence, in which case it'll be a reference to one of the textures referenced by Clip::fbo. Can be used directly to draw the rendered frame.