DebugTraceUtil


@UnstableApi
public final class DebugTraceUtil


A debugging tracing utility. Debug logging is disabled at compile time by default.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@StringDef(value = )
@Target(value = TYPE_USE)
public annotation DebugTraceUtil.Component

Components logged by logEvent.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@StringDef(value = )
@Target(value = TYPE_USE)
public annotation DebugTraceUtil.Event

Events logged by logEvent.

Constants

static final String
COMPONENT_ASSET_LOADER = "AssetLoader"
static final String
COMPONENT_AUDIO_DECODER = "AudioDecoder"
static final String
COMPONENT_AUDIO_ENCODER = "AudioEncoder"
static final String
COMPONENT_AUDIO_GRAPH = "AudioGraph"
static final String
COMPONENT_AUDIO_MIXER = "AudioMixer"
static final String
COMPONENT_BITMAP_TEXTURE_MANAGER = "BitmapTextureManager"
static final String
COMPONENT_COMPOSITOR = "Compositor"
static final String
COMPONENT_EXTERNAL_TEXTURE_MANAGER = "ExternalTextureManager"
static final String
COMPONENT_MUXER = "Muxer"
static final String
COMPONENT_TEX_ID_TEXTURE_MANAGER = "TexIdTextureManager"
static final String
COMPONENT_TRANSFORMER_INTERNAL = "TransformerInternal"
static final String
static final String
COMPONENT_VIDEO_DECODER = "VideoDecoder"
static final String
COMPONENT_VIDEO_ENCODER = "VideoEncoder"
static final String
EVENT_ACCEPTED_INPUT = "AcceptedInput"
static final String
EVENT_CAN_WRITE_SAMPLE = "CanWriteSample"
static final String
EVENT_INPUT_ENDED = "InputEnded"
static final String
EVENT_INPUT_FORMAT = "InputFormat"
static final String
EVENT_OUTPUT_ENDED = "OutputEnded"
static final String
EVENT_OUTPUT_FORMAT = "OutputFormat"
static final String
EVENT_OUTPUT_TEXTURE_RENDERED = "OutputTextureRendered"
static final String
EVENT_PRODUCED_OUTPUT = "ProducedOutput"
static final String
EVENT_QUEUE_BITMAP = "QueueBitmap"
static final String
EVENT_QUEUE_FRAME = "QueueFrame"
static final String
EVENT_QUEUE_TEXTURE = "QueueTexture"
static final String
EVENT_RECEIVE_END_OF_ALL_INPUT = "ReceiveEndOfAllInput"
static final String
EVENT_RECEIVE_EOS = "ReceiveEOS"
static final String
EVENT_REGISTER_NEW_INPUT_STREAM = "RegisterNewInputStream"
static final String
EVENT_RENDERED_TO_OUTPUT_SURFACE = "RenderedToOutputSurface"
static final String
EVENT_SIGNAL_ENDED = "SignalEnded"
static final String
EVENT_SIGNAL_EOS = "SignalEOS"
static final String
EVENT_START = "Start"
static final String
EVENT_SURFACE_TEXTURE_INPUT = "SurfaceTextureInput"
static final String
EVENT_SURFACE_TEXTURE_TRANSFORM_FIX = "SurfaceTextureTransformFix"

Public fields

static boolean

Whether to store tracing events for debug logging.

Public constructors

Public methods

synchronized static void
dumpTsv(Writer writer)

Dumps all the logged events to the Writer as tab separated values (tsv).

synchronized static String

Generate a summary of the logged events, containing the total number of times an event happened and the detailed log of a window of the oldest and newest events.

synchronized static void
logCodecEvent(
    boolean isDecoder,
    boolean isVideo,
    @DebugTraceUtil.Event @DebugTraceUtil.Event String eventName,
    long presentationTimeUs,
    String extraFormat,
    Object[] extraArgs
)

Logs an Event for a codec, if debug logging is enabled.

synchronized static void
logEvent(
    @DebugTraceUtil.Component @DebugTraceUtil.Component String component,
    @DebugTraceUtil.Event @DebugTraceUtil.Event String event,
    long presentationTimeUs
)

Logs a new event, if debug logging is enabled.

synchronized static void
logEvent(
    @DebugTraceUtil.Component @DebugTraceUtil.Component String component,
    @DebugTraceUtil.Event @DebugTraceUtil.Event String event,
    long presentationTimeUs,
    String extraFormat,
    Object[] extraArgs
)

Logs a new event, if debug logging is enabled.

synchronized static void

Constants

COMPONENT_ASSET_LOADER

public static final String COMPONENT_ASSET_LOADER = "AssetLoader"

COMPONENT_AUDIO_DECODER

public static final String COMPONENT_AUDIO_DECODER = "AudioDecoder"

COMPONENT_AUDIO_ENCODER

public static final String COMPONENT_AUDIO_ENCODER = "AudioEncoder"

COMPONENT_AUDIO_GRAPH

public static final String COMPONENT_AUDIO_GRAPH = "AudioGraph"

COMPONENT_AUDIO_MIXER

public static final String COMPONENT_AUDIO_MIXER = "AudioMixer"

COMPONENT_BITMAP_TEXTURE_MANAGER

public static final String COMPONENT_BITMAP_TEXTURE_MANAGER = "BitmapTextureManager"

COMPONENT_COMPOSITOR

public static final String COMPONENT_COMPOSITOR = "Compositor"

COMPONENT_EXTERNAL_TEXTURE_MANAGER

public static final String COMPONENT_EXTERNAL_TEXTURE_MANAGER = "ExternalTextureManager"

COMPONENT_MUXER

public static final String COMPONENT_MUXER = "Muxer"

COMPONENT_TEX_ID_TEXTURE_MANAGER

public static final String COMPONENT_TEX_ID_TEXTURE_MANAGER = "TexIdTextureManager"

COMPONENT_TRANSFORMER_INTERNAL

public static final String COMPONENT_TRANSFORMER_INTERNAL = "TransformerInternal"

COMPONENT_VFP

public static final String COMPONENT_VFP = "VFP"

COMPONENT_VIDEO_DECODER

public static final String COMPONENT_VIDEO_DECODER = "VideoDecoder"

COMPONENT_VIDEO_ENCODER

public static final String COMPONENT_VIDEO_ENCODER = "VideoEncoder"

EVENT_ACCEPTED_INPUT

public static final String EVENT_ACCEPTED_INPUT = "AcceptedInput"

EVENT_CAN_WRITE_SAMPLE

public static final String EVENT_CAN_WRITE_SAMPLE = "CanWriteSample"

EVENT_INPUT_ENDED

public static final String EVENT_INPUT_ENDED = "InputEnded"

EVENT_INPUT_FORMAT

public static final String EVENT_INPUT_FORMAT = "InputFormat"

EVENT_OUTPUT_ENDED

public static final String EVENT_OUTPUT_ENDED = "OutputEnded"

EVENT_OUTPUT_FORMAT

public static final String EVENT_OUTPUT_FORMAT = "OutputFormat"

EVENT_OUTPUT_TEXTURE_RENDERED

public static final String EVENT_OUTPUT_TEXTURE_RENDERED = "OutputTextureRendered"

EVENT_PRODUCED_OUTPUT

public static final String EVENT_PRODUCED_OUTPUT = "ProducedOutput"

EVENT_QUEUE_BITMAP

public static final String EVENT_QUEUE_BITMAP = "QueueBitmap"

EVENT_QUEUE_FRAME

public static final String EVENT_QUEUE_FRAME = "QueueFrame"

EVENT_QUEUE_TEXTURE

public static final String EVENT_QUEUE_TEXTURE = "QueueTexture"

EVENT_RECEIVE_END_OF_ALL_INPUT

public static final String EVENT_RECEIVE_END_OF_ALL_INPUT = "ReceiveEndOfAllInput"

EVENT_RECEIVE_EOS

public static final String EVENT_RECEIVE_EOS = "ReceiveEOS"

EVENT_REGISTER_NEW_INPUT_STREAM

public static final String EVENT_REGISTER_NEW_INPUT_STREAM = "RegisterNewInputStream"

EVENT_RENDERED_TO_OUTPUT_SURFACE

public static final String EVENT_RENDERED_TO_OUTPUT_SURFACE = "RenderedToOutputSurface"

EVENT_SIGNAL_ENDED

public static final String EVENT_SIGNAL_ENDED = "SignalEnded"

EVENT_SIGNAL_EOS

public static final String EVENT_SIGNAL_EOS = "SignalEOS"

EVENT_START

public static final String EVENT_START = "Start"

EVENT_SURFACE_TEXTURE_INPUT

public static final String EVENT_SURFACE_TEXTURE_INPUT = "SurfaceTextureInput"

EVENT_SURFACE_TEXTURE_TRANSFORM_FIX

public static final String EVENT_SURFACE_TEXTURE_TRANSFORM_FIX = "SurfaceTextureTransformFix"

Public fields

enableTracing

public static boolean enableTracing

Whether to store tracing events for debug logging. Should be set to true for testing and debugging purposes only.

Public constructors

DebugTraceUtil

public DebugTraceUtil()

Public methods

dumpTsv

synchronized public static void dumpTsv(Writer writer)

Dumps all the logged events to the Writer as tab separated values (tsv).

generateTraceSummary

synchronized public static String generateTraceSummary()

Generate a summary of the logged events, containing the total number of times an event happened and the detailed log of a window of the oldest and newest events.

logCodecEvent

synchronized public static void logCodecEvent(
    boolean isDecoder,
    boolean isVideo,
    @DebugTraceUtil.Event @DebugTraceUtil.Event String eventName,
    long presentationTimeUs,
    String extraFormat,
    Object[] extraArgs
)

Logs an Event for a codec, if debug logging is enabled.

Parameters
boolean isDecoder

Whether the codec is a decoder.

boolean isVideo

Whether the codec is for video.

@DebugTraceUtil.Event @DebugTraceUtil.Event String eventName

The Event to log.

long presentationTimeUs

The current presentation time of the media. Use TIME_UNSET if unknown, TIME_END_OF_SOURCE if EOS.

String extraFormat

Format string for optional extra information. See formatInvariant.

Object[] extraArgs

Arguments for optional extra information.

logEvent

synchronized public static void logEvent(
    @DebugTraceUtil.Component @DebugTraceUtil.Component String component,
    @DebugTraceUtil.Event @DebugTraceUtil.Event String event,
    long presentationTimeUs
)

Logs a new event, if debug logging is enabled.

Parameters
@DebugTraceUtil.Component @DebugTraceUtil.Component String component

The Component to log.

@DebugTraceUtil.Event @DebugTraceUtil.Event String event

The Event to log.

long presentationTimeUs

The current presentation time of the media. Use TIME_UNSET if unknown, TIME_END_OF_SOURCE if EOS.

logEvent

synchronized public static void logEvent(
    @DebugTraceUtil.Component @DebugTraceUtil.Component String component,
    @DebugTraceUtil.Event @DebugTraceUtil.Event String event,
    long presentationTimeUs,
    String extraFormat,
    Object[] extraArgs
)

Logs a new event, if debug logging is enabled.

Parameters
@DebugTraceUtil.Component @DebugTraceUtil.Component String component

The Component to log.

@DebugTraceUtil.Event @DebugTraceUtil.Event String event

The Event to log.

long presentationTimeUs

The current presentation time of the media. Use TIME_UNSET if unknown, TIME_END_OF_SOURCE if EOS.

String extraFormat

Format string for optional extra information. See formatInvariant.

Object[] extraArgs

Arguments for optional extra information.

reset

synchronized public static void reset()