Vuo  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
VuoVideoPlayer Class Reference

Description

Video playback using a decoder to read video.

Public Member Functions

void Destroy ()
 Release resources used by this player instance.
 
void SetVideoDelegate (void(*func)(VuoVideoFrame))
 Set the pointer to the static function that will be called when a new video frame is available.
 
void SetAudioDelegate (void(*func)(VuoList_VuoAudioSamples))
 Set the pointer to the static function that will be called when a new audio frame is available.
 
void SetPlaybackRate (double rate)
 Set the playback speed. Can be negative or positive. Events to videoFrameReceivedDelegate will be sent at a rate of video fps * rate.
 
void Play ()
 Returns true if media contains audio, false otherwise.
 
void Pause ()
 Stop playback (but don't move the playhead).
 
bool Seek (double second)
 Seek to a position in the video track.
 
double GetCurrentTimestamp ()
 Returns the last decoded video frame timestamp.
 
double GetLastFrameDelta ()
 Returns the last frame delta (current frame timestamp - last frame timestamp). This is not guaranteed to be accurate to the framerate, as video can have variable rates.
 
double GetDuration ()
 Returns the duration in seconds of the video associated with this player.
 
bool GetCurrentVideoFrame (VuoVideoFrame *frame)
 Get the last decoded image.
 
bool GetVideoFrameAtSecond (double second, VuoVideoFrame *videoFrame)
 Get a video frame at the requested second.
 
unsigned int GetAudioChannels ()
 Return the number of audio channels available.
 
bool IsReady ()
 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)
 
bool IsPlaying ()
 True if the player is running, false otherwise.
 
bool NextVideoFrame (VuoVideoFrame *frame)
 Get the next video frame. Always false if currently playing.
 
bool NextAudioFrame (VuoAudioFrame *frame)
 Get the next audio frame. Always false if currently playing.
 

Static Public Member Functions

static VuoVideoPlayerCreate (VuoUrl url, VuoVideoOptimization optimization)
 Create a new video player instance.
 

Public Attributes

VuoUrl videoPath
 The path to the movie file.
 
void(* videoFrameReceivedDelegate )(VuoVideoFrame)
 Delegate to call when a new video frame is available.
 
void(* audioFrameReceivedDelegate )(VuoList_VuoAudioSamples)
 Delegate to call when a new audio frame is available.
 
VuoLoopType loop
 What to do when playback is finished.
 

Member Function Documentation

VuoVideoPlayer * VuoVideoPlayer::Create ( VuoUrl  url,
VuoVideoOptimization  optimization 
)
static

Create a new video player instance.

If url is not found, or the media is playable Create will return null and clean up any resources allocated in the process.

if optimization is set to forward or auto, assume forward playback.

void VuoVideoPlayer::Destroy ( )

Release resources used by this player instance.

wait til ondecoderplaybackready is invoked before destroying things.

unsigned int VuoVideoPlayer::GetAudioChannels ( )

Return the number of audio channels available.

double VuoVideoPlayer::GetCurrentTimestamp ( )

Returns the last decoded video frame timestamp.

bool VuoVideoPlayer::GetCurrentVideoFrame ( VuoVideoFrame frame)

Get the last decoded image.

This may be null, and will return false in the event that no frame is available. Images associated with returned frames have a retain count of 1.

double VuoVideoPlayer::GetDuration ( )

Returns the duration in seconds of the video associated with this player.

if ffmpeg didn't load, let avfoundation think about it before returning

double VuoVideoPlayer::GetLastFrameDelta ( )

Returns the last frame delta (current frame timestamp - last frame timestamp). This is not guaranteed to be accurate to the framerate, as video can have variable rates.

bool VuoVideoPlayer::GetVideoFrameAtSecond ( double  second,
VuoVideoFrame videoFrame 
)

Get a video frame at the requested second.

bool VuoVideoPlayer::IsPlaying ( )
inline

True if the player is running, false otherwise.

bool VuoVideoPlayer::IsReady ( )

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)

bool VuoVideoPlayer::NextAudioFrame ( VuoAudioFrame frame)

Get the next audio frame. Always false if currently playing.

bool VuoVideoPlayer::NextVideoFrame ( VuoVideoFrame frame)

Get the next video frame. Always false if currently playing.

void VuoVideoPlayer::Pause ( )

Stop playback (but don't move the playhead).

void VuoVideoPlayer::Play ( )

Returns true if media contains audio, false otherwise.

Begins decoding and sending video/audio frames through delegates.

bool VuoVideoPlayer::Seek ( double  second)

Seek to a position in the video track.

0 is always the start of playback. second will be clamped to 0 ≤ second ≤ duration.

void VuoVideoPlayer::SetAudioDelegate ( void(*)(VuoList_VuoAudioSamples func)
inline

Set the pointer to the static function that will be called when a new audio frame is available.

void VuoVideoPlayer::SetPlaybackRate ( double  rate)

Set the playback speed. Can be negative or positive. Events to videoFrameReceivedDelegate will be sent at a rate of video fps * rate.

void VuoVideoPlayer::SetVideoDelegate ( void(*)(VuoVideoFrame func)
inline

Set the pointer to the static function that will be called when a new video frame is available.

The player handles timing.

Member Data Documentation

void(* VuoVideoPlayer::audioFrameReceivedDelegate)(VuoList_VuoAudioSamples)

Delegate to call when a new audio frame is available.

VuoLoopType VuoVideoPlayer::loop

What to do when playback is finished.

void(* VuoVideoPlayer::videoFrameReceivedDelegate)(VuoVideoFrame)

Delegate to call when a new video frame is available.

VuoUrl VuoVideoPlayer::videoPath

The path to the movie file.


The documentation for this class was generated from the following files: