Vuo  2.0.1
VuoAvPlayerObject.h
Go to the documentation of this file.
1 
10 #ifndef NS_RETURNS_INNER_POINTER
12 #define NS_RETURNS_INNER_POINTER
13 #endif
14 #import <Cocoa/Cocoa.h>
15 #undef NS_RETURNS_INNER_POINTER
16 
17 #include "VuoVideoFrame.h"
18 #include "VuoAudioFrame.h"
19 #include "VuoImage.h"
20 #include "VuoLoopType.h"
21 #import <AVFoundation/AVFoundation.h>
22 
23 @class VuoAvTrackOutput;
24 
28 @interface VuoAvPlayerObject : NSObject
29 {
31  AVAsset* asset;
33  // AVPlayer* player;
37  AVAssetReader* assetReader;
41  AVAssetReaderTrackOutput* assetReaderAudioTrackOutput;
42 
44  volatile bool isReady;
48  float playbackRate;
54  void(*readyToPlayCallback)(void* decoderCppObject, bool canPlayMedia);
55 
57  NSMutableArray* videoQueue;
58 
60  Float32* audioBuffer;
70  unsigned int audioBufferSampleIndex;
72  unsigned int audioChannelCount;
75 
76  bool hasAlpha;
77 
79  CVOpenGLTextureCacheRef textureCache;
80 }
81 
83 - (id) init;
85 - (void) setPlayerCallback:(void (*)(void* functionPtr, bool canPlayMedia))callback target:(void*)decoderCppObject;
87 - (bool) setURL:(NSURL*)url;
89 // - (void) unload;
91 - (void) setPlaybackRate:(double)rate;
93 - (bool) decodePreceedingVideoSamples;
95 - (bool) seekToSecond:(float)second withRange:(float)range frame:(VuoVideoFrame *)frame;
97 - (bool) canBeginPlayback;
99 - (bool) nextVideoFrame:(VuoVideoFrame*)frame;
101 - (bool) nextAudioFrame:(VuoAudioFrame*) frame;
103 - (VuoReal) getCurrentTimestamp;
105 - (bool) setAssetReaderTimeRange:(CMTimeRange)timeRange;
107 - (bool) copyNextVideoSampleBuffer;
109 - (unsigned int) getAudioChannelCount:(AVAssetTrack*) track;
111 - (bool) audioEnabled;
113 - (VuoReal) getDuration;
115 - (double) getFrameRate;
117 - (bool) canPlayAudio;
119 - (unsigned int) audioChannels;
121 + (void) releaseAssetReader:(AVAssetReader*)reader;
122 @end