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 static methods enabling you to retrieve device/decoder information to help the application avoid issues on devices. The OTVDecoderInfoUtil
class contains four static methods to support retrieving audio and video decoder information and check if the specific audio/video OTVDecoderFormat
can be supported.
The
getVideoDecoderInfo
method returns an array with all video decoders of H264/H265/AV1.getAudioDecoderInfo
returns an array with all audio decoders.isVideoDecoderSupported
checks if the specificOTVDecoderFormat
is supported by video decoders in the system according to the information of MIME type and codec inOTVDecoderFormat
.isVideoDecoderSupported
checks if the specificOTVDecoderFormat
is supported by audio decoders in the system according to the information of MIME type information only inOTVDecoderFormat
.
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;
The first value of the pair of profileLevels
is profile, and the second value is level when getting the profile and level value of decoder. 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", "mp4a.40.2");
Boolean isSupported = OTVDecoderInfoUtil.isAudioDecoderSupported(decoderFormat);