问题
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