Search in sources :

Example 1 with DecoderCounters

use of com.google.android.exoplayer2.decoder.DecoderCounters in project ExoPlayer by google.

the class DecoderAudioRenderer method onEnabled.

@Override
protected void onEnabled(boolean joining, boolean mayRenderStartOfStream) throws ExoPlaybackException {
    decoderCounters = new DecoderCounters();
    eventDispatcher.enabled(decoderCounters);
    if (getConfiguration().tunneling) {
        audioSink.enableTunnelingV21();
    } else {
        audioSink.disableTunneling();
    }
    audioSink.setPlayerId(getPlayerId());
}
Also used : DecoderCounters(com.google.android.exoplayer2.decoder.DecoderCounters)

Example 2 with DecoderCounters

use of com.google.android.exoplayer2.decoder.DecoderCounters in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onVideoDisabled.

@Override
// Calling deprecated listener method.
@SuppressWarnings("deprecation")
public final void onVideoDisabled(DecoderCounters counters) {
    EventTime eventTime = generatePlayingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_VIDEO_DISABLED, listener -> {
        listener.onVideoDisabled(eventTime, counters);
        listener.onDecoderDisabled(eventTime, C.TRACK_TYPE_VIDEO, counters);
    });
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 3 with DecoderCounters

use of com.google.android.exoplayer2.decoder.DecoderCounters in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onVideoEnabled.

// Video events.
@Override
// Calling deprecated listener method.
@SuppressWarnings("deprecation")
public final void onVideoEnabled(DecoderCounters counters) {
    EventTime eventTime = generateReadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_VIDEO_ENABLED, listener -> {
        listener.onVideoEnabled(eventTime, counters);
        listener.onDecoderEnabled(eventTime, C.TRACK_TYPE_VIDEO, counters);
    });
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 4 with DecoderCounters

use of com.google.android.exoplayer2.decoder.DecoderCounters in project ExoPlayer by google.

the class DefaultAnalyticsCollector method onAudioEnabled.

// Audio events.
// Calling deprecated listener method.
@SuppressWarnings("deprecation")
@Override
public final void onAudioEnabled(DecoderCounters counters) {
    EventTime eventTime = generateReadingMediaPeriodEventTime();
    sendEvent(eventTime, AnalyticsListener.EVENT_AUDIO_ENABLED, listener -> {
        listener.onAudioEnabled(eventTime, counters);
        listener.onDecoderEnabled(eventTime, C.TRACK_TYPE_AUDIO, counters);
    });
}
Also used : EventTime(com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)

Example 5 with DecoderCounters

use of com.google.android.exoplayer2.decoder.DecoderCounters in project ExoPlayer by google.

the class DecoderVideoRenderer method onEnabled.

// Protected methods.
@Override
protected void onEnabled(boolean joining, boolean mayRenderStartOfStream) throws ExoPlaybackException {
    decoderCounters = new DecoderCounters();
    eventDispatcher.enabled(decoderCounters);
    mayRenderFirstFrameAfterEnableIfNotStarted = mayRenderStartOfStream;
    renderedFirstFrameAfterEnable = false;
}
Also used : DecoderCounters(com.google.android.exoplayer2.decoder.DecoderCounters)

Aggregations

DecoderCounters (com.google.android.exoplayer2.decoder.DecoderCounters)8 Format (com.google.android.exoplayer2.Format)4 EventTime (com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)4 SurfaceTexture (android.graphics.SurfaceTexture)1 Looper (android.os.Looper)1 SparseArray (android.util.SparseArray)1 Surface (android.view.Surface)1 Nullable (androidx.annotation.Nullable)1 ApplicationProvider (androidx.test.core.app.ApplicationProvider)1 AndroidJUnit4 (androidx.test.ext.junit.runners.AndroidJUnit4)1 C (com.google.android.exoplayer2.C)1 ExoPlaybackException (com.google.android.exoplayer2.ExoPlaybackException)1 ExoPlayer (com.google.android.exoplayer2.ExoPlayer)1 MediaItem (com.google.android.exoplayer2.MediaItem)1 PlaybackException (com.google.android.exoplayer2.PlaybackException)1 PlaybackParameters (com.google.android.exoplayer2.PlaybackParameters)1 Player (com.google.android.exoplayer2.Player)1 Renderer (com.google.android.exoplayer2.Renderer)1 RenderersFactory (com.google.android.exoplayer2.RenderersFactory)1 Timeline (com.google.android.exoplayer2.Timeline)1