通过SMDK210自带的DOC《SMDKV210_WinCE60_TVOUT_UserManual.pdf》了解到
其HDMI驱动通过应用程序DeviceIoControl调用
操作顺序是:
1.打开TV
2.打开图像层(GRP层)
3.打开视频层(Video层)
4.再配置HDMI相关
http://www.yespartner.com/yespartner/lect_view.asp?gotopage=1&searchString=&schcontent=&schsubject=&schuid=81&cate=1
给了我很大启示,网上很多人是在研究直接把fb放到GRP层,可是这样不能全屏的问题
发现Video层可以轻易解决大小的问题,但是现在卡在Video层需要YUV格式
而fb读出来的是RGB格式
DOC中
// because video processor supports only YUV420 NV12 type, need 2 values about address
unsigned int uiTopYAddress; // Y data start address of source image
unsigned int uiTopCAddress; // C data start address of source image
所以,我在研究怎么解决这个格式转换问题,有大神说用VP——VIDEO PROCESSOR
不知道是什么东西,估计只能明天再话精力了解了。
今天code出来的:
DWORD dwBytes;
// Turn on TV
//1st Step: Driver Open
HANDLE hVideoDrv =INVALID_HANDLE_VALUE;
hVideoDrv = CreateFile( L"TVD0:", GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
if (hVideoDrv == INVALID_HANDLE_VALUE)
{
RETAILMSG(1,(L"[VDE:ERR] TVD0 Open Device Failed\n"));
return;
}
//Read HPD status
bool bHpdStatus;
DeviceIoControl(hVideoDrv, IOCTL_STDA_HDMI_GET_HPD_STATUS, NULL, 0, &bHpdStatus, sizeof(BOOL), &dwBytes, NULL);
if(bHpdStatus == FALSE)
{
RETAILMSG(1, (TEXT("bHpdStatus is false!\r\n")));
//exit(0);
}
//If HPD status is plugged, you should read HDMI available mode.
STDA_ARG_HDMI_AVAILABLE_MODE tMode;
DeviceIoControl(hVideoDrv, IOCTL_STDA_HDMI_AVAILABLE_MODE, NULL, 0, &tMode, sizeof(STDA_ARG_HDMI_AVAILABLE_MODE), &dwBytes, NULL);
RETAILMSG(1, (TEXT("___________________Mode________________\r\n")));
RETAILMSG(1, (TEXT("bHDMI_480P_16_9 = %d\r\n"),tMode.bHDMI_480P_16_9));
RETAILMSG(1, (TEXT("bHDMI_480P_4_3 = %d\r\n"),tMode.bHDMI_480P_4_3));
RETAILMSG(1, (TEXT("bHDMI_576P_16_9 = %d\r\n"),tMode.bHDMI_576P_16_9));
RETAILMSG(1, (TEXT("bHDMI_576P_4_3 = %d\r\n"),tMode.bHDMI_576P_4_3));
RETAILMSG(1, (TEXT("bHDMI_720P_60_16_9 = %d\r\n"),tMode.bHDMI_720P_60_16_9));
RETAILMSG(1, (TEXT("bHDMI_1080P_60_16_9 = %d\r\n"),tMode.bHDMI_1080P_60_16_9));
RETAILMSG(1, (TEXT("bHDMI_1080P_30_16_9 = %d\r\n"),tMode.bHDMI_1080P_30_16_9));
RETAILMSG(1, (TEXT("bHDMI_1080I_60_16_9 = %d\r\n"),tMode.bHDMI_1080I_60_16_9));
RETAILMSG(1, (TEXT("bLPCM2CH = %d\r\n"),tMode.bLPCM2CH));
RETAILMSG(1, (TEXT("bHDMI_CS_RGB = %d\r\n"),tMode.bHDMI_CS_RGB));
RETAILMSG(1, (TEXT("bHDMI_CS_YCBCR444 = %d\r\n"),tMode.bHDMI_CS_YCBCR444));
RETAILMSG(1, (TEXT("bHDMI_CS_YCBCR422 = %d\r\n"),tMode.bHDMI_CS_YCBCR422));
RETAILMSG(1, (TEXT("bHDMI_COLORIMETRY_EXTENDED_xvYCC601 = %d\r\n"),tMode.bHDMI_COLORIMETRY_EXTENDED_xvYCC601));
RETAILMSG(1, (TEXT("bHDMI_COLORIMETRY_EXTENDED_xvYCC709 = %d\r\n"),tMode.bHDMI_COLORIMETRY_EXTENDED_xvYCC709));
RETAILMSG(1, (TEXT("bHDMI_CD_36_HDMI_CS_RGB = %d\r\n"),tMode.bHDMI_CD_36_HDMI_CS_RGB));
RETAILMSG(1, (TEXT("bHDMI_CD_36_HDMI_CS_YCBCR444 = %d\r\n"),tMode.bHDMI_CD_36_HDMI_CS_YCBCR444));