I think it's impossible. The MediaCodec resources are shared among all applications in the system, so the system cannot guarantee that your upcoming MediaCodec creation will succeed even if it appears that resources are currently available — another application may create a MediaCodec in the meantime. Moreover, the creation of a MediaCodec mainly depends on the vendor's implementation. Therefore, aside from actually attempting to create a MediaCodec to see if it succeeds, there's no way to determine in advance whether the creation will be successful.