com.google.android.exoplayer2.audio.AudioProcessor Java Examples

The following examples show how to use com.google.android.exoplayer2.audio.AudioProcessor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExoplayerAudioRenderer.java    From lbry-android with MIT License 6 votes vote down vote up
@Override
protected void buildAudioRenderers(
        Context context,
        int extensionRendererMode,
        MediaCodecSelector mediaCodecSelector,
        @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
        boolean playClearSamplesWithoutKeys,
        boolean enableDecoderFallback,
        AudioProcessor[] audioProcessors,
        Handler eventHandler,
        AudioRendererEventListener eventListener,
        ArrayList<Renderer> out) {
    AudioProcessor[] audioProcessorList = { new TeeAudioProcessor(audioBufferSink) };
    super.buildAudioRenderers(
            context,
            extensionRendererMode,
            mediaCodecSelector,
            drmSessionManager,
            playClearSamplesWithoutKeys,
            enableDecoderFallback,
            audioProcessorList,
            eventHandler,
            eventListener,
            out);
}
 
Example #2
Source File: LibopusAudioRenderer.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibopusAudioRenderer(
    Handler eventHandler,
    AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, audioProcessors);
}
 
Example #3
Source File: SonicMediaCodecAudioRenderer.java    From K-Sonic with MIT License 5 votes vote down vote up
public SonicMediaCodecAudioRenderer(MediaCodecSelector mediaCodecSelector,
    DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    boolean playClearSamplesWithoutKeys, Handler eventHandler,
    AudioRendererEventListener eventListener, AudioCapabilities audioCapabilities,
    AudioProcessor... audioProcessors) {
  super(mediaCodecSelector, drmSessionManager, playClearSamplesWithoutKeys, eventHandler, eventListener, audioCapabilities, audioProcessors);
  //Init
  bufferIndex = -1;
  speed = 1.0f;
  pitch = 1.0f;
  rate = 1.0f;
}
 
Example #4
Source File: RendererErrorMapper.java    From no-player with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({"PMD.StdCyclomaticComplexity", "PMD.CyclomaticComplexity", "PMD.ModifiedCyclomaticComplexity", "PMD.NPathComplexity"})
static NoPlayer.PlayerError map(Exception rendererException, String message) {
    if (rendererException instanceof AudioSink.ConfigurationException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.AUDIO_SINK_CONFIGURATION_ERROR, message);
    }

    if (rendererException instanceof AudioSink.InitializationException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.AUDIO_SINK_INITIALISATION_ERROR, message);
    }

    if (rendererException instanceof AudioSink.WriteException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.AUDIO_SINK_WRITE_ERROR, message);
    }

    if (rendererException instanceof AudioProcessor.UnhandledFormatException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.AUDIO_UNHANDLED_FORMAT_ERROR, message);
    }

    if (rendererException instanceof AudioDecoderException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.AUDIO_DECODER_ERROR, message);
    }

    if (rendererException instanceof MediaCodecRenderer.DecoderInitializationException) {
        MediaCodecRenderer.DecoderInitializationException decoderInitializationException =
                (MediaCodecRenderer.DecoderInitializationException) rendererException;
        String fullMessage = "decoder-name:" + decoderInitializationException.decoderName + ", "
                + "mimetype:" + decoderInitializationException.mimeType + ", "
                + "secureCodeRequired:" + decoderInitializationException.secureDecoderRequired + ", "
                + "diagnosticInfo:" + decoderInitializationException.diagnosticInfo + ", "
                + "exceptionMessage:" + message;
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.INITIALISATION_ERROR, fullMessage);
    }

    if (rendererException instanceof MediaCodecUtil.DecoderQueryException) {
        return new NoPlayerError(PlayerErrorType.DEVICE_MEDIA_CAPABILITIES, DetailErrorType.UNKNOWN, message);
    }

    if (rendererException instanceof SubtitleDecoderException) {
        return new NoPlayerError(PlayerErrorType.RENDERER_DECODER, DetailErrorType.DECODING_SUBTITLE_ERROR, message);
    }

    if (rendererException instanceof UnsupportedDrmException) {
        return mapUnsupportedDrmException((UnsupportedDrmException) rendererException, message);
    }

    if (rendererException instanceof DefaultDrmSessionManager.MissingSchemeDataException) {
        return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.CANNOT_ACQUIRE_DRM_SESSION_MISSING_SCHEME_FOR_REQUIRED_UUID_ERROR, message);
    }

    if (rendererException instanceof DrmSession.DrmSessionException) {
        return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.DRM_SESSION_ERROR, message);
    }

    if (rendererException instanceof KeysExpiredException) {
        return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.DRM_KEYS_EXPIRED_ERROR, message);
    }

    if (rendererException instanceof DecryptionException) {
        return new NoPlayerError(PlayerErrorType.CONTENT_DECRYPTION, DetailErrorType.FAIL_DECRYPT_DATA_DUE_NON_PLATFORM_COMPONENT_ERROR, message);
    }

    if (rendererException instanceof MediaCodec.CryptoException) {
        return mapCryptoException((MediaCodec.CryptoException) rendererException, message);
    }

    if (rendererException instanceof IllegalStateException) {
        return new NoPlayerError(PlayerErrorType.DRM, DetailErrorType.MEDIA_REQUIRES_DRM_SESSION_MANAGER_ERROR, message);
    }

    return new NoPlayerError(PlayerErrorType.UNKNOWN, DetailErrorType.UNKNOWN, message);
}
 
Example #5
Source File: SoftAudioRenderer.java    From DanDanPlayForAndroid with MIT License 5 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public SoftAudioRenderer(
    @Nullable Handler eventHandler,
    @Nullable AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  this(
      eventHandler,
      eventListener,
      new DefaultAudioSink(/* audioCapabilities= */ null, audioProcessors),
      /* enableFloatOutput= */ false);
}
 
Example #6
Source File: FfmpegAudioRenderer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public FfmpegAudioRenderer(
    @Nullable Handler eventHandler,
    @Nullable AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  this(
      eventHandler,
      eventListener,
      new DefaultAudioSink(/* audioCapabilities= */ null, audioProcessors),
      /* enableFloatOutput= */ false);
}
 
Example #7
Source File: LibflacAudioRenderer.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibflacAudioRenderer(
    Handler eventHandler,
    AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, audioProcessors);
}
 
Example #8
Source File: FfmpegAudioRenderer.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public FfmpegAudioRenderer(
    @Nullable Handler eventHandler,
    @Nullable AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  this(
      eventHandler,
      eventListener,
      new DefaultAudioSink(/* audioCapabilities= */ null, audioProcessors),
      /* enableFloatOutput= */ false);
}
 
Example #9
Source File: FfmpegAudioRenderer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public FfmpegAudioRenderer(
    @Nullable Handler eventHandler,
    @Nullable AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  this(
      eventHandler,
      eventListener,
      new DefaultAudioSink(/* audioCapabilities= */ null, audioProcessors),
      /* enableFloatOutput= */ false);
}
 
Example #10
Source File: LibopusAudioRenderer.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibopusAudioRenderer(
    Handler eventHandler,
    AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, audioProcessors);
}
 
Example #11
Source File: LibflacAudioRenderer.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibflacAudioRenderer(
    Handler eventHandler,
    AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, audioProcessors);
}
 
Example #12
Source File: FfmpegAudioRenderer.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public FfmpegAudioRenderer(
    @Nullable Handler eventHandler,
    @Nullable AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  this(
      eventHandler,
      eventListener,
      new DefaultAudioSink(/* audioCapabilities= */ null, audioProcessors),
      /* enableFloatOutput= */ false);
}
 
Example #13
Source File: VideoPlayer.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void buildAudioRenderers(Context context, int extensionRendererMode, MediaCodecSelector mediaCodecSelector, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, boolean playClearSamplesWithoutKeys, boolean enableDecoderFallback, AudioProcessor[] audioProcessors, Handler eventHandler, AudioRendererEventListener eventListener, ArrayList<Renderer> out) {
    AudioProcessor audioProcessor = new TeeAudioProcessor(new VisualizerBufferSink());
    super.buildAudioRenderers(context, extensionRendererMode, mediaCodecSelector, drmSessionManager, playClearSamplesWithoutKeys, enableDecoderFallback, new AudioProcessor[]{audioProcessor}, eventHandler, eventListener, out);
}
 
Example #14
Source File: SimpleRenderersFactory.java    From no-player with Apache License 2.0 4 votes vote down vote up
/**
 * Builds an array of {@link AudioProcessor}s that will process PCM audio before output.
 */
private AudioProcessor[] buildAudioProcessors() {
    return new AudioProcessor[0];
}
 
Example #15
Source File: DefaultRenderersFactory.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Builds an array of {@link AudioProcessor}s that will process PCM audio before output.
 */
protected AudioProcessor[] buildAudioProcessors() {
  return new AudioProcessor[0];
}
 
Example #16
Source File: VideoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void buildAudioRenderers(Context context, int extensionRendererMode, MediaCodecSelector mediaCodecSelector, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, boolean playClearSamplesWithoutKeys, boolean enableDecoderFallback, AudioProcessor[] audioProcessors, Handler eventHandler, AudioRendererEventListener eventListener, ArrayList<Renderer> out) {
    AudioProcessor audioProcessor = new TeeAudioProcessor(new VisualizerBufferSink());
    super.buildAudioRenderers(context, extensionRendererMode, mediaCodecSelector, drmSessionManager, playClearSamplesWithoutKeys, enableDecoderFallback, new AudioProcessor[]{audioProcessor}, eventHandler, eventListener, out);
}
 
Example #17
Source File: SimpleExoPlayer.java    From K-Sonic with MIT License 4 votes vote down vote up
/**
 * Builds an array of {@link AudioProcessor}s that will process PCM audio before output.
 */
protected AudioProcessor[] buildAudioProcessors() {
  return new AudioProcessor[0];
}
 
Example #18
Source File: DefaultRenderersFactory.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Builds an array of {@link AudioProcessor}s that will process PCM audio before output.
 */
protected AudioProcessor[] buildAudioProcessors() {
  return new AudioProcessor[0];
}
 
Example #19
Source File: ExoPlayerErrorMapperTest.java    From no-player with Apache License 2.0 4 votes vote down vote up
@Parameterized.Parameters(name = "{0} with detail {1} is mapped from {2}")
public static Collection<Object[]> parameters() {
    return Arrays.asList(
            new Object[]{SOURCE, SAMPLE_QUEUE_MAPPING_ERROR, createSource(new SampleQueueMappingException("mimetype-sample"))},
            new Object[]{SOURCE, READING_LOCAL_FILE_ERROR, createSource(new FileDataSource.FileDataSourceException(new IOException()))},
            new Object[]{SOURCE, UNEXPECTED_LOADING_ERROR, createSource(new Loader.UnexpectedLoaderException(new Throwable()))},
            new Object[]{SOURCE, LIVE_STALE_MANIFEST_AND_NEW_MANIFEST_COULD_NOT_LOAD_ERROR, createSource(new DashManifestStaleException())},
            new Object[]{SOURCE, DOWNLOAD_ERROR, createSource(new DownloadException("download-exception"))},
            new Object[]{SOURCE, AD_LOAD_ERROR_THEN_WILL_SKIP, createSource(AdsMediaSource.AdLoadException.createForAd(new Exception()))},
            new Object[]{SOURCE, AD_GROUP_LOAD_ERROR_THEN_WILL_SKIP, createSource(AdsMediaSource.AdLoadException.createForAdGroup(new Exception(), 0))},
            new Object[]{SOURCE, ALL_ADS_LOAD_ERROR_THEN_WILL_SKIP, createSource(AdsMediaSource.AdLoadException.createForAllAds(new Exception()))},
            new Object[]{SOURCE, ADS_LOAD_UNEXPECTED_ERROR_THEN_WILL_SKIP, createSource(AdsMediaSource.AdLoadException.createForUnexpected(new RuntimeException()))},
            new Object[]{SOURCE, MERGING_MEDIA_SOURCE_CANNOT_MERGE_ITS_SOURCES, createSource(new MergingMediaSource.IllegalMergeException(MergingMediaSource.IllegalMergeException.REASON_PERIOD_COUNT_MISMATCH))},
            new Object[]{SOURCE, CLIPPING_MEDIA_SOURCE_CANNOT_CLIP_WRAPPED_SOURCE_INVALID_PERIOD_COUNT, createSource(new ClippingMediaSource.IllegalClippingException(ClippingMediaSource.IllegalClippingException.REASON_INVALID_PERIOD_COUNT))},
            new Object[]{SOURCE, CLIPPING_MEDIA_SOURCE_CANNOT_CLIP_WRAPPED_SOURCE_NOT_SEEKABLE_TO_START, createSource(new ClippingMediaSource.IllegalClippingException(ClippingMediaSource.IllegalClippingException.REASON_NOT_SEEKABLE_TO_START))},
            new Object[]{SOURCE, CLIPPING_MEDIA_SOURCE_CANNOT_CLIP_WRAPPED_SOURCE_INVALID_PERIOD_COUNT, createSource(new ClippingMediaSource.IllegalClippingException(ClippingMediaSource.IllegalClippingException.REASON_INVALID_PERIOD_COUNT))},
            new Object[]{SOURCE, TASK_CANNOT_PROCEED_PRIORITY_TOO_LOW, createSource(new PriorityTaskManager.PriorityTooLowException(1, 2))},
            new Object[]{SOURCE, PARSING_MEDIA_DATA_OR_METADATA_ERROR, createSource(new ParserException())},
            new Object[]{SOURCE, CACHE_WRITING_DATA_ERROR, createSource(new Cache.CacheException("cache-exception"))},
            new Object[]{SOURCE, READ_LOCAL_ASSET_ERROR, createSource(new AssetDataSource.AssetDataSourceException(new IOException()))},
            new Object[]{SOURCE, DATA_POSITION_OUT_OF_RANGE_ERROR, createSource(new DataSourceException(DataSourceException.POSITION_OUT_OF_RANGE))},

            new Object[]{CONNECTIVITY, HTTP_CANNOT_OPEN_ERROR, createSource(new HttpDataSource.HttpDataSourceException(new DataSpec(Uri.EMPTY, 0), HttpDataSource.HttpDataSourceException.TYPE_OPEN))},
            new Object[]{CONNECTIVITY, HTTP_CANNOT_READ_ERROR, createSource(new HttpDataSource.HttpDataSourceException(new DataSpec(Uri.EMPTY, 0), HttpDataSource.HttpDataSourceException.TYPE_READ))},
            new Object[]{CONNECTIVITY, HTTP_CANNOT_CLOSE_ERROR, createSource(new HttpDataSource.HttpDataSourceException(new DataSpec(Uri.EMPTY, 0), HttpDataSource.HttpDataSourceException.TYPE_CLOSE))},
            new Object[]{CONNECTIVITY, READ_CONTENT_URI_ERROR, createSource(new ContentDataSource.ContentDataSourceException(new IOException()))},
            new Object[]{CONNECTIVITY, READ_FROM_UDP_ERROR, createSource(new UdpDataSource.UdpDataSourceException(new IOException()))},

            new Object[]{RENDERER_DECODER, AUDIO_SINK_CONFIGURATION_ERROR, createRenderer(new AudioSink.ConfigurationException("configuration-exception"))},
            new Object[]{RENDERER_DECODER, AUDIO_SINK_INITIALISATION_ERROR, createRenderer(new AudioSink.InitializationException(0, 0, 0, 0))},
            new Object[]{RENDERER_DECODER, AUDIO_SINK_WRITE_ERROR, createRenderer(new AudioSink.WriteException(0))},
            new Object[]{RENDERER_DECODER, AUDIO_UNHANDLED_FORMAT_ERROR, createRenderer(new AudioProcessor.UnhandledFormatException(0, 0, 0))},
            new Object[]{RENDERER_DECODER, AUDIO_DECODER_ERROR, createRenderer(new AudioDecoderException("audio-decoder-exception"))},
            new Object[]{RENDERER_DECODER, INITIALISATION_ERROR, createRenderer(new MediaCodecRenderer.DecoderInitializationException(Format.createSampleFormat("id", "sample-mimety[e", 0), new Throwable(), true, 0))},
            new Object[]{RENDERER_DECODER, DECODING_SUBTITLE_ERROR, createRenderer(new SubtitleDecoderException("metadata-decoder-exception"))},

            new Object[]{DRM, UNSUPPORTED_DRM_SCHEME_ERROR, createRenderer(new UnsupportedDrmException(UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME))},
            new Object[]{DRM, DRM_INSTANTIATION_ERROR, createRenderer(new UnsupportedDrmException(UnsupportedDrmException.REASON_INSTANTIATION_ERROR))},
            new Object[]{DRM, DRM_SESSION_ERROR, createRenderer(new DrmSession.DrmSessionException(new Throwable()))},
            new Object[]{DRM, DRM_KEYS_EXPIRED_ERROR, createRenderer(new KeysExpiredException())},
            new Object[]{DRM, MEDIA_REQUIRES_DRM_SESSION_MANAGER_ERROR, createRenderer(new IllegalStateException())},

            new Object[]{CONTENT_DECRYPTION, FAIL_DECRYPT_DATA_DUE_NON_PLATFORM_COMPONENT_ERROR, createRenderer(new DecryptionException(0, "decryption-exception"))},

            new Object[]{UNEXPECTED, MULTIPLE_RENDERER_MEDIA_CLOCK_ENABLED_ERROR, ExoPlaybackExceptionFactory.createForUnexpected(new IllegalStateException("Multiple renderer media clocks enabled."))},
            new Object[]{PlayerErrorType.UNKNOWN, DetailErrorType.UNKNOWN, ExoPlaybackExceptionFactory.createForUnexpected(new IllegalStateException("Any other exception"))}
            // DefaultAudioSink.InvalidAudioTrackTimestampException is private, cannot create
            // EGLSurfaceTexture.GlException is private, cannot create
            // PlaylistStuckException constructor is private, cannot create
            // PlaylistResetException constructor is private, cannot create
            // MediaCodecUtil.DecoderQueryException constructor is private, cannot create
            // DefaultDrmSessionManager.MissingSchemeDataException constructor is private, cannot create
            // Crypto Exceptions cannot be instantiated, it throws a RuntimeException("Stub!")
    );
}
 
