mirror of
https://github.com/samsonjs/media.git
synced 2026-04-01 10:35:48 +00:00
Transformer: Update TODOs to use new bug link
PiperOrigin-RevId: 524349341
This commit is contained in:
parent
eadb78e52a
commit
0e85491d4e
5 changed files with 5 additions and 35 deletions
|
|
@ -455,8 +455,6 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
|
|||
throws GlUtil.GlException, VideoFrameProcessingException {
|
||||
checkState(Thread.currentThread().getName().equals(THREAD_NAME));
|
||||
|
||||
// TODO(b/237674316): Delay initialization of things requiring the colorInfo, to
|
||||
// configure based on the color info from the decoder output media format instead.
|
||||
EGLDisplay eglDisplay = GlUtil.createEglDisplay();
|
||||
int[] configAttributes =
|
||||
ColorInfo.isTransferHdr(outputColorInfo)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ import androidx.annotation.Nullable;
|
|||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.media3.common.C;
|
||||
import androidx.media3.common.ColorInfo;
|
||||
import androidx.media3.common.Format;
|
||||
import androidx.media3.common.MimeTypes;
|
||||
import androidx.media3.common.util.Log;
|
||||
|
|
@ -342,21 +341,6 @@ public final class DefaultCodec implements Codec {
|
|||
if (outputBufferIndex < 0) {
|
||||
if (outputBufferIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
|
||||
outputFormat = convertToFormat(mediaCodec.getOutputFormat(), isDecoder);
|
||||
ColorInfo expectedColorInfo =
|
||||
isSdrToneMappingEnabled(configurationMediaFormat)
|
||||
? ColorInfo.SDR_BT709_LIMITED
|
||||
: configurationFormat.colorInfo;
|
||||
if (!areColorTransfersEqual(expectedColorInfo, outputFormat.colorInfo)) {
|
||||
// TODO(b/237674316): The container ColorInfo's transfer doesn't match the decoder output
|
||||
// MediaFormat, or we requested tone-mapping but it hasn't been applied. We should
|
||||
// reconfigure downstream components for this case instead.
|
||||
Log.w(
|
||||
TAG,
|
||||
"Codec output color format does not match configured color format. Expected: "
|
||||
+ expectedColorInfo
|
||||
+ ". Actual: "
|
||||
+ outputFormat.colorInfo);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -407,19 +391,6 @@ public final class DefaultCodec implements Codec {
|
|||
return ExportException.createForCodec(cause, errorCode, isVideo, isDecoder, codecDetails);
|
||||
}
|
||||
|
||||
private static boolean areColorTransfersEqual(
|
||||
@Nullable ColorInfo colorInfo1, @Nullable ColorInfo colorInfo2) {
|
||||
@C.ColorTransfer int transfer1 = C.COLOR_TRANSFER_SDR;
|
||||
if (colorInfo1 != null && colorInfo1.colorTransfer != Format.NO_VALUE) {
|
||||
transfer1 = colorInfo1.colorTransfer;
|
||||
}
|
||||
@C.ColorTransfer int transfer2 = C.COLOR_TRANSFER_SDR;
|
||||
if (colorInfo2 != null && colorInfo2.colorTransfer != Format.NO_VALUE) {
|
||||
transfer2 = colorInfo2.colorTransfer;
|
||||
}
|
||||
return transfer1 == transfer2;
|
||||
}
|
||||
|
||||
private static Format convertToFormat(MediaFormat mediaFormat, boolean isDecoder) {
|
||||
ImmutableList.Builder<byte[]> csdBuffers = new ImmutableList.Builder<>();
|
||||
int csdIndex = 0;
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
|
||||
if (shouldInitDecoder) {
|
||||
if (getProcessedTrackType(inputFormat.sampleMimeType) == C.TRACK_TYPE_VIDEO) {
|
||||
// TODO(b/237674316): Move surface creation out of video sampleConsumer. Init decoder and
|
||||
// TODO(b/278259383): Move surface creation out of video sampleConsumer. Init decoder and
|
||||
// get decoder output Format before init sampleConsumer.
|
||||
if (!ensureSampleConsumerInitialized()) {
|
||||
return false;
|
||||
|
|
@ -256,7 +256,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
}
|
||||
outputFormat = decoderOutputFormat;
|
||||
} else {
|
||||
// TODO(b/237674316): Move surface creation out of video sampleConsumer. Init decoder and
|
||||
// TODO(b/278259383): Move surface creation out of video sampleConsumer. Init decoder and
|
||||
// get decoderOutput Format before init sampleConsumer.
|
||||
outputFormat = inputFormat;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
|
||||
@Override
|
||||
protected void initDecoder(Format inputFormat) throws ExportException {
|
||||
// TODO(b/237674316): Move surface creation out of sampleConsumer. Init decoder before
|
||||
// TODO(b/278259383): Move surface creation out of sampleConsumer. Init decoder before
|
||||
// sampleConsumer.
|
||||
checkStateNotNull(sampleConsumer);
|
||||
boolean isDecoderToneMappingRequired =
|
||||
|
|
|
|||
|
|
@ -88,6 +88,8 @@ import org.checkerframework.dataflow.qual.Pure;
|
|||
DebugViewProvider debugViewProvider)
|
||||
throws ExportException {
|
||||
// TODO(b/262693177) Add tests for input format change.
|
||||
// TODO(b/278259383) Consider delaying configuration of VideoSamplePipeline to use the decoder
|
||||
// output format instead of the extractor output format, to match AudioSamplePipeline behavior.
|
||||
super(firstInputFormat, muxerWrapper);
|
||||
|
||||
mediaItemOffsetUs = new AtomicLong();
|
||||
|
|
@ -384,7 +386,6 @@ import org.checkerframework.dataflow.qual.Pure;
|
|||
if (isInputToneMapped) {
|
||||
// When tone-mapping HDR to SDR is enabled, assume we get BT.709 to avoid having the encoder
|
||||
// populate default color info, which depends on the resolution.
|
||||
// TODO(b/237674316): Get the color info from the decoder output media format instead.
|
||||
return ColorInfo.SDR_BT709_LIMITED;
|
||||
}
|
||||
if (inputFormat.colorInfo == null) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue