Open khouzam opened 2 days ago
@khouzam
Thanks for submitting your request! Just a curiosity, have you looked at [MediaCodecVideoRenderer::shouldInitCodec] for your use case? Its already overridable and utilized by MediaCodecRenderer
to decide if the decoder should be initialized.
This enables a derived renderer to disable the placeholder surface.
Not having a placeholder surface allows to delay instantiating the codecs until we have a surface. This allows to have more players ready without having their decoders loaded.
This follows the mode that
shouldUseDetachedSurface
is protected and overridable by a derived class.Since
getSurfaceForCodec
must callhasSurfaceForCodec
, the check for the placeholder surface ingetSurfaceForCodec
should not trigger if we disable the placeholder surface ashasSurfaceForCodec
would have returned false.