Rename format to mediaFormat for clarity.

PiperOrigin-RevId: 276036585
This commit is contained in:
samrobinson 2019-10-22 12:08:08 +01:00 committed by Oliver Woodman
parent 101746934f
commit 82d3e1e8ab

View File

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