I try to use H.264 hardware codec encoder using Android NDK, OpenMAX AL API.
But when I try to get video encoder capabilities interface, I got error code XA_RESULT_FEATURE_UNSUPPORTED (0x0000000C).
Here is my questions
My test code is below:
static XAObjectItf engineObject = NULL;
static XAEngineItf engineEngine = NULL;
void Java_com_example_nativemedia_NativeMedia_createEngine(JNIEnv* env, jclass clazz)
{
XAresult res;
XAVideoEncoderCapabilitiesItf vidEncCap;
// create engine
res = xaCreateEngine(&engineObject, 0, NULL, 0, NULL, NULL);
assert(XA_RESULT_SUCCESS == res);
// realize the engine
res = (*engineObject)->Realize(engineObject, XA_BOOLEAN_FALSE);
assert(XA_RESULT_SUCCESS == res);
// get the engine interface, which is needed in order to create other objects
res = (*engineObject)->GetInterface(engineObject, XA_IID_ENGINE, &engineEngine);
assert(XA_RESULT_SUCCESS == res);
res = (*engineObject)->GetInterface(engineObject, XA_IID_VIDEOENCODERCAPABILITIES, &vidEncCap); // I GOT ERROR HERE!!!!
assert(XA_RESULT_SUCCESS == res);
// create output mix
res = (*engineEngine)->CreateOutputMix(engineEngine, &outputMixObject, 0, NULL, NULL);
assert(XA_RESULT_SUCCESS == res);
// realize the output mix
res = (*outputMixObject)->Realize(outputMixObject, XA_BOOLEAN_FALSE);
assert(XA_RESULT_SUCCESS == res);
}
User contributions licensed under CC BY-SA 3.0