赞
踩
-
- #include <config.h>
- #include <convert_manager.h>
- #include <string.h>
-
- static PT_VideoConvert g_ptVideoConvertHead = NULL;
-
- /**********************************************************************
- * 函数名称: RegisterVideoConvert
- * 功能描述: 注册"字体模块", 所谓字体模块就是取出字符位图的方法
- * 输入参数: ptVideoConvert - 一个结构体,内含"取出字符位图"的操作函数
- * 输出参数: 无
- * 返 回 值: 0 - 成功, 其他值 - 失败
- * 修改日期 版本号 修改人 修改内容
- * -----------------------------------------------
- * 2013/02/08 V1.0 韦东山 创建
- ***********************************************************************/
-
- //构造结构体,并形成链表
- int RegisterVideoConvert(PT_VideoConvert ptVideoConvert)
- {
- PT_VideoConvert ptTmp;
-
- if (!g_ptVideoConvertHead)
- {
- g_ptVideoConvertHead = ptVideoConvert;
- ptVideoConvert->ptNext = NULL;
- }
- else
- {
- ptTmp = g_ptVideoConvertHead;
- while (ptTmp->ptNext)
- {
- ptTmp = ptTmp->ptNext;
- }
- ptTmp->ptNext = ptVideoConvert;
- ptVideoConvert->ptNext = NULL;
- }
-
- return 0;
- }
-
-
- /**********************************************************************
- * 函数名称: ShowVideoConvert
- * 功能描述: 显示本程序能支持的"字体模块"
- * 输入参数: 无
- * 输出参数: 无
- * 返 回 值: 无
- * 修改日期 版本号 修改人 修改内容
- * -----------------------------------------------
- * 2013/02/08 V1.0 韦东山 创建
- ***********************************************************************/
-
- //显示一个结构体的name成员
- void ShowVideoConvert(void)
- {
- int i = 0;
- PT_VideoConvert ptTmp = g_ptVideoConvertHead;
-
- while (ptTmp)
- {
- printf("%02d %s\n", i++, ptTmp->name);
- ptTmp = ptTmp->ptNext;
- }
- }
-
- /**********************************************************************
- * 函数名称: GetVideoConvert
- * 功能描述: 根据名字取出指定的"字体模块"
- * 输入参数: pcName - 名字
- * 输出参数: 无
- * 返 回 值: NULL - 失败,没有指定的模块,
- * 非NULL - 字体模块的PT_VideoConvert结构体指针
- * 修改日期 版本号 修改人 修改内容
- * -----------------------------------------------
- * 2013/02/08 V1.0 韦东山 创建
- ***********************************************************************/
-
- //根据结构的name来得到结构体
- PT_VideoConvert GetVideoConvert(char *pcName)
- {
- PT_VideoConvert ptTmp = g_ptVideoConvertHead;
-
- while (ptTmp)
- {
- if (strcmp(ptTmp->name, pcName) == 0)
- {
- return ptTmp;
- }
- ptTmp = ptTmp->ptNext;
- }
- return NULL;
- }
-
-
- /**********************************************************************
- * 函数名称: FontsInit
- * 功能描述: 调用各个字体模块的初始化函数
- * 输入参数: 无
- * 输出参数: 无
- * 返 回 值: 0 - 成功, 其他值 - 失败
- * 修改日期 版本号 修改人 修改内容
- * -----------------------------------------------
- * 2013/02/08 V1.0 韦东山 创建
- ***********************************************************************/
-
- //各个转化模块初始化
- int VideoConvertInit(void)
- {
- int iError;
-
- iError = Yuv2RgbInit();
- iError |= Mjpeg2RgbInit();
- iError |= Rgb2RgbInit();
-
- return iError;
- }
-
-
-
-
-

convert_manager.h
-
- #ifndef _CONVERT_MANAGER_H
- #define _CONVERT_MANAGER_H
-
- #include <config.h>
- #include <video_manager.h>
-
- typedef struct VideoConvert {
- int (*isSupport)(int iPixelFormatIn, int iPixelFormatOut); // 看输入像素格式 是否支持 转化成 输出像素格式
- int (*Convert)(PT_VideoBuf ptVideoBufIn, PT_VideoBuf ptVideoBufOut); //输入像素buf 转换成 输出像素buf
- int (*ConvertExit)(PT_VideoBuf ptVideoBufOut);//输出像素buf在 convert函数中申请内存,用完要释放掉
- }T_VideoConvert, *PT_VideoConvert;
-
-
- #endif /* _CONVERT_MANAGER_H */
-

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。