openDecoder

expect fun openDecoder(stream: StreamInfo, threadCount: Int = 0, lowDelay: Boolean = false, decoder: CodecId? = null, options: DecoderOptions? = null, hardware: HardwareAccel? = null, corruptData: CorruptData = CorruptData.Skip): StreamDecoder

Opens one independently driven decoder for stream.

A null decoder lets FFmpeg choose its default implementation by codec id. A non-null value selects that exact decoder name and refuses it unless it can decode this stream's codec. This is the selection seam used for FFmpeg-owned hardware decoders such as h264_mediacodec; it does not call a platform decoder API directly.

hardware requests an HWACCEL behind the chosen decoder (HardwareAccel); it is attached between context creation and open and fails typed when the running FFmpeg cannot honour it.

actual fun openDecoder(stream: StreamInfo, threadCount: Int, lowDelay: Boolean, decoder: CodecId?, options: DecoderOptions?, hardware: HardwareAccel?, corruptData: CorruptData): StreamDecoder

Opens one independently driven decoder for stream.

A null decoder lets FFmpeg choose its default implementation by codec id. A non-null value selects that exact decoder name and refuses it unless it can decode this stream's codec. This is the selection seam used for FFmpeg-owned hardware decoders such as h264_mediacodec; it does not call a platform decoder API directly.

hardware requests an HWACCEL behind the chosen decoder (HardwareAccel); it is attached between context creation and open and fails typed when the running FFmpeg cannot honour it.

actual fun openDecoder(stream: StreamInfo, threadCount: Int, lowDelay: Boolean, decoder: CodecId?, options: DecoderOptions?, hardware: HardwareAccel?, corruptData: CorruptData): StreamDecoder

Opens one decoder for one stream, for you to drive.

Independent of every other decoder and of the reader, which is the point: this is what lets a player decode audio and video at their own rates.

Parameters

threadCount

0 lets libavcodec choose, which is usually the core count. Video gets frame-level threading, without which real-time 4K is not possible.

lowDelay

stops the decoder holding frames back for reordering. Right for audio in a player, wrong for video, where it costs decode efficiency.

actual fun openDecoder(stream: StreamInfo, threadCount: Int, lowDelay: Boolean, decoder: CodecId?, options: DecoderOptions?, hardware: HardwareAccel?, corruptData: CorruptData): StreamDecoder

Opens one independently driven decoder for stream.

A null decoder lets FFmpeg choose its default implementation by codec id. A non-null value selects that exact decoder name and refuses it unless it can decode this stream's codec. This is the selection seam used for FFmpeg-owned hardware decoders such as h264_mediacodec; it does not call a platform decoder API directly.

hardware requests an HWACCEL behind the chosen decoder (HardwareAccel); it is attached between context creation and open and fails typed when the running FFmpeg cannot honour it.

actual fun openDecoder(stream: StreamInfo, threadCount: Int, lowDelay: Boolean, decoder: CodecId?, options: DecoderOptions?, hardware: HardwareAccel?, corruptData: CorruptData): StreamDecoder

Opens one independently driven decoder for stream.

A null decoder lets FFmpeg choose its default implementation by codec id. A non-null value selects that exact decoder name and refuses it unless it can decode this stream's codec. This is the selection seam used for FFmpeg-owned hardware decoders such as h264_mediacodec; it does not call a platform decoder API directly.

hardware requests an HWACCEL behind the chosen decoder (HardwareAccel); it is attached between context creation and open and fails typed when the running FFmpeg cannot honour it.