Greifen Sie über OpenMAX in Android auf die Kamera zu

Lesezeit: 2 Minuten

Ich versuche gerade herauszufinden, wie ich über OpenMAX in Android 4.0 auf die Kamera zugreifen kann. Die Dokumentation ist für mich nicht ausreichend, daher kämpfe ich derzeit damit, wie ich die richtige abrufen kann XADataSource für den folgenden Anruf.

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

Und erspar mir das bitte Benutze einfach Java– “Antworten”.

Dies ist im Grunde eine Definition von XADataSource, entnommen aus http://www.khronos.org/registry/omxal/specs/OpenMAX_AL_1_1_Specification.pdf

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

Zu den Feldern gehören:

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

Tut mir leid, ich konnte es nicht besser formatieren, aber ich schlage vor, das Dokument trotzdem zu überprüfen, falls Sie das noch nicht getan haben.

  • Tut mir leid, ich verstehe nicht, wie mir das hilft.

    – Bergmeier

    29. Oktober 2012 um 8:16 Uhr

Benutzer-Avatar
Lugyu

Die Implementierung von Android unterstützt nur CreateMediaPlayer und spielt MP2T H264 AAC-Stream ab.

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

1370170cookie-checkGreifen Sie über OpenMAX in Android auf die Kamera zu

This website is using cookies to improve the user-friendliness. You agree by using the website further.

Privacy policy