录播主机开机logo显示

Posted 旧年不在cd

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了录播主机开机logo显示相关的知识,希望对你有一定的参考价值。

一、开机logo显示流程:

  • 通过命令行将logo图片烧录到flash的指定位置(已经实现可以通过升级工具进行烧写)
usb reset
fatload usb 0 0x44000000 logo.jpg		//将U盘中的logo图片读到内存0x44000000的位置上
usb stop
sf probe 0
sf erase 3000000 100000
sf write 44000000 3000000 100000		//将logo图片写到flash 0x3000000的位置
  • 在u-boot中添加如下logo如下代码:自动读取flash logo分区的图片信息,并设置环境变量,解码显示(3531d/osdrv/opensource/uboot/u-boot-2010.06/common/display_logo.c)
#include <common.h>
#include <command.h>
#include <image.h>
#include <spi_flash.h>
#include <linux/mtd/mtd.h>
#include <environment.h>
#include <hi3531d_vo.h>

#define LOGO_LOAD_ADDR      0x44000000
#define LOGO_DECODE_ADDR    0x44800000
#define VO_NUM              0
#define VO_TYPE             4       //VGA
#define VO_SYNC             12      //1080P60
#define VL_NUM              0
#define X                   0
#define Y                   0
#define LOGO_W              1920
#define LOGO_H              1080
#ifndef CONFIG_SF_DEFAULT_SPEED
#define CONFIG_SF_DEFAULT_SPEED	    1000000
#endif
#ifndef CONFIG_SF_DEFAULT_MODE
#define CONFIG_SF_DEFAULT_MODE      SPI_MODE_3
#endif

#if 1
#define DBG(x...)       printf(x)
#else
#define DBG(x...)       do   while (0)
#endif

extern int load_jpeg(void);
extern int jpeg_decode(void);
extern int start_vo(unsigned int dev, unsigned int type, unsigned int sync);
extern int start_videolayer(unsigned int layer, unsigned addr, unsigned int strd, unsigned int x, unsigned int y, unsigned int w, unsigned int h);

int display_logo(void)

    int ret = 0;
    unsigned long logo_size = 0;
    struct spi_flash *spf = NULL;
    image_header_t *hdr = NULL;
    char jpeg_addr[32] = 0;
    char jpeg_size[32] = 0;
    char vobuf[32] = 0;
    char *s = NULL;
    int env_update = 0;

    spf = spi_flash_probe(0, 0, CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE);
    if (!spf)
    
        DBG("fail to spi_flash_probe!\\n");
        return -1;
    

    ret = spi_flash_read(spf, AU_FL_LOGO_ST, sizeof(image_header_t), (void *)LOGO_LOAD_ADDR);
    if (ret)
    
        DBG("fail to spi_flash_read!\\n");
        return -1;
    

    hdr = (image_header_t *)LOGO_LOAD_ADDR;
    logo_size = ntohl(hdr->ih_size);
    DBG("logo_size = %#lx\\n", logo_size);
    if (logo_size > 0x100000)
    
        DBG("maybe the logo_size is error!\\n");
        return -1;
    

    ret = spi_flash_read(spf, AU_FL_LOGO_ST + sizeof(image_header_t), logo_size, (void *)LOGO_LOAD_ADDR);
    if (ret)
    
        DBG("fail to spi_flash_read!\\n");
        return -1;
    

    s = getenv("jpeg_addr");
    if ((NULL == s) || (LOGO_LOAD_ADDR != simple_strtol(s, NULL, 0)))
    
        sprintf(jpeg_addr, "%#x", LOGO_LOAD_ADDR);
        DBG("jpeg_addr = %s\\n", jpeg_addr);
        setenv("jpeg_addr", jpeg_addr);
        env_update = 1;
    

    s = getenv("jpeg_size");
    if ((NULL == s) || (logo_size != simple_strtol(s, NULL, 0)))
    
        sprintf(jpeg_size, "%#lx", logo_size);
        DBG("jpeg_size = %s\\n", jpeg_size);
        setenv("jpeg_size", jpeg_size);
        env_update = 1;
    

    s = getenv("vobuf");
    if ((NULL == s) || (LOGO_DECODE_ADDR != simple_strtol(s, NULL, 0)))
    
        sprintf(vobuf, "%#x", LOGO_DECODE_ADDR);
        DBG("vobuf = %s\\n", vobuf);
        setenv("vobuf", vobuf);
        env_update = 1;
    

    if (env_update == 1)
    
        DBG("save env\\n");
        env_crc_update();
        saveenv();
    

    ret = load_jpeg();
    if (0 == ret)
    
        ret = jpeg_decode();
        if (0 != ret)
        
            DBG("fail to jpeg_decode!\\n");
            return -1;
        

        ret = start_vo(VO_NUM, VO_TYPE, VO_SYNC);
        if (0 != ret)
        
            DBG("fail to start_vo!\\n");
            return -1;
        

        ret = start_videolayer(VL_NUM, LOGO_DECODE_ADDR, LOGO_W, X, Y, LOGO_W, LOGO_H);
        if (0 != ret)
        
            DBG("fail to start_videolayer!\\n");
            return -1;
        
    
    else
    
        DBG("fail to load_jpeg!\\n");
        return -1;
    

    return 0;

  • uboot命令行下显示logo的方法:需要先根据图片信息设置环境变量jpeg_addr、jpeg_size、vobuf
sf probe 0
sf read 44000000 3000000 100000
decjpg
startvo 0 4 12
startvl 0 0x44800000 1920 0 0 1920 1080
stopvo 0		//关闭显示

以上是关于录播主机开机logo显示的主要内容,如果未能解决你的问题,请参考以下文章

Android开机logo简单修改方法

改变安卓手机开机LOGO

Linux修改开机启动logo

修改u-boot的开机logo及显示过程

Android5.1开机LOGO与开机动画

手机开机一直显示安卓LOGO,怎么点击都进不了主系统