package com.example.livingai.domain.ml

/**
 * Singleton provider of camera intrinsic data.
 * Must be initialized once per session.
 */
object CameraInfoProvider {
    @Volatile
    private var cameraInfoData: CameraInfoData? = null

    fun init(info: CameraInfoData) {
        cameraInfoData = info
    }

    fun get(): CameraInfoData {
        return cameraInfoData
            ?: throw IllegalStateException("CameraInfoProvider not initialized")
    }

    fun tryGet(): CameraInfoData? = cameraInfoData
}
