int result = inputBuffer.isEncrypted() ? opusSecureDecode(nativeDecoderContext, inputBuffer.timeUs, inputData, inputData.limit(), outputBuffer, SAMPLE_RATE, exoMediaCrypto, cryptoInfo.mode,
private void assertInputBufferHasNoDefaultFlagsSet() { assertThat(inputBuffer.isEndOfStream()).isFalse(); assertThat(inputBuffer.isDecodeOnly()).isFalse(); assertThat(inputBuffer.isEncrypted()).isFalse(); }
if (buffer.isEncrypted()) { readEncryptionData(buffer, extrasHolder);
/** * Asserts {@link SampleQueue#read} returns {@link C#RESULT_BUFFER_READ} and that the * {@link DecoderInputBuffer#isEndOfStream()} is set. * * @param formatRequired The value of {@code formatRequired} passed to readData. */ private void assertReadEndOfStream(boolean formatRequired) { clearFormatHolderAndInputBuffer(); int result = sampleQueue.read(formatHolder, inputBuffer, formatRequired, true, 0); assertThat(result).isEqualTo(RESULT_BUFFER_READ); // formatHolder should not be populated. assertThat(formatHolder.format).isNull(); // inputBuffer should not contain sample data, but end of stream flag should be set. assertInputBufferContainsNoSampleData(); assertThat(inputBuffer.isEndOfStream()).isTrue(); assertThat(inputBuffer.isDecodeOnly()).isFalse(); assertThat(inputBuffer.isEncrypted()).isFalse(); }
/** * Asserts {@link SampleQueue#read} returns {@link C#RESULT_BUFFER_READ} and that the buffer is * filled with the specified sample data. * * @param timeUs The expected buffer timestamp. * @param isKeyframe The expected keyframe flag. * @param sampleData An array containing the expected sample data. * @param offset The offset in {@code sampleData} of the expected sample data. * @param length The length of the expected sample data. */ private void assertReadSample( long timeUs, boolean isKeyframe, byte[] sampleData, int offset, int length) { clearFormatHolderAndInputBuffer(); int result = sampleQueue.read(formatHolder, inputBuffer, false, false, 0); assertThat(result).isEqualTo(RESULT_BUFFER_READ); // formatHolder should not be populated. assertThat(formatHolder.format).isNull(); // inputBuffer should be populated. assertThat(inputBuffer.timeUs).isEqualTo(timeUs); assertThat(inputBuffer.isKeyFrame()).isEqualTo(isKeyframe); assertThat(inputBuffer.isDecodeOnly()).isFalse(); assertThat(inputBuffer.isEncrypted()).isFalse(); inputBuffer.flip(); assertThat(inputBuffer.data.limit()).isEqualTo(length); byte[] readData = new byte[length]; inputBuffer.data.get(readData); assertThat(readData).isEqualTo(copyOfRange(sampleData, offset, offset + length)); }
boolean bufferEncrypted = buffer.isEncrypted(); waitingForKeys = shouldWaitForKeys(bufferEncrypted); if (waitingForKeys) {
return false; boolean bufferEncrypted = inputBuffer.isEncrypted(); waitingForKeys = shouldWaitForKeys(bufferEncrypted); if (waitingForKeys) {