通过的OpenMAX在Android的访问摄像头 [英] Access camera via OpenMAX in Android

查看:133
本文介绍了通过的OpenMAX在Android的访问摄像头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我试图找出如何通过的OpenMAX访问摄像机中的Andr​​oid 4.0。该文件是不够的我,所以我现在跟我怎么可以检索正确的奋斗的XADataSource 以下电话。

I currently try to figure out how to access the Camera via OpenMAX in Android 4.0. The documentation is not sufficient for me so I currently struggle with how I can retrieve the correct XADataSource for the following call.

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

和请饶了我的只需使用Java 的 - 答案

And please spare me the just use Java-"answers".

推荐答案

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

This is basically a definition of XADataSource, taken from 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

抱歉不能更好的格式,但我建议无论如何要检查该文件,如果你还没有做到这一点。

Sorry couldn't format it better, but I suggest to check that document anyway if you haven't already done that.

这篇关于通过的OpenMAX在Android的访问摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