private void processEndOfStream() throws ExoPlaybackException { outputStreamEnded = true; try { audioSink.playToEndOfStream(); } catch (AudioSink.WriteException e) { throw ExoPlaybackException.createForRenderer(e, getIndex()); } }
@Override public final int supportsFormat(Format format) throws ExoPlaybackException { try { return supportsFormat(mediaCodecSelector, drmSessionManager, format); } catch (DecoderQueryException e) { throw ExoPlaybackException.createForRenderer(e, getIndex()); } }
@Override protected void renderToEndOfStream() throws ExoPlaybackException { try { audioSink.playToEndOfStream(); } catch (AudioSink.WriteException e) { throw ExoPlaybackException.createForRenderer(e, getIndex()); } }
private boolean shouldWaitForKeys(boolean bufferEncrypted) throws ExoPlaybackException { if (drmSession == null || (!bufferEncrypted && playClearSamplesWithoutKeys)) { return false; } @DrmSession.State int drmSessionState = drmSession.getState(); if (drmSessionState == DrmSession.STATE_ERROR) { throw ExoPlaybackException.createForRenderer(drmSession.getError(), getIndex()); } return drmSessionState != DrmSession.STATE_OPENED_WITH_KEYS; }
private boolean shouldWaitForKeys(boolean bufferEncrypted) throws ExoPlaybackException { if (drmSession == null || (!bufferEncrypted && playClearSamplesWithoutKeys)) { return false; } @DrmSession.State int drmSessionState = drmSession.getState(); if (drmSessionState == DrmSession.STATE_ERROR) { throw ExoPlaybackException.createForRenderer(drmSession.getError(), getIndex()); } return drmSessionState != DrmSession.STATE_OPENED_WITH_KEYS; }
private boolean shouldWaitForKeys(boolean bufferEncrypted) throws ExoPlaybackException { if (drmSession == null || (!bufferEncrypted && playClearSamplesWithoutKeys)) { return false; } @DrmSession.State int drmSessionState = drmSession.getState(); if (drmSessionState == DrmSession.STATE_ERROR) { throw ExoPlaybackException.createForRenderer(drmSession.getError(), getIndex()); } return drmSessionState != DrmSession.STATE_OPENED_WITH_KEYS; }
if (format.drmInitData != null) { if (drmSessionManager == null) { throw ExoPlaybackException.createForRenderer( new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
if (inputFormat.drmInitData != null) { if (drmSessionManager == null) { throw ExoPlaybackException.createForRenderer( new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
decoderCounters.decoderInitCount++; } catch (AudioDecoderException e) { throw ExoPlaybackException.createForRenderer(e, getIndex());
if (format.drmInitData != null) { if (drmSessionManager == null) { throw ExoPlaybackException.createForRenderer( new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
decoderCounters.decoderInitCount++; } catch (VpxDecoderException e) { throw ExoPlaybackException.createForRenderer(e, getIndex());
@Override protected void onOutputFormatChanged(MediaCodec codec, MediaFormat outputFormat) throws ExoPlaybackException { @C.Encoding int encoding; MediaFormat format; if (passthroughMediaFormat != null) { encoding = MimeTypes.getEncoding(passthroughMediaFormat.getString(MediaFormat.KEY_MIME)); format = passthroughMediaFormat; } else { encoding = pcmEncoding; format = outputFormat; } int channelCount = format.getInteger(MediaFormat.KEY_CHANNEL_COUNT); int sampleRate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE); int[] channelMap; if (codecNeedsDiscardChannelsWorkaround && channelCount == 6 && this.channelCount < 6) { channelMap = new int[this.channelCount]; for (int i = 0; i < this.channelCount; i++) { channelMap[i] = i; } } else { channelMap = null; } try { audioSink.configure(encoding, channelCount, sampleRate, 0, channelMap, encoderDelay, encoderPadding); } catch (AudioSink.ConfigurationException e) { throw ExoPlaybackException.createForRenderer(e, getIndex()); } }
throw ExoPlaybackException.createForRenderer(e, getIndex());
audioSink.playToEndOfStream(); } catch (AudioSink.WriteException e) { throw ExoPlaybackException.createForRenderer(e, getIndex()); } catch (AudioDecoderException | AudioSink.ConfigurationException | AudioSink.InitializationException | AudioSink.WriteException e) { throw ExoPlaybackException.createForRenderer(e, getIndex());
throw ExoPlaybackException.createForRenderer(e, getIndex()); decoderCounters.inputBufferCount++; } catch (CryptoException e) { throw ExoPlaybackException.createForRenderer(e, getIndex());
@DrmSession.State int drmSessionState = drmSession.getState(); if (drmSessionState == DrmSession.STATE_ERROR) { throw ExoPlaybackException.createForRenderer(drmSession.getError(), getIndex()); } else if (drmSessionState != DrmSession.STATE_OPENED_WITH_KEYS) { throw ExoPlaybackException.createForRenderer(e, getIndex());
TraceUtil.endSection(); } catch (VpxDecoderException e) { throw ExoPlaybackException.createForRenderer(e, getIndex());
nextSubtitle = decoder.dequeueOutputBuffer(); } catch (SubtitleDecoderException e) { throw ExoPlaybackException.createForRenderer(e, getIndex()); throw ExoPlaybackException.createForRenderer(e, getIndex());
private static ExoPlaybackException createRenderer(Exception exception) { return ExoPlaybackException.createForRenderer(exception, 0); }