Class ShadowMediaCodec

java.lang.Object
org.robolectric.shadows.ShadowMediaCodec

@Implements(value=android.media.MediaCodec.class,
            minSdk=16,
            looseSignatures=true)
public class ShadowMediaCodec
extends Object
Implementation of MediaCodec which supports both asynchronous and synchronous modes.

By default for any encoded required, a 1 to 1 mapping will be used between the input and output buffers. Data from a queued input buffer will be copied to the output buffer. In the case that is it necessary so simulate some form of data compression, a custom encoder or decoder can be added via addEncoder(String, CodecConfig) and addDecoder(String, CodecConfig) respectively.

Asynchronous mode: Once the codec is started, a format change will be reported, switching to an empty MediaFormat with fake codec-specific info. Following this, the implementation will present an input buffer, which will be copied to an output buffer once queued, which will be subsequently presented to the callback handler.