Vuo  2.3.2
Typedefs | Functions
VuoVideo.h File Reference

Description

VuoVideo interface.

Definition in file VuoVideo.h.

Go to the source code of this file.

Typedefs

typedef void * VuoVideo
 An opaque object for decoding video. More...
 

Functions

VuoVideo VuoVideo_make (VuoUrl path, VuoVideoOptimization optimization)
 Create a new instance of a video player. More...
 
void VuoVideo_setVideoDelegate (VuoVideo player, void(*delegate)(VuoVideoFrame))
 Set the delegate to be called when a new video frame is available. More...
 
void VuoVideo_setAudioDelegate (VuoVideo player, void(*delegate)(VuoList_VuoAudioSamples))
 Set the delegate to be called when a new video frame is available. More...
 
void VuoVideo_setPlaybackFinishedDelegate (VuoVideo player, void(*delegate)(void))
 Set the delegate to be called when a video playback reaches the end (or beginning, if playback rate is negative). More...
 
void VuoVideo_play (VuoVideo player)
 Begin playback of video. More...
 
void VuoVideo_pause (VuoVideo player)
 Stop playback of video. More...
 
void VuoVideo_setPlaybackRate (VuoVideo player, VuoReal rate)
 Set the playback rate for the decoder. More...
 
void VuoVideo_setPlaybackLooping (VuoVideo player, VuoLoopType loop)
 Set how the video reacts when reaching the end of playback. More...
 
double VuoVideo_getLastDecodedVideoTimestamp (VuoVideo player)
 Return the timestamp of the last decoded video frame. More...
 
double VuoVideo_getLastFrameDelta (VuoVideo player)
 Return the timestamp of the last decoded video frame minus the timestamp of the frame prior to that. More...
 
double VuoVideo_getDuration (VuoVideo player)
 Get the total duration of this movie in seconds. More...
 
bool VuoVideo_seekToSecond (VuoVideo player, VuoReal second) VuoWarnUnusedResult
 Seek the decoder to the second. More...
 
bool VuoVideo_getFrameAtSecond (VuoVideo player, VuoReal second, VuoVideoFrame *videoFrame) VuoWarnUnusedResult
 Get the video frame at timestamp second. More...
 
unsigned int VuoVideo_getAudioChannels (VuoVideo player)
 Get the number of audio channels this video contains. More...
 
bool VuoVideo_isReady (VuoVideo player)
 True if the video is loaded and ready to play, else false. More...
 
bool VuoVideo_isPlaying (VuoVideo player)
 True if video playback is running, false otherwise. More...
 
bool VuoVideo_getCurrentVideoFrame (VuoVideo player, VuoVideoFrame *videoFrame) VuoWarnUnusedResult
 If manually controlling video using VuoVideo_nextVideoFrame, use this function to retrieve the video frame stored after a seek operation. More...
 
bool VuoVideo_nextVideoFrame (VuoVideo player, VuoVideoFrame *videoFrame) VuoWarnUnusedResult
 Steps the video one frame, returning the newly decoded image. More...
 
bool VuoVideo_nextAudioFrame (VuoVideo player, VuoAudioFrame *audioFrame) VuoWarnUnusedResult
 Get the next decoded audio frame. More...
 
VuoReal VuoVideo_validateTimestamp (VuoReal frameTime, VuoReal duration, VuoLoopType loop, int *outputDirection)
 Ensure that frameTime is a valid timestamp, wrapping or clamping the value depending on loop type. More...
 

Typedef Documentation

◆ VuoVideo

typedef void* VuoVideo

An opaque object for decoding video.

Definition at line 25 of file VuoVideo.h.

Function Documentation

◆ VuoVideo_getAudioChannels()

unsigned int VuoVideo_getAudioChannels ( VuoVideo  player)

Get the number of audio channels this video contains.

Definition at line 186 of file VuoVideo.cc.

◆ VuoVideo_getCurrentVideoFrame()

bool VuoVideo_getCurrentVideoFrame ( VuoVideo  player,
VuoVideoFrame videoFrame 
)

If manually controlling video using VuoVideo_nextVideoFrame, use this function to retrieve the video frame stored after a seek operation.

If calling VuoVideo_seekToSecond() and not making use of VuoVideo_getFrameAtSecond() you must release the image associated with this this frame after a seek operation. Note that if VuoVideo_getCurrentVideoFrame() returns false no video frame was procured.

Definition at line 202 of file VuoVideo.cc.

◆ VuoVideo_getDuration()

double VuoVideo_getDuration ( VuoVideo  player)

Get the total duration of this movie in seconds.

Definition at line 118 of file VuoVideo.cc.

◆ VuoVideo_getFrameAtSecond()

bool VuoVideo_getFrameAtSecond ( VuoVideo  player,
VuoReal  second,
VuoVideoFrame videoFrame 
)

Get the video frame at timestamp second.

Images contained by VuoVideoFrame have their retain count set at 1 coming from this function.

Definition at line 162 of file VuoVideo.cc.

◆ VuoVideo_getLastDecodedVideoTimestamp()

