Get interface of XA_IID_VIDEOENCODERCAPABILITIES in Android NDK OpenMAX AL

0

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

  1. Is it possible that Android developers can use H.264 hardware encoder by using Android NDK?
  2. If it is not possible, there are other ways to use hardware encoder?
  3. I got XA_RESULT_FEATURE_UNSUPPORTED code from Samsung Galaxy S8. If I change the device, can I get success code?

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);

}
android
android-ndk
hardware-acceleration
video-codecs
openmax
asked on Stack Overflow May 8, 2018 by Seungho Jeong

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0