2012-03-29 75 views
27

我目前試圖找出如何通過Android 4.0中的OpenMAX訪問攝像頭。這些文件對我來說是不夠的,所以我現在正在努力如何爲下面的調用找回正確的XADataSource在Android中通過OpenMAX訪問攝像頭

(*_engine)->CreateMediaRecorder(_engine, 
           &_mediaRecorder, //pRecorder 
           nullptr, //pAudioSrc 
           XADataSource *, //pImageVideoSrc 
           XADataSink *, //pDataSnk 
           XAuint32, // numInterfaces 
           const XAInterfaceID *, //pInterfaceIds 
           const XAboolean *, //pInterfaceRequired 
); 

並請饒了我的只是使用Java - 「答案」。

回答

4

這基本上是XADataSource的原始定義,從http://www.khronos.org/registry/omxal/specs/OpenMAX_AL_1_1_Specification.pdf採取

typedef struct XADataSource_ { 
    void * pLocator; 
    void * pFormat; 
} XADataSource; 

領域包括:

Field  Description 
pLocator Pointer to the specified data locator structure. This may point to any of the  following structures. 
    XADataLocator_Address 
    XADataLocator_IODevice 
    XADataLocator_URI 
    XADataLocator_MediaObject 
    XADataLocator_Null 
    XADataLocator_ContentPipe 
The first field of each of these structures includes the 32 bit locatorType field, which identifies 
the locator type (see XA_DATALOCATOR definitions) and hence the structure pointed to. 
Note: The available XA_DATALOCATOR definitions may be extended through an API extension. 

pFormat A pointer to the specified format structure. This may point to any of the following structures. 
    XADataFormat_PCM (Deprecated) 
    XADataFormat_PCM_EX 
    XADataFormat_MIME 
    XADataFormat_RawImage 
The first field of each of these structures includes the 32 bit formatType field, which identifies the 
format type (XA_DATAFORMAT definitions) and hence the structure pointed to. pFormat is ignored 
if pLocator is XADataLocator_IODevice 

抱歉不能更好的格式,但我建議檢查文件無論如何,如果你還沒有做到這一點。

+0

對不起,我看不出這對我有什麼幫助。 – abergmeier 2012-10-29 08:16:27