QCamera Demo

The application shows the viewfinder picture from the device camera and allows the user to capture images. Captured images are stored into the gallery and can be sent as an MMS message to a friend. Application listens for incoming MMS messages in the Inbox folder. If the MMS message contains a picture, the application asks the user whether he or she wants to add the picture as an avatar of the sender. The person's general contact information has to exist in the device phonebook in order to store the avatar in it.

The application uses own MyVideoSurface video surface derived from QAbstractVideoSurface for showing camera view finder pictures. A video surface presents a continuous stream of identically formatted frames.

QMediaService* ms = m_camera->service();
QVideoRendererControl* vrc = ms->requestControl<QVideoRendererControl*>();
m_myVideoSurface = new MyVideoSurface(this,this,this);
vrc->setSurface(m_myVideoSurface);

The application handles Graphics Out Of Memory (GOOM) events in it's QApplication::symbianEventFilter() method.

  bool symbianEventFilter( const QSymbianEvent* symbianEvent )
  {
    const TWsEvent *event = symbianEvent->windowServerEvent();
    if ( !event ) {
      return false;
    }
    switch ( event->Type() ) {
      // GOOM handling enabled
      // http://wiki.forum.nokia.com/index.php/Graphics_memory_handling
      case EEventUser: {
        TApaSystemEvent* eventData = reinterpret_cast<TApaSystemEvent*>(event->EventData());
        if ((*eventData) == EApaSystemEventShutdown) {
            eventData++;
            if ((*eventData) == KGoomMemoryLowEvent) {
             return true;
            }
        }
        break;
      }
      default:
        break;
    };

    // Always return false so we don't stop
    // the event from being processed
    return false;
  }

Required capabilities

Application can be self-signed.

After enabling Qt Mobility Messaging module (MESSAGING_ENABLED flag in .pro file) from the project file is ReadDeviceData WriteDeviceData capabilities also needed and application have to be Developer Signed. Enabling Messaging adds MMS sending feature for the application.

Compatibility

Qt SDK 1.1

Qt 4.7.2 for Symbian

QtMobility 1.1.1

Tested on: Nokia N8, Nokia E7

Developed with: Qt SDK 1.1

Files:

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.