selectVideoFormats

open fun selectVideoFormats(formatWrappers: List<out Representation>, allowedContainerMimeTypes: Array<String>, filterHdFormats: Boolean, orientationMayChange: Boolean, viewportWidth: Int, viewportHeight: Int): Array<Int>

Chooses a suitable subset from a number of video formats.

A format is filtered (i.e. not selected) if:

  • allowedContainerMimeTypes is non-null and the format does not have one of the permitted mime types.
  • filterHdFormats is true and the format is HD.
  • It's determined that the video decoder isn't powerful enough to decode the format.
  • There exists another format of lower resolution whose resolution exceeds the maximum size in pixels that the video can be rendered within the viewport.

Return

An array holding the indices of the selected formats.

Parameters

formatWrappers

Wrapped formats from which to select.

allowedContainerMimeTypes

An array of allowed container mime types. Null allows all mime types.

filterHdFormats

True to filter HD formats. False otherwise.

orientationMayChange

True if the video's orientation may change with respect to the viewport during playback.

viewportWidth

The width in pixels of the viewport within which the video will be displayed. If the viewport size may change, this should be set to the maximum possible width.

viewportHeight

The height in pixels of the viewport within which the video will be displayed. If the viewport size may change, this should be set to the maximum possible height.

Throws

MediaCodecUtil.DecoderQueryException