@Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); audioRenderer = new SimpleDecoderAudioRenderer(null, null, null, false, mockAudioSink) { @Override protected int supportsFormatInternal(DrmSessionManager<ExoMediaCrypto> drmSessionManager, Format format) { return FORMAT_HANDLED; } @Override protected SimpleDecoder<DecoderInputBuffer, ? extends SimpleOutputBuffer, ? extends AudioDecoderException> createDecoder(Format format, ExoMediaCrypto mediaCrypto) throws AudioDecoderException { return new FakeDecoder(); } }; }
/** * Creates a decoder for the given format. * * @param format The format for which a decoder is required. * @param mediaCrypto The {@link ExoMediaCrypto} object required for decoding encrypted content. * Maybe null and can be ignored if decoder does not handle encrypted content. * @return The decoder. * @throws AudioDecoderException If an error occurred creating a suitable decoder. */ protected abstract SimpleDecoder<DecoderInputBuffer, ? extends SimpleOutputBuffer, ? extends AudioDecoderException> createDecoder(Format format, ExoMediaCrypto mediaCrypto) throws AudioDecoderException;
/** * Creates a decoder for the given format. * * @param format The format for which a decoder is required. * @return The decoder. * @throws AudioDecoderException If an error occurred creating a suitable decoder. */ protected abstract SimpleDecoder<DecoderInputBuffer, ? extends SimpleOutputBuffer, ? extends AudioDecoderException> createDecoder(Format format) throws AudioDecoderException;