×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    11

    Camera ViewFinder problem

    I have a strange problem with camera ViewFinder.

    I use MCameraObserver2 interface. This interface has a method - ViewFinderReady(MCameraBuffer& aCameraBuffer, TInt aError), which has to be called periodicaly.
    But in my program it called only once.

    There is my algorithm with camera:

    1) iCamera = CCamera::New2L(*this, 0, 0);
    2) iCamera->Reserve();
    3) in HandleEvent(const TECAMEvent& aEvent) I call iCamera->PowerOn();
    4) in HandleEvent(const TECAMEvent& aEvent) I call StartViewFinder();

    A code of the HandleEvent and StartViewFinder:

    PHP Code:

    void HandleEvent
    (const TECAMEventaEvent)
        {
        if (
    aEvent.iEventType == KUidECamEventReserveComplete)
            {
            if (
    aEvent.iErrorCode == KErrNone)
                {
                
    iCamera->PowerOn();
                }
            else
                {
                }
            }
        else
            if (
    aEvent.iEventType == KUidECamEventPowerOnComplete)
                {
                if (
    aEvent.iErrorCode == KErrNone)
                    {
                    
    StartViewFinder();
                    }
                else
                    {
                    }
                }
    }


    void StartViewFinder()
        {
        if (
    iCamera->ViewFinderActive())
            {
            return;
            }
        
    TRAPD(erriCamera->StartViewFinderBitmapsL(iSize));
         } 
    StartViewFinder TRAP return KErrNone (err == KErrNone)

    After that MCameraObserver2's method ViewFinderReady() called and I draw the image on a screen.
    BUT: after that ViewFinderReady() does NOT called and my screen aren't updating

    But camera are working at the moment, so I can capture image (before capturing image I call StopViewFinder). After capturing image I call StartViewFinder and again ViewFinderReady() called only once.

    What a problem could be?

    ViewFinderReady implamentation
    PHP Code:
    void ViewFinderReady(MCameraBufferaCameraBufferTInt aError)
        {
        
    iNotifier.DrawImage(aCameraBuffer.BitmapL(0));
        } 
    I've been testing this on a Nokia N78 (FP2)

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,688

    Re: Camera ViewFinder problem

    Unfortunately I have no FP2 device, but my guess would be this one
    Quote Originally Posted by SDK Help
    virtual void Release()=0;
    Description
    Releases the buffer. Once the client has processed the picture data it should use this method to signal to CCamera that the buffer can be re-used
    You should try invoking aCameraBuffer.Release() after using the bitmap.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    11

    Re: Camera ViewFinder problem

    wizard_hu_

    Thank you for a such quick answer.
    And other thanks for the solution of the problem.
    It works good now

Similar Threads

  1. Camera viewfinder rotation problem
    By bugge in forum Symbian
    Replies: 5
    Last Post: 2010-01-07, 12:54
  2. Using camera frame as OpenGL texture, problem!!
    By abolfoooud in forum Symbian Media (Closed)
    Replies: 29
    Last Post: 2009-06-18, 02:58
  3. Camera viewFinder
    By nuker85 in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2008-12-01, 09:48
  4. N90 Camera Problem!...
    By toybox89 in forum Mobile Java General
    Replies: 11
    Last Post: 2006-06-01, 15:30
  5. Nokia N70 Camera Shutter & Media Key Problem!!!
    By joshua_dsouza86 in forum General Development Questions
    Replies: 0
    Last Post: 2006-01-30, 08:31

Posting Permissions

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