I wrote this peace of code for android 1.5 it was working fine on
device and Emulator but when I ported for Android 2.0.1 I started
facing problem.
Please suggest what is wrong and what has changed on the framebuffer
side on 1.5 and 2.0?
Vineet
> I am having similar problem, screehshot code work fine on Emulator but
> does work fine when taken from devices.
>
> I wrote this peace of code for android 1.5 it was working fine on
> device and Emulator but when I ported for Android 2.0.1 I started
> facing problem.
> Please suggest what is wrong and what has changed on the framebuffer
> side on 1.5 and 2.0?
>
> Vineet
I believe that graphics are rendered in the GPU's private memory on Android 2.0 rather than in a frame buffer accessible from the CPU.
The Android 2.0 Surface Flinger appears to have been changed with that in mind: it no longer assumes that it has direct memory access to the screen image, and all graphics operations are done through OpenGL calls.
The Android engineers have said that this transition would occur, in various mailing list posts over the past year or so.
For our attempts at allowing remote control of Android devices[1], we added a 'capture screen' API to the surface flinger. For Android 1.0-1.6, this could simply copy a section of the memory which Surface Flinger pointed at. For Android 2.0, we had to go a bit further and call glReadPixels to grab the screen image each time.
If this is the case, and graphics are being composited in GPU memory not accessible from the CPU, then that means there is no way to take screenshots of Android devices without adding additional APIs to Surface Flinger like we've had to, and using glReadPixels in their implementation. I find it amazing that Google's marketing department allow that situation to exist :-)
Regards
Adrian
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Now I am able to get screen-shot on android 1.6
I downloaded the full source code of android 1.6
For my device, the default screen resolution is 1366 x 768.
For this particular resolution, the frame-buffer size is not exactly
1366 x 768; some padding bits are added in frame-buffer.
If one is able to deal with this padding bits, it is possible to have
screen-capture.
This info is available in VSCREENINFO structure.
Right now I managed to change the screen resolution to 800 x 600.
For this resolution, no padding bits are added in the frame-buffer.
One can have exact screen-shot for this screen resolution.
Android DDMS screen capture utility also fails at 1366 x 768 screen
resolution and works properly for 800 x 600 screen resolution.
For screen capturing, I am directly reading /dev/graphics/fb0 file,
and creating bmp file.
Thanks,
Niraj
On Dec 24 2009, 6:09 pm, "p. yog" <usb...@gmail.com> wrote:
> Hi all and Andrian,
>
> Thanks for your valuable suggestions, i have doubts in surface flinger part.
> can you please clarify these.
>
> I want to collect frame buffer data in surface flinger layer and need to
> give it to APP. Here are my doubts
>
> 1) where can i get the right Frame buffer data that is going to frame-buffer
> driver in surface flinger? If i call glReadpixel, can i get right frame
> buffer data.
>
> (or) Is there any other point that i get Frame buffer info.
>
> 2) can the Java APP written can collect this frame buffer data? In
> "frameworks/base/core/res/AndroidManifest.xml" file there given
> "GET_FRAME_DATA" structure which says that we can collect frame buffer data,
> does it mean that any written APP can collect Frame data?
>
> Any such open App that is collecting data from libraries section. Just for
> an Idea.
>
> Thanks in advance,
> Yog
>
> >> On Sat, Dec 19, 2009 at 4:46 PM, Adrian Taylor <adrian.tay...@realvnc.com
> >>>http://groups.google.com/group/android-platform/browse_thread/thread/...
>
> >>> --
>
> >>> You received this message because you are subscribed to the Google Groups
> >>> "android-ndk" group.
> >>> To post to this group, send email to andro...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr oups.com>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/android-ndk?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-ndk" group.
> > To post to this group, send email to andro...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-ndk...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/android-ndk?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-ndk" group.
> > To post to this group, send email to andro...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr oups.com>