public CryptoInfo() { frameworkCryptoInfo = Util.SDK_INT >= 16 ? newFrameworkCryptoInfoV16() : null; patternHolder = Util.SDK_INT >= 24 ? new PatternHolderV24(frameworkCryptoInfo) : null; }
/** * Returns whether the {@link C#BUFFER_FLAG_DECODE_ONLY} flag is set. */ public final boolean isDecodeOnly() { return getFlag(C.BUFFER_FLAG_DECODE_ONLY); }
/** * Creates a new instance for which {@link #isFlagsOnly()} will return true. * * @return A new flags only input buffer. */ public static DecoderInputBuffer newFlagsOnlyInstance() { return new DecoderInputBuffer(BUFFER_REPLACEMENT_MODE_DISABLED); }
/** * Returns the sum of the skipped, dropped and rendered buffers. * * @param counters The counters for which the total should be calculated. * @return The sum of the skipped, dropped and rendered buffers. */ public static int getTotalBufferCount(DecoderCounters counters) { counters.ensureUpdated(); return counters.skippedOutputBufferCount + counters.droppedBufferCount + counters.renderedOutputBufferCount; }
@Override protected AudioDecoderException decode(DecoderInputBuffer inputBuffer, SimpleOutputBuffer outputBuffer, boolean reset) { if (inputBuffer.isEndOfStream()) { outputBuffer.setFlags(C.BUFFER_FLAG_END_OF_STREAM); } return null; }
private void releaseDecoder() { if (decoder == null) { return; } inputBuffer = null; outputBuffer = null; decoder.release(); decoder = null; decoderCounters.decoderReleaseCount++; decoderReinitializationState = REINITIALIZATION_STATE_NONE; decoderReceivedBuffers = false; }
@Override protected SimpleOutputBuffer createOutputBuffer() { return new SimpleOutputBuffer(this); }
@Override public int readData(FormatHolder formatHolder, DecoderInputBuffer buffer, boolean formatRequired) { buffer.setFlags(C.BUFFER_FLAG_END_OF_STREAM); return C.RESULT_BUFFER_READ; }
/** * Releases an output buffer back to the decoder. * * @param outputBuffer The output buffer being released. */ protected void releaseOutputBuffer(O outputBuffer) { synchronized (lock) { releaseOutputBufferInternal(outputBuffer); maybeNotifyDecodeLoop(); } }
@Override public void release() { owner.releaseOutputBuffer(this); }
@Override public void clear() { super.clear(); subtitle = null; }
/** * Returns whether the {@link C#BUFFER_FLAG_ENCRYPTED} flag is set. */ public final boolean isEncrypted() { return getFlag(C.BUFFER_FLAG_ENCRYPTED); }
/** * @param bufferReplacementMode Determines the behavior of {@link #ensureSpaceForWrite(int)}. One * of {@link #BUFFER_REPLACEMENT_MODE_DISABLED}, {@link #BUFFER_REPLACEMENT_MODE_NORMAL} and * {@link #BUFFER_REPLACEMENT_MODE_DIRECT}. */ public DecoderInputBuffer(@BufferReplacementMode int bufferReplacementMode) { this.cryptoInfo = new CryptoInfo(); this.bufferReplacementMode = bufferReplacementMode; }
private static String getDecoderCountersBufferCountString(DecoderCounters counters) { if (counters == null) { return ""; } counters.ensureUpdated(); return " sib:" + counters.skippedInputBufferCount + " sb:" + counters.skippedOutputBufferCount + " rb:" + counters.renderedOutputBufferCount + " db:" + counters.droppedBufferCount + " mcdb:" + counters.maxConsecutiveDroppedBufferCount + " dk:" + counters.droppedToKeyframeCount; }
@Override protected SimpleOutputBuffer createOutputBuffer() { return new SimpleOutputBuffer(this); }
/** * Returns whether the {@link C#BUFFER_FLAG_END_OF_STREAM} flag is set. */ public final boolean isEndOfStream() { return getFlag(C.BUFFER_FLAG_END_OF_STREAM); }
/** * Returns the sum of the skipped, dropped and rendered buffers. * * @param counters The counters for which the total should be calculated. * @return The sum of the skipped, dropped and rendered buffers. */ public static int getTotalBufferCount(DecoderCounters counters) { counters.ensureUpdated(); return counters.skippedOutputBufferCount + counters.droppedBufferCount + counters.renderedOutputBufferCount; }
/** * Returns whether the {@link C#BUFFER_FLAG_KEY_FRAME} flag is set. */ public final boolean isKeyFrame() { return getFlag(C.BUFFER_FLAG_KEY_FRAME); }