MKMediaFile class documentation

Authors

Generated by builder

Software documentation for the MKMediaFile class

MKMediaFile : NSObject

Declared in:
MKMediaFile.h

Class encapsulating a media file. Currently a fairly minimal implementation which is only capable of accessing a single stream from a file. Still to do is a mechanism for accessing multiple streams in a file and for decoding video.


Instance Variables

Method summary

URL 

- (NSURL*) URL;

Return the URL of this media file


channels 

- (int) channels;

Returns the number of channels in the currently-selected audio stream.


decodeAudioTo: size: 

- (int) decodeAudioTo: (int16_t*)buffer size: (int)bufferSize;

Decodes the next frame of audio to the specified buffer, or a negative result in case of error (e.g. the end of the stream).


duration 

- (int64_t) duration;

Returns the duration of the currently selected stream, in milliseconds.


initWithPath: 

- (id) initWithPath: (NSString*)path;

Initialises the object with a media file.


initWithURL: 

- (id) initWithURL: (NSURL*)aURL;

Initialises the object with a (potentially remote) media file.


isAudioFile 

- (BOOL) isAudioFile;

Returns YES if this file contains any audio streams.


isVideoFile 

- (BOOL) isVideoFile;

Returns yes if this file contains any video streams.


metadata 

- (NSDictionary*) metadata;

Returns a dictionary of metadata


requiredBufferSize 

- (int) requiredBufferSize;

Returns the size of the output buffer required for decoding a frame in the current stream.


sampleRate 

- (int) sampleRate;

Returns the sample rate of the currently-selected audio stream.


selectAnyAudioStream 

- (BOOL) selectAnyAudioStream;

Selects any audio stream for playback. Returns YES if an audio stream is found.


selectAnyVideoStream 

- (BOOL) selectAnyVideoStream;

Selects a video stream for playback. Returns YES if a video stream is found.


streams 

- (int) streams;

Returns the number of streams in this file.


timestamp 

- (int64_t) timestamp;

Returns the current stream position, in milliseconds.




Instance Variables for MKMediaFile Class

URL

@protected NSURL* URL;
Description forthcoming.

codec

@protected AVCodec* codec;
Description forthcoming.

context

@protected AVCodecContext* context;
Description forthcoming.

formatContext

@protected AVFormatContext* formatContext;
Description forthcoming.

metadata

@protected NSMutableDictionary* metadata;
Description forthcoming.

stream

@protected int stream;
Description forthcoming.

timestamp

@protected int64_t timestamp;
Description forthcoming.