Remove some obsolete bits.

They can be updated again later when things are more stable, if needed.

Change-Id: I73bdacdd3d1fd43a60cd3a0c14b925fa9c32ee27
Reviewed-on: http://codereview.qt.nokia.com/1724
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
This commit is contained in:
Michael Goddard
2011-07-18 10:32:16 +10:00
committed by Qt by Nokia
parent 7085775a11
commit 1403a1c7be
264 changed files with 47 additions and 51130 deletions

View File

@@ -49,7 +49,7 @@ CameraBinAudioEncoder::CameraBinAudioEncoder(QObject *parent)
{
QList<QByteArray> codecCandidates;
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
#if defined(Q_WS_MAEMO_6)
codecCandidates << "audio/AAC" << "audio/PCM" << "audio/AMR" << "audio/AMR-WB" << "audio/speex"
<< "audio/ADPCM" << "audio/iLBC" << "audio/vorbis" << "audio/mpeg" << "audio/FLAC";

View File

@@ -129,12 +129,6 @@ void CameraBinControl::setCaptureMode(QCamera::CaptureMode mode)
bool CameraBinControl::isCaptureModeSupported(QCamera::CaptureMode mode) const
{
#ifdef Q_WS_MAEMO_5
//Front camera on N900 supports only video capture
if (m_session->cameraRole() == CameraBinSession::FrontCamera)
return mode == QCamera::CaptureVideo;
#endif
return mode == QCamera::CaptureStillImage || mode == QCamera::CaptureVideo;
}

View File

@@ -101,26 +101,16 @@ qreal CameraBinFocus::opticalZoom() const
qreal CameraBinFocus::digitalZoom() const
{
#ifdef Q_WS_MAEMO_5
gint zoomFactor = 0;
g_object_get(GST_BIN(m_session->cameraBin()), "zoom", &zoomFactor, NULL);
return zoomFactor/100.0;
#else
gfloat zoomFactor = 1.0;
g_object_get(GST_BIN(m_session->cameraBin()), "zoom", &zoomFactor, NULL);
return zoomFactor;
#endif
}
void CameraBinFocus::zoomTo(qreal optical, qreal digital)
{
Q_UNUSED(optical);
digital = qBound(qreal(1.0), digital, qreal(10.0));
#ifdef Q_WS_MAEMO_5
g_object_set(GST_BIN(m_session->cameraBin()), "zoom", qRound(digital*100.0), NULL);
#else
g_object_set(GST_BIN(m_session->cameraBin()), "zoom", digital, NULL);
#endif
emit digitalZoomChanged(digital);
}
@@ -223,13 +213,6 @@ void CameraBinFocus::_q_handleCameraStateChange(QCamera::State state)
void CameraBinFocus::_q_handleCapturedImage()
{
#ifdef Q_WS_MAEMO_5
//N900 lost focus after image capture
if (m_focusStatus != QCamera::Unlocked) {
m_focusStatus = QCamera::Unlocked;
emit _q_focusStatusChanged(QCamera::Unlocked, QCamera::LockLost);
}
#endif
}
void CameraBinFocus::_q_startFocusing()

View File

@@ -52,12 +52,7 @@
//#define DEBUG_CAPTURE
#ifdef Q_WS_MAEMO_5
#define IMAGE_DONE_SIGNAL "img-done"
#else
#define IMAGE_DONE_SIGNAL "image-done"
#endif
Q_DECLARE_METATYPE(QVideoFrame)
Q_DECLARE_METATYPE(QtMultimediaKit::MetaData)

View File

@@ -76,10 +76,6 @@
#include <QtCore/qdebug.h>
#include <QtCore/qprocess.h>
#if defined(Q_WS_MAEMO_5)
#include "camerabuttonlistener_maemo.h"
#endif
#if defined(Q_WS_MAEMO_6)
#include "camerabuttonlistener_meego.h"
#endif
@@ -145,22 +141,13 @@ CameraBinService::CameraBinService(const QString &service, QObject *parent):
connect(m_metaDataControl, SIGNAL(metaDataChanged(QMap<QByteArray,QVariant>)),
m_captureSession, SLOT(setMetaData(QMap<QByteArray,QVariant>)));
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
#if defined(Q_WS_MAEMO_6)
new CameraButtonListener(this);
#endif
#if defined(Q_WS_MAEMO_5)
//disable the system camera application
QProcess::execute("/usr/sbin/dsmetool -k /usr/bin/camera-ui");
#endif
}
CameraBinService::~CameraBinService()
{
#if defined(Q_WS_MAEMO_5)
//restore the system camera application
QProcess::execute("/usr/sbin/dsmetool -U user -o /usr/bin/camera-ui");
#endif
}
QMediaControl *CameraBinService::requestControl(const char *name)

