在DM8168的DVRRDK中添加采集和显示的各种分辨率的支持
[复制链接]
在DVRRDK中,系统提供了多个分辨率的标准(SYSTEM_STD_1080P_60、VSYS_STD_1080P_60、FVID2_STD_1080P_60),为用户层、link层、系统底层都定义了一套,而且支持程度不一,所以在添加的过程中,有点点繁琐
先说在hdvpss中添加输出分辨率
添加分辨率信息,时钟格式等信息和描述信息
ti_tools/hdvpss/dvr_rdk_hdvpss/packages/ti/psp/vps/drivers/src/fvid2_drvMgr.c
/** \brief FVID2 standard information table. */
static FVID2_ModeInfo gFdmStdInfoTable[] =
{
/* Standard, FrameWidth, FrameHeight, ScanFormat, PixelClock (KHz), FPS,
Reserved */
{FVID2_STD_NTSC, 720u, 480u, FVID2_SF_INTERLACED, 27000u, 30u, 0u},
{FVID2_STD_PAL, 720u, 576u, FVID2_SF_INTERLACED, 27000u, 25u, 0u},
{FVID2_STD_480I, 720u, 480u, FVID2_SF_INTERLACED, 27000u, 30u, 0u},
{FVID2_STD_576I, 720u, 576u, FVID2_SF_INTERLACED, 27000u, 25u, 0u},
/** \brief Standard string table. */
static Fdm_StdString gFdmStdStrTable[] =
{
{FVID2_STD_NTSC, "NTSC" },
{FVID2_STD_PAL, "PAL" },
{FVID2_STD_480I, "480I" },
{FVID2_STD_576I, "576I" },
{FVID2_STD_CIF, "CIF" },
添加视频格式
ti_tools/hdvpss/dvr_rdk_hdvpss/packages/ti/psp/vps/fvid2.h
/**
* \brief Video standards.
*/
typedef enum
{
FVID2_STD_NTSC = 0u,
/**< 720x480 30FPS interlaced NTSC standard. */
FVID2_STD_PAL,
/**< 720x576 30FPS interlaced PAL standard. */
FVID2_STD_480I,
/**< 720x480 30FPS interlaced SD standard. */
FVID2_STD_576I,
/**< 720x576 30FPS interlaced SD standard. */
添加分辨率的时序详细信息
ti_tools/hdvpss/dvr_rdk_hdvpss/packages/ti/psp/vps/hal/src/vpshal_hdvenc.c
HdVenc_StdModeInfo HdVencStdModeInfo[] = {
{{FVID2_STD_1080P_60, 1920, 1080, FVID2_SF_PROGRESSIVE, 148500, 60,
88, 148, 44, 4, 36, 5}, 3, 8, 0},
{{FVID2_STD_1080P_50, 1920, 1080, FVID2_SF_PROGRESSIVE, 148500, 50,
528, 148, 44, 4, 36, 5}, 3, 7, 0},
{{FVID2_STD_1080P_30, 1920, 1080, FVID2_SF_PROGRESSIVE, 74250, 30,
88, 148, 44, 4, 36, 5}, 3, 4, 0},
{{FVID2_STD_1080P_25, 1920, 1080, FVID2_SF_PROGRESSIVE, 74250, 30,
528, 148, 44, 4, 36, 5}, 3, 4, 0},
{{FVID2_STD_1080P_24, 1920, 1080, FVID2_SF_PROGRESSIVE, 74250, 30,
638, 148, 44, 4, 36, 5}, 3, 4, 0},
在MCFW中相关位置的调整
dvr_rdk/mcfw/interfaces/common_def/ti_vsys_common_def.h
/**
\brief Possible Video Standards - NTSC, PAL, CIF, etc
*/
typedef enum
{
VSYS_STD_NTSC = 0u,
/**< 720x480 30FPS interlaced NTSC standard. */
VSYS_STD_PAL,
/**< 720x576 30FPS interlaced PAL standard. */
VSYS_STD_480I,
/**< 720x480 30FPS interlaced SD standard. */
VSYS_STD_576I,
/**< 720x576 30FPS interlaced SD standard. */
dvr_rdk/mcfw/interfaces/link_api/system_const.h
/**
\brief Video standards..
SUPPORTED in ALL platforms
*/
typedef enum
{
SYSTEM_STD_NTSC = 0u,
/**< 720x480 30FPS interlaced NTSC standard. */
SYSTEM_STD_PAL,
/**< 720x576 30FPS interlaced PAL standard. */
SYSTEM_STD_480I,
/**< 720x480 30FPS interlaced SD standard. */
SYSTEM_STD_576I,
/**< 720x576 30FPS interlaced SD standard. */
这里会对枚举的分辨率进行一次检验,应当多个格式标准的问题,所以添加分辨率的时候需要同步添加
dvr_rdk/mcfw/src_bios6/links_common/system/system_common.c
/*
* enum's defined in system_const.h MUST match the enum's defined in FVID2
* driver's since they are passed directly to the driver without conversion
*
* Anytime a new const is added in system_const.h, MAKE sure to put a assert
* check in this function */
int System_enumAssertCheck()
{
UTILS_COMPILETIME_ASSERT(SYSTEM_STD_NTSC == FVID2_STD_NTSC);
UTILS_COMPILETIME_ASSERT(SYSTEM_STD_PAL == FVID2_STD_PAL);
UTILS_COMPILETIME_ASSERT(SYSTEM_STD_480I == FVID2_STD_480I);
UTILS_COMPILETIME_ASSERT(SYSTEM_STD_576I == FVID2_STD_576I);
UTILS_COMPILETIME_ASSERT(SYSTEM_STD_CIF == FVID2_STD_CIF);
UTILS_COMPILETIME_ASSERT(SYSTEM_STD_HALF_D1 == FVID2_STD_HALF_D1);
UTILS_COMPILETIME_ASSERT(SYSTEM_STD_D1 == FVID2_STD_D1);
在这个里面还添加下面三个函数的支持
UInt32 Vsys_getStdSize(UInt32 std, UInt32 *width, UInt32 *height);
UInt32 Vsys_getStdRate(UInt32 std, UInt32 *frameRate);
UInt32 Vsys_isStdInterlaced(UInt32 std);
修改display输出的时候获取到正确的分辨率值
dvr_rdk/mcfw/src_bios6/links_m3vpss/display/displayLink_drv.c
Int32 DisplayLink_drvDisplayCreate(DisplayLink_Obj * pObj)
在视频输出的时候启动的时候会获取视频的时钟频率
dvr_rdk/mcfw/src_bios6/links_m3vpss/system/system_dctrl.c
Int32 System_getClk(UInt32 displayRes)
{
Int32 clkValue = VSYS_STD_MAX;
switch(displayRes) {
case VSYS_STD_1080P_60:
case VSYS_STD_1080P_50:
clkValue = 148500u;
break;
更新一下模式
dvr_rdk/mcfw/src_bios6/links_m3vpss/system/system_dctrl_modeInfo.c
Int32 System_getVencMode(Int32 resolution)
{
Int32 vencMode;
switch(resolution){
case VSYS_STD_NTSC:
vencMode = FVID2_STD_NTSC;
break;
case VSYS_STD_PAL:
vencMode = FVID2_STD_PAL;
break;
获取视频输出的分辨率
dvr_rdk/mcfw/src_bios6/links_m3vpss/system/system_m3vpss.c
Int32 System_getOutSize(UInt32 outRes, UInt32 * width, UInt32 * height)
{
Vsys_getStdSize(outRes, width, height);
return 0;
}
在DVRRDK中常用的视频格式基本是支持的,如果需要支持更多的分辨率,大家可以参考一下;
只是系统整个框架比较的大,一时没法完整的完成;
|