0

Hello there? There is one question. nexus5 lollipop5.1's issue. surfaceflinger there is a code that comes in response to the device screen information in ScreenshotClient update by using. The code looks like the following.

unsigned int sw, sh, xsize, gsize, stride;
... ...
ScreenshotClient sc;

sp<IBinder> display = SurfaceComposerClient::getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain);

if( sc.update(display,Rect(), sw,sh, false) != NO_ERROR) {
    ... ...

    sc.release();

    return 0;
}
stride = sc.getStride();

mapbase = sc.getPixels();
... ...

The above code, in other lollipop version is operating normally. Of course, nexus7 the same version also operate normally. However, the change in nexus5. My code to reference, but continue to code loop is. And because you try to get to continue the screen. First I code in nexus5 is operating normally. However, when a certain count is, update is not came under the other screen to return the error. More ...! After complete finished my code, re-run, after it is another well, the same phenomenon occurs when it comes to a certain number. If you are ability who know about this?

I'm sorry it is not so good in English.

  • What are you trying to do? Can you just use `SurfaceComposerClient::getDisplayInfo()` to get what you need? – fadden Apr 28 '15 at 15:41
  • @fadden Continue get the device screen information repeatedly calling the code. By the way problem, if you repeated about 1,000 times, `if (sc.update (display, Rect (), sw, sh, false)! = NO_ERROR)` this part will return to continue Error. For reference, to create the jpeg format file by using the device screen information that has been imported. T.T – user2362055 Apr 29 '15 at 05:47

1 Answers1

0

I had solve. ScreenshotClient sc and sp < IBinder > display should be declared as a global variable. If the class is declared error occurs several times. (example. It declared in the function to be repeated.)