public final class DecoderCounters extends Object
Counters should be written from the playback thread only. Counters may be read from any
thread. To ensure that the counter values are made visible across threads, users of this class
should invoke ensureUpdated() prior to reading and after writing.
| Modifier and Type | Field | Description |
|---|---|---|
int |
decoderInitCount |
The number of times a decoder has been initialized.
|
int |
decoderReleaseCount |
The number of times a decoder has been released.
|
int |
droppedBufferCount |
The number of dropped buffers.
|
int |
droppedToKeyframeCount |
The number of times all buffers to a keyframe were dropped.
|
int |
inputBufferCount |
The number of queued input buffers.
|
int |
maxConsecutiveDroppedBufferCount |
The maximum number of dropped buffers without an interleaving rendered output buffer.
|
int |
renderedOutputBufferCount |
The number of rendered output buffers.
|
int |
skippedInputBufferCount |
The number of skipped input buffers.
|
int |
skippedOutputBufferCount |
The number of skipped output buffers.
|
long |
totalVideoFrameProcessingOffsetUs |
The sum of the video frame processing offsets in microseconds.
|
int |
videoFrameProcessingOffsetCount |
The number of video frame processing offsets added.
|
| Constructor | Description |
|---|---|
DecoderCounters() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addVideoFrameProcessingOffset(long processingOffsetUs) |
Adds a video frame processing offset to
totalVideoFrameProcessingOffsetUs and
increases videoFrameProcessingOffsetCount by one. |
void |
ensureUpdated() |
Should be called to ensure counter values are made visible across threads.
|
void |
merge(DecoderCounters other) |
Merges the counts from
other into this instance. |
public int decoderInitCount
public int decoderReleaseCount
public int inputBufferCount
public int skippedInputBufferCount
A skipped input buffer is an input buffer that was deliberately not sent to the decoder.
public int renderedOutputBufferCount
public int skippedOutputBufferCount
A skipped output buffer is an output buffer that was deliberately not rendered.
public int droppedBufferCount
A dropped buffer is an buffer that was supposed to be decoded/rendered, but was instead dropped because it could not be rendered in time.
public int maxConsecutiveDroppedBufferCount
Skipped output buffers are ignored for the purposes of calculating this value.
public int droppedToKeyframeCount
Each time buffers to a keyframe are dropped, this counter is increased by one, and the dropped buffer counters are increased by one (for the current output buffer) plus the number of buffers dropped from the source to advance to the keyframe.
public long totalVideoFrameProcessingOffsetUs
The processing offset for a video frame is the difference between the time at which the frame became available to render, and the time at which it was scheduled to be rendered. A positive value indicates the frame became available early enough, whereas a negative value indicates that the frame wasn't available until after the time at which it should have been rendered.
Note: Use addVideoFrameProcessingOffset(long) to update this field instead of
updating it directly.
public int videoFrameProcessingOffsetCount
Note: Use addVideoFrameProcessingOffset(long) to update this field instead of
updating it directly.
public void ensureUpdated()
public void merge(DecoderCounters other)
other into this instance.other - The DecoderCounters to merge into this instance.public void addVideoFrameProcessingOffset(long processingOffsetUs)
totalVideoFrameProcessingOffsetUs and
increases videoFrameProcessingOffsetCount by one.
Convenience method to ensure both fields are updated when adding a single offset.
processingOffsetUs - The video frame processing offset in microseconds.