【问题标题】:Access camera via OpenMAX in Android在 Android 中通过 OpenMAX 访问相机
【发布时间】:2012-04-13 10:09:13
【问题描述】:

我目前正在尝试弄清楚如何在 Android 4.0 中通过 OpenMAX 访问相机。文档对我来说还不够,所以我目前正在努力为以下调用检索正确的XADataSource

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

请不要让我只使用Java-“答案”。

【问题讨论】:

    标签: android c android-ndk openmax


    【解决方案1】:

    这基本上是一个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
    

    抱歉,无法更好地格式化它,但如果您还没有这样做,我建议您检查该文档。

    【讨论】:

    • 抱歉,我不明白这对我有什么帮助。
    【解决方案2】:

    android的实现只支持CreateMediaPlayer 并播放 MP2T H264 AAC 流。

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

    【讨论】:

      猜你喜欢
      • 2013-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-14
      相关资源
      最近更新 更多