Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User feixing1's Avatar
    Join Date
    Aug 2009
    Posts
    19
    Code:
        QGraphicsVideoItem* videoItem = new QGraphicsVideoItem(this);
        videoItem->setSize(QSizeF(480, 360));
        videoItem->setPos(80, 0);
    
    //    QCameraViewfinder* viewFinder = new QCameraViewfinder();
    //    viewFinder->setFixedSize(480, 360);
    //    QGraphicsProxyWidget* widget = new QGraphicsProxyWidget(this);
    //    widget->setWidget(viewFinder);
    //    widget->setPos(80, 0);
    
    
        QList<QByteArray> devices = QCamera::availableDevices();
        for(int i=0; i<devices.size(); i++)
        {
            qDebug() << devices.at(i);  //Primary camera; Secondary camera
        }
    
        QByteArray device = devices[0]; //Primary camera
        QCamera* camera = new QCamera(device, this);
        qDebug() << "Camera Available:" << camera->isAvailable(); //Camera Available: true
        connect(camera, SIGNAL(error(QCamera::Error)), this, SLOT(showError(QCamera::Error)));
        camera->setViewfinder(videoItem);
        camera->setCaptureMode(QCamera::CaptureStillImage);
        camera->start();
    when i use Secondary camera, everything works fine. but when i change to the Primary camera, got a graphicsitem fill with black, and got a warning "Cannot write to gdb: No connection"

    how can i use the Primary camera correctly? thanks for any advice

  2. #2
    Registered User vladest's Avatar
    Join Date
    Apr 2009
    Posts
    506
    what was the phone?
    there is a bug in QtMobility in terms of QGraphicsVideoItem+QGamera+Symbian^1
    Symbian & Qt developer. http://vladest.org

  3. #3
    Registered User feixing1's Avatar
    Join Date
    Aug 2009
    Posts
    19
    Quote Originally Posted by vladest View Post
    what was the phone?
    there is a bug in QtMobility in terms of QGraphicsVideoItem+QGamera+Symbian^1
    my device is Nokia N97. even i use QCameraViewfinder* as viewfinder, cant work with Primary camera, but works fine with Secondary camera.

    The strange thing is this example(http://doc.qt.nokia.com/qtmobility-1...pture-cpp.html) works correctly with Primary camera on the same device N97.

Similar Threads

  1. Replies: 2
    Last Post: 2011-03-13, 18:41
  2. How to use the device camera to take pictures?
    By Rondo23 in forum [Archived] Qt Mobility Project
    Replies: 13
    Last Post: 2010-12-28, 11:47
  3. video call primary camera
    By hidden_ghost in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2010-08-08, 15:16
  4. how to capture the camera shutter open event from the camera phones?
    By kanishk_408 in forum Mobile Java General
    Replies: 1
    Last Post: 2009-06-05, 12:50
  5. Camer on N95: How do i know that the primary camera is closed??
    By gmsk19 in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2008-06-09, 15:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved