Add debug trace log for AssetLoader Renderer format events.
PiperOrigin-RevId: 634474584
This commit is contained in:
parent
2ac8247cf4
commit
1abcf5c22c
@ -126,11 +126,11 @@ public final class DebugTraceUtil {
|
|||||||
@Documented
|
@Documented
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@StringDef({
|
@StringDef({
|
||||||
|
COMPONENT_ASSET_LOADER,
|
||||||
COMPONENT_AUDIO_DECODER,
|
COMPONENT_AUDIO_DECODER,
|
||||||
COMPONENT_AUDIO_GRAPH,
|
COMPONENT_AUDIO_GRAPH,
|
||||||
COMPONENT_AUDIO_MIXER,
|
COMPONENT_AUDIO_MIXER,
|
||||||
COMPONENT_AUDIO_ENCODER,
|
COMPONENT_AUDIO_ENCODER,
|
||||||
COMPONENT_VIDEO,
|
|
||||||
COMPONENT_VIDEO_DECODER,
|
COMPONENT_VIDEO_DECODER,
|
||||||
COMPONENT_VFP,
|
COMPONENT_VFP,
|
||||||
COMPONENT_BITMAP_TEXTURE_MANAGER,
|
COMPONENT_BITMAP_TEXTURE_MANAGER,
|
||||||
@ -143,9 +143,7 @@ public final class DebugTraceUtil {
|
|||||||
@Target(TYPE_USE)
|
@Target(TYPE_USE)
|
||||||
public @interface Component {}
|
public @interface Component {}
|
||||||
|
|
||||||
// TODO - b/339639306: Migrate COMPONENT_VIDEO usage to COMPONENT_ASSETLOADER.
|
public static final String COMPONENT_ASSET_LOADER = "AssetLoader";
|
||||||
public static final String COMPONENT_VIDEO = "Video";
|
|
||||||
|
|
||||||
public static final String COMPONENT_AUDIO_DECODER = "AudioDecoder";
|
public static final String COMPONENT_AUDIO_DECODER = "AudioDecoder";
|
||||||
public static final String COMPONENT_AUDIO_GRAPH = "AudioGraph";
|
public static final String COMPONENT_AUDIO_GRAPH = "AudioGraph";
|
||||||
public static final String COMPONENT_AUDIO_MIXER = "AudioMixer";
|
public static final String COMPONENT_AUDIO_MIXER = "AudioMixer";
|
||||||
@ -162,6 +160,7 @@ public final class DebugTraceUtil {
|
|||||||
// For a given component, events are in the rough expected order that they occur.
|
// For a given component, events are in the rough expected order that they occur.
|
||||||
private static final ImmutableMap<@Component String, List<@Event String>> COMPONENTS_TO_EVENTS =
|
private static final ImmutableMap<@Component String, List<@Event String>> COMPONENTS_TO_EVENTS =
|
||||||
ImmutableMap.<String, List<String>>builder()
|
ImmutableMap.<String, List<String>>builder()
|
||||||
|
.put(COMPONENT_ASSET_LOADER, ImmutableList.of(EVENT_INPUT_FORMAT, EVENT_OUTPUT_FORMAT))
|
||||||
.put(
|
.put(
|
||||||
COMPONENT_AUDIO_DECODER,
|
COMPONENT_AUDIO_DECODER,
|
||||||
ImmutableList.of(
|
ImmutableList.of(
|
||||||
@ -187,7 +186,6 @@ public final class DebugTraceUtil {
|
|||||||
EVENT_PRODUCED_OUTPUT,
|
EVENT_PRODUCED_OUTPUT,
|
||||||
EVENT_INPUT_ENDED,
|
EVENT_INPUT_ENDED,
|
||||||
EVENT_OUTPUT_ENDED))
|
EVENT_OUTPUT_ENDED))
|
||||||
.put(COMPONENT_VIDEO, ImmutableList.of(EVENT_INPUT_FORMAT))
|
|
||||||
.put(
|
.put(
|
||||||
COMPONENT_VIDEO_DECODER,
|
COMPONENT_VIDEO_DECODER,
|
||||||
ImmutableList.of(
|
ImmutableList.of(
|
||||||
|
@ -17,8 +17,6 @@ package androidx.media3.transformer;
|
|||||||
|
|
||||||
import static androidx.media3.common.util.Assertions.checkNotNull;
|
import static androidx.media3.common.util.Assertions.checkNotNull;
|
||||||
import static androidx.media3.common.util.Assertions.checkStateNotNull;
|
import static androidx.media3.common.util.Assertions.checkStateNotNull;
|
||||||
import static androidx.media3.effect.DebugTraceUtil.COMPONENT_VIDEO;
|
|
||||||
import static androidx.media3.effect.DebugTraceUtil.EVENT_INPUT_FORMAT;
|
|
||||||
import static androidx.media3.transformer.TransformerUtil.getDecoderOutputColor;
|
import static androidx.media3.transformer.TransformerUtil.getDecoderOutputColor;
|
||||||
|
|
||||||
import android.media.MediaCodec;
|
import android.media.MediaCodec;
|
||||||
@ -27,7 +25,6 @@ import androidx.media3.common.C;
|
|||||||
import androidx.media3.common.ColorInfo;
|
import androidx.media3.common.ColorInfo;
|
||||||
import androidx.media3.common.Format;
|
import androidx.media3.common.Format;
|
||||||
import androidx.media3.decoder.DecoderInputBuffer;
|
import androidx.media3.decoder.DecoderInputBuffer;
|
||||||
import androidx.media3.effect.DebugTraceUtil;
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -87,12 +84,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onInputFormatRead(Format inputFormat) {
|
protected void onInputFormatRead(Format inputFormat) {
|
||||||
DebugTraceUtil.logEvent(
|
|
||||||
COMPONENT_VIDEO,
|
|
||||||
EVENT_INPUT_FORMAT,
|
|
||||||
C.TIME_UNSET,
|
|
||||||
/* extraFormat= */ "%s",
|
|
||||||
/* extraArgs...= */ inputFormat);
|
|
||||||
if (flattenForSlowMotion) {
|
if (flattenForSlowMotion) {
|
||||||
sefVideoSlowMotionFlattener = new SefSlowMotionFlattener(inputFormat);
|
sefVideoSlowMotionFlattener = new SefSlowMotionFlattener(inputFormat);
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,9 @@ import static androidx.media3.common.util.Assertions.checkArgument;
|
|||||||
import static androidx.media3.common.util.Assertions.checkNotNull;
|
import static androidx.media3.common.util.Assertions.checkNotNull;
|
||||||
import static androidx.media3.common.util.Assertions.checkState;
|
import static androidx.media3.common.util.Assertions.checkState;
|
||||||
import static androidx.media3.common.util.Assertions.checkStateNotNull;
|
import static androidx.media3.common.util.Assertions.checkStateNotNull;
|
||||||
|
import static androidx.media3.effect.DebugTraceUtil.COMPONENT_ASSET_LOADER;
|
||||||
|
import static androidx.media3.effect.DebugTraceUtil.EVENT_INPUT_FORMAT;
|
||||||
|
import static androidx.media3.effect.DebugTraceUtil.EVENT_OUTPUT_FORMAT;
|
||||||
import static androidx.media3.transformer.Transformer.PROGRESS_STATE_AVAILABLE;
|
import static androidx.media3.transformer.Transformer.PROGRESS_STATE_AVAILABLE;
|
||||||
import static androidx.media3.transformer.Transformer.PROGRESS_STATE_NOT_STARTED;
|
import static androidx.media3.transformer.Transformer.PROGRESS_STATE_NOT_STARTED;
|
||||||
import static androidx.media3.transformer.TransformerUtil.getProcessedTrackType;
|
import static androidx.media3.transformer.TransformerUtil.getProcessedTrackType;
|
||||||
@ -37,6 +40,7 @@ import androidx.media3.common.util.HandlerWrapper;
|
|||||||
import androidx.media3.common.util.TimestampIterator;
|
import androidx.media3.common.util.TimestampIterator;
|
||||||
import androidx.media3.common.util.Util;
|
import androidx.media3.common.util.Util;
|
||||||
import androidx.media3.decoder.DecoderInputBuffer;
|
import androidx.media3.decoder.DecoderInputBuffer;
|
||||||
|
import androidx.media3.effect.DebugTraceUtil;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -215,6 +219,14 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
@Override
|
@Override
|
||||||
public boolean onTrackAdded(Format inputFormat, @SupportedOutputTypes int supportedOutputTypes) {
|
public boolean onTrackAdded(Format inputFormat, @SupportedOutputTypes int supportedOutputTypes) {
|
||||||
boolean isAudio = getProcessedTrackType(inputFormat.sampleMimeType) == C.TRACK_TYPE_AUDIO;
|
boolean isAudio = getProcessedTrackType(inputFormat.sampleMimeType) == C.TRACK_TYPE_AUDIO;
|
||||||
|
DebugTraceUtil.logEvent(
|
||||||
|
COMPONENT_ASSET_LOADER,
|
||||||
|
EVENT_INPUT_FORMAT,
|
||||||
|
C.TIME_UNSET,
|
||||||
|
"%s:%s",
|
||||||
|
isAudio ? "audio" : "video",
|
||||||
|
inputFormat);
|
||||||
|
|
||||||
if (!isCurrentAssetFirstAsset) {
|
if (!isCurrentAssetFirstAsset) {
|
||||||
return isAudio ? decodeAudio : decodeVideo;
|
return isAudio ? decodeAudio : decodeVideo;
|
||||||
}
|
}
|
||||||
@ -249,6 +261,14 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
@Override
|
@Override
|
||||||
public SampleConsumerWrapper onOutputFormat(Format format) throws ExportException {
|
public SampleConsumerWrapper onOutputFormat(Format format) throws ExportException {
|
||||||
@C.TrackType int trackType = getProcessedTrackType(format.sampleMimeType);
|
@C.TrackType int trackType = getProcessedTrackType(format.sampleMimeType);
|
||||||
|
DebugTraceUtil.logEvent(
|
||||||
|
COMPONENT_ASSET_LOADER,
|
||||||
|
EVENT_OUTPUT_FORMAT,
|
||||||
|
C.TIME_UNSET,
|
||||||
|
"%s:%s",
|
||||||
|
Util.getTrackTypeString(trackType),
|
||||||
|
format);
|
||||||
|
|
||||||
SampleConsumerWrapper sampleConsumer;
|
SampleConsumerWrapper sampleConsumer;
|
||||||
if (isCurrentAssetFirstAsset) {
|
if (isCurrentAssetFirstAsset) {
|
||||||
@Nullable
|
@Nullable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user