Documentation

MKMediaFile class documentation

MKMediaFile : NSObject

AuthorsGenerated by builder
Declared inMKMediaFile.h

Overview

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.


Default

- (id) initWithURL: (NSURL *)aURL

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

    - (id) initWithPath: (NSString *)path

    Initialises the object with a media file.

      - (NSURL *) URL

      Return the URL of this media file

        - (BOOL) selectAnyVideoStream

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

          - (BOOL) selectAnyAudioStream

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

            - (int) streams

            Returns the number of streams in this file.

              - (BOOL) isAudioFile

              Returns YES if this file contains any audio streams.

                - (BOOL) isVideoFile

                Returns yes if this file contains any video streams.

                  - (int) channels

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

                    - (int) sampleRate

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

                      - (int64_t) timestamp

                      Returns the current stream position, in milliseconds.

                        - (int64_t) duration

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

                          - (int) requiredBufferSize

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

                            - (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).

                              - (NSDictionary *) metadata

                              Returns a dictionary of metadata