首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Android中通过OpenMAX访问摄像头

在Android中通过OpenMAX访问摄像头
EN

Stack Overflow用户
提问于 2012-03-29 18:02:08
回答 2查看 2.9K关注 0票数 29

目前,我试图弄清楚如何通过Android4.0中的OpenMAX来访问摄像头。这些文档对我来说是不够的,所以我目前很难找到正确的XADataSource来进行下面的调用。

代码语言:javascript
运行
复制
(*_engine)->CreateMediaRecorder(_engine,
                                &_mediaRecorder, //pRecorder
                                nullptr, //pAudioSrc
                                XADataSource *, //pImageVideoSrc
                                XADataSink *, //pDataSnk
                                XAuint32, // numInterfaces
                                const XAInterfaceID *, //pInterfaceIds
                                const XAboolean *, //pInterfaceRequired
);

请不要再用Java-“答案”了。

EN

回答 2

Stack Overflow用户

发布于 2012-10-05 09:33:35

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

代码语言:javascript
运行
复制
typedef struct XADataSource_ {
    void * pLocator;
    void * pFormat;
} XADataSource;

领域包括:

代码语言:javascript
运行
复制
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

对不起,没有更好的格式,但我建议,无论如何,如果你还没有检查该文件。

票数 4
EN

Stack Overflow用户

发布于 2017-02-26 06:26:11

安卓系统的实现只支持CreateMediaPlayer和播放MP2T H264 AAC流。

http://mobilepearls.com/labs/native-android-api/ndk/docs/openmaxal/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9930852

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档