https://b33p.net/kosada/node/9140
Internal video player implementation. Use VuoVideoPlayer to work with video.
|
AVAsset * | asset |
| The AVAsset currnetly loaded.
|
|
float | videoTimestamp |
| AVPlayer object.
|
|
AVAssetReader * | assetReader |
| asset reader
|
|
AVAssetReaderTrackOutput * | assetReaderVideoTrackOutput |
| video reader output
|
|
AVAssetReaderTrackOutput * | assetReaderAudioTrackOutput |
| audio reader output
|
|
volatile bool | isReady |
| is the asset ready to begin playback
|
|
bool | playOnReady |
| shoudl play once tracks are ready?
|
|
float | playbackRate |
| the speed of playback (used to decide which direction to decode video in, and whether audio should be read or not)
|
|
float | nominalFrameRate |
| the playback speed that this asset wants to be played at by default
|
|
void * | avDecoderCppObject |
| A pointer to the C++ VuoAvDecoder object that's driving this thing. Used to fire callbacks into C++ land.
|
|
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.
|
|
NSMutableArray * | videoQueue |
| list of video frames to be output
|
|
Float32 * | audioBuffer |
| Holds audio extracted from copyNextSampleBuffer until an audio frame comes to collect it. Is interleaved.
|
|
float | audioTimestamp |
| the last timestamp as reported by the audio asset reader.
|
|
size_t | audioBufferCapacity |
| the capacity in byte size that the audioBuffer possesses
|
|
unsigned int | audioBufferChannelCount |
| how many channels copyNextSampleBuffer gives the audio buffer.
|
|
unsigned int | audioBufferSamplesPerChannel |
| the number of samples one channel of audio contains in the audioBuffer
|
|
unsigned int | audioBufferSampleIndex |
| The current index that audio frames are copying samples from the audioBuffer.
|
|
unsigned int | audioChannelCount |
| How many channels of audio are in the current asset track.
|
|
bool | containsUnplayableAudio |
| True if there is an audio stream that cannot be played by AvFoundation. False otherwise.
|
|
CVOpenGLTextureCacheRef | textureCache |
| GL_TEXTURE_RECTANGLEs from the movie.
|
|
- (unsigned int) audioChannels |
|
|
|
return the number of available audio channels
is audio playback enabled?
- (bool) canBeginPlayback |
|
|
|
Is the video ready to begin playback?
true if no audio stream is found, or one is fonud and the decoder is capable of playing it
- (bool) copyNextVideoSampleBuffer |
|
|
|
read the next video samplebuffer to store.
read the next video sample buffer
- (bool) decodePreceedingVideoSamples |
|
|
|
decode a number of video samples prior to the current timestamp
- (unsigned int) getAudioChannelCount: |
|
(AVAssetTrack*) |
track |
|
Get the number of audio channels.
Get the last decoded video timestamp.
get the total duration of this asset
Initialize new instance.
Creates a new player.
Get the last decoded audio frame.
Get the last decoded video frame.
Returns the current frame's image.
+ (void) releaseAssetReader: |
|
(AVAssetReader*) |
reader |
|
Release an AVAssetReader after a 200 ms delay.
- (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.
- (bool) setAssetReaderTimeRange: |
|
(CMTimeRange) |
timeRange |
|
reset the assetreader to a new range.
audio settings
- (void) setPlaybackRate: |
|
(double) |
rate |
|
unload the currently playing video
Set the rate of playback.
playback is swapping directions, clear the caches
- (void) setPlayerCallback: |
|
(void* functionPtr, bool canPlayMedia) |
callback |
target: |
|
(void*) |
decoderCppObject |
|
|
| |
tell this player where the decoder is so that it can invoke callbacks
- (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.
The AVAsset currnetly loaded.
- (AVAssetReader*) assetReader |
|
protected |
- (AVAssetReaderTrackOutput*) assetReaderAudioTrackOutput |
|
protected |
- (AVAssetReaderTrackOutput*) assetReaderVideoTrackOutput |
|
protected |
Holds audio extracted from copyNextSampleBuffer until an audio frame comes to collect it. Is interleaved.
- (size_t) audioBufferCapacity |
|
protected |
the capacity in byte size that the audioBuffer possesses
- (unsigned int) audioBufferChannelCount |
|
protected |
how many channels copyNextSampleBuffer gives the audio buffer.
- (unsigned int) audioBufferSampleIndex |
|
protected |
The current index that audio frames are copying samples from the audioBuffer.
- (unsigned int) audioBufferSamplesPerChannel |
|
protected |
the number of samples one channel of audio contains in the audioBuffer
- (unsigned int) audioChannelCount |
|
protected |
How many channels of audio are in the current asset track.
the last timestamp as reported by the audio asset reader.
- (void*) avDecoderCppObject |
|
protected |
A pointer to the C++ VuoAvDecoder object that's driving this thing. Used to fire callbacks into C++ land.
- (bool) containsUnplayableAudio |
|
protected |
True if there is an audio stream that cannot be played by AvFoundation. False otherwise.
- (volatile bool) isReady |
|
protected |
is the asset ready to begin playback
- (float) nominalFrameRate |
|
protected |
the playback speed that this asset wants to be played at by default
the speed of playback (used to decide which direction to decode video in, and whether audio should be read or not)
shoudl play once tracks are ready?
- (void(* readyToPlayCallback)(void *decoderCppObject, bool canPlayMedia)) |
|
protected |
A function pointer to a static C++ function that accepts a pointer to a VuoAvDecoder object to send an OnDecoderReady
event.
- (CVOpenGLTextureCacheRef) textureCache |
|
protected |
GL_TEXTURE_RECTANGLEs from the movie.
- (NSMutableArray*) videoQueue |
|
protected |
list of video frames to be output
AVPlayer object.
The current frame timestamp where start of video = 0.
The documentation for this class was generated from the following files: