Media player use cases

Using the media playback capabilities of OpenMAX AL generally involves three steps:

OpenMAX AL diagram showing the sequence of actions when using the media player object.

The following diagrams show how to use the buffer queue in three different applications.

Play from the buffer queue

In the buffer queue callback, you need to push one buffer that contains input data. At the end of the stream, push an XAAndroidBufferItem with the itemKey as XA_ANDROID_ITEMKEY_EOS. If the input data is a raw compressed bitstream, specify the input format of the XADataFormat_QNXEncoded structure in XADataSource::pFormat. The data contained in the buffer that is pushed in the callback function should be one video or audio frame.

OpenMAX AL diagram showing the sequence of actions when playing from the buffer queue.

Decode to the buffer queue

The decoded data is sent back in the callback function. If the source contains only audio or video data, you need to query the audio or video buffer queue sink interface.

OpenMAX AL diagram showing the sequence of actions when decoding to the buffer queue.

Input from buffer queue and output to buffer queue

In this use case, the app can access the decoder directly. You need to specify the input format of the XADataFormat_QNXEncoded structure in XADataSource::pFormat. The data contained in the buffer that is pushed in the callback function should be one video or audio frame.

OpenMAX AL diagram showing the sequence of actions when inputting from buffer queue and outputting to buffer queue.

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus