2

我正在尝试以 h.264 格式将我的视频缓冲区从内存记录到闪存中,并使用此代码来初始化录像机。我应该使用什么格式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);
4

0 回答 0