@RequiresApi(value = 29)
@UnstableApi
class RandomizedMp3Decoder : ShadowMediaCodec.CodecConfig.Codec


Generates randomized, but correct amount of data on MP3 audio input.

The decoder reads the MP3 header for each input MP3 frame, determines the number of bytes the input frame should inflate to, and writes randomized data of that amount to the output buffer. Decoder randomness can help us identify possible errors in downstream renderers and audio processors. The random bahavior is deterministic, it outputs the same bytes across multiple runs.

All the data written to the output by the decoder can be obtained by getAllOutputBytes().

Summary

Public constructors

Public functions

ImmutableList<ByteArray<Byte>!>!

Returns all arrays of bytes output from the decoder.

Unit
onConfigured(
    format: MediaFormat!,
    surface: Surface!,
    crypto: MediaCrypto!,
    flags: Int
)
Unit
process(in: ByteBuffer!, out: ByteBuffer!)

Public constructors

RandomizedMp3Decoder

RandomizedMp3Decoder()

Public functions

getAllOutputBytes

fun getAllOutputBytes(): ImmutableList<ByteArray<Byte>!>!

Returns all arrays of bytes output from the decoder.

Returns
ImmutableList<ByteArray<Byte>!>!

a list of byte arrays (for each MP3 frame input) that were previously output from the decoder.

onConfigured

fun onConfigured(
    format: MediaFormat!,
    surface: Surface!,
    crypto: MediaCrypto!,
    flags: Int
): Unit

process

fun process(in: ByteBuffer!, out: ByteBuffer!): Unit