8#import <Foundation/Foundation.h>
9#import <AVFoundation/AVFoundation.h>
10#import <Accelerate/Accelerate.h>
11#import <CoreMedia/CoreMedia.h>
15#include <TargetConditionals.h>
16#if (TARGET_IPHONE_SIMULATOR) || (TARGET_OS_IPHONE) || (TARGET_IPHONE)
23#define USE_VIDEO_OUTPUT (defined(MAC_OS_X_VERSION_10_8) || defined(iOS6))
35#if defined(USE_VIDEO_OUTPUT)
81@property (nonatomic, strong) AVPlayer * player;
82@property (nonatomic, strong) AVAsset * asset;
83@property (nonatomic, strong) AVPlayerItem * playerItem;
86@property (nonatomic, strong) AVAssetReader * assetReader;
87@property (nonatomic, strong) AVAssetReaderTrackOutput * assetReaderVideoTrackOutput;
88@property (nonatomic, strong) AVAssetReaderTrackOutput * assetReaderAudioTrackOutput;
90#if defined(USE_VIDEO_OUTPUT)
91@property (nonatomic, strong) AVPlayerItemVideoOutput *videoOutput;
95- (BOOL)loadWithFile:(NSString*)file async:(BOOL)bAsync;
96- (BOOL)loadWithPath:(NSString*)path async:(BOOL)bAsync;
97- (BOOL)loadWithURL:(NSURL*)url async:(BOOL)bAsync stream:(BOOL)isStream;
98- (void)unloadVideoAsync;
105- (void)togglePlayPause;
108- (void)stepByCount:(
long)frames;
112- (void)seekToTime:(CMTime)time;
113- (void)seekToTime:(CMTime)time withTolerance:(CMTime)tolerance;
122- (void)setEnableVideoSampling:(BOOL)value;
123- (void)setEnableAudioSampling:(BOOL)value;
124- (void)setSynchSampleTime:(CMTime)time;
125- (void)setSynchSampleTimeInSec:(
double)time;
127- (CMTime)getVideoSampleTime;
128- (double)getVideoSampleTimeInSec;
129- (CMTime)getAudioSampleTime;
130- (double)getAudioSampleTimeInSec;
131- (CMSampleBufferRef)getVideoSampleBuffer;
132- (CMSampleBufferRef)getAudioSampleBuffer;
133- (CVImageBufferRef)getCurrentFrame;
135- (NSInteger)getWidth;
136- (NSInteger)getHeight;
137- (CMTime)getCurrentTime;
138- (double)getCurrentTimeInSec;
139- (CMTime)getDuration;
140- (double)getDurationInSec;
141- (int)getDurationInFrames;
142- (int)getCurrentFrameNum;
143- (float)getFrameRate;
145- (void)setFrame:(
int)frame;
146- (void)setPosition:(
float)position;
148- (void)setVolume:(
float)volume;
152- (void)setSpeed:(
float)speed;
154- (void)setAutoplay:(BOOL)bAutoplay;
156- (void)setWillBeUpdatedExternally:(BOOL)value;
158- (void)setStreaming:(BOOL)value;
Definition ofAVFoundationVideoPlayer.h:34
NSLock * asyncLock
Definition ofAVFoundationVideoPlayer.h:77
CMTime synchSampleTime
Definition ofAVFoundationVideoPlayer.h:46
float frameRate
Definition ofAVFoundationVideoPlayer.h:51
BOOL bIsStopped
Definition ofAVFoundationVideoPlayer.h:75
BOOL bReady
Definition ofAVFoundationVideoPlayer.h:59
BOOL bSeeking
Definition ofAVFoundationVideoPlayer.h:68
NSCondition * deallocCond
Definition ofAVFoundationVideoPlayer.h:78
float positionBeforeReady
Definition ofAVFoundationVideoPlayer.h:74
CMTime audioSampleTime
Definition ofAVFoundationVideoPlayer.h:45
BOOL bNewFrame
Definition ofAVFoundationVideoPlayer.h:63
int frameBeforeReady
Definition ofAVFoundationVideoPlayer.h:73
CMSampleBufferRef audioSampleBuffer
Definition ofAVFoundationVideoPlayer.h:42
BOOL bUpdateFirstFrame
Definition ofAVFoundationVideoPlayer.h:62
BOOL bWasPlayingBackwards
Definition ofAVFoundationVideoPlayer.h:65
BOOL bWillBeUpdatedExternally
Definition ofAVFoundationVideoPlayer.h:58
BOOL bSampleVideo
Definition ofAVFoundationVideoPlayer.h:69
CMTime videoSampleTime
Definition ofAVFoundationVideoPlayer.h:43
CMTime videoSampleTimePrev
Definition ofAVFoundationVideoPlayer.h:44
BOOL bPlayStateBeforeLoad
Definition ofAVFoundationVideoPlayer.h:61
BOOL bLoaded
Definition ofAVFoundationVideoPlayer.h:60
float volume
Definition ofAVFoundationVideoPlayer.h:49
NSInteger videoWidth
Definition ofAVFoundationVideoPlayer.h:53
CMVideoFormatDescriptionRef _videoInfo
Definition ofAVFoundationVideoPlayer.h:36
BOOL bIsUnloaded
Definition ofAVFoundationVideoPlayer.h:71
BOOL bPlaying
Definition ofAVFoundationVideoPlayer.h:64
CMSampleBufferRef videoSampleBuffer
Definition ofAVFoundationVideoPlayer.h:41
playerLoopType loop
Definition ofAVFoundationVideoPlayer.h:56
NSInteger videoHeight
Definition ofAVFoundationVideoPlayer.h:54
float speed
Definition ofAVFoundationVideoPlayer.h:50
BOOL bStream
Definition ofAVFoundationVideoPlayer.h:72
BOOL bAutoPlayOnLoad
Definition ofAVFoundationVideoPlayer.h:67
id timeObserver
Definition ofAVFoundationVideoPlayer.h:39
CMTime duration
Definition ofAVFoundationVideoPlayer.h:47
BOOL bSampleAudio
Definition ofAVFoundationVideoPlayer.h:70
CMTime currentTime
Definition ofAVFoundationVideoPlayer.h:48
BOOL bFinished
Definition ofAVFoundationVideoPlayer.h:66
enum _playerLoopType playerLoopType
_playerLoopType
Definition ofAVFoundationVideoPlayer.h:26
@ LOOP_PALINDROME
Definition ofAVFoundationVideoPlayer.h:28
@ LOOP_NONE
Definition ofAVFoundationVideoPlayer.h:27
@ LOOP_NORMAL
Definition ofAVFoundationVideoPlayer.h:29