public Ac3PassthroughTrackRenderer(SampleSource source, Handler eventHandler, EventListener listener) { mSource = source.register(); mEventHandler = eventHandler; mEventListener = listener; mTrackIndex = -1; mSampleHolder = new SampleHolder(SampleHolder.BUFFER_REPLACEMENT_MODE_DIRECT); mSampleHolder.ensureSpaceForWrite(DEFAULT_INPUT_BUFFER_SIZE); mOutputBuffer = ByteBuffer.allocate(DEFAULT_OUTPUT_BUFFER_SIZE); mFormatHolder = new MediaFormatHolder(); AUDIO_TRACK.restart(); mCodecCounters = new CodecCounters(); mMonitor = new AudioTrackMonitor(); mAudioClock = new AudioClock(); mTracksIndex = new ArrayList<>(); }
public static void assertOutputFormatChangedCount(String name, CodecCounters counters, int expected) { counters.ensureUpdated(); int actual = counters.outputFormatChangedCount; TestCase.assertEquals("Codec(" + name + ") output format changed " + actual + " times. " + "Expected " + expected + " times.", expected, actual); }
public static void assertOutputBuffersChangedLimit(String name, CodecCounters counters, int limit) { counters.ensureUpdated(); int actual = counters.outputBuffersChangedCount; TestCase.assertTrue("Codec(" + name + ") output buffers changed " + actual + " times. " + "Limit: " + limit + "", actual <= limit); }
public static void assertSkippedOutputBufferCount(String name, CodecCounters counters, int expected) { counters.ensureUpdated(); int actual = counters.skippedOutputBufferCount; TestCase.assertEquals("Codec(" + name + ") skipped " + actual + " buffers. Expected " + expected + "", expected, actual); }
public static void assertTotalOutputBufferCount(String name, CodecCounters 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); }
public static void assertDroppedOutputBufferLimit(String name, CodecCounters counters, int limit) { counters.ensureUpdated(); int actual = counters.droppedOutputBufferCount; TestCase.assertTrue("Codec(" + name + ") was late decoding: " + actual + " buffers. " + "Limit: " + limit + "", actual <= limit); }
public static void assertConsecutiveDroppedOutputBufferLimit(String name, CodecCounters counters, int limit) { counters.ensureUpdated(); int actual = counters.maxConsecutiveDroppedOutputBufferCount; TestCase.assertTrue("Codec(" + name + ") was late decoding: " + actual + " buffers consecutively. " + "Limit: " + limit + "", actual <= limit); }
@Override public CodecCounters getCodecCounters() { return codecCounters; }
private String getVideoCodecCountersString() { CodecCounters codecCounters = debuggable.getCodecCounters(); return codecCounters == null ? "" : codecCounters.getDebugString(); }
public CodecCounters getCodecCounters() { return codecCounters; }