Interface IBufferQueueWriter
interface IBufferQueueWriter
Extends com.amazon.apmf.ICloseable
This interface defines a buffer queue writer
This is a closeable interface once the queue is closed, no
more frames can be enqueued into the writer, also reader gets
a DequeueStatus of QUEUE_CLOSED once writer closes the queue.
Reader will still be able to dequeue all the pending frames
till the last frame in the queue is dequeued.
Methods
tryDequeueFrame()
API to get a frame from buffer queue. Note: Clients may recieve a null object in return if buffer queue does not have a free frame available. We will trigger onFrameAvailable callback on client listeners (if they implemented listner interface and passed while attaching to buffer queue) once a free frame is available for clients to use.DequeueStatustryDequeueFrame(outFrame*frame)
Parameters
frame (out)
Frame* — Required
pass Frame* and queue will return the available (if any) frame.
Returns
DequeueStatus
DequeueStatus
enqueueFrame()
When a client is done processing Frame which was made available via onFrameAvailable() callback, they should use this API to return the frame back to queue.voidenqueueFrame(Frame*frame)
Parameters
frame
Frame* — Required
enqueue the frame back to the queue
addBuffers()
Add buffer to bufferqueue from the IBufferGroup list provided as paramvoidaddBuffers(com.amazon.kepler.buffer.IBufferGroup*[]buffers)
Parameters
buffers
com.amazon.kepler.buffer.IBufferGroup*[] — Required
list of bufferGroup to be added to the queue
removeBuffers()
Remove buffers in IBufferGroup list provided from bufferqueuevoidremoveBuffers(com.amazon.kepler.buffer.IBufferGroup*[]buffers)
Parameters
buffers
com.amazon.kepler.buffer.IBufferGroup*[] — Required
list of bufferGroup to be removed from the queue
reclaimInflightFrames()
void reclaimInflightFrames()
Returns all the frames that are enqueued by the Writer but not yet
dequeued by the reader.
For e.g. in case of a seek scenario video decoder needs to drop
the decoded frames so that old frames are not rendered.