Example #20
Source File: DefaultRenderersFactory.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
/**
 * Builds an array of {@link AudioProcessor}s that will process PCM audio before output.
 */
protected AudioProcessor[] buildAudioProcessors() {
  return new AudioProcessor[0];
}
 
Example #21
Source File: SimpleRendersFactory.java    From DanDanPlayForAndroid with MIT License 4 votes vote down vote up
@Override
protected void buildAudioRenderers(Context context, int extensionRendererMode, MediaCodecSelector mediaCodecSelector, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, boolean playClearSamplesWithoutKeys, AudioProcessor[] audioProcessors, Handler eventHandler, AudioRendererEventListener eventListener, ArrayList<Renderer> out) {
    out.add(new SoftAudioRenderer());
    super.buildAudioRenderers(context, extensionRendererMode, mediaCodecSelector, drmSessionManager, playClearSamplesWithoutKeys, audioProcessors, eventHandler, eventListener, out);
}
 
Example #22
Source File: DefaultRenderersFactory.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Builds an array of {@link AudioProcessor}s that will process PCM audio before output.
 */
protected AudioProcessor[] buildAudioProcessors() {
  return new AudioProcessor[0];
}
 
Example #23
Source File: MultiDrmRendererFactory.java    From ARVI with Apache License 2.0 4 votes vote down vote up
@Override
protected void buildAudioRenderers(Context context,
                                   int extensionRendererMode,
                                   MediaCodecSelector mediaCodecSelector,
                                   @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
                                   boolean playClearSamplesWithoutKeys,
                                   boolean enableDecoderFallback,
                                   AudioProcessor[] audioProcessors,
                                   Handler eventHandler,
                                   AudioRendererEventListener eventListener,
                                   ArrayList<Renderer> out) {
    final ArrayList<Renderer> localOut = new ArrayList<>();

    super.buildAudioRenderers(
        context,
        extensionRendererMode,
        mediaCodecSelector,
        drmSessionManager,
        playClearSamplesWithoutKeys,
        enableDecoderFallback,
        audioProcessors,
        eventHandler,
        eventListener,
        localOut
    );

    final Set<Renderer> outSet = new HashSet<>(localOut);

    if(!this.drmSessionManagers.isEmpty()) {
        localOut.clear();

        for(DrmSessionManager<FrameworkMediaCrypto> manager : this.drmSessionManagers) {
            super.buildAudioRenderers(
                context,
                EXTENSION_RENDERER_MODE_OFF,
                mediaCodecSelector,
                manager,
                playClearSamplesWithoutKeys,
                enableDecoderFallback,
                audioProcessors,
                eventHandler,
                eventListener,
                localOut
            );
        }

        outSet.addAll(localOut);
    }

    out.addAll(outSet);
}
 
