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... | |
![]() | |
virtual | ~VuoVideoDecoder () |
Clean up any resources claimed by decoder. More... | |
Static Public Member Functions | |
static VuoAvDecoder * | Create (VuoUrl url) |
Initialize a new AvFoundation video decoder with URL. More... | |
Protected Member Functions | |
VuoAvDecoder () | |
Constructor initializes the decoder object. More... | |
![]() | |
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 | |
![]() | |
typedef class VuoVideoPlayer | VideoPlayer |
Forward declare VuoVideoPlayer for the onReady delegate. More... | |
![]() | |
VideoPlayer * | videoPlayer = 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... | |
|
inlineprotected |
Constructor initializes the decoder object.
Definition at line 37 of file VuoAvDecoder.h.
|
virtual |
Clean up any resources claimed by decoder.
Definition at line 75 of file VuoAvDecoder.cc.
|
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.
|
static |
Initialize a new AvFoundation video decoder with URL.
Definition at line 52 of file VuoAvDecoder.cc.
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.
|
virtual |
Returns the number of audio channels in this video;.
Implements VuoVideoDecoder.
Definition at line 110 of file VuoAvDecoder.cc.
|
virtual |
The total duration of this video in seconds.
Implements VuoVideoDecoder.
Definition at line 146 of file VuoAvDecoder.cc.
|
virtual |
The average video framerate.
Implements VuoVideoDecoder.
Definition at line 155 of file VuoAvDecoder.cc.
|
virtual |
Returns the timestamp of the last decoded video frame.
Implements VuoVideoDecoder.
Definition at line 171 of file VuoAvDecoder.cc.
|
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.
|
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.
|
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.
|
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.
|
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.
|
protected |
Serializes all operations, so this class's methods can be called from any thread.
Definition at line 40 of file VuoAvDecoder.h.