|
发表于 2016-3-21 11:13:21
只看该作者
5#
详细代码如下:
static int rga_display(SDL_Overlay *overlay, SDL_Rect* rect)
{
static int start_display= 0;
if (!start_display)
{
start_display=1;
int fb_size = rect->w*rect->h*4;
char* fb_addr = open_fb(fb_size);
int rga_fd = rga_init(overlay->w, overlay->h, fb_addr, rect->w, rect->h);
g_fb_info.rga_fd = rga_fd;
}
rga_scale(g_fb_info.rga_fd, (char**)overlay->pixels);
return(0);
}
static int rga_scale(int fd, char **src)
{
Rga_Request.src.yrgb_addr = (int)(src[0]);
Rga_Request.src.uv_addr = (int)(src[1]);
Rga_Request.src.v_addr = (int)(src[2]);
if(ioctl(fd, RGA_BLIT_SYNC, &Rga_Request) != 0) {
printf("ioctl rga error!!\n");
exit(-1);
return -1;
}
return 0;
}
大神帮忙瞅瞅 |
|