Device Information
To test this feature and view the example code, please see the Android SDK 5 Example Code Quick Start guide.
The CONNECT Player SDK provides the means to retrieve decoder information to help the application avoid device-specific issues. The OTVDecoderInfoUtil
class provides static methods to retrieve audio and video decoder information, and methods to check if a given audio/video MIME type and codec combination (provided using an OTVDecoderFormat
) can be supported.
getVideoDecoderInfo()
returns an array of all H264/H265/AV1 video decoders.getAudioDecoderInfo()
returns an array of all audio decoders.isVideoDecoderSupported()
checks if a given MIME type and codec combination is supported by any of the device’s video decoders.isAudioDecoderSupported
() checks if the given MIME type is supported by any of the device’s audio decoders. This method ignores the codec value.
Devices connected to a TV monitor via HDMI may report differently, depending on the cable and monitor connected. For example, AC3 audio may be decoded either by the monitor or by the Android STB.
Retrieving video and audio decoder information
Query video information
OTVVideoDecoderInfo[] videoDecoderInfos = OTVDecoderInfoUtil.getVideoDecoderInfo();
String videoDecoderName = videoDecoderInfos[0].decoderName;
String mimeType = videoDecoderInfos[0].decoderMimeType;
int maxInstances = videoDecoderInfos[0].maxInstances;
boolean isHardwareSupported = videoDecoderInfos[0].isHardwareSupported;
Pair<Integer,Integer> supportedMaxResolution = videoDecoderInfos[0].supportedMaxResolution;
//Get all profile and level values of first video decoder
Pair<Integer, Integer>[] profileLevels = videoDecoderInfos[0].decoderProfileLevels;
InprofileLevels
, the first value is the profile and the second value is the level. All integer values are defined in Android SDK.
Query audio information
OTVAudioDecoderInfo[] audioDecoderInfos = OTVDecoderInfoUtil.getAudioDecoderInfo();
String audioDecoderName = audioDecoderInfos[0].decoderName;
String mimeType = audioDecoderInfos[0].decoderMimeType;
int maxInstances = audioDecoderInfos[0].maxInstances;
Checking if the specific OTVDecoderFormat is supported
Video decoder
OTVDecoderFormat decoderFormat = new OTVDecoderFormat("video/avc", "avc1.64001f");
boolean isSupported = OTVDecoderInfoUtil.isAudioDecoderSupported(decoderFormat);
Audio decoder
OTVDecoderFormat decoderFormat = new OTVDecoderFormat("audio/mp4", "");
boolean isSupported = OTVDecoderInfoUtil.isAudioDecoderSupported(decoderFormat);