影响当中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希望能有所帮助

解决方案 »

  1.   

    截图方法种类太多了,/dev/graphics/fb0这样的一般还要root才能读取,一般用的不多了
      

  2.   

    大侠,我看到screencap里也是通过读取/dev/graphics/fb0的啊,但是我直接去读确实不行?您手头要是有Nexus7的话,跟其它手机对比一下就知道了。
    我帖子里讲的ddms通过getScreenshot接口确实是错了,这是2.3.3的代码里这样做的。
      

  3.   

    其实是这样,我在用开源的libvncserver做android的VNC程序,除了读取fb0,我不知道还有其它什么方法才能读取?root是没问题的,不过能有不root的办法那是更好。请赐教。
      

  4.   


    程序其实应该算搞定了,因为所有其它手机、平板都ok的,唯独这个Nexus7有问题。
    安卓的机海战略真是让人头疼,你不去兼容吧,人抱怨你做的不好,你去都兼容吧,现有的机种就得累死你,更别提后续维护。
      

  5.   

    我和你遇到一样的问题,我在nexus 3上也想获取fb0的数据,里面根本啥都没有,全0。现在怀疑nexus系列是不是都这样。这个问题跟root没关系,我都root过了,一样全0,怀疑是不是google做了啥手脚,nexus不是可以自己截图吗,我觉得可以从这里入手追一下代码,看它最后是怎么实现的。
      

  6.   


    应该跟自己截图无关(您所指应该就是同时按住电源键+音量下键),这个不是Nexus才有,是4.0 ICS新增的特性,所有4.0以后的手机都可以这样截屏,但这些手机我测试过fb0读取都是正常的。
    看来所有Nexus系列都有这个通病,这背后一定有原因。Google工程师不可能不知道这事,说不定故意这么做的。
      

  7.   

    在网上找到一段解释这个问题的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.
      

  8.   


    感谢这位仁兄,应该是Google做了手脚了。目前ScreenCast出到3.2版了,还是不能support Galaxy Nexus系列,看来我也有非常充分的理由不去support它了。结贴。
      

  9.   

    三星GT-P7510设备 与楼主所描述的 Galaxy Nexus设备有相同的问题。我试过,别的手机都可以,GT-P7510不好使,黑的。GTP-7310不全是黑的,但是也不行,7310 fb0 里面装的有点像开机画面
      

  10.   

    GT P7510也是黑的读不到任何数据,有没有解决方案
      

  11.   

    我们引擎目前也遇到这个问题,在这个设备上后处理会花屏,无法写入数据,如果这样的话,游戏在这个平板电脑上运行只能关闭后处理效果了,另外 cocos3d-x 发布了,可以在github上获取源码,有兴趣的朋友可以加入cocos3d-x群 194861571 一起学习。