#include "DeckLinkVideoIOFormat.h"

BMDPixelFormat DeckLinkPixelFormatForVideoIO(VideoIOPixelFormat format)
{
	switch (format)
	{
	case VideoIOPixelFormat::V210:
		return bmdFormat10BitYUV;
	case VideoIOPixelFormat::Yuva10:
		return bmdFormat10BitYUVA;
	case VideoIOPixelFormat::Bgra8:
		return bmdFormat8BitBGRA;
	case VideoIOPixelFormat::Uyvy8:
	default:
		return bmdFormat8BitYUV;
	}
}

VideoIOPixelFormat VideoIOPixelFormatFromDeckLink(BMDPixelFormat format)
{
	if (format == bmdFormat10BitYUV)
		return VideoIOPixelFormat::V210;
	if (format == bmdFormat10BitYUVA)
		return VideoIOPixelFormat::Yuva10;
	if (format == bmdFormat8BitBGRA)
		return VideoIOPixelFormat::Bgra8;
	return VideoIOPixelFormat::Uyvy8;
}
