Interface IMediaSampleSourceTrack3
interface IMediaSampleSourceTrack3
Extends IMediaSampleSourceTrack2
This interface is an extension of IMediaSampleSourceTrack2 which
adds support for queueMediaSample to work in non-blocking mode.
The APIs in this interface must be called after onInitialized
callback is received, else exception would be thrown.
Methods
queueMediaSampleAsync()
Queues a mediaSample object to MediaSampleSourceTrack’s queue. Apps must enqueue samples in decoding order.IMediaSampleSourceQueueReturn*queueMediaSampleAsync(IMediaSample*mediaSample)
Parameters
mediaSample
IMediaSample* — Required
The media sample to be enqueued to track.
Returns
IMediaSampleSourceQueueReturn*
an instance of IMediaSampleSourceQueueReturn object
addQueueListener()
Adds the mediaSampleSourceQueueListener implemented by the clients to receive notifications. Only one IMediaSampleSourceQueueListener can be registered per track. Multiple addQueueListener on same track will result in an InvalidStateError exception. This API call is optional.com.amazon.apmf.ISubscription*addQueueListener(IMediaSampleSourceQueueListener*mediaSampleSourceQueueListener)
Parameters
mediaSampleSourceQueueListener
IMediaSampleSourceQueueListener* — Required
IMediaSampleSourceQueueListener instance to notify
queue under-run (onNeedData) and over-run (onEnoughData)
Returns
com.amazon.apmf.ISubscription*
ISubscription object instance
setQueueThresholds()
Sets the thresholds for internal cache to trigger the IMediaSampleSourceQueueListener callbacks for queue under-run (onNeedData) and over-run (onEnoughData) NOTE: needDataThresholdMs must be less than enoughDataThresholdMs with minimum difference of 500ms. Else, InvalidStateException will be thrown.voidsetQueueThresholds(i64needDataThresholdMs,i64enoughDataThresholdMs)
Parameters
needDataThresholdMs
i64 — Required
time in ms below which onNeedData callback will be invoked,
minimum possible 500ms. Default value: 500
enoughDataThresholdMs
i64 — Required
time in ms above which onEnoughData callback will be invoked,
maximum possible 5000ms. Default value: 5000

