首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

截图软件,Nexus7平板之framebuffer有关问题

2013-03-13 
截图软件,Nexus7平板之framebuffer问题各位大侠,小弟最近在做一个截图软件,是通过抓取/dev/graphics/fb0来

截图软件,Nexus7平板之framebuffer问题
各位大侠,小弟最近在做一个截图软件,是通过抓取/dev/graphics/fb0来实现的。
程序在其它手机平板上运行都很完美,唯独Nexus7平板抓出来的fb0根本就不是屏幕显示的图像,而是一堆乱码。
而且这个文件不管什么时候去抓,数据都不变,从而确认底层根本就没有去修改过它。
所以想请教有没有这方面的达人,知道这种情况下到底应该去哪里读取display的数据?

Nexus7的GPU是Tegra,我私下怀疑它根本就没有去实现读写framebuffer。

一个参考是:我用ddms去抓取截图是ok的,但ddms是调用底层device的getScreenshot接口去抓的,跟framebuffer应该不同。
[解决办法]
影响当中ddms也是通过adb的framebuffer读的。看了你的贴子,查了下jb的code,现在是通过sceencap命令读的。你可以参考frameworks/native/libs/gui/SurfaceComposerClient.cpp
frameworks/base/cmds/screencap/screencap.cpp
sdk/ddms/libs/ddmlib/src/com/android/ddmlib/AdbHelper.java
sdk/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java
system/core/adb/framebuffer_service.c

希望能有所帮助
[解决办法]
在网上找到一段解释这个问题的E文,大概是说google阻止了直接读写framebuffer,原文如下:

Wouldn’t it be great if you could record a video of your phone’s screen? Well, thanks to Media Solutions and a little rooting, Screencast does just that. However, Galaxy Nexus users (such as me) were reporting black screens instead of screen recordings. After trying everything from Mobo Player to re-installing the app, I decided to contact the developer(s). Clearly, this was the right thing to do. Within minutes, I had a response sitting in my inbox.

Media Solution’s answer was nice and simple:

“Google blocked the conventional framebuffer where Screencast and other screen capture utilities grab the screen on the Galaxy Nexus. We are actively investigating new ways to support your device.”

Media Solutions went on to explain to me how the Screencast app works and why exactly it is currently not compatible with the Galaxy Nexus:

“Traditionally, on all Linux systems and all Android OSs (excluding Tegra based devices) the display is updated using what is called the Framebuffer, a layer between the graphics processor and the LCD. You can think of it as a “bucket” which contains what the screen should display, the graphics processor updates it then signals to the LCD to read the bucket. All screen capture programs for Android used this layer to save the screen as a screen shot. Screencast uses it as well to create frames it needs to save as a video.

The Galaxy Nexus seems to use a framebuffer as well (good news). However, the framebuffer seems to always be empty (bad news). This can be due to many factors including permissions on the framebuffer driver. Support for the Galaxy Nexus may be as easy as changing permissions on the framebuffer or as difficult as going back to the drawing board to figure out a new way to grab the display. During each release cycle, we usually have on main big feature + previous bug fixes and tweaks. After Screencast v3.0 is released, Galaxy Nexus support will be the main feature we will be working on.”



So as you can see, Media Solutions already has two plans of action. In addition, I was told that now that v3.0 of Screencast is out, fixing the Galaxy Nexus compatibility issue is their number one priority.

热点排行