#pragma once

#include "VideoIOFormat.h"

#include <cstddef>
#include <cstdint>

enum class SystemFrameSlotState
{
	Free,
	Rendering,
	Completed,
	Scheduled
};

struct SystemFrameExchangeConfig
{
	unsigned width = 0;
	unsigned height = 0;
	VideoIOPixelFormat pixelFormat = VideoIOPixelFormat::Bgra8;
	unsigned rowBytes = 0;
	std::size_t capacity = 0;
	std::size_t maxCompletedFrames = 0;
};

struct SystemFrame
{
	void* bytes = nullptr;
	long rowBytes = 0;
	unsigned width = 0;
	unsigned height = 0;
	VideoIOPixelFormat pixelFormat = VideoIOPixelFormat::Bgra8;
	std::size_t index = 0;
	uint64_t generation = 0;
	uint64_t frameIndex = 0;
};

struct SystemFrameExchangeMetrics
{
	std::size_t capacity = 0;
	std::size_t freeCount = 0;
	std::size_t renderingCount = 0;
	std::size_t completedCount = 0;
	std::size_t scheduledCount = 0;
	std::size_t completedDepth = 0;
	uint64_t acquiredFrames = 0;
	uint64_t completedFrames = 0;
	uint64_t scheduledFrames = 0;
	uint64_t completedDrops = 0;
	uint64_t acquireMisses = 0;
	uint64_t completedPollMisses = 0;
};
