loadFrom
Loads a dataset from [source]: reads capture JSON, decodes it in one pass with [kotlinx.serialization], and returns a [PlaybackDataset] that uses [source] for on-demand frame loading.
Declaration
@Deprecated( "Will be removed in a future release. Use PlaybackDataset.open(), which reads the dataset " + "through native playback.", level = DeprecationLevel.WARNING ) @Suppress("DEPRECATION") @JvmStatic @JvmOverloads fun loadFrom( source: PlaybackDatasetSource, imageDecoder: (ByteArray) -> Bitmap? = { bytes -> BitmapFactory.decodeByteArray(bytes, 0, bytes.size) } ): PlaybackDataset?
Summary
Returns
The dataset, or null if JSON is missing or invalid.
Parameters
| Name | Type | Summary |
|---|---|---|
| source | PlaybackDatasetSource | - |
| imageDecoder | (ByteArray) -> Bitmap? | Decodes image bytes to [Bitmap]; default uses [BitmapFactory]. In unit tests pass { null } to avoid "BitmapFactory not mocked". |
Loads a dataset from
source: reads capture JSON, decodes it in one pass withkotlinx.serialization, and returns aPlaybackDatasetthat usessourcefor on-demand frame loading.