VuoVideo implementation.
Definition in file VuoVideo.cc.
Go to the source code of this file.
Functions | |
void | VuoVideo_free (void *player) |
Destroy an instance of VuoVideoPlayer. More... | |
VuoVideo | VuoVideo_make (VuoUrl path, VuoVideoOptimization optimization) |
Creates a video player for path . More... | |
void | VuoVideo_setVideoDelegate (VuoVideo player, void(*delegate)(VuoVideoFrame)) |
Set the delgate to be called when a new video frame is available. More... | |
void | VuoVideo_setAudioDelegate (VuoVideo player, void(*delegate)(VuoList_VuoAudioSamples)) |
Set the delgate 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... | |
const char * | VuoVideo_getPath (VuoVideo player) |
Return the full path to the currently playing video. More... | |
void | VuoVideo_play (VuoVideo player) |
Begin playback of video. More... | |
void | VuoVideo_pause (VuoVideo player) |
Stop playback of video. More... | |
bool | VuoVideo_seekToSecond (VuoVideo player, VuoReal second) |
Seek the decoder to the second. More... | |
double | VuoVideo_getDuration (VuoVideo player) |
Get the total duration of this movie in seconds. More... | |
void | VuoVideo_setPlaybackLooping (VuoVideo player, VuoLoopType loop) |
Set how the video reacts when reaching the end of playback. More... | |
void | VuoVideo_setPlaybackRate (VuoVideo player, VuoReal rate) |
Set the playback rate for the decoder. More... | |
double | VuoVideo_getLastDecodedVideoTimestamp (VuoVideo player) |
Return the timestamp of the last decoded video frame. More... | |
bool | VuoVideo_isPlaying (VuoVideo player) |
True if video playback is running, false otherwise. 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... | |
bool | VuoVideo_getFrameAtSecond (VuoVideo player, VuoReal second, VuoVideoFrame *videoFrame) |
Get the video frame at timestamp second . More... | |
bool | VuoVideo_nextVideoFrame (VuoVideo player, VuoVideoFrame *videoFrame) |
Steps the video one frame, returning the newly decoded image. More... | |
bool | VuoVideo_nextAudioFrame (VuoVideo player, VuoAudioFrame *audioFrame) |
Get the next decoded audio frame. 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_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. 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... | |
void VuoVideo_free | ( | void * | player | ) |
Destroy an instance of VuoVideoPlayer.
Definition at line 36 of file VuoVideo.cc.
unsigned int VuoVideo_getAudioChannels | ( | VuoVideo | player | ) |
Get the number of audio channels this video contains.
Definition at line 186 of file VuoVideo.cc.
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.
double VuoVideo_getDuration | ( | VuoVideo | player | ) |
Get the total duration of this movie in seconds.
Definition at line 118 of file VuoVideo.cc.
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.
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.
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.
const char* VuoVideo_getPath | ( | VuoVideo | player | ) |
Return the full path to the currently playing video.
bool VuoVideo_isPlaying | ( | VuoVideo | player | ) |
True if video playback is running, false otherwise.
Definition at line 148 of file VuoVideo.cc.
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 VuoVideo_make | ( | VuoUrl | path, |
VuoVideoOptimization | optimization | ||
) |
Creates a video player for path
.
Create a new instance of a video player.
Definition at line 46 of file VuoVideo.cc.
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.
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.
void VuoVideo_pause | ( | VuoVideo | player | ) |
Stop playback of video.
Definition at line 103 of file VuoVideo.cc.
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.
Seek the decoder to the second.
Definition at line 110 of file VuoVideo.cc.
void VuoVideo_setAudioDelegate | ( | VuoVideo | player, |
void(*)(VuoList_VuoAudioSamples) | delegate | ||
) |
Set the delgate to be called when a new video frame is available.
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.
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.
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.
Set the playback rate for the decoder.
If the value is not 1, audio is discarded.
Definition at line 133 of file VuoVideo.cc.
void VuoVideo_setVideoDelegate | ( | VuoVideo | player, |
void(*)(VuoVideoFrame) | delegate | ||
) |
Set the delgate to be called when a new video frame is available.
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.
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.