double VuoVideo_getLastDecodedVideoTimestamp ( VuoVideo  player)

Return the timestamp of the last decoded video frame.

If no frames have been decoded yet, the timestamp of the first frame is returned.

Definition at line 141 of file VuoVideo.cc.

◆ VuoVideo_getLastFrameDelta()

double VuoVideo_getLastFrameDelta ( VuoVideo  player)

Return the timestamp of the last decoded video frame minus the timestamp of the frame prior to that.

If no frames have been decoded yet, 0 is returned.

Definition at line 155 of file VuoVideo.cc.

◆ VuoVideo_isPlaying()

bool VuoVideo_isPlaying ( VuoVideo  player)

True if video playback is running, false otherwise.

Definition at line 148 of file VuoVideo.cc.

◆ VuoVideo_isReady()

bool VuoVideo_isReady ( VuoVideo  player)

True if the video is loaded and ready to play, else false.

If false, some values may not yet be available (duration, channel counts, etc)

Definition at line 195 of file VuoVideo.cc.

◆ VuoVideo_make()

VuoVideo VuoVideo_make ( VuoUrl  path,
VuoVideoOptimization  optimization 
)

Create a new instance of a video player.

Create a new instance of a video player.

Definition at line 46 of file VuoVideo.cc.

◆ VuoVideo_nextAudioFrame()

bool VuoVideo_nextAudioFrame ( VuoVideo  player,
VuoAudioFrame audioFrame 
)

Get the next decoded audio frame.

Returns false if no audio is available, or the playhead is at the end of track. If true, the audioFrame.samples list will be populated with samples equaliing the number of audio channels. The VuoList_VuoAudioSamples() list should be initialized and retained prior to calling.

If video is currently playing, this will always returns false.

Definition at line 179 of file VuoVideo.cc.

◆ VuoVideo_nextVideoFrame()

bool VuoVideo_nextVideoFrame ( VuoVideo  player,
VuoVideoFrame videoFrame 
)

Steps the video one frame, returning the newly decoded image.

Will be forwards or backwards depending on playback rate. The image stored in videoFrame will have been registered and have a retain count of 1 - caller is responsible for release. If returning false, image will be null.

If video is currently playing, this will always returns false.

Definition at line 172 of file VuoVideo.cc.

◆ VuoVideo_pause()

void VuoVideo_pause ( VuoVideo  player)

Stop playback of video.

Definition at line 103 of file VuoVideo.cc.

◆ VuoVideo_play()

void VuoVideo_play ( VuoVideo  player)

Begin playback of video.

Frames will be sent to delegates as set by VuoVideo_SetVideoDelegate and VuoVideo_SetAudioDelegate.

Definition at line 93 of file VuoVideo.cc.

◆ VuoVideo_seekToSecond()

bool VuoVideo_seekToSecond ( VuoVideo  player,
VuoReal  second 
)

Seek the decoder to the second.

Definition at line 110 of file VuoVideo.cc.

◆ VuoVideo_setAudioDelegate()

void VuoVideo_setAudioDelegate ( VuoVideo  player,
void(*)(VuoList_VuoAudioSamples delegate 
)

Set the delegate to be called when a new video frame is available.

Video frames will be sent to delegates at the appropriate timestamp automatically when playing.

Set the delegate to be called when a new video frame is available.

Video frames will be send to delegates at the appropriate timestamp automatically when playing.

Definition at line 71 of file VuoVideo.cc.

◆ VuoVideo_setPlaybackFinishedDelegate()

void VuoVideo_setPlaybackFinishedDelegate ( VuoVideo  player,
void(*)(void)  delegate 
)

Set the delegate to be called when a video playback reaches the end (or beginning, if playback rate is negative).

Definition at line 78 of file VuoVideo.cc.

◆ VuoVideo_setPlaybackLooping()

void VuoVideo_setPlaybackLooping ( VuoVideo  player,
VuoLoopType  loop 
)

Set how the video reacts when reaching the end of playback.

Definition at line 125 of file VuoVideo.cc.

◆ VuoVideo_setPlaybackRate()

void VuoVideo_setPlaybackRate ( VuoVideo  player,
VuoReal  rate 
)

Set the playback rate for the decoder.

If the value is not 1, audio is discarded.

Definition at line 133 of file VuoVideo.cc.

◆ VuoVideo_setVideoDelegate()

void VuoVideo_setVideoDelegate ( VuoVideo  player,
void(*)(VuoVideoFrame delegate 
)

Set the delegate to be called when a new video frame is available.

Video frames will be send to delegates at the appropriate timestamp automatically when playing.

Set the delegate to be called when a new video frame is available.

Video frames will be send to delegates at the appropriate timestamp automatically when playing.

Definition at line 61 of file VuoVideo.cc.

◆ VuoVideo_validateTimestamp()

VuoReal VuoVideo_validateTimestamp ( VuoReal  frameTime,
VuoReal  duration,
VuoLoopType  loop,
int *  outputDirection 
)

Ensure that frameTime is a valid timestamp, wrapping or clamping the value depending on loop type.

Definition at line 209 of file VuoVideo.cc.