Internal video player implementation.
Use VuoVideoPlayer to work with video.
Definition at line 28 of file VuoAvPlayerObject.h.
Instance Methods | |
(id) | - init |
Initialize new instance. More... | |
(void) | - setPlayerCallback:target: |
tell this player where the decoder is so that it can invoke callbacks More... | |
(bool) | - setURL: |
Set the file path and begin loading assets. More... | |
(void) | - setPlaybackRate: |
unload the currently playing video More... | |
(bool) | - decodePreceedingVideoSamples |
decode a number of video samples prior to the current timestamp More... | |
(bool) | - seekToSecond:withRange:frame: |
seek playhead to point and time range to decode within. If range is < 0, duration - second is set as range. More... | |
(bool) | - canBeginPlayback |
Is the video ready to begin playback? More... | |
(bool) | - nextVideoFrame: |
Get the last decoded video frame. More... | |
(bool) | - nextAudioFrame: |
Get the last decoded audio frame. More... | |
(VuoReal) | - getCurrentTimestamp |
Get the last decoded video timestamp. More... | |
(bool) | - setAssetReaderTimeRange: |
reset the assetreader to a new range. More... | |
(bool) | - copyNextVideoSampleBuffer |
read the next video samplebuffer to store. More... | |
(unsigned int) | - getAudioChannelCount: |
Get the number of audio channels. More... | |
(bool) | - audioEnabled |
is audio playback enabled? More... | |
(VuoReal) | - getDuration |
get the total duration of this asset More... | |
(double) | - getFrameRate |
the ideal framerate More... | |
(bool) | - canPlayAudio |
true if no audio stream is found, or one is fonud and the decoder is capable of playing it More... | |
(unsigned int) | - audioChannels |
return the number of available audio channels More... | |
Class Methods | |
(void) | + releaseAssetReader: |
Release an AVAssetReader after a 200 ms delay. More... | |
Protected Attributes | |
AVAsset * | asset |
The AVAsset currnetly loaded. More... | |
float | videoTimestamp |
AVPlayer object. More... | |
AVAssetReader * | assetReader |
asset reader More... | |
VuoAvTrackOutput * | assetReaderVideoTrackOutput |
video reader output More... | |
AVAssetReaderTrackOutput * | assetReaderAudioTrackOutput |
audio reader output More... | |
volatile bool | isReady |
is the asset ready to begin playback More... | |
bool | playOnReady |
shoudl play once tracks are ready? More... | |
float | playbackRate |
the speed of playback (used to decide which direction to decode video in, and whether audio should be read or not) More... | |
float | nominalFrameRate |
the playback speed that this asset wants to be played at by default More... | |
void * | avDecoderCppObject |
A pointer to the C++ VuoAvDecoder object that's driving this thing. Used to fire callbacks into C++ land. More... | |
void(* | readyToPlayCallback )(void *decoderCppObject, bool canPlayMedia) |
A function pointer to a static C++ function that accepts a pointer to a VuoAvDecoder object to send an OnDecoderReady event. More... | |
NSMutableArray * | videoQueue |
list of video frames to be output More... | |
Float32 * | audioBuffer |
Holds audio extracted from copyNextSampleBuffer until an audio frame comes to collect it. Is interleaved. More... | |
float | audioTimestamp |
the last timestamp as reported by the audio asset reader. More... | |
size_t | audioBufferCapacity |
the capacity in byte size that the audioBuffer possesses More... | |
unsigned int | audioBufferChannelCount |
how many channels copyNextSampleBuffer gives the audio buffer. More... | |
unsigned int | audioBufferSamplesPerChannel |
the number of samples one channel of audio contains in the audioBuffer More... | |
unsigned int | audioBufferSampleIndex |
The current index that audio frames are copying samples from the audioBuffer. More... | |
unsigned int | audioChannelCount |
How many channels of audio are in the current asset track. More... | |
bool | containsUnplayableAudio |
True if there is an audio stream that cannot be played by AvFoundation. False otherwise. More... | |
bool | hasAlpha |
True if the video frames have an alpha channel. More... | |
CVOpenGLTextureCacheRef | textureCache |
GL_TEXTURE_RECTANGLEs from the movie. More... | |
- (unsigned int) audioChannels |
return the number of available audio channels
Definition at line 562 of file VuoAvPlayerObject.m.
- (bool) audioEnabled |
is audio playback enabled?
Definition at line 557 of file VuoAvPlayerObject.m.
- (bool) canBeginPlayback |
Is the video ready to begin playback?
Definition at line 391 of file VuoAvPlayerObject.m.
- (bool) canPlayAudio |
true if no audio stream is found, or one is fonud and the decoder is capable of playing it
Definition at line 396 of file VuoAvPlayerObject.m.
- (bool) copyNextVideoSampleBuffer |
read the next video samplebuffer to store.
read the next video sample buffer
Definition at line 745 of file VuoAvPlayerObject.m.
- (bool) decodePreceedingVideoSamples |
decode a number of video samples prior to the current timestamp
Definition at line 667 of file VuoAvPlayerObject.m.
- (unsigned int) getAudioChannelCount: | (AVAssetTrack*) | track |
Get the number of audio channels.
Definition at line 524 of file VuoAvPlayerObject.m.
- (VuoReal) getCurrentTimestamp |
Get the last decoded video timestamp.
Definition at line 629 of file VuoAvPlayerObject.m.
- (VuoReal) getDuration |
get the total duration of this asset
Definition at line 682 of file VuoAvPlayerObject.m.
- (double) getFrameRate |
the ideal framerate
Definition at line 401 of file VuoAvPlayerObject.m.
- (id) init |
- (bool) nextAudioFrame: | (VuoAudioFrame*) | frame |
Get the last decoded audio frame.
Definition at line 687 of file VuoAvPlayerObject.m.
- (bool) nextVideoFrame: | (VuoVideoFrame*) | frame |
Get the last decoded video frame.
Returns the current frame's image.
Definition at line 635 of file VuoAvPlayerObject.m.
+ (void) releaseAssetReader: | (AVAssetReader*) | reader |
Release an AVAssetReader after a 200 ms delay.
Definition at line 219 of file VuoAvPlayerObject.m.
- (bool) seekToSecond: | (float) | second | |
withRange: | (float) | range | |
frame: | (VuoVideoFrame *) | frame | |
seek playhead to point and time range to decode within. If range is < 0, duration - second
is set as range.
Definition at line 582 of file VuoAvPlayerObject.m.
- (bool) setAssetReaderTimeRange: | (CMTimeRange) | timeRange |
reset the assetreader to a new range.
audio settings
Definition at line 406 of file VuoAvPlayerObject.m.
- (void) setPlaybackRate: | (double) | rate |
unload the currently playing video
Set the rate of playback.
playback is swapping directions, clear the caches
Definition at line 542 of file VuoAvPlayerObject.m.
- (void) setPlayerCallback: | (void(*)(void* functionPtr, bool canPlayMedia)) | callback | |
target: | (void*) | decoderCppObject | |
tell this player where the decoder is so that it can invoke callbacks
Definition at line 623 of file VuoAvPlayerObject.m.
- (bool) setURL: | (NSURL*) | url |
Set the file path and begin loading assets.
Loads media at url
.
prevent race condition when trying to seek right away by enabling playback after initial setrange.
try to load a few frames of video before declaring this asset ready to play. some codecs will load and successfully extract a single frame then crap out. cough mjpeg cough
calling on main thread prevents tests from compiling in the event that isReady is false.
Definition at line 263 of file VuoAvPlayerObject.m.
|
protected |
The AVAsset currnetly loaded.
Definition at line 31 of file VuoAvPlayerObject.h.
|
protected |
asset reader
Definition at line 37 of file VuoAvPlayerObject.h.
|
protected |
audio reader output
Definition at line 41 of file VuoAvPlayerObject.h.
|
protected |
video reader output
Definition at line 39 of file VuoAvPlayerObject.h.
|
protected |
Holds audio extracted from copyNextSampleBuffer until an audio frame comes to collect it. Is interleaved.
Definition at line 60 of file VuoAvPlayerObject.h.
|
protected |
the capacity in byte size that the audioBuffer possesses
Definition at line 64 of file VuoAvPlayerObject.h.
|
protected |
how many channels copyNextSampleBuffer gives the audio buffer.
Definition at line 66 of file VuoAvPlayerObject.h.
|
protected |
The current index that audio frames are copying samples from the audioBuffer.
Definition at line 70 of file VuoAvPlayerObject.h.
|
protected |
the number of samples one channel of audio contains in the audioBuffer
Definition at line 68 of file VuoAvPlayerObject.h.
|
protected |
How many channels of audio are in the current asset track.
Definition at line 72 of file VuoAvPlayerObject.h.
|
protected |
the last timestamp as reported by the audio asset reader.
Definition at line 62 of file VuoAvPlayerObject.h.
|
protected |
A pointer to the C++ VuoAvDecoder object that's driving this thing. Used to fire callbacks into C++ land.
Definition at line 52 of file VuoAvPlayerObject.h.
|
protected |
True if there is an audio stream that cannot be played by AvFoundation. False otherwise.
Definition at line 74 of file VuoAvPlayerObject.h.
|
protected |
True if the video frames have an alpha channel.
Definition at line 76 of file VuoAvPlayerObject.h.
|
protected |
is the asset ready to begin playback
Definition at line 44 of file VuoAvPlayerObject.h.
|
protected |
the playback speed that this asset wants to be played at by default
Definition at line 50 of file VuoAvPlayerObject.h.
|
protected |
the speed of playback (used to decide which direction to decode video in, and whether audio should be read or not)
Definition at line 48 of file VuoAvPlayerObject.h.
|
protected |
shoudl play once tracks are ready?
Definition at line 46 of file VuoAvPlayerObject.h.
|
protected |
A function pointer to a static C++ function that accepts a pointer to a VuoAvDecoder object to send an OnDecoderReady
event.
Definition at line 54 of file VuoAvPlayerObject.h.
|
protected |
GL_TEXTURE_RECTANGLEs from the movie.
Definition at line 79 of file VuoAvPlayerObject.h.
|
protected |
list of video frames to be output
Definition at line 57 of file VuoAvPlayerObject.h.
|
protected |
AVPlayer object.
The current frame timestamp where start of video = 0.
Definition at line 35 of file VuoAvPlayerObject.h.