FrameExtractor.Builder


class FrameExtractor.Builder


A builder for FrameExtractor instances.

Summary

Public constructors

Builder(context: Context!, mediaItem: MediaItem!)

Creates a new instance.

Public functions

FrameExtractor!

Builds a new FrameExtractor instance.

FrameExtractor.Builder!

Sets the Effects to apply to the extracted video frames.

FrameExtractor.Builder!

Sets whether HDR bitmap should be extracted from HDR videos.

FrameExtractor.Builder!

Sets the GlObjectsProvider to be used by the effect processing pipeline.

FrameExtractor.Builder!

Sets the selector of MediaCodec instances.

FrameExtractor.Builder!

Sets the parameters that control how seek operations are performed.

Public constructors

Builder

Builder(context: Context!, mediaItem: MediaItem!)

Creates a new instance.

Parameters
context: Context!

The Context.

mediaItem: MediaItem!

The MediaItem from which to extract frames.

Public functions

build

fun build(): FrameExtractor!

Builds a new FrameExtractor instance.

setEffects

@CanIgnoreReturnValue
fun setEffects(effects: (Mutable)List<Effect!>!): FrameExtractor.Builder!

Sets the Effects to apply to the extracted video frames.

Parameters
effects: (Mutable)List<Effect!>!

The List of video effects.

Returns
FrameExtractor.Builder!

This builder.

setExtractHdrFrames

@CanIgnoreReturnValue
@RequiresApi(value = 34)
fun setExtractHdrFrames(extractHdrFrames: Boolean): FrameExtractor.Builder!

Sets whether HDR bitmap should be extracted from HDR videos.

When set to false, extracted HDR frames will be tone-mapped to BT709.

When set to true, extracted HDR frames will have a high bit depth Bitmap.Config and BT2020_HLG. Extracting HDR frames is only supported on API 34+.

This flag has no effect when the input is SDR.

Defaults to false.

Parameters
extractHdrFrames: Boolean

Whether HDR frames should be returned.

Returns
FrameExtractor.Builder!

This builder.

setGlObjectsProvider

@CanIgnoreReturnValue
fun setGlObjectsProvider(glObjectsProvider: GlObjectsProvider!): FrameExtractor.Builder!

Sets the GlObjectsProvider to be used by the effect processing pipeline.

By default, a DefaultGlObjectsProvider is used.

Parameters
glObjectsProvider: GlObjectsProvider!

The GlObjectsProvider.

Returns
FrameExtractor.Builder!

This builder.

setMediaCodecSelector

@CanIgnoreReturnValue
fun setMediaCodecSelector(mediaCodecSelector: MediaCodecSelector!): FrameExtractor.Builder!

Sets the selector of MediaCodec instances. Defaults to PREFER_SOFTWARE.

Parameters
mediaCodecSelector: MediaCodecSelector!

The MediaCodecSelector.

Returns
FrameExtractor.Builder!

This builder.

setSeekParameters

@CanIgnoreReturnValue
fun setSeekParameters(seekParameters: SeekParameters!): FrameExtractor.Builder!

Sets the parameters that control how seek operations are performed. Defaults to DEFAULT.

Parameters
seekParameters: SeekParameters!

The SeekParameters.

Returns
FrameExtractor.Builder!

This builder.