diff -r 2b40d63a9c3d -r 90517678cc4f qtmobility/plugins/multimedia/gstreamer/qgstreamerserviceplugin.cpp --- a/qtmobility/plugins/multimedia/gstreamer/qgstreamerserviceplugin.cpp Fri Apr 16 15:51:22 2010 +0300 +++ b/qtmobility/plugins/multimedia/gstreamer/qgstreamerserviceplugin.cpp Mon May 03 13:18:40 2010 +0300 @@ -50,7 +50,9 @@ #ifdef QMEDIA_GSTREAMER_PLAYER #include "qgstreamerplayerservice.h" #endif -#ifdef QMEDIA_GSTREAMER_CAPTURE +#if defined(QMEDIA_GSTREAMER_CAPTURE) && (defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)) +#include "qgstreamercaptureservice_maemo.h" +#elif defined(QMEDIA_GSTREAMER_CAPTURE) #include "qgstreamercaptureservice.h" #endif @@ -77,7 +79,6 @@ #endif #ifdef QMEDIA_GSTREAMER_CAPTURE << QLatin1String(Q_MEDIASERVICE_AUDIOSOURCE) - << QLatin1String(Q_MEDIASERVICE_CAMERA) #endif ; } @@ -91,9 +92,6 @@ #ifdef QMEDIA_GSTREAMER_CAPTURE if (key == QLatin1String(Q_MEDIASERVICE_AUDIOSOURCE)) return new QGstreamerCaptureService(key); - - if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) - return new QGstreamerCaptureService(key); #endif //qDebug() << "unsupported key:" << key; @@ -105,77 +103,4 @@ delete service; } -QList QGstreamerServicePlugin::devices(const QByteArray &service) const -{ - if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); - - return m_cameraDevices; - } - - return QList(); -} - -QString QGstreamerServicePlugin::deviceDescription(const QByteArray &service, const QByteArray &device) -{ - if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); - - for (int i=0; i= 0; ++input.index) { - if(input.type == V4L2_INPUT_TYPE_CAMERA || input.type == 0) { - isCamera = ::ioctl(fd, VIDIOC_S_INPUT, input.index) != 0; - break; - } - } - - if (isCamera) { - // find out its driver "name" - QString name; - struct v4l2_capability vcap; - memset(&vcap, 0, sizeof(struct v4l2_capability)); - - if (ioctl(fd, VIDIOC_QUERYCAP, &vcap) != 0) - name = entryInfo.fileName(); - else - name = QString((const char*)vcap.card); - //qDebug() << "found camera: " << name; - - m_cameraDevices.append(entryInfo.filePath().toLocal8Bit()); - m_cameraDescriptions.append(name); - } - ::close(fd); - } -} - Q_EXPORT_PLUGIN2(gstengine, QGstreamerServicePlugin);