Profile and Level hints can be ignored by a given AVC encoder.
To be absolutely sure which profile and level have been selected by the AVC encoder, you can query the SPS in realtime from its MediaFormat after it has started (like during the initial format change event).
See Section 7 of the spec.
This poster shows to pull the profile and level from these base64 strings (please upvote him!):
Can profile-level-id and sprop-parameter-sets be extracted from an RTP stream?
Here are the Base64 encoded SPS and PPS:
...
mIndex = mMediaEncoder.dequeueOutputBuffer(mBufferInfo, TIMEOUT);
// First buffer encoded is the NAL frame metadata
if (mIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED)
{
Log.i("PPS: "+getParameterSetAsString(mMediaEncoder, "csd-0");
Log.i("SPS: "+getParameterSetAsString(mMediaEncoder, "csd-1");
}
...
private String getParameterSetAsString(MediaCodec encoder, String csd)
{
MediaFormat mMediaFormat = encoder.getOutputFormat();
ByteBuffer ps = mMediaFormat.getByteBuffer(csd);
// The actual SPS and PPS byte codes
byte[] mPS = new byte[ps.capacity()-4];
ps.position(4);
ps.get(mPS,0,mPS.length);
//Covert to String
return Base64.encodeToString(mPS, 0, mPS.length, Base64.NO_WRAP);
}