You should use MediaCodec api and not any lower level api. The MediaCodec api will then use the appropriate framework internally. This is because android vendors will integrate their own codecs and hardware / dsp accelerated codecs into the framework and set those as default for MediaCodec api. They will ensure their codecs work with MediaCodec api. If you use MediaCodec api it will work on all devices irrespective of the framework being used below. That is what that api is for.
Unless you specifically want to do some testing with OpenCore/Stagefright don't go there.