2 di626000216 di626000216 于 2013.08.14 11:13 提问

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进行读取就死机!
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!