#ifndef LCAMERA_DEV_H
#define LCAMERA_DEV_H

#include <cameraIdentity.h>
#include <cameraModeRequest.h>
#include <memory>
#include <spinscale/co/invokers.h>
#include <spinscale/componentThread.h>
#include <string>
#include <vector>

namespace lcamera_dev {

class CameraSession;

struct LcameraDevGetOrCreateResult
{
	std::shared_ptr<CameraSession> deviceSession;
	CameraIdentityRecord resolvedIdentity;
};

struct LcameraDevCameraInfo
{
	std::string id;
	std::string model;
	std::string location;
};

} // namespace lcamera_dev

#ifdef __cplusplus
extern "C" {
#endif

typedef void lcameraDev_mainFn(
	const std::shared_ptr<sscl::ComponentThread>& componentThread);

typedef void lcameraDev_exitFn(void);

typedef sscl::co::ViralNonPostingInvoker<lcamera_dev::LcameraDevGetOrCreateResult>
	lcameraDev_getOrCreateDeviceCReqFn(const std::string& deviceSelector);

typedef sscl::co::ViralNonPostingInvoker<lcamera_dev::CameraIdentityRecord>
	lcameraDev_resolveDeviceSelectorCReqFn(const std::string& deviceSelector);

typedef sscl::co::ViralNonPostingInvoker<void>
	lcameraDev_releaseDeviceCReqFn(
		const std::shared_ptr<lcamera_dev::CameraSession>& deviceSession);

typedef sscl::co::ViralNonPostingInvoker<std::vector<lcamera_dev::LcameraDevCameraInfo>>
	lcameraDev_enumerateCamerasCReqFn(void);

typedef sscl::co::ViralNonPostingInvoker<lcamera_dev::LcameraDevConfiguredCameraMode>
	lcameraDev_configureSessionModeCReqFn(
		const std::shared_ptr<lcamera_dev::CameraSession>& deviceSession,
		const lcamera_dev::LcameraDevCameraModeRequest& request);

lcameraDev_mainFn lcameraDev_main;
lcameraDev_exitFn lcameraDev_exit;
lcameraDev_getOrCreateDeviceCReqFn lcameraDev_getOrCreateDeviceCReq;
lcameraDev_resolveDeviceSelectorCReqFn lcameraDev_resolveDeviceSelectorCReq;
lcameraDev_releaseDeviceCReqFn lcameraDev_releaseDeviceCReq;
lcameraDev_enumerateCamerasCReqFn lcameraDev_enumerateCamerasCReq;
lcameraDev_configureSessionModeCReqFn lcameraDev_configureSessionModeCReq;

#ifdef __cplusplus
}
#endif

#endif // LCAMERA_DEV_H
