From 82d3e1e8ab858c287624467e22c7514b6c9939a4 Mon Sep 17 00:00:00 2001 From: samrobinson Date: Tue, 22 Oct 2019 12:08:08 +0100 Subject: [PATCH] Rename format to mediaFormat for clarity. PiperOrigin-RevId: 276036585 --- .../mediacodec/MediaCodecRenderer.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java index 211fc13ea5..b7d753ec3b 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java @@ -1273,11 +1273,11 @@ public abstract class MediaCodecRenderer extends BaseRenderer { /** * Called when the output format of the {@link MediaCodec} changes. - *

- * The default implementation is a no-op. + * + *

The default implementation is a no-op. * * @param codec The {@link MediaCodec} instance. - * @param outputFormat The new output format. + * @param outputFormat The new output MediaFormat. * @throws ExoPlaybackException Thrown if an error occurs handling the new output format. */ protected void onOutputFormatChanged(MediaCodec codec, MediaFormat outputFormat) @@ -1570,22 +1570,21 @@ public abstract class MediaCodecRenderer extends BaseRenderer { return false; } - /** - * Processes a new output format. - */ + /** Processes a new output {@link MediaFormat}. */ private void processOutputFormat() throws ExoPlaybackException { - MediaFormat format = codec.getOutputFormat(); + MediaFormat mediaFormat = codec.getOutputFormat(); if (codecAdaptationWorkaroundMode != ADAPTATION_WORKAROUND_MODE_NEVER - && format.getInteger(MediaFormat.KEY_WIDTH) == ADAPTATION_WORKAROUND_SLICE_WIDTH_HEIGHT - && format.getInteger(MediaFormat.KEY_HEIGHT) == ADAPTATION_WORKAROUND_SLICE_WIDTH_HEIGHT) { + && mediaFormat.getInteger(MediaFormat.KEY_WIDTH) == ADAPTATION_WORKAROUND_SLICE_WIDTH_HEIGHT + && mediaFormat.getInteger(MediaFormat.KEY_HEIGHT) + == ADAPTATION_WORKAROUND_SLICE_WIDTH_HEIGHT) { // We assume this format changed event was caused by the adaptation workaround. shouldSkipAdaptationWorkaroundOutputBuffer = true; return; } if (codecNeedsMonoChannelCountWorkaround) { - format.setInteger(MediaFormat.KEY_CHANNEL_COUNT, 1); + mediaFormat.setInteger(MediaFormat.KEY_CHANNEL_COUNT, 1); } - onOutputFormatChanged(codec, format); + onOutputFormatChanged(codec, mediaFormat); } /**