CodecDbDatasetLoader


@ExperimentalApi
class CodecDbDatasetLoader


Loads CodecDbEncoderDataset instances from the CodecDB database for a specific device.

Obtain instances via onDevice.

Summary

Public functions

CodecDbEncoderDataset!

Loads a CodecDbEncoderDataset for the device identifiers provided during creation, using the provided fallback provider for missing configurations.

Public functions

forEncoding

fun forEncoding(
    fallbackProvider: Function<VideoEncoderConstraints!, VideoEncoderConfiguration?>!
): CodecDbEncoderDataset!

Loads a CodecDbEncoderDataset for the device identifiers provided during creation, using the provided fallback provider for missing configurations.

The dataset includes encoding performance models relevant to the specified device, with the following order of precedence:

  • Device-specific models
  • Chipset-specific models
  • Tier-specific models
  • Generic models

If no loaded model satisfies the requested constraints, findOptimalConfiguration returns the result of the provided fallback provider.

Parameters
fallbackProvider: Function<VideoEncoderConstraints!, VideoEncoderConfiguration?>!

A function that is queried with the requested constraints when no model loaded for this device satisfies them. It returns the configuration to use instead, or null if it has none, in which case the query also returns null. Pass constraints -> null to disable the fallback.

Returns
CodecDbEncoderDataset!

A CodecDbEncoderDataset containing encoder-specific data.

Throws
java.io.IOException

if an error occurs while reading from the database.