问题
Where can I find the complete list of the type used in MediaCodec.createDecoderByType (String type)?
Google's document only gives a partial list.
Update[2015-06-03]
Per pskink's tip, I ran a piece of code to extract all the decode's MIME types on an Asus MeMO tablet. Here is the list
video/avc
video/3gpp
video/mp4v-es
audio/3gpp
audio/amr-wb
audio/mp4a-latm
audio/flac
audio/mp4a-latm
Using the method suggested by fadden(adb shell cat /system/etc/media_codecs.xml), I got the following
<MediaCodec name="OMX.WMT.decoder.h263" type="video/3gpp" >
<Quirk name="requires-allocate-on-output-ports" />
</MediaCodec>
<MediaCodec name="OMX.WMT.decoder.avc" type="video/avc" >
<Quirk name="requires-allocate-on-output-ports" />
</MediaCodec>
<MediaCodec name="OMX.WMT.decoder.mpeg2v" type="video/mpeg2" >
<Quirk name="requires-allocate-on-output-ports" />
</MediaCodec>
<MediaCodec name="OMX.google.mp3.decoder" type="audio/mpeg" />
<MediaCodec name="OMX.google.amrnb.decoder" type="audio/3gpp" />
<MediaCodec name="OMX.google.amrwb.decoder" type="audio/amr-wb" />
<MediaCodec name="OMX.google.aac.decoder" type="audio/mp4a-latm" />
<MediaCodec name="OMX.google.g711.alaw.decoder" type="audio/g711-alaw" />
<MediaCodec name="OMX.google.g711.mlaw.decoder" type="audio/g711-mlaw" />
<MediaCodec name="OMX.google.vorbis.decoder" type="audio/vorbis" />
<MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" />
<MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" />
<MediaCodec name="OMX.google.h264.decoder" type="video/avc" />
<MediaCodec name="OMX.google.vpx.decoder" type="video/x-vnd.on2.vp8" />
Now I am suspecting that not every decoder declared in media_codecs.xml has been actually implemented.
Update[2015-06-13]
Very useful information provided by @fadden:
CDD sections 5.1.1 - 5.1.3 "Video Codecs" list all audio, image and video codecs that all Android devices are required to support. I am not sure how many devices meet the requirement. My two Android devices miss many required codecs.
回答1:
List of codecs is completely dependent on a particular device. You have to enum all available codecs using MediaCodecList and call MediaCodec.createDecoderByType for the right one.
来源:https://stackoverflow.com/questions/30610609/type-list-of-mediacodec-createdecoderbytype-string-type