1.简介:
因为WINCE 跟WMOBILE不提供任何TVOUT的API,所以PC100需要TVOUT的驱动来提供API,包括VIDEO 处理器,VIDEO 混合器,TV编码器,HDMI。
应用程序可以通过调用API,并将物理地址当成参数传递给API,但并不表示应用可以直接访问物理地址,如果应用要访问物理地址,可通过系统函数将物理地址变虑拟地址。(VirtualAlloc(),VirtualCopy().)。
BSP包里面的任何驱都可以像应用一样使用TVOUT驱动去控制HW 。任何应用在调用API之前要保存一些HW 资源。因为任何时候都会有其它的应用或驱动使用TVOUT的API。
2、目录布局
Directory Name Description
INC Common header files for Tvout D/D
S5PC100_VP_LIB Video Processor Function Library
S5PC100_VM_LIB Video Mixer Function Library
S5PC100_SDOUT_LIB TV Encoder Function Library
S5PC100_HDMI_LIB HDMI Function Library
S5PC100_POWER_LIB TV IP POWER Function Library
S5PC100_CLOCK_LIB TV IP CLOCK Function Library
S5PC100_HDCP_LIB HDCP Function Library
S5PC100_EDID_LIB EDID Function Library
S5PC100_HDMI_IIC_DRV HDMI I2C Driver for HDCP & EDID
S5PC100_TVOUT_DRV Main codes of TVout Driver
3.驱动调用及打开
要使用TVout驱动API,首先必须加载驱动,然后像流接口一样地操作,打开TVOUT驱动来获取驱动句柄。驱动名为:“TVD0”
可通过下列方式打驱动。
m_hVideoDrv = CreateFile( L"TVD0:", GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 );
4.TVOUT驱动API:
所有的API通过系统函数DeviceIoControl() 调用。
TVOUT 驱动的API分为:资源请求与释放API,功能函数API,还有电源管理API。
功能函数API主要用来控制硬件特性。
资源请求与释放API主要在功能API调用之前保存一些HW资源。
为了应用开发方便,所有的IOCTL 代码,数据结构,枚举值都定义在 SMDKC100/SDK/INC/s5pc100_tvd_api.h 中。
Resource Request/Release API :
IOCTL Code Description
IOCTL_STDA_RSC_REQUEST_TVOUT_INTERFACE Request the resource of TV Output Interface.
IOCTL_STDA_RSC_RELEASE_TVOUT_INTERFACE Release the resource of TV Output Interface.
IOCTL_STDA_RSC_REQUEST_VIDEO_PROCESSOR Request the resource of Video Layer.
IOCTL_STDA_RSC_RELEASE_VIDEO_PROCESSOR Release the resource of Video Layer.
IOCTL_STDA_RSC_REQUEST_GRAPHIC_0 Request the resource of Graphic0 Layer.
IOCTL_STDA_RSC_RELEASE_GRAPHIC_0 Release the resource of Graphic0 Layer.
IOCTL_STDA_RSC_REQUEST_GRAPHIC_1 Request the resource of Graphic1 Layer.
IOCTL_STDA_RSC_RELEASE_GRAPHIC_1 Release the resource of Graphic1 Layer.
Function API :
(1)TV out Interface API :
IOCTL Code Description
IOCTL_STDA_TVOUT_INIT_INTERFACE_PARAM Configuring Parameters of TV Output Interface
IOCTL_STDA_TVOUT_START Start TV output
IOCTL_STDA_TVOUT_STOP Stop TV output
IOCTL_STDA_TVOUT_GET_INFO Get TV I/F Information
(2)Video Layer Interface API :
IOCTL Code |
Description |
IOCTL_STDA_VL_INIT_PROCESSING_PARAM |
Configuring Parameters of Video Layer Interface |
IOCTL_STDA_VL_START |
Show Video Layer on Screen |
IOCTL_STDA_VL_STOP |
Hide Video Layer on Screen |
IOCTL_STDA_VL_INIT_BRIGHTNESS |
Adjust the brightness of Video Layer before showing Video Layer |
IOCTL_STDA_VL_INIT_CONTRAST |
Adjust the contrast of Video Layer before showing Video Layer |
IOCTL_STDA_VL_SET_PRIORITY |
Change the priority of Video Layer after showing Video Layer |
IOCTL_STDA_VL_SET_TOP_ADDRESS |
Change the image address of Video Layer after showing Video Layer |
IOCTL_STDA_VL_SET_IMG_SIZE |
Change the size of source image after showing Video Layer |
IOCTL_STDA_VL_SET_SRC_POSITION |
Change the starting position of source image after showing Video Layer |
IOCTL_STDA_VL_SET_DEST_POSITION |
Change the position of Video Layer on TV screen after showing Video Layer |
IOCTL_STDA_VL_SET_SRC_SIZE |
Change the cropping size of source image after showing Video Layer |
IOCTL_STDA_VL_SET_DEST_SIZE |
Change the display size of Video Layer on TV after showing Video Layer |
IOCTL_STDA_VL_SET_BRIGHTNESS |
Change the priority of Video Layer after showing Video Layer |
IOCTL_STDA_VL_SET_CONTRAST |
Change the contrast of Video Layer after showing Video Layer |
IOCTL_STDA_VL_GET_PRIORITY |
Take the priority value of Video Layer after showing Video Layer |
(3)Grp Layer API :
IOCTL Code |
Description |
IOCTL_STDA_GRP0_INIT_PROCESSING_PARAM IOCTL_STDA_GRP1_INIT_PROCESSING_PARAM |
Configuring Parameters of Grp0/1 Layer Interface |
IOCTL_STDA_GRP0_START IOCTL_STDA_GRP1_START |
Show Grp0/1 Layer on TV Screen |
IOCTL_STDA_GRP0_STOP IOCTL_STDA_GRP1_STOP |
Hide Grp0/1 Layer on TV Screen |
IOCTL_STDA_GRP0_SET_PRIORITY IOCTL_STDA_GRP1_SET_PRIORITY |
Change the priority of Grp0/1 Layer after showing Grp0/1 Layer |
IOCTL_STDA_GRP0_SET_BASE_ADDRESS IOCTL_STDA_GRP1_SET_BASE_ADDRESS |
Change the base image address of Grp0/1 Layer after showing Grp0/1 Layer |
IOCTL_STDA_GRP0_SET_DEST_POSITION IOCTL_STDA_GRP1_SET_DEST_POSITION |
Change the position of Grp0/1 Layer on TV screen after showing Grp0/1 Layer |
IOCTL_STDA_GRP0_GET_PRIORITY IOCTL_STDA_GRP1_GET_PRIORITY |
Take the priority value of Grp0/1 Layer after showing Grp0/1 Layer |
(4)SD TV out API :
IOCTL Code |
Description |
IOCTL_STDA_SDOUT_INIT_OUTPUT_ORDER |
Choose output order for SD TV. |
(5)HDMI API :
IOCTL Code |
Description |
IOCTL_STDA_HDMI_INIT_SPD_INFOFRAME |
Transfer SPD Info-frame through HDMI. |
IOCTL_STDA_HDMI_INIT_HDCP_EN |
Enable/Disable HDCP. |
IOCTL_STDA_HDMI_INIT_AUDIO |
Choose audio format for HDMI. |
IOCTL_STDA_HDMI_GET_HPD_STATUS |
Check if HDTV is connected through HDMI |
IOCTL_STDA_HDMI_WAIT_HPD_STATUS_CHANGE |
Wait for connecting or disconnecting HDTV during defined time. |
IOCTL_STDA_HDMI_AVAILABLE_MODE |
Get the information of available HDMI mode |