VKVideoDecoder Class Reference
Overview
VKVideoDecoder is responsible for decoding video packets into video frames, queuing frames for AV syncing, and feeding OpenGL view with frames
– initWithFormatContext:codecContext:stream:streamId:manager:audioDecoder:
Initialize video decoder with AVCodecContext, AVStream, stream index, and audioIsOK parameters
- (id)initWithFormatContext:(AVFormatContext *)avFmtCtx codecContext:(AVCodecContext *)cdcCtx stream:(AVStream *)strm streamId:(NSInteger)sId manager:(id)manager audioDecoder:(VKAudioDecoder *)audioDecoderParameters
avFmtCtx |
FFmpeg’s format I/O context |
|---|---|
cdcCtx |
FFmpeg’s codec I/O context |
strm |
FFmpeg’s Stream structure |
sId |
Stream index |
manager |
VKDecodeManager object |
audioDecoder |
VKAudioDecoder object to be used in AV sync algorithm |
Return Value
VKVideoDecoder object
Declared In
VKVideoDecoder.h
– unlockQueues
Queues are interworking with eachother and uses wait mechanism for management, this methods unlocks all queues
- (void)unlockQueuesDeclared In
VKVideoDecoder.h
– schedulePicture
A loop for refreshing screen with pictures
- (void)schedulePictureDeclared In
VKVideoDecoder.h
– onAudioDecoderDestroyed
Inform Video Decoder that Audio Decoder is destroyed
- (void)onAudioDecoderDestroyedDeclared In
VKVideoDecoder.h
– onStreamPaused
Inform Video Decoder that streaming/playing is paused
- (void)onStreamPausedDeclared In
VKVideoDecoder.h
– onAudioStreamCycled:
Inform Video Decoder that Audio stream is cycled/changed
- (void)onAudioStreamCycled:(VKAudioDecoder *)decoderParameters
decoder |
VKAudioDecoder object should be set again in Video Decoder |
|---|
Declared In
VKVideoDecoder.h
– setEOF:
Inform Video Decoder that it’s reached end of file
- (void)setEOF:(BOOL)valueParameters
value |
Specify YES for end of file is reached or NO for continue playing |
|---|
Declared In
VKVideoDecoder.h
– decodeVideo
Start to decode video packets (This method needs to be called after a succesful connection)
- (int)decodeVideoDeclared In
VKVideoDecoder.h
– snapshot
Get snapshot of video frame in original size in UIImage format
- (UIImage *)snapshotReturn Value
UIImage object
Declared In
VKVideoDecoder.h
decodeJobIsDone
A Boolean that indicates whether if the decode process is done not not, used for managing threads
@property (nonatomic, readonly) BOOL decodeJobIsDoneDeclared In
VKVideoDecoder.h
schedulePictureJobIsDone
A Boolean that indicates whether if the scheduling of picture process is done not not, used for managing threads
@property (nonatomic, readonly) BOOL schedulePictureJobIsDoneDeclared In
VKVideoDecoder.h
currentPos
Current byte position of AVPacket in stream, used for AV syncing
@property (nonatomic, readonly) int64_t currentPosDeclared In
VKVideoDecoder.h