在安卓系统中通过OpenMAX访问相机

29

我目前正在尝试通过OpenMAX在Android 4.0中访问相机。文档对我来说不够充分,所以我目前正在努力找到如何检索正确的XADataSource以进行以下调用。

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

请不要给我那些只用Java的答案。

2个回答

4

这基本上是对XADataSource的定义,摘自http://www.khronos.org/registry/omxal/specs/OpenMAX_AL_1_1_Specification.pdf

。XADataSource是一个Java类,用于获取与关系数据库的连接。它提供了一种方法来创建和管理数据库连接,并允许应用程序在不了解底层细节的情况下使用这些连接。
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

抱歉,我不能更好地格式化它,但如果你还没有查看那份文件,我建议你去检查一下。


抱歉,以上内容与IT技术无关,请提供更多上下文以便我能够更好地为您服务。


抱歉,我不明白这如何对我有所帮助。 - abergmeier

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接