×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    227

    View Finder not displayed in N96

    Hi i'm try to use ccamera to capture image

    In many devices it can run well.
    But in nokia N96 the view finder is not displayed...
    (maybe because N96 is FP2 ??)
    What is the problem?
    How to solved this problem?


    Or there is any example that i can learn?


    Thx a lot

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: View Finder not displayed in N96

    I thikn you should debug the application a bit omre to see what it is that is going wrong with it.. wit the current information is it rather impossible to know what goes wrong inside of it.

  3. #3
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    227

    Re: View Finder not displayed in N96

    Ah i guess N96 not support DirectViewFinder, i change to BitmapViewFinder and it can capture image well.


    But now i got another problem (in other devices, not n96), why in the function
    ImageReady(CFbsBitmap* /*aBitmap*/, HBufC8* aData, TInt aError)

    the aData is not there yet, so if i save the image to file it will panic

    what's wrong with the aData?

    Anyone know this problem?

    Thx a lot

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: View Finder not displayed in N96

    aBitmap and aData are not just random variables, they are going to have some content according to what kind of output you have requested. Check TFormat once more. EFormatFbsBitmapColorXy will produce "CFbsBitmap *aBitmap", everything else will result in "HBufC8 *aData".

  5. #5
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    227

    Re: View Finder not displayed in N96

    Quote Originally Posted by wizard_hu_ View Post
    aBitmap and aData are not just random variables, they are going to have some content according to what kind of output you have requested. Check TFormat once more. EFormatFbsBitmapColorXy will produce "CFbsBitmap *aBitmap", everything else will result in "HBufC8 *aData".


    i using EFormatJpeg in this case

    the aData maybe NULL,
    but i need that aData, so i can write it to file

    O yah i want to ask about the viewfinfer mode, if i only use bitmapviewfinder is that OK?

    Thx

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: View Finder not displayed in N96

    Hmm... If aData is NULL, aError probably is not. You may want to check it (I can easily imagine KErrNoMemory for example).
    By the way: low-memory situations and the like may also affect the viewfinder.

  7. #7
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    227

    Re: View Finder not displayed in N96

    i'm using this in my code :


    void CCameraEngine::ImageReady(CFbsBitmap* /*aBitmap*/, HBufC8* aData, TInt aError)
    {
    if ((KErrNone == aError) && (aData))
    {
    // saving method...
    ....

    User::LeaveIfError(file.Write(aData));


    delete aData;
    }
    else
    {
    iObserver.OnError(aError); --->notify the error
    }
    }


    nah i got error = 0, suppose the aData is the problem, right?
    but why the aData is not there?

    Need help please

    Thx

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: View Finder not displayed in N96

    Although I would expect some error code if EFormatJpeg is not supported, have you really checked if EFormatJpeg+the size index you use would produce something (EnumerateCaptureSizes)?
    Alternatively you may try EFormatExif.

    Note that your code is hypothetical, file.Write(aData) can not compile if aData is HBufC8*. Prefer copy-paste when posting.

  9. #9
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    227

    Re: View Finder not displayed in N96

    Quote Originally Posted by wizard_hu_ View Post
    Although I would expect some error code if EFormatJpeg is not supported, have you really checked if EFormatJpeg+the size index you use would produce something (EnumerateCaptureSizes)?
    Alternatively you may try EFormatExif.

    Note that your code is hypothetical, file.Write(aData) can not compile if aData is HBufC8*. Prefer copy-paste when posting.


    Ah ya forgot the star *aData

    TRAPD(err, iCamera->PrepareImageCaptureL(format, 2));
    ok try to check the size, maybe from 0 - 3

    Oh yah how to check the format supported and size supported by the device?


    Thx again wizard_hu

  10. #10
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    227

    Re: View Finder not displayed in N96

    o ya in my code to check the supported format is like this:


    iCamera->CameraInfo(iCameraInfo);

    if ((iCameraInfo.iImageFormatsSupported & CCamera::EFormatJpeg) > 0)
    format = CCamera::EFormatJpeg;
    else if ((iCameraInfo.iImageFormatsSupported & CCamera::EFormatExif) > 0)
    format = CCamera::EFormatExif;

    is that ok?

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: View Finder not displayed in N96

    It seems to be fine. However since you say it actually does not work, you may want to try checking for exif-support first.
    And/or you may consider adding an else at the end in order to see if neither branch has been executed (a simple User::Panic could do the job).

  12. #12
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    227

    Re: View Finder not displayed in N96

    Quote Originally Posted by wizard_hu_ View Post
    It seems to be fine. However since you say it actually does not work, you may want to try checking for exif-support first.
    And/or you may consider adding an else at the end in order to see if neither branch has been executed (a simple User::Panic could do the job).

    in the if statement, the format is in the CCamera::EFormatJpeg,
    but the aData error, maybe i must try another format yah?
    (in format exif the devices not support)

  13. #13
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: View Finder not displayed in N96

    Quote Originally Posted by Kaz32 View Post
    Oh yah how to check the format supported and size supported by the device?
    Oh, I have not noticed this question so far. You already know the format.
    For the sizes you can expect, check CCamera::EnumerateCaptureSizes (aSize is an output argument, it is going to contain the size for the specified size index).

  14. #14
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    227

    Re: View Finder not displayed in N96

    Eh I try in format EFormatFbsBitmapColor16M, so my imageready function :

    void CCameraEngine::ImageReady(CFbsBitmap* aBitmap, HBufC8* aData, TInt aError)
    {
    if ((KErrNone == aError) && (aData))
    {
    // saving method...
    ...

    User::LeaveIfError(file.Write(*aData));


    delete aData;
    }
    // In format EFormatFbsBitmapColor16M
    // Add this, because the aData doesn't exist
    else if((KErrNone == aError) && (aBitmap))
    {
    // converting aBitmap to jpg
    ....

    }
    else
    {
    iObserver.OnError(aError); --->notify the error
    }
    }


    the image can save to the jpg,
    but the problem is the image rather flicker/ failure in the right section of the image
    any one know this problem?

    O Yah the devices i used is Samsung Innov8/ i8510
    (eh what is web of samsung forum?, just like this forum but for samsung?)

    Thx

Similar Threads

  1. Replies: 5
    Last Post: 2009-02-06, 16:18
  2. Camera view finder
    By Karliski in forum Python
    Replies: 1
    Last Post: 2007-07-07, 21:59
  3. View not displayed on N95 3rd edition
    By Rozik in forum Symbian C++
    Replies: 1
    Last Post: 2007-04-26, 14:06
  4. capturing image without view finder.
    By sajindra in forum Symbian C++
    Replies: 4
    Last Post: 2006-01-09, 21:43
  5. Replies: 2
    Last Post: 2004-08-04, 09:48

Posting Permissions

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