Example #24
Source File: DefaultRenderersFactory.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Builds an array of {@link AudioProcessor}s that will process PCM audio before output.
 */
protected AudioProcessor[] buildAudioProcessors() {
  return new AudioProcessor[0];
}
 
Example #25
Source File: LibopusAudioRenderer.java    From TelePlus-Android with GNU General Public License v2.0 3 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param drmSessionManager For use with encrypted media. May be null if support for encrypted
 *     media is not required.
 * @param playClearSamplesWithoutKeys Encrypted media may contain clear (un-encrypted) regions.
 *     For example a media file may start with a short clear region so as to allow playback to
 *     begin in parallel with key acquisition. This parameter specifies whether the renderer is
 *     permitted to play clear regions of encrypted media files before {@code drmSessionManager}
 *     has obtained the keys necessary to decrypt encrypted regions of the media.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    DrmSessionManager<ExoMediaCrypto> drmSessionManager, boolean playClearSamplesWithoutKeys,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, null, drmSessionManager, playClearSamplesWithoutKeys,
      audioProcessors);
}
 
Example #26
Source File: LibopusAudioRenderer.java    From Telegram-FOSS with GNU General Public License v2.0 3 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param drmSessionManager For use with encrypted media. May be null if support for encrypted
 *     media is not required.
 * @param playClearSamplesWithoutKeys Encrypted media may contain clear (un-encrypted) regions.
 *     For example a media file may start with a short clear region so as to allow playback to
 *     begin in parallel with key acquisition. This parameter specifies whether the renderer is
 *     permitted to play clear regions of encrypted media files before {@code drmSessionManager}
 *     has obtained the keys necessary to decrypt encrypted regions of the media.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    DrmSessionManager<ExoMediaCrypto> drmSessionManager, boolean playClearSamplesWithoutKeys,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, null, drmSessionManager, playClearSamplesWithoutKeys,
      audioProcessors);
}
 
Example #27
Source File: LibopusAudioRenderer.java    From TelePlus-Android with GNU General Public License v2.0 3 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param drmSessionManager For use with encrypted media. May be null if support for encrypted
 *     media is not required.
 * @param playClearSamplesWithoutKeys Encrypted media may contain clear (un-encrypted) regions.
 *     For example a media file may start with a short clear region so as to allow playback to
 *     begin in parallel with key acquisition. This parameter specifies whether the renderer is
 *     permitted to play clear regions of encrypted media files before {@code drmSessionManager}
 *     has obtained the keys necessary to decrypt encrypted regions of the media.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    DrmSessionManager<ExoMediaCrypto> drmSessionManager, boolean playClearSamplesWithoutKeys,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, null, drmSessionManager, playClearSamplesWithoutKeys,
      audioProcessors);
}
 
Example #28
Source File: LibopusAudioRenderer.java    From Telegram with GNU General Public License v2.0 3 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param drmSessionManager For use with encrypted media. May be null if support for encrypted
 *     media is not required.
 * @param playClearSamplesWithoutKeys Encrypted media may contain clear (un-encrypted) regions.
 *     For example a media file may start with a short clear region so as to allow playback to
 *     begin in parallel with key acquisition. This parameter specifies whether the renderer is
 *     permitted to play clear regions of encrypted media files before {@code drmSessionManager}
 *     has obtained the keys necessary to decrypt encrypted regions of the media.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    DrmSessionManager<ExoMediaCrypto> drmSessionManager, boolean playClearSamplesWithoutKeys,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, null, drmSessionManager, playClearSamplesWithoutKeys,
      audioProcessors);
}
 
Example #29
Source File: LibflacAudioRenderer.java    From Jockey with Apache License 2.0 2 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibflacAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, audioProcessors);
}
 
Example #30
Source File: LibflacAudioRenderer.java    From TelePlus-Android with GNU General Public License v2.0 2 votes vote down vote up
/**
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibflacAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, audioProcessors);
}