什么Android设备/解码器支持自适应视频播放

时间:2014-03-28 10:33:33

标签: android mediacodec decoder

我在Nexus 5上测试了

codecInfo.isFeatureSupported(MediaCodecInfo.CodecCapabilities.FEATURE_AdaptivePlayback)

返回false。

有谁知道芯片组/软件编解码器支持该功能?

https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#FEATURE_AdaptivePlayback

由于

1 个答案:

答案 0 :(得分:4)

大多数通过KK MR1的Nexus设备都支持此功能。注意,它只是HW视频解码器。

Nexus 5(KK MR1):// Qualcomm Snapdragon 800

  • OMX.qcom.video.decoder.avc
  • OMX.qcom.video.decoder.mpeg4
  • OMX.qcom.video.decoder.h263
  • OMX.qcom.video.decoder.vp8

Nexus 4和Nexus 7 v2013(KK MR1):// Qualcomm Snapdragon S4 Pro APQ8064

  • OMX.qcom.video.decoder.avc
  • OMX.qcom.video.decoder.mpeg4
  • OMX.qcom.video.decoder.h263

Nexus 10(KK MR1)//三星Exynos 5250

  • OMX.Exynos.MPEG4.Decoder
  • OMX.Exynos.H263.Decoder
  • OMX.Exynos.AVC.Decoder

值得注意的例外:

  • Nexus 7 v2012(没有编解码器支持KK MR1)

对于非Nexus设备,您需要自己查询编解码器。这是我为查询做的代码片段。

int numCodecs = MediaCodecList.getCodecCount();
for (int i = 0; i < numCodecs; i++) {
    MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
    String name = codecInfo.getName();
    Log.i(TAG, "Examinig " + (codecInfo.isEncoder() ? "encoder" : "decoder") + ": " + name);
    for(String type: codecInfo.getSupportedTypes()) {
        boolean ap = codecInfo.getCapabilitiesForType(type).isFeatureSupported(MediaCodecInfo.CodecCapabilities.FEATURE_AdaptivePlayback);
        Log.i(TAG, "supports adaptive playback: " + ap);
    }
}