void HDevice::ConvertVideoSettings()
{
	VIDEOINFOHEADER  *vih  = (VIDEOINFOHEADER*)videoMediaType->pbFormat;
	BITMAPINFOHEADER *bmih = GetBitmapInfoHeader(videoMediaType);

	if (bmih) {
		Debug(L"Video media type changed");

		videoConfig.cx            = bmih->biWidth;
		videoConfig.cy            = bmih->biHeight;
		videoConfig.frameInterval = vih->AvgTimePerFrame;

		bool same = videoConfig.internalFormat == videoConfig.format;
		GetMediaTypeVFormat(videoMediaType, videoConfig.internalFormat);

		if (same)
			videoConfig.format = videoConfig.internalFormat;
	}
}
/* Note:  DEVICE_VideoInfo is not to be confused with Device::VideoInfo */
static bool Get_FORMAT_VideoInfo_Data(VideoInfo &info,
		const AM_MEDIA_TYPE &mt, const BYTE *data)
{
	const VIDEO_STREAM_CONFIG_CAPS *vscc;
	const VIDEOINFOHEADER          *viHeader;
	const BITMAPINFOHEADER         *bmiHeader;
	VideoFormat                    format;

	vscc      = reinterpret_cast<const VIDEO_STREAM_CONFIG_CAPS*>(data);
	viHeader  = reinterpret_cast<const VIDEOINFOHEADER*>(mt.pbFormat);
	bmiHeader = &viHeader->bmiHeader;

	if (!GetMediaTypeVFormat(mt, format))
		return false;

	if (vscc) {
		info.format      = format;
		info.minInterval = vscc->MinFrameInterval;
		info.maxInterval = vscc->MaxFrameInterval;
		info.minCX       = vscc->MinOutputSize.cx;
		info.minCY       = vscc->MinOutputSize.cy;
		info.maxCX       = vscc->MaxOutputSize.cx;
		info.maxCY       = vscc->MaxOutputSize.cy;

		if (!info.minCX || !info.minCY ||
		    !info.maxCX || !info.maxCY) {
			info.minCX = info.maxCX = bmiHeader->biWidth;
			info.minCY = info.maxCY = bmiHeader->biHeight;
		}

		info.granularityCX = max(vscc->OutputGranularityX, 1);
		info.granularityCY = max(vscc->OutputGranularityY, 1);
	} else {
		/* TODO, handling of terrible devices goes here */
		return false;
	}

	return true;
}