View File

@@ -68,33 +68,6 @@
//#define CAMERABIN_DEBUG 1
#define ENUM_NAME(c,e,v) (c::staticMetaObject.enumerator(c::staticMetaObject.indexOfEnumerator(e)).valueToKey((v)))
#ifdef Q_WS_MAEMO_5
#define FILENAME_PROPERTY "filename"
#define MODE_PROPERTY "mode"
#define MUTE_PROPERTY "mute"
#define ZOOM_PROPERTY "zoom"
#define IMAGE_PP_PROPERTY "imagepp"
#define IMAGE_ENCODER_PROPERTY "imageenc"
#define VIDEO_PP_PROPERTY "videopp"
#define VIDEO_ENCODER_PROPERTY "videoenc"
#define AUDIO_ENCODER_PROPERTY "audioenc"
#define VIDEO_MUXER_PROPERTY "videomux"
#define VIEWFINDER_SINK_PROPERTY "vfsink"
#define VIDEO_SOURCE_PROPERTY "videosrc"
#define AUDIO_SOURCE_PROPERTY "audiosrc"
#define VIDEO_SOURCE_CAPS_PROPERTY "inputcaps"
#define FILTER_CAPS_PROPERTY "filter-caps"
#define PREVIEW_CAPS_PROPERTY "preview-caps"
#define IMAGE_DONE_SIGNAL "img-done"
#define CAPTURE_START "user-start"
#define CAPTURE_STOP "user-stop"
#define CAPTURE_PAUSE "user-pause"
#define SET_VIDEO_RESOLUTION_FPS "user-res-fps"
#define SET_IMAGE_RESOLUTION "user-image-res"
#else
#define FILENAME_PROPERTY "filename"
#define MODE_PROPERTY "mode"
#define MUTE_PROPERTY "mute"
@@ -118,7 +91,6 @@
#define CAPTURE_PAUSE "capture-pause"
#define SET_VIDEO_RESOLUTION_FPS "set-video-resolution-fps"
#define SET_IMAGE_RESOLUTION "set-image-resolution"
#endif
#define CAMERABIN_IMAGE_MODE 0
#define CAMERABIN_VIDEO_MODE 1
@@ -135,7 +107,7 @@
//using GST_STATE_READY for QCamera::LoadedState
//doesn't work reliably at least with some webcams.
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
#if defined(Q_WS_MAEMO_6)
#define USE_READY_STATE_ON_LOADED
#endif
@@ -228,11 +200,6 @@ GstPhotography *CameraBinSession::photography()
CameraBinSession::CameraRole CameraBinSession::cameraRole() const
{
#ifdef Q_WS_MAEMO_5
return m_inputDevice == QLatin1String("/dev/video1") ?
FrontCamera : BackCamera;
#endif
return BackCamera;
}
@@ -475,7 +442,7 @@ QDir CameraBinSession::defaultDir(QCamera::CaptureMode mode) const
{
QStringList dirCandidates;
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
#if defined(Q_WS_MAEMO_6)
dirCandidates << QLatin1String("/home/user/MyDocs/DCIM");
dirCandidates << QLatin1String("/home/user/MyDocs/");
#endif
@@ -1218,12 +1185,7 @@ QList<QSize> CameraBinSession::supportedResolutions(QPair<int,int> rate,
QSize minSize = res.first();
QSize maxSize = res.last();
#ifdef Q_WS_MAEMO_5
if (mode == QCamera::CaptureVideo && cameraRole() == BackCamera)
maxSize = QSize(848, 480);
if (mode == QCamera::CaptureStillImage)
minSize = QSize(640, 480);
#elif defined(Q_WS_MAEMO_6)
#if defined(Q_WS_MAEMO_6)
if (cameraRole() == FrontCamera && maxSize.width() > 640)
maxSize = QSize(640, 480);
else if (mode == QCamera::CaptureVideo && maxSize.width() > 1280)

View File

@@ -49,22 +49,7 @@ CameraBinVideoEncoder::CameraBinVideoEncoder(CameraBinSession *session)
:QVideoEncoderControl(session), m_session(session)
{
QList<QByteArray> codecCandidates;
#if defined(Q_WS_MAEMO_5)
codecCandidates << "video/mpeg4" << "video/h264" << "video/h263" << "video/theora"
<< "video/mpeg2" << "video/mpeg1" << "video/mjpeg" << "video/VP8" << "video/h261";
m_elementNames["video/h264"] = "dsph264enc";
m_elementNames["video/mpeg4"] = "dspmp4venc";
m_elementNames["video/h263"] = "dsph263enc";
m_elementNames["video/theora"] = "theoraenc";
m_elementNames["video/mpeg2"] = "ffenc_mpeg2video";
m_elementNames["video/mpeg1"] = "ffenc_mpeg1video";
m_elementNames["video/mjpeg"] = "ffenc_mjpeg";
m_elementNames["video/VP8"] = "vp8enc";
m_elementNames["video/h261"] = "ffenc_h261";
m_codecOptions["video/mpeg4"] = QStringList() << "mode" << "keyframe-interval";
#elif defined(Q_WS_MAEMO_6)
#if defined(Q_WS_MAEMO_6)
codecCandidates << "video/mpeg4" << "video/h264" << "video/h263";
m_elementNames["video/h264"] = "dsph264enc";

View File

@@ -1,121 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "camerabuttonlistener_maemo.h"
#include <QtDBus/qdbusconnection.h>
#include <QtDBus/qdbusinterface.h>
#include <QtGui/qapplication.h>
#include <QtGui/qevent.h>
#include <QtGui/qwidget.h>
CameraButtonListener::CameraButtonListener(QObject *parent) :
QObject(parent),
m_focusPressed(false),
m_shutterPressed(false)
{
QDBusConnection::systemBus().connect(
QString(),
"/org/freedesktop/Hal/devices/platform_cam_launch",
"org.freedesktop.Hal.Device",
"PropertyModified",
this,
SLOT(updateShuterButtonState()));
QDBusConnection::systemBus().connect(
QString(),
"/org/freedesktop/Hal/devices/platform_cam_focus",
"org.freedesktop.Hal.Device",
"PropertyModified",
this,
SLOT(updateFocusButtonState()));
}
CameraButtonListener::~CameraButtonListener()
{
}
void CameraButtonListener::updateFocusButtonState()
{
QDBusInterface propertyInterface("org.freedesktop.Hal",
"/org/freedesktop/Hal/devices/platform_cam_focus",
"org.freedesktop.Hal.Device",
QDBusConnection::systemBus());
bool pressed = propertyInterface.call("GetProperty", "button.state.value").arguments().at(0).toBool();
if (m_focusPressed != pressed) {
m_focusPressed = pressed;
QWidget *window = QApplication::focusWidget();
if (window) {
QApplication::postEvent(window,
new QKeyEvent(pressed ? QEvent::KeyPress : QEvent::KeyRelease,
0x01100021, //Qt::Key_CameraFocus since Qt 4.7.0
Qt::NoModifier));
}
}
}
void CameraButtonListener::updateShuterButtonState()
{
QDBusInterface propertyInterface("org.freedesktop.Hal",
"/org/freedesktop/Hal/devices/platform_cam_launch",
"org.freedesktop.Hal.Device",
QDBusConnection::systemBus());
bool pressed = propertyInterface.call("GetProperty", "button.state.value").arguments().at(0).toBool();
if (m_shutterPressed != pressed) {
m_shutterPressed = pressed;
QWidget *window = QApplication::focusWidget();
if (window) {
QApplication::postEvent(window,
new QKeyEvent(pressed ? QEvent::KeyPress : QEvent::KeyRelease,
0x01100020, //Qt::Key_Camera since Qt 4.7.0
Qt::NoModifier));
}
}
}

View File

@@ -1,64 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CAMERABUTTONLISTENER_MAEMO_H
#define CAMERABUTTONLISTENER_MAEMO_H
#include <QObject>
class CameraButtonListener : public QObject
{
Q_OBJECT
public:
CameraButtonListener(QObject *parent = 0);
virtual ~CameraButtonListener();
private slots:
void updateFocusButtonState();
void updateShuterButtonState();
private:
bool m_focusPressed;
bool m_shutterPressed;
};
#endif // CAMERABUTTONLISTENER_MAEMO_H

View File

@@ -26,13 +26,6 @@ PKGCONFIG += \
maemo*:PKGCONFIG +=gstreamer-plugins-bad-0.10
contains(gstreamer-appsrc_enabled, yes): PKGCONFIG += gstreamer-app-0.10
maemo5 {
HEADERS += camerabuttonlistener_maemo.h
SOURCES += camerabuttonlistener_maemo.cpp
QT += dbus
}
maemo6 {
HEADERS += camerabuttonlistener_meego.h
SOURCES += camerabuttonlistener_meego.cpp
@@ -76,7 +69,7 @@ SOURCES += \
qgstutils.cpp
!win32:!contains(QT_CONFIG,embedded):!mac:!symbian:!simulator:!contains(QT_CONFIG, qpa) {
!win32:!contains(QT_CONFIG,embedded):!mac:!simulator:!contains(QT_CONFIG, qpa) {
LIBS += -lXv -lX11 -lXext
HEADERS += \

View File

@@ -52,9 +52,7 @@ QGstreamerAudioEncode::QGstreamerAudioEncode(QObject *parent)
{
QList<QByteArray> codecCandidates;
#if defined(Q_WS_MAEMO_5)
codecCandidates << "audio/PCM"; //<< "audio/AMR" << "audio/AMR-WB" << "audio/speex";
#elif defined(Q_WS_MAEMO_6)
#if defined(Q_WS_MAEMO_6)
codecCandidates << "audio/AAC" << "audio/mpeg" << "audio/vorbis" << "audio/speex" << "audio/GSM"
<< "audio/PCM" << "audio/AMR" << "audio/AMR-WB" << "audio/FLAC";
#else
@@ -62,7 +60,7 @@ QGstreamerAudioEncode::QGstreamerAudioEncode(QObject *parent)
<< "audio/PCM" << "audio/AMR" << "audio/AMR-WB" << "audio/FLAC";
#endif
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
#if defined(Q_WS_MAEMO_6)
m_elementNames["audio/AMR"] = "nokiaamrnbenc";
m_elementNames["audio/AMR-WB"] = "nokiaamrwbenc";
m_elementNames["audio/AAC"] = "nokiaaacenc";

View File

@@ -202,12 +202,7 @@ GstElement *QGstreamerCaptureSession::buildAudioSrc()
if (m_audioInputFactory)
audioSrc = m_audioInputFactory->buildElement();
else {
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
audioSrc = gst_element_factory_make("pulsesrc", "audio_src");
#elif defined(QT_QWS_N810)
audioSrc = gst_element_factory_make("dsppcmsrc", "audio_src");
#else
QString elementName = "alsasrc";
QString device;
@@ -225,7 +220,6 @@ GstElement *QGstreamerCaptureSession::buildAudioSrc()
audioSrc = gst_element_factory_make(elementName.toAscii().constData(), "audio_src");
if (audioSrc && !device.isEmpty())
g_object_set(G_OBJECT(audioSrc), "device", device.toLocal8Bit().constData(), NULL);
#endif
}
if (!audioSrc) {

View File

@@ -252,7 +252,7 @@ QDir QGstreamerRecorderControl::defaultDir() const
{
QStringList dirCandidates;
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
#if defined(Q_WS_MAEMO_6)
dirCandidates << QLatin1String("/home/user/MyDocs");
#endif

View File

@@ -76,11 +76,7 @@ QGstreamerV4L2Input::~QGstreamerV4L2Input()
GstElement *QGstreamerV4L2Input::buildElement()
{
#ifndef Q_WS_MAEMO_5
GstElement *camera = gst_element_factory_make("v4l2src", "camera_source");
#else
GstElement *camera = gst_element_factory_make("v4l2camsrc", "camera_source");
#endif
if (camera && !m_device.isEmpty() )
g_object_set(G_OBJECT(camera), "device", m_device.constData(), NULL);

View File

@@ -57,7 +57,7 @@
#include <QtCore/qdir.h>
#include <QtGui/qdesktopservices.h>
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || (GST_VERSION_MICRO > 20)
#if defined(Q_WS_MAEMO_6) || (GST_VERSION_MICRO > 20)
#define USE_PLAYBIN2
#endif

View File

@@ -104,10 +104,8 @@ void QGstreamerAudioInputEndpointSelector::update()
{
m_names.clear();
m_descriptions.clear();
#ifndef Q_WS_MAEMO_5
updateAlsaDevices();
updateOssDevices();
#endif
updatePulseDevices();
if (m_names.size() > 0)
m_audioInput = m_names.at(0);
@@ -151,16 +149,11 @@ void QGstreamerAudioInputEndpointSelector::updateOssDevices()
{
QDir devDir("/dev");
devDir.setFilter(QDir::System);
#ifndef QT_QWS_N810
QFileInfoList entries = devDir.entryInfoList(QStringList() << "dsp*");
foreach(const QFileInfo& entryInfo, entries) {
m_names.append(QLatin1String("oss:")+entryInfo.filePath());
m_descriptions.append(QString("OSS device %1").arg(entryInfo.fileName()));
}
#else
m_names.append("dsppcm");
m_descriptions.append("PCM audio input");
#endif
}
void QGstreamerAudioInputEndpointSelector::updatePulseDevices()

View File

@@ -178,12 +178,6 @@ void QGstreamerServicePlugin::updateDevices() const
m_cameraDevices.clear();
m_cameraDescriptions.clear();
#ifdef Q_WS_MAEMO_5
m_cameraDevices << "/dev/video0" << "/dev/video1";
m_cameraDescriptions << tr("Main Camera") << tr("Front Camera");
return;
#endif
#ifdef Q_WS_MAEMO_6
m_cameraDevices << "primary" << "secondary";
m_cameraDescriptions << tr("Main camera") << tr("Front camera");

View File

@@ -132,11 +132,6 @@ void QGstreamerVideoWidgetControl::createVideoWidget()
gst_element_set_state(m_videoSink, GST_STATE_NULL);
g_object_set(G_OBJECT(m_videoSink), "force-aspect-ratio", 1, (const char*)NULL);
#ifdef Q_WS_MAEMO_5
//the overlay xvideo adapter fails to switch winId,
//use "SGX Textured Video" adapter instead
g_object_set(G_OBJECT(m_videoSink), "device", "1", NULL);
#endif
}
}

View File

@@ -457,13 +457,7 @@ bool QX11VideoSurface::findPort()
bool portFound = false;
if (XvQueryAdaptors(QX11Info::display(), m_winId, &count, &adaptors) == Success) {
#ifdef Q_WS_MAEMO_5
//the overlay xvideo adapter fails to switch winId,
//prefer the "SGX Textured Video" adapter instead
for (int i = count-1; i >= 0 && !portFound; --i) {
#else
for (unsigned int i = 0; i < count && !portFound; ++i) {
#endif
if (adaptors[i].type & XvImageMask) {
m_portId = adaptors[i].base_id;