VideoDecodingWrapper


@UnstableApi
@RequiresApi(value = 21)
class VideoDecodingWrapper : AutoCloseable


A wrapper for decoding a video using MediaCodec.

Summary

Public constructors

VideoDecodingWrapper(
    context: Context!,
    filePath: String!,
    comparisonInterval: Int,
    maxImagesAllowed: Int
)

Creates a new instance.

Public functions

Unit
Image?

Returns the next decoded comparison frame, or null if the stream has ended.

Public constructors

VideoDecodingWrapper

VideoDecodingWrapper(
    context: Context!,
    filePath: String!,
    comparisonInterval: Int,
    maxImagesAllowed: Int
)

Creates a new instance.

Parameters
context: Context!

The Context.

filePath: String!

The path to the video file.

comparisonInterval: Int

The number of frames between the frames selected for comparison.

maxImagesAllowed: Int

The max number of images allowed in ImageReader.

Throws
java.io.IOException

When failed to open the video file.

Public functions

close

fun close(): Unit

runUntilComparisonFrameOrEnded

fun runUntilComparisonFrameOrEnded(): Image?

Returns the next decoded comparison frame, or null if the stream has ended. The caller takes ownership of any returned image and is responsible for closing it before calling this method again.