资源简介
该代码是基于HI3516AD+IMX290厂家提供的rtsp-h264测试代码进行完善修改的,本来的测试代码只支持旧版的vlc播放器,而该代码支持新版的vlc播放器 、ios端、安卓端等。
代码片段和文件信息
#include
#include
#include
#include
#include “loadbmp.h“
OSD_COMP_INFO s_OSDCompInfo[OSD_COLOR_FMT_BUTT] = {{0 4 4 4} /*RGB444*/
{4 4 4 4} /*ARGB4444*/
{0 5 5 5} /*RGB555*/
{0 5 6 5} /*RGB565*/
{1 5 5 5} /*ARGB1555*/
{0 0 0 0} /*RESERVED*/
{0 8 8 8} /*RGB888*/
{8 8 8 8} /*ARGB8888*/
};
inline HI_U16 OSD_MAKECOLOR_U16(HI_U8 r HI_U8 g HI_U8 b OSD_COMP_INFO compinfo)
{
HI_U8 r1 g1 b1;
HI_U16 pixel = 0;
HI_U32 tmp = 15;
r1 = g1 = b1 = 0;
r1 = r >> (8 - compinfo.rlen);
g1 = g >> (8 - compinfo.glen);
b1 = b >> (8 - compinfo.blen);
while (compinfo.alen)
{
pixel |= (1 << tmp);
tmp --;
compinfo.alen--;
}
pixel |= (r1 | (g1 << compinfo.blen) | (b1 << (compinfo.blen + compinfo.glen)));
return pixel;
}
HI_S32 GetBmpInfo(const char* filename OSD_BITMAPFILEHEADER* pBmpFileHeader
OSD_BITMAPINFO* pBmpInfo)
{
FILE* pFile;
HI_U16 bfType;
if (NULL == filename)
{
printf(“OSD_LoadBMP: filename=NULL\n“);
return -1;
}
if ((pFile = fopen((char*)filename “rb“)) == NULL)
{
printf(“Open file faild:%s!\n“ filename);
return -1;
}
(void)fread(&bfType 1 sizeof(bfType) pFile);
if (bfType != 0x4d42)
{
printf(“not bitmap file\n“);
fclose(pFile);
return -1;
}
(void)fread(pBmpFileHeader 1 sizeof(OSD_BITMAPFILEHEADER) pFile);
(void)fread(pBmpInfo 1 sizeof(OSD_BITMAPINFO) pFile);
fclose(pFile);
return 0;
}
int LoadBMP(const char* filename OSD_LOGO_T* pVideoLogo)
{
FILE* pFile;
HI_U16 i j;
HI_U32 w h;
HI_U16 Bpp;
HI_U16 dstBpp;
OSD_BITMAPFILEHEADER bmpFileHeader;
OSD_BITMAPINFO bmpInfo;
HI_U8* pOrigBMPBuf;
HI_U8* pRGBBuf;
HI_U32 stride;
if (NULL == filename)
{
printf(“OSD_LoadBMP: filename=NULL\n“);
return -1;
}
if (GetBmpInfo(filename &bmpFileHeader &bmpInfo) < 0)
{
return -1;
}
Bpp = bmpInfo.bmiHeader.biBitCount / 8;
if (Bpp < 2)
{
/* only support 1555.8888 888 bitmap */
printf(“bitmap format not supported!\n“);
return -1;
}
if (bmpInfo.bmiHeader.biCompression != 0)
{
printf(“not support compressed bitmap file!\n“);
return -1;
}
if (bmpInfo.bmiHeader.biHeight < 0)
{
printf(“bmpInfo.bmiHeader.biHeight < 0\n“);
return -1;
}
if ( (pFile = fopen((char*)filename “rb“)) == NULL)
{
printf(“Open file faild:%s!\n“ filename);
return -1;
}
pVideoLogo->width = (HI_U16)bmpInfo.bmiHeader.biWidth;
pVideoLogo->height = (HI_U16)((bmpInfo.bmiHeader.biHeight > 0) ? bmpInfo.bmiHeader.biHeight : (-bmpInfo.bmiHeader.biHeight));
w = pVideoLogo->width;
h = pVideoLogo->height;
stride = w
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-03-17 17:43 rtsp-h264\
文件 817 2018-09-03 13:48 rtsp-h264\Makefile
目录 0 2020-03-17 17:16 rtsp-h264\include\
文件 9616 2016-03-28 19:36 rtsp-h264\include\acodec.h
文件 11595 2016-03-28 19:36 rtsp-h264\include\dictionary.h
文件 5493 2016-03-28 19:36 rtsp-h264\include\hi_ae_comm.h
文件 900 2016-03-28 19:36 rtsp-h264\include\hi_af_comm.h
文件 4263 2016-03-28 19:36 rtsp-h264\include\hi_awb_comm.h
文件 10695 2016-03-28 19:36 rtsp-h264\include\hi_comm_3a.h
文件 5455 2016-03-28 19:36 rtsp-h264\include\hi_comm_adec.h
文件 4874 2016-03-28 19:36 rtsp-h264\include\hi_comm_aenc.h
文件 879 2016-03-28 19:36 rtsp-h264\include\hi_comm_ai.h
文件 24415 2016-03-28 19:36 rtsp-h264\include\hi_comm_aio.h
文件 881 2016-03-28 19:36 rtsp-h264\include\hi_comm_ao.h
文件 1883 2016-03-28 19:36 rtsp-h264\include\hi_comm_fisheye.h
文件 60809 2016-03-28 19:36 rtsp-h264\include\hi_comm_isp.h
文件 14416 2016-03-28 19:36 rtsp-h264\include\hi_comm_ive.h
文件 9316 2016-03-28 19:36 rtsp-h264\include\hi_comm_pciv.h
文件 16374 2016-03-28 19:36 rtsp-h264\include\hi_comm_rc.h
文件 9452 2016-03-28 19:36 rtsp-h264\include\hi_comm_region.h
文件 5644 2016-03-28 19:36 rtsp-h264\include\hi_comm_sns.h
文件 3832 2016-03-28 19:36 rtsp-h264\include\hi_comm_sys.h
文件 3918 2016-03-28 19:36 rtsp-h264\include\hi_comm_vb.h
文件 9652 2016-03-28 19:36 rtsp-h264\include\hi_comm_vda.h
文件 9533 2016-03-28 19:36 rtsp-h264\include\hi_comm_vdec.h
文件 31183 2016-03-28 19:36 rtsp-h264\include\hi_comm_venc.h
文件 3732 2016-03-28 19:36 rtsp-h264\include\hi_comm_vgs.h
文件 25601 2016-03-28 19:36 rtsp-h264\include\hi_comm_vi.h
文件 15758 2016-03-28 19:36 rtsp-h264\include\hi_comm_video.h
文件 17292 2016-03-28 19:36 rtsp-h264\include\hi_comm_vo.h
文件 16672 2016-03-28 19:36 rtsp-h264\include\hi_comm_vpss.h
............此处省略103个文件信息
- 上一篇:学校人力资源管理系统
- 下一篇:origin使用教程.pdf
评论
共有 条评论