Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

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()

DequeueStatus tryDequeueFrame(out Frame* frame)
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.

Parameters

frame (out)
Frame* — Required pass Frame* and queue will return the available (if any) frame.

Returns

DequeueStatus DequeueStatus

enqueueFrame()

void enqueueFrame(Frame* frame)
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.

Parameters

frame
Frame* — Required enqueue the frame back to the queue

addBuffers()

void addBuffers(com.amazon.kepler.buffer.IBufferGroup*[] buffers)
Add buffer to bufferqueue from the IBufferGroup list provided as param

Parameters

buffers
com.amazon.kepler.buffer.IBufferGroup*[] — Required list of bufferGroup to be added to the queue

removeBuffers()

void removeBuffers(com.amazon.kepler.buffer.IBufferGroup*[] buffers)
Remove buffers in IBufferGroup list provided from bufferqueue

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.
Last modified on October 29, 2026