Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2010

    Need Help on CCamera and MCameraObserver2 and StartViewFinderDirectL

    I'm using these CCamera and MCameraObserver2 classes for implementing Image and video capturing on N97.As you know it has two cameras one on front and other on the back ,I'm stuck with how to use the startviewFinder.
    In case of front camera it is coming under EViewFinderBitmapsSupported option so I'm able to launch the view finder using StartViewFinderBitmapsL.
    But in case of back camera it is coming under EViewFinderDirectSupported so I'm using

    CCoeEnv* coeEnv = CCoeEnv::Static();
    iCamera->StartViewFinderDirectL(coeEnv->WsSession(),*(coeEnv->ScreenDevice()),*this->DrawableWindow,screenSize,pictureSize );
    here it is getting failed.
    I'm developing the app in Qt.I'm not sure of the arguments that needs to passed to this method.can any body help me how to use this method in qt?
    should my app class get inherited from RWindowBase in order to use this method or is there any other way?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003

    Re: Need Help on CCamera and MCameraObserver2 and StartViewFinderDirectL

    if you are using Qt, then you might want to look into the Mobility 1.1.0, it does have Camera API in it. Secondly if something fails, you should always explain on what is actually happening.

  3. #3
    Registered User
    Join Date
    Dec 2010

    Re: Need Help on CCamera and MCameraObserver2 and StartViewFinderDirectL

    Hi thanks for the quick reply.
    First thing is I can't use the Qt mobility 1.1.0 because it is still in experimental stage.
    Coming to the my problem ,after executing this step iCamera->StartViewFinderDirectL(coeEnv->WsSession(),*(coeEnv->ScreenDevice()),*this->DrawableWindow,screenSize,pictureSize ); the application is exiting.Its not even leaving anything
    TRAPD(error,iCamera->StartViewFinderDirectL(coeEnv->WsSession(),*(coeEnv->ScreenDevice()),this->Window(),screenSize ))
    if(error == KErrNone)
    QMessageBox::warning(this,"", "no leave",0,0);
    if(error == KErrNotSupported)
    QMessageBox::warning(this,"", "KErrNotSupported",0,0);
    else if(error == KErrNotReady)
    QMessageBox::warning(this,"", "KErrNotReady",0,0);
    QMessageBox::warning(this,"", "nothig matched",0,0);
    no case is getting matched for me.

    I need the help on the arguments that needs to passed , especially the third argument ,that is pointer to the RWindowBase.i tried with these
    *this->Window(),internalWinId()->Window() ,since my app is inheriting from QMainWindow .

  4. #4
    Regular Contributor
    Join Date
    Oct 2008
    Oslo, Norway

    Re: Need Help on CCamera and MCameraObserver2 and StartViewFinderDirectL


    You can get the native window ID (On Symbian, a pointer to a CCoeControl-derived class instance) with QWidget::effectiveWinId(). However, I think it would be better to create a completely new CCoeControl-derived container window for the viewfinder to use.

    Something like this:

    #ifdef Q_OS_SYMBIAN
    #include <coecntrl.h>
    #include <w32std.h>
    class CViewFinderContainer : public CCoeControl
        static CViewFinderContainer* NewL(const TRect& aRect) {
          CViewFinderContainer* self = new (ELeave) CViewFinderContainer;
          return self;
        virtual ~CViewFinderContainer() {}
        CViewFinderContainer() {}
        void ConstructL(const TRect& aRect) {
      // see TSS001472
      void Draw( const TRect& aRect ) const {
        CWindowGc& gc = SystemGc();
        gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
        gc.SetBrushColor( TRgb( 0, 0 ) );
    Then just pass container's DrawableWindow() to StartViewFinderDirectL().

    Btw, nothing keeps you from using StartViewFinderBitmapsL() with the main camera, either.

Similar Threads

  1. StartViewFInderDirectL error = -14
    By fecxelmin in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-12-07, 08:26
  2. Replies: 3
    Last Post: 2009-11-27, 07:42
  3. Replies: 4
    Last Post: 2009-07-13, 08:36
  4. MCameraobserver2 vs MCameraobserver
    By Rishi Kaura in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2008-05-16, 08:12
  5. CCamera/MCameraObserver2
    By Rishi Kaura in forum Symbian Media (Closed)
    Replies: 5
    Last Post: 2008-05-13, 07:54

Posting Permissions

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