Java Code Examples for com.google.android.exoplayer2.decoder.DecoderCounters#ensureUpdated()
The following examples show how to use
com.google.android.exoplayer2.decoder.DecoderCounters#ensureUpdated() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AudioRendererEventListener.java From MediaSDK with Apache License 2.0 | 5 votes |
/** * Invokes {@link AudioRendererEventListener#onAudioDisabled(DecoderCounters)}. */ public void disabled(final DecoderCounters counters) { counters.ensureUpdated(); if (handler != null) { handler.post( () -> { counters.ensureUpdated(); castNonNull(listener).onAudioDisabled(counters); }); } }
Example 2
Source File: VideoRendererEventListener.java From MediaSDK with Apache License 2.0 | 5 votes |
/** Invokes {@link VideoRendererEventListener#onVideoDisabled(DecoderCounters)}. */ public void disabled(DecoderCounters counters) { counters.ensureUpdated(); if (handler != null) { handler.post( () -> { counters.ensureUpdated(); castNonNull(listener).onVideoDisabled(counters); }); } }
Example 3
Source File: DecoderCountersUtil.java From ExoPlayer-Offline with Apache License 2.0 | 5 votes |
public static void assertSkippedOutputBufferCount(String name, DecoderCounters counters, int expected) { counters.ensureUpdated(); int actual = counters.skippedOutputBufferCount; TestCase.assertEquals("Codec(" + name + ") skipped " + actual + " buffers. Expected " + expected + ".", expected, actual); }
Example 4
Source File: DecoderCountersUtil.java From ExoPlayer-Offline with Apache License 2.0 | 5 votes |
public static void assertTotalOutputBufferCount(String name, DecoderCounters counters, int minCount, int maxCount) { counters.ensureUpdated(); int actual = getTotalOutputBuffers(counters); TestCase.assertTrue("Codec(" + name + ") output " + actual + " buffers. Expected in range [" + minCount + ", " + maxCount + "].", minCount <= actual && actual <= maxCount); }
Example 5
Source File: DecoderCountersUtil.java From ExoPlayer-Offline with Apache License 2.0 | 5 votes |
public static void assertDroppedOutputBufferLimit(String name, DecoderCounters counters, int limit) { counters.ensureUpdated(); int actual = counters.droppedOutputBufferCount; TestCase.assertTrue("Codec(" + name + ") was late decoding: " + actual + " buffers. " + "Limit: " + limit + ".", actual <= limit); }
Example 6
Source File: DecoderCountersUtil.java From ExoPlayer-Offline with Apache License 2.0 | 5 votes |
public static void assertConsecutiveDroppedOutputBufferLimit(String name, DecoderCounters counters, int limit) { counters.ensureUpdated(); int actual = counters.maxConsecutiveDroppedOutputBufferCount; TestCase.assertTrue("Codec(" + name + ") was late decoding: " + actual + " buffers consecutively. " + "Limit: " + limit + ".", actual <= limit); }
Example 7
Source File: DebugTextViewHelper.java From K-Sonic with MIT License | 5 votes |
private static String getDecoderCountersBufferCountString(DecoderCounters counters) { if (counters == null) { return ""; } counters.ensureUpdated(); return " rb:" + counters.renderedOutputBufferCount + " sb:" + counters.skippedOutputBufferCount + " db:" + counters.droppedOutputBufferCount + " mcdb:" + counters.maxConsecutiveDroppedOutputBufferCount; }
Example 8
Source File: AudioRendererEventListener.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
/** * Invokes {@link AudioRendererEventListener#onAudioDisabled(DecoderCounters)}. */ public void disabled(final DecoderCounters counters) { counters.ensureUpdated(); if (listener != null) { handler.post( () -> { counters.ensureUpdated(); listener.onAudioDisabled(counters); }); } }
Example 9
Source File: VideoRendererEventListener.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
/** Invokes {@link VideoRendererEventListener#onVideoDisabled(DecoderCounters)}. */ public void disabled(DecoderCounters counters) { counters.ensureUpdated(); if (listener != null) { handler.post( () -> { counters.ensureUpdated(); listener.onVideoDisabled(counters); }); } }
Example 10
Source File: AudioRendererEventListener.java From Telegram with GNU General Public License v2.0 | 5 votes |
/** * Invokes {@link AudioRendererEventListener#onAudioDisabled(DecoderCounters)}. */ public void disabled(final DecoderCounters counters) { counters.ensureUpdated(); if (listener != null) { handler.post( () -> { counters.ensureUpdated(); listener.onAudioDisabled(counters); }); } }
Example 11
Source File: VideoRendererEventListener.java From Telegram with GNU General Public License v2.0 | 5 votes |
/** Invokes {@link VideoRendererEventListener#onVideoDisabled(DecoderCounters)}. */ public void disabled(DecoderCounters counters) { counters.ensureUpdated(); if (listener != null) { handler.post( () -> { counters.ensureUpdated(); listener.onVideoDisabled(counters); }); } }