问题描述
- ARM 上进行视屏截屏是死机
- 在ARM上对正在播放的视频文件进行截屏时挂掉啦, 但是截取静态图片是成功的。以下是代码, 求高手指教!~
struct fb_fix_screeninfo finfo;
struct fb_var_screeninfo vinfo;
uchar *frameBuffer = NULL;
long int screensize = 0;(fb0里是普通静态画面的缓冲设备, fb1是视频播放时的缓冲设备)qint32 fd = open(""/dev/graphics/fb1"" O_RDONLY);if (fd < 0) { fd = open(""/dev/fb"" O_RDONLY); if (fd < 0) { return false; }}if (ioctl(fd FBIOGET_FSCREENINFO &finfo)<0) { return false;}if (ioctl(fd FBIOGET_VSCREENINFO &vinfo)<0) { return false;}screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;int curViewOffset = vinfo.yoffset/480;frameBuffer = (uchar *) mmap(0 /* start */ screensize /* bytes */ PROT_READ /* prot */ MAP_SHARED /* flags */ fd /* fd */ screensize * curViewOffset /* offset */);if (MAP_FAILED == frameBuffer) { return false;}只要对frameBuffer进行读取就死机!
时间: 2024-10-30 03:00:13