use of com.google.android.exoplayer2.decoder.DecoderReuseEvaluation in project ExoPlayer by google.
the class MediaCodecInfoTest method canKeepCodec_withResolutionChange_adaptiveCodec_returnsYesWithReconfiguration.
@Test
public void canKeepCodec_withResolutionChange_adaptiveCodec_returnsYesWithReconfiguration() {
MediaCodecInfo codecInfo = buildH264CodecInfo(/* adaptive= */
true);
assertThat(codecInfo.canReuseCodec(FORMAT_H264_HD, FORMAT_H264_4K)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, FORMAT_H264_HD, FORMAT_H264_4K, REUSE_RESULT_YES_WITH_RECONFIGURATION, /* discardReasons= */
0));
}
use of com.google.android.exoplayer2.decoder.DecoderReuseEvaluation in project ExoPlayer by google.
the class MediaCodecInfoTest method canKeepCodec_audioWithDifferentInitializationData_returnsNo.
@Test
public void canKeepCodec_audioWithDifferentInitializationData_returnsNo() {
MediaCodecInfo codecInfo = buildAacCodecInfo();
Format stereoVariantFormat = FORMAT_AAC_STEREO.buildUpon().setInitializationData(ImmutableList.of(new byte[] { 0 })).build();
assertThat(codecInfo.canReuseCodec(FORMAT_AAC_STEREO, stereoVariantFormat)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, FORMAT_AAC_STEREO, stereoVariantFormat, REUSE_RESULT_NO, DISCARD_REASON_INITIALIZATION_DATA_CHANGED));
}
use of com.google.android.exoplayer2.decoder.DecoderReuseEvaluation in project ExoPlayer by google.
the class MediaCodecInfoTest method canKeepCodec_audioWithSameChannelCounts_returnsYesWithFlush.
@Test
public void canKeepCodec_audioWithSameChannelCounts_returnsYesWithFlush() {
MediaCodecInfo codecInfo = buildAacCodecInfo();
Format stereoVariantFormat = FORMAT_AAC_STEREO.buildUpon().setAverageBitrate(100).build();
assertThat(codecInfo.canReuseCodec(FORMAT_AAC_STEREO, stereoVariantFormat)).isEqualTo(new DecoderReuseEvaluation(codecInfo.name, FORMAT_AAC_STEREO, stereoVariantFormat, REUSE_RESULT_YES_WITH_FLUSH, /* discardReasons= */
0));
}
use of com.google.android.exoplayer2.decoder.DecoderReuseEvaluation in project ExoPlayer by google.
the class DefaultAnalyticsCollector method onVideoInputFormatChanged.
@Override
// Calling deprecated listener method.
@SuppressWarnings("deprecation")
public final void onVideoInputFormatChanged(Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation) {
EventTime eventTime = generateReadingMediaPeriodEventTime();
sendEvent(eventTime, AnalyticsListener.EVENT_VIDEO_INPUT_FORMAT_CHANGED, listener -> {
listener.onVideoInputFormatChanged(eventTime, format);
listener.onVideoInputFormatChanged(eventTime, format, decoderReuseEvaluation);
listener.onDecoderInputFormatChanged(eventTime, C.TRACK_TYPE_VIDEO, format);
});
}
use of com.google.android.exoplayer2.decoder.DecoderReuseEvaluation in project ExoPlayer by google.
the class DefaultAnalyticsCollector method onAudioInputFormatChanged.
// Calling deprecated listener method.
@SuppressWarnings("deprecation")
@Override
public final void onAudioInputFormatChanged(Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation) {
EventTime eventTime = generateReadingMediaPeriodEventTime();
sendEvent(eventTime, AnalyticsListener.EVENT_AUDIO_INPUT_FORMAT_CHANGED, listener -> {
listener.onAudioInputFormatChanged(eventTime, format);
listener.onAudioInputFormatChanged(eventTime, format, decoderReuseEvaluation);
listener.onDecoderInputFormatChanged(eventTime, C.TRACK_TYPE_AUDIO, format);
});
}
Aggregations