package com.performancecoachlab.posedetection.encoding

import androidx.compose.ui.graphics.ImageBitmap

/**
 * Builder for creating videos from a sequence of ImageBitmap frames
 */
interface VideoBuilder {

    suspend fun addFrame(frame: ImageBitmap, timestampms: Long)

    /**
     * Finalizes the video creation and returns the path to the created video file
     * @return Path to the created video file
     */
    suspend fun finalize(): String

    /**
     * Cancels video creation and cleans up resources
     */
    suspend fun cancel()
}

/**
 * Creates a new VideoBuilder instance
 */
expect fun createVideoBuilder(
    outputPath: String,
    fps: Int = 30,
    width: Int,
    height: Int
): VideoBuilder