OpenMAX recorder on Android

爷,独闯天下 提交于 2019-12-07 20:18:30

问题


I am trying to record my video buffer from memory to flash in h.264 format and am using this code to initialize the recorder. What format should I use for dataSrc?

 XADataLocator_URI locUri;
    locUri.locatorType = XA_DATALOCATOR_URI;
    locUri.URI = (XAchar *) "/sdcard/test.ts";

    XADataFormat_MIME format_mime = {
            XA_DATAFORMAT_MIME, XA_ANDROID_MIME_MP2TS, XA_CONTAINERTYPE_MPEG_TS };
    XADataSource dataDst = {&locUri, &format_mime};

    XADataSource dataSrc = {&locUri, &format_mime};

    XADataSink imageVideoSink = {&dataDst, NULL};

    // declare interfaces to use
    XAboolean     required[NB_MAXAL_INTERFACES]
                           = {XA_BOOLEAN_TRUE, XA_BOOLEAN_TRUE,           XA_BOOLEAN_TRUE};
    XAInterfaceID iidArray[NB_MAXAL_INTERFACES]
                           = {XA_IID_RECORD,     XA_IID_ANDROIDBUFFERQUEUESOURCE,
                                               XA_IID_STREAMINFORMATION};

    res = (*engineEngine)->CreateMediaRecorder(engineEngine,
            &recorderObj,
            NULL,
            &dataSrc,
            &imageVideoSink,
            NB_MAXAL_INTERFACES /*XAuint32 numInterfaces*/,
            iidArray /*const XAInterfaceID *pInterfaceIds*/,
            required /*const XAboolean *pInterfaceRequired*/);
    assert(XA_RESULT_SUCCESS == res);

来源:https://stackoverflow.com/questions/19273898/openmax-recorder-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!