×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    190

    Direct screen access in Symbian 3rd edition - still available?

    I have used direct screen access in Symbian 1st/2nd ed (CDirectScreenAccess).

    Now when porting to 3rd edition, there're problems (seems like UserSvr::ScreenInfo does never return valid screen pointer).

    Can someone confirm if DSA is possible in Symbian 3rd edition?

  2. #2
    Registered User
    Join Date
    Mar 2006
    Posts
    6

    Re: Direct screen access in Symbian 3rd edition - still available?

    Check out this example:
    http://www.forum.nokia.com/info/sw.n..._v1_0.zip.html

    It uses CDirectScreenAccess and works on the 3rd edition

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    190

    Re: Direct screen access in Symbian 3rd edition - still available?

    I checked. This example uses CDirectScreenAccess for something (forcing screen refresh), but for copying ofscreen buffer to video memory it uses plain and slow BitBlt. Even it relies on BitBlt performing colordepth conversion.

    So that's not what I'm looking for.

    There was an example with real direct screen access, which was taking address of video memory where app could directly write pixels. This is how I used to draw graphics efficiently on Symbian 1st/2nd edition. Now I'd like to find the same for 3rd edition.

    Note that using any kind of CBitmapContext::BitBlt is too slow for games or video playback.

  4. #4
    Regular Contributor
    Join Date
    May 2005
    Location
    Sweden
    Posts
    272

    Re: Direct screen access in Symbian 3rd edition - still available?

    You're out of luck (sort of). BitBlt() is horribly slow when it does colour depth conversion, but if you take care of that yourself and then call BitBlt(), it's usable.

    If it suits the design of your app, the "Anti-tearing API" (CDirectScreenBitmap) might be what you want.

  5. #5
    Registered User
    Join Date
    Jul 2003
    Posts
    190

    Re: Direct screen access in Symbian 3rd edition - still available?

    BitBlt is typically 2x slower than direct memcpy to screen, even if bitdepth matches.

    Thanks for info about CDirectScreenBitmap. Is there some working example with source code?

    I have tried to use CDirectScreenBitmap, it works on Symbian 7.0 (also on real device) - although CActive::RunL is never called.
    On Symbian 9.1 I'm getting E32USER-CBase 46 (stray signal) after calling CDirectScreenBitmap::EndUpdate. I've no clue why, any idea?

  6. #6
    Regular Contributor
    Join Date
    May 2005
    Location
    Sweden
    Posts
    272

    Re: Direct screen access in Symbian 3rd edition - still available?

    No, I don't think there are any examples. As for the stray signals, I have no idea.

  7. #7
    Registered User
    Join Date
    Jul 2003
    Posts
    190

    Re: Direct screen access in Symbian 3rd edition - still available?

    We may try to guess what kind of TRequestStatus is to be passed to CDirectScreenBitmap::EndUpdate.

    Header file cdsb.h just writes:
    EndUpdate Indicates to the Video Driver that the bitmap corresponding to the update has been fully rendered. The video driver will perform the actions required to copy this to the frame buffer.

    But what is supposed to be video driver??
    I tried to make own CActive-inherited object, but then I get stray signals, I think because the signal has to be directed to a video driver.
    Anyone has further ideas?

  8. #8
    Regular Contributor
    Join Date
    May 2005
    Location
    Sweden
    Posts
    272

    Re: Direct screen access in Symbian 3rd edition - still available?

    I don't understand your question.

    You'll get a callback from the video driver when the screen update has finished. This has to be caught somehow, or you'll get a stray signal panic. For example, if you call User::WaitForRequest(yourTRequestStatus) right after EndUpdate(), you won't get the panic. So I guess there's something wrong with your active object.

  9. #9
    Registered User
    Join Date
    Jul 2003
    Posts
    190

    Re: Direct screen access in Symbian 3rd edition - still available?

    ptrmn, I hope you know what are active objects designed for. They're not made for stalling execution while waiting for them to complete, rather they're signalled asychronously and CActive::RunL is called when request is complete.

    I have used active objects with CSocket, CTimer, and other places, and I never had to use User::WaitForRequest, and I don't get stray signals in other code.

    I'll try to restate the question:
    What kind of CActive object is supposed to be used with CDirectScreenBitmap::EndUpdate? Self-declared, or utilizing some existing system class?

  10. #10
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Direct screen access in Symbian 3rd edition - still available?

    Use DSA is supported via CDirectScreenBitmap in 3rd edition, see technote TSS000307
    in the Nokia Technical Library

  11. #11
    Registered User
    Join Date
    Jul 2003
    Posts
    190

    Re: Direct screen access in Symbian 3rd edition - still available?

    I have read that technote. It doesn't tell more than cdsb.h header file.

    But can someone please answer the question, what kind of CActive has to be used, and why I get E32USER-CBase 46 panic?

    So far I'm not convinced that it works.

  12. #12
    Regular Contributor
    Join Date
    May 2005
    Location
    Sweden
    Posts
    272

    Re: Direct screen access in Symbian 3rd edition - still available?

    mike.b: I was suggesting you try to get it to work first with WaitForRequest(), as that might be easier. And it works on 3rd edition devices.

  13. #13
    Regular Contributor
    Join Date
    May 2005
    Location
    Sweden
    Posts
    272

    Re: Direct screen access in Symbian 3rd edition - still available?

    Anyway, here's how you use it:

    Start DirectScreenAccess.

    iDSBitmap = CDirectScreenBitmap::NewL();

    Each time after calling CDirectScreenAccess::StartL():
    iDSBitmap->Create(iDrawingRect, CDirectScreenBitmap::EDoubleBuffer);

    Each time DirectScreenAccess is stopped:
    iDSBitmap->Close();

    Drawing:

    TAcceleratedBitmapInfo info;
    iDSBitmap->BeginUpdate(info);
    iScreenAddr = info.iAddress;
    ... // Draw directly to screen iScreenAddr
    iDSBitmap->EndUpdate(iStatus);

  14. #14
    Registered User
    Join Date
    Jul 2003
    Posts
    190

    Re: Direct screen access in Symbian 3rd edition - still available?

    I finally got it work.

    Thanks for code example, but it's missing important part:

    Code:
    class C_dsb_active: public CActive{
    public:
       C_dsb_active():
          CActive(CActive::EPriorityHigh)
       {
          CActiveScheduler::Add(this);
       }
       virtual void RunL(){ }
       virtual void DoCancel(){ }
       void SetActive(){ CActive::SetActive(); }
    };
    C_dsb_active dsb_active;
    ...

    Code:
    dsb_active.Cancel();
    iDSBitmap->EndUpdate(dsb_active.iStatus);
    dsb_active.SetActive();
    This is what I wanted to know - that one has to create own CActive-inherited class, register it to active scheduler using CActiveScheduler::Add(this), and after each EndUpdate need to call CActive::SetActive() on this call. And there's additional CActive::Cancel() for case that app draws too fast (avoid multiple activations).

    Now yes, it works for me, even on Symbian 7.0. But it was hell to decipher missing information how to use this method.
    Thanks for help anyway.

  15. #15
    Registered User
    Join Date
    Aug 2006
    Posts
    46

    Re: Direct screen access in Symbian 3rd edition - still available?

    Thanks for greate example.
    Its works for me but not for long, application crashes after running 1-2 minutes.
    If i comment

    iDSBitmap->BeginUpdate(info);
    iScreenAddr = info.iAddress;

    and

    iDSBitmap->EndUpdate(iStatus);

    it can run for hours without problem.
    Any ideas whats wrong with this stuff?

Similar Threads

  1. Replies: 2
    Last Post: 2009-03-10, 08:18
  2. Replies: 0
    Last Post: 2005-12-12, 07:10
  3. Direct Screen Access in OpenGL ES.
    By raghu_an in forum Symbian
    Replies: 0
    Last Post: 2004-03-28, 11:33
  4. Direct Screen Access
    By in forum Symbian
    Replies: 0
    Last Post: 2003-02-25, 05:21
  5. Direct screen access question?
    By in forum Symbian
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •