Vuo  2.0.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
VuoAvDecoder Class Reference

Description

AvFoundation video decoder.

Definition at line 29 of file VuoAvDecoder.h.

Public Member Functions

virtual ~VuoAvDecoder ()
 Clean up any resources claimed by decoder. More...
 
virtual bool IsReady ()
 Bool relaying the preparedness of playback. More...
 
virtual bool NextVideoFrame (VuoVideoFrame *frame)
 Get the next video frame in the queue. If playback speed is negative, this will the the frame prior to the last retrieved. More...
 
virtual bool NextAudioFrame (VuoAudioFrame *audio)
 Get the next audio frame in the queue. If playback speed is negative (or anything other than 1), this returns nothing. More...
 
virtual bool SeekToSecond (double second, VuoVideoFrame *frame)
 Seek the playhead to the second. second is not in timestamp format, rather, relative to movie start. More...
 
virtual double GetDuration ()
 The total duration of this video in seconds. More...
 
virtual void SetPlaybackRate (double rate)
 Set the playback rate. More...
 
virtual double GetLastDecodedVideoTimeStamp ()
 Returns the timestamp of the last decoded video frame. More...
 
virtual bool CanPlayAudio ()
 Returns true if there isn't an audio track, or there is but the decoder can play it. More...
 
virtual unsigned int GetAudioChannelCount ()
 Returns the number of audio channels in this video;. More...
 
void DecoderReady (bool canPlayMedia)
 Called by AvFoundation when ready to begin playback. More...
 
double GetFrameRate ()
 The average video framerate. More...
 
- Public Member Functions inherited from VuoVideoDecoder
virtual ~VuoVideoDecoder ()
 Clean up any resources claimed by decoder. More...
 

Static Public Member Functions

static VuoAvDecoderCreate (VuoUrl url)
 Initialize a new AvFoundation video decoder with URL. More...
 

Protected Member Functions

 VuoAvDecoder ()
 Constructor initializes the decoder object. More...
 
- Protected Member Functions inherited from VuoVideoDecoder
 VuoVideoDecoder ()
 Base constructor does nothing interesting. More...
 

Protected Attributes

dispatch_queue_t queue
 Serializes all operations, so this class's methods can be called from any thread. More...
 

Additional Inherited Members

- Public Types inherited from VuoVideoDecoder
typedef class VuoVideoPlayer VideoPlayer
 Forward declare VuoVideoPlayer for the onReady delegate. More...
 
- Public Attributes inherited from VuoVideoDecoder
VideoPlayervideoPlayer = NULL
 Reference to the VuoVideoPlayer making use of this decoder. More...
 
void(VideoPlayer::* onReadyToPlay )(bool canPlayMedia)
 A delegate to be called when the decoder is ready to begin playback. More...
 

Constructor & Destructor Documentation

◆ VuoAvDecoder()

VuoAvDecoder::VuoAvDecoder ( )
inlineprotected

Constructor initializes the decoder object.

Definition at line 37 of file VuoAvDecoder.h.

◆ ~VuoAvDecoder()

VuoAvDecoder::~VuoAvDecoder ( )
virtual

Clean up any resources claimed by decoder.

Definition at line 75 of file VuoAvDecoder.cc.

Member Function Documentation

◆ CanPlayAudio()

bool VuoAvDecoder::CanPlayAudio ( )
virtual

Returns true if there isn't an audio track, or there is but the decoder can play it.

Implements VuoVideoDecoder.

Definition at line 101 of file VuoAvDecoder.cc.

◆ Create()

VuoAvDecoder * VuoAvDecoder::Create ( VuoUrl  url)
static

Initialize a new AvFoundation video decoder with URL.

Definition at line 52 of file VuoAvDecoder.cc.

◆ DecoderReady()

void VuoAvDecoder::DecoderReady ( bool  canPlayMedia)

Called by AvFoundation when ready to begin playback.

If VuoVideoDecoder videoPlayer and onReadyToPlay are non-null, they'll be invoked.

Definition at line 41 of file VuoAvDecoder.cc.

◆ GetAudioChannelCount()

unsigned int VuoAvDecoder::GetAudioChannelCount ( )
virtual

Returns the number of audio channels in this video;.

Implements VuoVideoDecoder.

Definition at line 110 of file VuoAvDecoder.cc.

◆ GetDuration()

double VuoAvDecoder::GetDuration ( )
virtual

The total duration of this video in seconds.

Implements VuoVideoDecoder.

Definition at line 146 of file VuoAvDecoder.cc.

◆ GetFrameRate()

double VuoAvDecoder::GetFrameRate ( )
virtual

The average video framerate.

Implements VuoVideoDecoder.

Definition at line 155 of file VuoAvDecoder.cc.

◆ GetLastDecodedVideoTimeStamp()

double VuoAvDecoder::GetLastDecodedVideoTimeStamp ( )
virtual

Returns the timestamp of the last decoded video frame.

Implements VuoVideoDecoder.

Definition at line 171 of file VuoAvDecoder.cc.

◆ IsReady()

bool VuoAvDecoder::IsReady ( )
virtual

Bool relaying the preparedness of playback.

If this is false, register with onReadyToPlay to receive a notification when playback is enabled. If inheriting class does not override, playback is assumed to be available immediately following initialization.

Reimplemented from VuoVideoDecoder.

Definition at line 92 of file VuoAvDecoder.cc.

◆ NextAudioFrame()

bool VuoAvDecoder::NextAudioFrame ( VuoAudioFrame audio)
virtual

Get the next audio frame in the queue. If playback speed is negative (or anything other than 1), this returns nothing.

Implements VuoVideoDecoder.

Definition at line 128 of file VuoAvDecoder.cc.

◆ NextVideoFrame()

bool VuoAvDecoder::NextVideoFrame ( VuoVideoFrame frame)
virtual

Get the next video frame in the queue. If playback speed is negative, this will the the frame prior to the last retrieved.

Implements VuoVideoDecoder.

Definition at line 119 of file VuoAvDecoder.cc.

◆ SeekToSecond()

bool VuoAvDecoder::SeekToSecond ( double  second,
VuoVideoFrame frame 
)
virtual

Seek the playhead to the second. second is not in timestamp format, rather, relative to movie start.

Implements VuoVideoDecoder.

Definition at line 137 of file VuoAvDecoder.cc.

◆ SetPlaybackRate()

void VuoAvDecoder::SetPlaybackRate ( double  rate)
virtual

Set the playback rate.

Any value that isn't 1 will flush the audio queue and discard any future audio frames until frame rate is back to 1.

Implements VuoVideoDecoder.

Definition at line 164 of file VuoAvDecoder.cc.

Member Data Documentation

◆ queue

dispatch_queue_t VuoAvDecoder::queue
protected

Serializes all operations, so this class's methods can be called from any thread.

Definition at line 40 of file VuoAvDecoder.h.


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