Decoder Information
To test this feature and view the example code, please see the Apple (FPS) SDK 5 Example Code Quick Start guide.
This feature provides details about the video and audio decoders supported by the iOS/tvOS devices. Using this information we can optimise media playback and ensure compatibility with different decoder configurations.
Initialisation
The initialisation of OTVDecoderInfoUtil
should be done prior to calling any APIs
let decoderInfo = OTVDecoderInfoUtil()
Retrieving information about the supported video decoders
let videoDecoderInfoList = decoderInfo.getVideoDecoderInfo()
This will return an array of type OTVVideoDecoderInfo
, where each element contains the following members:
decoderName (String): The name of the video decoder.
decoderMimeType (String): The MIME type of the video decoder.
maxInstances (Optional Int): The maximum number of instances supported by the decoder.
decoderProfileLevels (Optional array of Int): Array of supported decoder profile levels.
isHardwareSupported: Indicates whether hardware acceleration is supported.
isTunellingSupported: Indicates whether tunnelling is supported.
supportedMaxResolution (Optional array of Int): Array of supported maximum resolutions.
Retrieving information about the supported audio decoders
let audioDecoderInfoList = decoderInfo.getAudioDecoderInfo()
This will return an array of type OTVAudioDecoderInfo
, where each element contains the following members:
decoderName (String): The name of the audio decoder.
decoderMimeType (String): The MIME type of the audio decoder.
maxInstances (Optional Int): The maximum number of instances supported by the decoder.
Verify if a decoder is supported
let videoDecoderFormat = OTVDecoderFormat(mimeType: "video/h264")
let isDecoderSupported = decoderInfo.isVideoDecoderSupported(xFormat: videoDecoderFormat)
let audioDecoderFormat = OTVDecoderFormat(mimeType: "audio/mp3")
let isDecoderSupported = decoderInfo.isAudioDecoderSupported(xFormat: audioDecoderFormat)
isVideoDecoderSupported
and isAudioDecoderSupported
returns a boolean value indicating whether the given decoder format is supported by the device.