Worrying about the compatibility of Android MediaC

2019-09-21 14:38发布

问题:

With an effort, I wrote a demo which can record a h264/aac video successfully. I use MediaCodec and MediaMuxer which are both available since api-18. To avoid that the color formats for the camera output and the MediaCodec encoder input are different, I chose the color format "MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface" according to the continous capture activity of grafika. But I am worrying about one thing, there are so many kinds of Android phones, Can my demo record video successfully on any android mobile phone with api-18 or higher.

回答1:

There are few guarantees in life, but the Android CTS tests attempt to ensure that all devices correctly perform certain actions. It sounds like what you're doing makes use of features covered by CTS, so the chances of success are very good, but there can always be exceptions.

For this or any app, it's good to test on as many different devices as possible.