Merge remote-tracking branch 'origin/stable' into dev
Conflicts: .qmake.conf Change-Id: Id367a610a3aefd288bfe287a3bf64606e582deb9
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
include(../spectrum.pri)
|
include(../spectrum.pri)
|
||||||
|
|
||||||
static: error(This application cannot be statically linked to the fftreal library)
|
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
|
||||||
TARGET = spectrum
|
TARGET = spectrum
|
||||||
|
|||||||
@@ -57,13 +57,24 @@
|
|||||||
#include <linux/videodev2.h>
|
#include <linux/videodev2.h>
|
||||||
|
|
||||||
QGstreamerVideoInputDeviceControl::QGstreamerVideoInputDeviceControl(QObject *parent)
|
QGstreamerVideoInputDeviceControl::QGstreamerVideoInputDeviceControl(QObject *parent)
|
||||||
:QVideoDeviceSelectorControl(parent), m_selectedDevice(0)
|
:QVideoDeviceSelectorControl(parent), m_source(0), m_selectedDevice(0)
|
||||||
{
|
{
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QGstreamerVideoInputDeviceControl::QGstreamerVideoInputDeviceControl(GstElement *source, QObject *parent)
|
||||||
|
:QVideoDeviceSelectorControl(parent), m_source(source), m_selectedDevice(0)
|
||||||
|
{
|
||||||
|
if (m_source)
|
||||||
|
gst_object_ref(GST_OBJECT(m_source));
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
QGstreamerVideoInputDeviceControl::~QGstreamerVideoInputDeviceControl()
|
QGstreamerVideoInputDeviceControl::~QGstreamerVideoInputDeviceControl()
|
||||||
{
|
{
|
||||||
|
if (m_source)
|
||||||
|
gst_object_unref(GST_OBJECT(m_source));
|
||||||
}
|
}
|
||||||
|
|
||||||
int QGstreamerVideoInputDeviceControl::deviceCount() const
|
int QGstreamerVideoInputDeviceControl::deviceCount() const
|
||||||
@@ -107,10 +118,15 @@ void QGstreamerVideoInputDeviceControl::update()
|
|||||||
m_names.clear();
|
m_names.clear();
|
||||||
m_descriptions.clear();
|
m_descriptions.clear();
|
||||||
|
|
||||||
#ifdef Q_WS_MAEMO_6
|
// subdevsrc and the like have a camera-device property that takes an enumeration
|
||||||
m_names << QLatin1String("primary") << QLatin1String("secondary");
|
// identifying a primary or secondary camera, so return identifiers that map to those
|
||||||
m_descriptions << tr("Main camera") << tr("Front camera");
|
// instead of a list of actual devices.
|
||||||
#else
|
if (m_source && g_object_class_find_property(G_OBJECT_GET_CLASS(m_source), "camera-device")) {
|
||||||
|
m_names << QLatin1String("primary") << QLatin1String("secondary");
|
||||||
|
m_descriptions << tr("Main camera") << tr("Front camera");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QDir devDir("/dev");
|
QDir devDir("/dev");
|
||||||
devDir.setFilter(QDir::System);
|
devDir.setFilter(QDir::System);
|
||||||
|
|
||||||
@@ -151,5 +167,4 @@ void QGstreamerVideoInputDeviceControl::update()
|
|||||||
}
|
}
|
||||||
::close(fd);
|
::close(fd);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,6 +267,7 @@ QSize QDeclarativeCameraCapture::resolution()
|
|||||||
|
|
||||||
void QDeclarativeCameraCapture::setResolution(const QSize &captureResolution)
|
void QDeclarativeCameraCapture::setResolution(const QSize &captureResolution)
|
||||||
{
|
{
|
||||||
|
m_imageSettings = m_capture->encodingSettings();
|
||||||
if (captureResolution != resolution()) {
|
if (captureResolution != resolution()) {
|
||||||
m_imageSettings.setResolution(captureResolution);
|
m_imageSettings.setResolution(captureResolution);
|
||||||
m_capture->setEncodingSettings(m_imageSettings);
|
m_capture->setEncodingSettings(m_imageSettings);
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ QString QDeclarativeCameraRecorder::mediaContainer() const
|
|||||||
|
|
||||||
void QDeclarativeCameraRecorder::setCaptureResolution(const QSize &resolution)
|
void QDeclarativeCameraRecorder::setCaptureResolution(const QSize &resolution)
|
||||||
{
|
{
|
||||||
|
m_videoSettings = m_recorder->videoSettings();
|
||||||
if (resolution != captureResolution()) {
|
if (resolution != captureResolution()) {
|
||||||
m_videoSettings.setResolution(resolution);
|
m_videoSettings.setResolution(resolution);
|
||||||
m_recorder->setVideoSettings(m_videoSettings);
|
m_recorder->setVideoSettings(m_videoSettings);
|
||||||
@@ -154,6 +155,7 @@ void QDeclarativeCameraRecorder::setCaptureResolution(const QSize &resolution)
|
|||||||
|
|
||||||
void QDeclarativeCameraRecorder::setAudioCodec(const QString &codec)
|
void QDeclarativeCameraRecorder::setAudioCodec(const QString &codec)
|
||||||
{
|
{
|
||||||
|
m_audioSettings = m_recorder->audioSettings();
|
||||||
if (codec != audioCodec()) {
|
if (codec != audioCodec()) {
|
||||||
m_audioSettings.setCodec(codec);
|
m_audioSettings.setCodec(codec);
|
||||||
m_recorder->setAudioSettings(m_audioSettings);
|
m_recorder->setAudioSettings(m_audioSettings);
|
||||||
@@ -163,6 +165,7 @@ void QDeclarativeCameraRecorder::setAudioCodec(const QString &codec)
|
|||||||
|
|
||||||
void QDeclarativeCameraRecorder::setVideoCodec(const QString &codec)
|
void QDeclarativeCameraRecorder::setVideoCodec(const QString &codec)
|
||||||
{
|
{
|
||||||
|
m_videoSettings = m_recorder->videoSettings();
|
||||||
if (codec != videoCodec()) {
|
if (codec != videoCodec()) {
|
||||||
m_videoSettings.setCodec(codec);
|
m_videoSettings.setCodec(codec);
|
||||||
m_recorder->setVideoSettings(m_videoSettings);
|
m_recorder->setVideoSettings(m_videoSettings);
|
||||||
@@ -281,6 +284,7 @@ QDeclarativeCameraRecorder::EncodingMode QDeclarativeCameraRecorder::audioEncodi
|
|||||||
|
|
||||||
void QDeclarativeCameraRecorder::setFrameRate(qreal frameRate)
|
void QDeclarativeCameraRecorder::setFrameRate(qreal frameRate)
|
||||||
{
|
{
|
||||||
|
m_videoSettings = m_recorder->videoSettings();
|
||||||
if (!qFuzzyCompare(m_videoSettings.frameRate(),frameRate)) {
|
if (!qFuzzyCompare(m_videoSettings.frameRate(),frameRate)) {
|
||||||
m_videoSettings.setFrameRate(frameRate);
|
m_videoSettings.setFrameRate(frameRate);
|
||||||
m_recorder->setVideoSettings(m_videoSettings);
|
m_recorder->setVideoSettings(m_videoSettings);
|
||||||
@@ -290,6 +294,7 @@ void QDeclarativeCameraRecorder::setFrameRate(qreal frameRate)
|
|||||||
|
|
||||||
void QDeclarativeCameraRecorder::setVideoBitRate(int rate)
|
void QDeclarativeCameraRecorder::setVideoBitRate(int rate)
|
||||||
{
|
{
|
||||||
|
m_videoSettings = m_recorder->videoSettings();
|
||||||
if (m_videoSettings.bitRate() != rate) {
|
if (m_videoSettings.bitRate() != rate) {
|
||||||
m_videoSettings.setBitRate(rate);
|
m_videoSettings.setBitRate(rate);
|
||||||
m_recorder->setVideoSettings(m_videoSettings);
|
m_recorder->setVideoSettings(m_videoSettings);
|
||||||
@@ -299,6 +304,7 @@ void QDeclarativeCameraRecorder::setVideoBitRate(int rate)
|
|||||||
|
|
||||||
void QDeclarativeCameraRecorder::setAudioBitRate(int rate)
|
void QDeclarativeCameraRecorder::setAudioBitRate(int rate)
|
||||||
{
|
{
|
||||||
|
m_audioSettings = m_recorder->audioSettings();
|
||||||
if (m_audioSettings.bitRate() != rate) {
|
if (m_audioSettings.bitRate() != rate) {
|
||||||
m_audioSettings.setBitRate(rate);
|
m_audioSettings.setBitRate(rate);
|
||||||
m_recorder->setAudioSettings(m_audioSettings);
|
m_recorder->setAudioSettings(m_audioSettings);
|
||||||
@@ -308,6 +314,7 @@ void QDeclarativeCameraRecorder::setAudioBitRate(int rate)
|
|||||||
|
|
||||||
void QDeclarativeCameraRecorder::setAudioChannels(int channels)
|
void QDeclarativeCameraRecorder::setAudioChannels(int channels)
|
||||||
{
|
{
|
||||||
|
m_audioSettings = m_recorder->audioSettings();
|
||||||
if (m_audioSettings.channelCount() != channels) {
|
if (m_audioSettings.channelCount() != channels) {
|
||||||
m_audioSettings.setChannelCount(channels);
|
m_audioSettings.setChannelCount(channels);
|
||||||
m_recorder->setAudioSettings(m_audioSettings);
|
m_recorder->setAudioSettings(m_audioSettings);
|
||||||
@@ -317,6 +324,7 @@ void QDeclarativeCameraRecorder::setAudioChannels(int channels)
|
|||||||
|
|
||||||
void QDeclarativeCameraRecorder::setAudioSampleRate(int rate)
|
void QDeclarativeCameraRecorder::setAudioSampleRate(int rate)
|
||||||
{
|
{
|
||||||
|
m_audioSettings = m_recorder->audioSettings();
|
||||||
if (m_audioSettings.sampleRate() != rate) {
|
if (m_audioSettings.sampleRate() != rate) {
|
||||||
m_audioSettings.setSampleRate(rate);
|
m_audioSettings.setSampleRate(rate);
|
||||||
m_recorder->setAudioSettings(m_audioSettings);
|
m_recorder->setAudioSettings(m_audioSettings);
|
||||||
@@ -326,6 +334,7 @@ void QDeclarativeCameraRecorder::setAudioSampleRate(int rate)
|
|||||||
|
|
||||||
void QDeclarativeCameraRecorder::setAudioEncodingMode(QDeclarativeCameraRecorder::EncodingMode encodingMode)
|
void QDeclarativeCameraRecorder::setAudioEncodingMode(QDeclarativeCameraRecorder::EncodingMode encodingMode)
|
||||||
{
|
{
|
||||||
|
m_audioSettings = m_recorder->audioSettings();
|
||||||
if (m_audioSettings.encodingMode() != QMultimedia::EncodingMode(encodingMode)) {
|
if (m_audioSettings.encodingMode() != QMultimedia::EncodingMode(encodingMode)) {
|
||||||
m_audioSettings.setEncodingMode(QMultimedia::EncodingMode(encodingMode));
|
m_audioSettings.setEncodingMode(QMultimedia::EncodingMode(encodingMode));
|
||||||
m_recorder->setAudioSettings(m_audioSettings);
|
m_recorder->setAudioSettings(m_audioSettings);
|
||||||
@@ -335,6 +344,7 @@ void QDeclarativeCameraRecorder::setAudioEncodingMode(QDeclarativeCameraRecorder
|
|||||||
|
|
||||||
void QDeclarativeCameraRecorder::setVideoEncodingMode(QDeclarativeCameraRecorder::EncodingMode encodingMode)
|
void QDeclarativeCameraRecorder::setVideoEncodingMode(QDeclarativeCameraRecorder::EncodingMode encodingMode)
|
||||||
{
|
{
|
||||||
|
m_videoSettings = m_recorder->videoSettings();
|
||||||
if (m_videoSettings.encodingMode() != QMultimedia::EncodingMode(encodingMode)) {
|
if (m_videoSettings.encodingMode() != QMultimedia::EncodingMode(encodingMode)) {
|
||||||
m_videoSettings.setEncodingMode(QMultimedia::EncodingMode(encodingMode));
|
m_videoSettings.setEncodingMode(QMultimedia::EncodingMode(encodingMode));
|
||||||
m_recorder->setVideoSettings(m_videoSettings);
|
m_recorder->setVideoSettings(m_videoSettings);
|
||||||
|
|||||||
@@ -45,6 +45,8 @@
|
|||||||
#include <qvideodeviceselectorcontrol.h>
|
#include <qvideodeviceselectorcontrol.h>
|
||||||
#include <QtCore/qstringlist.h>
|
#include <QtCore/qstringlist.h>
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QGstreamerVideoInputDeviceControl : public QVideoDeviceSelectorControl
|
class QGstreamerVideoInputDeviceControl : public QVideoDeviceSelectorControl
|
||||||
@@ -52,6 +54,7 @@ class QGstreamerVideoInputDeviceControl : public QVideoDeviceSelectorControl
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QGstreamerVideoInputDeviceControl(QObject *parent);
|
QGstreamerVideoInputDeviceControl(QObject *parent);
|
||||||
|
QGstreamerVideoInputDeviceControl(GstElement *source, QObject *parent);
|
||||||
~QGstreamerVideoInputDeviceControl();
|
~QGstreamerVideoInputDeviceControl();
|
||||||
|
|
||||||
int deviceCount() const;
|
int deviceCount() const;
|
||||||
@@ -68,6 +71,8 @@ public Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
|
GstElement *m_source;
|
||||||
|
|
||||||
int m_selectedDevice;
|
int m_selectedDevice;
|
||||||
QStringList m_names;
|
QStringList m_names;
|
||||||
QStringList m_descriptions;
|
QStringList m_descriptions;
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public:
|
|||||||
m_extraInfo.clear();
|
m_extraInfo.clear();
|
||||||
int artistStart = line.indexOf(QLatin1String(","), 8);
|
int artistStart = line.indexOf(QLatin1String(","), 8);
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
int length = line.mid(8, artistStart < 8 ? -1 : artistStart - 8).trimmed().toInt(&ok);
|
int length = line.midRef(8, artistStart < 8 ? -1 : artistStart - 8).trimmed().toInt(&ok);
|
||||||
if (ok && length > 0) {
|
if (ok && length > 0) {
|
||||||
//convert from second to milisecond
|
//convert from second to milisecond
|
||||||
m_extraInfo[QMediaMetaData::Duration] = QVariant(length * 1000);
|
m_extraInfo[QMediaMetaData::Duration] = QVariant(length * 1000);
|
||||||
@@ -108,13 +108,13 @@ public:
|
|||||||
if (artistStart > 0) {
|
if (artistStart > 0) {
|
||||||
int titleStart = getSplitIndex(line, artistStart);
|
int titleStart = getSplitIndex(line, artistStart);
|
||||||
if (titleStart > artistStart) {
|
if (titleStart > artistStart) {
|
||||||
m_extraInfo[QMediaMetaData::Author] = line.mid(artistStart + 1,
|
m_extraInfo[QMediaMetaData::Author] = line.midRef(artistStart + 1,
|
||||||
titleStart - artistStart - 1).trimmed().
|
titleStart - artistStart - 1).trimmed().toString().
|
||||||
replace(QLatin1String("--"), QLatin1String("-"));
|
replace(QLatin1String("--"), QLatin1String("-"));
|
||||||
m_extraInfo[QMediaMetaData::Title] = line.mid(titleStart + 1).trimmed().
|
m_extraInfo[QMediaMetaData::Title] = line.midRef(titleStart + 1).trimmed().toString().
|
||||||
replace(QLatin1String("--"), QLatin1String("-"));
|
replace(QLatin1String("--"), QLatin1String("-"));
|
||||||
} else {
|
} else {
|
||||||
m_extraInfo[QMediaMetaData::Title] = line.mid(artistStart + 1).trimmed().
|
m_extraInfo[QMediaMetaData::Title] = line.midRef(artistStart + 1).trimmed().toString().
|
||||||
replace(QLatin1String("--"), QLatin1String("-"));
|
replace(QLatin1String("--"), QLatin1String("-"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ Version=2
|
|||||||
emit error(QPlaylistFileParser::FormatError, QString(tr("Error parsing playlist at line[%1]:%2")).arg(QString::number(lineIndex), line));
|
emit error(QPlaylistFileParser::FormatError, QString(tr("Error parsing playlist at line[%1]:%2")).arg(QString::number(lineIndex), line));
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
return line.mid(start + 1).trimmed();
|
return line.midRef(start + 1).trimmed().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setCount(int count) {
|
void setCount(int count) {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ QString QAndroidMediaStorageLocation::generateFileName(const QString &prefix,
|
|||||||
if (lastMediaIndex == 0) {
|
if (lastMediaIndex == 0) {
|
||||||
// first run, find the maximum media number during the fist capture
|
// first run, find the maximum media number during the fist capture
|
||||||
Q_FOREACH (const QString &fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(extension))) {
|
Q_FOREACH (const QString &fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(extension))) {
|
||||||
const qint64 mediaIndex = fileName.mid(prefix.length(), fileName.size() - prefix.length() - extension.length() - 1).toInt();
|
const qint64 mediaIndex = fileName.midRef(prefix.length(), fileName.size() - prefix.length() - extension.length() - 1).toInt();
|
||||||
lastMediaIndex = qMax(lastMediaIndex, mediaIndex);
|
lastMediaIndex = qMax(lastMediaIndex, mediaIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ void QAndroidMetaDataReaderControl::updateData()
|
|||||||
// The genre can be returned as an ID3v2 id, get the name for it in that case
|
// The genre can be returned as an ID3v2 id, get the name for it in that case
|
||||||
if (string.startsWith('(') && string.endsWith(')')) {
|
if (string.startsWith('(') && string.endsWith(')')) {
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
int genreId = string.mid(1, string.length() - 2).toInt(&ok);
|
int genreId = string.midRef(1, string.length() - 2).toInt(&ok);
|
||||||
if (ok && genreId >= 0 && genreId <= 125)
|
if (ok && genreId >= 0 && genreId <= 125)
|
||||||
string = QLatin1String(qt_ID3GenreNames[genreId]);
|
string = QLatin1String(qt_ID3GenreNames[genreId]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ QString AudioCaptureSession::generateFileName(const QDir &dir,
|
|||||||
{
|
{
|
||||||
int lastClip = 0;
|
int lastClip = 0;
|
||||||
foreach(QString fileName, dir.entryList(QStringList() << QString("clip_*.%1").arg(ext))) {
|
foreach(QString fileName, dir.entryList(QStringList() << QString("clip_*.%1").arg(ext))) {
|
||||||
int imgNumber = fileName.mid(5, fileName.size()-6-ext.length()).toInt();
|
int imgNumber = fileName.midRef(5, fileName.size()-6-ext.length()).toInt();
|
||||||
lastClip = qMax(lastClip, imgNumber);
|
lastClip = qMax(lastClip, imgNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ QString AVFStorageLocation::generateFileName(const QString &prefix, const QDir &
|
|||||||
if (lastClip == 0) {
|
if (lastClip == 0) {
|
||||||
//first run, find the maximum clip number during the fist capture
|
//first run, find the maximum clip number during the fist capture
|
||||||
Q_FOREACH (const QString &fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(ext))) {
|
Q_FOREACH (const QString &fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(ext))) {
|
||||||
int imgNumber = fileName.mid(prefix.length(), fileName.size()-prefix.length()-ext.length()-1).toInt();
|
int imgNumber = fileName.midRef(prefix.length(), fileName.size()-prefix.length()-ext.length()-1).toInt();
|
||||||
lastClip = qMax(lastClip, imgNumber);
|
lastClip = qMax(lastClip, imgNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ maemo6 {
|
|||||||
CONFIG += have_gst_photography
|
CONFIG += have_gst_photography
|
||||||
}
|
}
|
||||||
|
|
||||||
have_gst_photography {
|
config_gstreamer_photography {
|
||||||
DEFINES += HAVE_GST_PHOTOGRAPHY
|
DEFINES += HAVE_GST_PHOTOGRAPHY
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
|||||||
@@ -201,7 +201,9 @@ void CameraBinControl::updateStatus()
|
|||||||
case QCamera::LoadedState:
|
case QCamera::LoadedState:
|
||||||
switch (sessionState) {
|
switch (sessionState) {
|
||||||
case QCamera::UnloadedState:
|
case QCamera::UnloadedState:
|
||||||
m_status = QCamera::LoadingStatus;
|
m_status = m_resourcePolicy->isResourcesGranted()
|
||||||
|
? QCamera::LoadingStatus
|
||||||
|
: QCamera::UnavailableStatus;
|
||||||
break;
|
break;
|
||||||
case QCamera::LoadedState:
|
case QCamera::LoadedState:
|
||||||
m_status = QCamera::LoadedStatus;
|
m_status = QCamera::LoadedStatus;
|
||||||
@@ -214,7 +216,9 @@ void CameraBinControl::updateStatus()
|
|||||||
case QCamera::ActiveState:
|
case QCamera::ActiveState:
|
||||||
switch (sessionState) {
|
switch (sessionState) {
|
||||||
case QCamera::UnloadedState:
|
case QCamera::UnloadedState:
|
||||||
m_status = QCamera::LoadingStatus;
|
m_status = m_resourcePolicy->isResourcesGranted()
|
||||||
|
? QCamera::LoadingStatus
|
||||||
|
: QCamera::UnavailableStatus;
|
||||||
break;
|
break;
|
||||||
case QCamera::LoadedState:
|
case QCamera::LoadedState:
|
||||||
m_status = QCamera::StartingStatus;
|
m_status = QCamera::StartingStatus;
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ public:
|
|||||||
bool canChangeProperty(PropertyChangeType changeType, QCamera::Status status) const;
|
bool canChangeProperty(PropertyChangeType changeType, QCamera::Status status) const;
|
||||||
bool viewfinderColorSpaceConversion() const;
|
bool viewfinderColorSpaceConversion() const;
|
||||||
|
|
||||||
|
CamerabinResourcePolicy *resourcePolicy() { return m_resourcePolicy; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void reloadLater();
|
void reloadLater();
|
||||||
void setViewfinderColorSpaceConversion(bool enabled);
|
void setViewfinderColorSpaceConversion(bool enabled);
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ CameraBinFocus::CameraBinFocus(CameraBinSession *session)
|
|||||||
m_focusStatus(QCamera::Unlocked),
|
m_focusStatus(QCamera::Unlocked),
|
||||||
m_focusZoneStatus(QCameraFocusZone::Selected)
|
m_focusZoneStatus(QCameraFocusZone::Selected)
|
||||||
{
|
{
|
||||||
|
gst_photography_set_focus_mode(m_session->photography(), GST_PHOTOGRAPHY_FOCUS_MODE_AUTO);
|
||||||
|
|
||||||
connect(m_session, SIGNAL(stateChanged(QCamera::State)),
|
connect(m_session, SIGNAL(stateChanged(QCamera::State)),
|
||||||
this, SLOT(_q_handleCameraStateChange(QCamera::State)));
|
this, SLOT(_q_handleCameraStateChange(QCamera::State)));
|
||||||
}
|
}
|
||||||
@@ -73,14 +75,49 @@ QCameraFocus::FocusModes CameraBinFocus::focusMode() const
|
|||||||
|
|
||||||
void CameraBinFocus::setFocusMode(QCameraFocus::FocusModes mode)
|
void CameraBinFocus::setFocusMode(QCameraFocus::FocusModes mode)
|
||||||
{
|
{
|
||||||
if (isFocusModeSupported(mode)) {
|
GstFocusMode photographyMode;
|
||||||
m_focusMode = mode;
|
|
||||||
|
switch (mode) {
|
||||||
|
case QCameraFocus::AutoFocus:
|
||||||
|
photographyMode = GST_PHOTOGRAPHY_FOCUS_MODE_AUTO;
|
||||||
|
break;
|
||||||
|
case QCameraFocus::HyperfocalFocus:
|
||||||
|
photographyMode = GST_PHOTOGRAPHY_FOCUS_MODE_HYPERFOCAL;
|
||||||
|
break;
|
||||||
|
case QCameraFocus::InfinityFocus:
|
||||||
|
photographyMode = GST_PHOTOGRAPHY_FOCUS_MODE_INFINITY;
|
||||||
|
break;
|
||||||
|
case QCameraFocus::ContinuousFocus:
|
||||||
|
photographyMode = GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_NORMAL;
|
||||||
|
break;
|
||||||
|
case QCameraFocus::MacroFocus:
|
||||||
|
photographyMode = GST_PHOTOGRAPHY_FOCUS_MODE_MACRO;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (mode & QCameraFocus::AutoFocus) {
|
||||||
|
photographyMode = GST_PHOTOGRAPHY_FOCUS_MODE_AUTO;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gst_photography_set_focus_mode(m_session->photography(), photographyMode))
|
||||||
|
m_focusMode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CameraBinFocus::isFocusModeSupported(QCameraFocus::FocusModes mode) const
|
bool CameraBinFocus::isFocusModeSupported(QCameraFocus::FocusModes mode) const
|
||||||
{
|
{
|
||||||
return mode & QCameraFocus::AutoFocus;
|
switch (mode) {
|
||||||
|
case QCameraFocus::AutoFocus:
|
||||||
|
case QCameraFocus::HyperfocalFocus:
|
||||||
|
case QCameraFocus::InfinityFocus:
|
||||||
|
case QCameraFocus::ContinuousFocus:
|
||||||
|
case QCameraFocus::MacroFocus:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return mode & QCameraFocus::AutoFocus;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QCameraFocus::FocusPointMode CameraBinFocus::focusPointMode() const
|
QCameraFocus::FocusPointMode CameraBinFocus::focusPointMode() const
|
||||||
|
|||||||
@@ -40,9 +40,11 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "camerabinimagecapture.h"
|
#include "camerabinimagecapture.h"
|
||||||
|
#include "camerabincontrol.h"
|
||||||
#include "camerabincapturedestination.h"
|
#include "camerabincapturedestination.h"
|
||||||
#include "camerabincapturebufferformat.h"
|
#include "camerabincapturebufferformat.h"
|
||||||
#include "camerabinsession.h"
|
#include "camerabinsession.h"
|
||||||
|
#include "camerabinresourcepolicy.h"
|
||||||
#include <private/qgstvideobuffer_p.h>
|
#include <private/qgstvideobuffer_p.h>
|
||||||
#include <private/qvideosurfacegstsink_p.h>
|
#include <private/qvideosurfacegstsink_p.h>
|
||||||
#include <private/qgstutils_p.h>
|
#include <private/qgstutils_p.h>
|
||||||
@@ -68,6 +70,7 @@ CameraBinImageCapture::CameraBinImageCapture(CameraBinSession *session)
|
|||||||
connect(m_session, SIGNAL(stateChanged(QCamera::State)), SLOT(updateState()));
|
connect(m_session, SIGNAL(stateChanged(QCamera::State)), SLOT(updateState()));
|
||||||
connect(m_session, SIGNAL(imageExposed(int)), this, SIGNAL(imageExposed(int)));
|
connect(m_session, SIGNAL(imageExposed(int)), this, SIGNAL(imageExposed(int)));
|
||||||
connect(m_session, SIGNAL(imageCaptured(int,QImage)), this, SIGNAL(imageCaptured(int,QImage)));
|
connect(m_session, SIGNAL(imageCaptured(int,QImage)), this, SIGNAL(imageCaptured(int,QImage)));
|
||||||
|
connect(m_session->cameraControl()->resourcePolicy(), SIGNAL(canCaptureChanged()), this, SLOT(updateState()));
|
||||||
|
|
||||||
m_session->bus()->installMessageFilter(this);
|
m_session->bus()->installMessageFilter(this);
|
||||||
}
|
}
|
||||||
@@ -103,7 +106,8 @@ void CameraBinImageCapture::cancelCapture()
|
|||||||
|
|
||||||
void CameraBinImageCapture::updateState()
|
void CameraBinImageCapture::updateState()
|
||||||
{
|
{
|
||||||
bool ready = m_session->state() == QCamera::ActiveState;
|
bool ready = m_session->state() == QCamera::ActiveState
|
||||||
|
&& m_session->cameraControl()->resourcePolicy()->canCapture();
|
||||||
if (m_ready != ready) {
|
if (m_ready != ready) {
|
||||||
#ifdef DEBUG_CAPTURE
|
#ifdef DEBUG_CAPTURE
|
||||||
qDebug() << "readyForCaptureChanged" << ready;
|
qDebug() << "readyForCaptureChanged" << ready;
|
||||||
|
|||||||
@@ -188,7 +188,9 @@ bool CameraBinImageProcessing::isParameterValueSupported(QCameraImageProcessingC
|
|||||||
QVariant CameraBinImageProcessing::parameter(
|
QVariant CameraBinImageProcessing::parameter(
|
||||||
QCameraImageProcessingControl::ProcessingParameter parameter) const
|
QCameraImageProcessingControl::ProcessingParameter parameter) const
|
||||||
{
|
{
|
||||||
if (m_values.contains(parameter))
|
if (parameter == QCameraImageProcessingControl::WhiteBalancePreset)
|
||||||
|
return QVariant::fromValue<QCameraImageProcessing::WhiteBalanceMode>(whiteBalanceMode());
|
||||||
|
else if (m_values.contains(parameter))
|
||||||
return m_values.value(parameter);
|
return m_values.value(parameter);
|
||||||
else
|
else
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "camerabinrecorder.h"
|
#include "camerabinrecorder.h"
|
||||||
|
#include "camerabincontrol.h"
|
||||||
|
#include "camerabinresourcepolicy.h"
|
||||||
#include "camerabinaudioencoder.h"
|
#include "camerabinaudioencoder.h"
|
||||||
#include "camerabinvideoencoder.h"
|
#include "camerabinvideoencoder.h"
|
||||||
#include "camerabincontainer.h"
|
#include "camerabincontainer.h"
|
||||||
@@ -61,6 +63,8 @@ CameraBinRecorder::CameraBinRecorder(CameraBinSession *session)
|
|||||||
|
|
||||||
connect(m_session, SIGNAL(durationChanged(qint64)), SIGNAL(durationChanged(qint64)));
|
connect(m_session, SIGNAL(durationChanged(qint64)), SIGNAL(durationChanged(qint64)));
|
||||||
connect(m_session, SIGNAL(mutedChanged(bool)), this, SIGNAL(mutedChanged(bool)));
|
connect(m_session, SIGNAL(mutedChanged(bool)), this, SIGNAL(mutedChanged(bool)));
|
||||||
|
connect(m_session->cameraControl()->resourcePolicy(), SIGNAL(canCaptureChanged()),
|
||||||
|
this, SLOT(updateStatus()));
|
||||||
}
|
}
|
||||||
|
|
||||||
CameraBinRecorder::~CameraBinRecorder()
|
CameraBinRecorder::~CameraBinRecorder()
|
||||||
@@ -98,7 +102,11 @@ void CameraBinRecorder::updateStatus()
|
|||||||
if (sessionState == QCamera::ActiveState &&
|
if (sessionState == QCamera::ActiveState &&
|
||||||
m_session->captureMode().testFlag(QCamera::CaptureVideo)) {
|
m_session->captureMode().testFlag(QCamera::CaptureVideo)) {
|
||||||
|
|
||||||
if (m_state == QMediaRecorder::RecordingState) {
|
if (!m_session->cameraControl()->resourcePolicy()->canCapture()) {
|
||||||
|
m_status = QMediaRecorder::UnavailableStatus;
|
||||||
|
m_state = QMediaRecorder::StoppedState;
|
||||||
|
m_session->stopVideoRecording();
|
||||||
|
} else if (m_state == QMediaRecorder::RecordingState) {
|
||||||
m_status = QMediaRecorder::RecordingStatus;
|
m_status = QMediaRecorder::RecordingStatus;
|
||||||
} else {
|
} else {
|
||||||
m_status = m_session->isBusy() ?
|
m_status = m_session->isBusy() ?
|
||||||
@@ -208,13 +216,16 @@ void CameraBinRecorder::setState(QMediaRecorder::State state)
|
|||||||
emit error(QMediaRecorder::ResourceError, tr("QMediaRecorder::pause() is not supported by camerabin2."));
|
emit error(QMediaRecorder::ResourceError, tr("QMediaRecorder::pause() is not supported by camerabin2."));
|
||||||
break;
|
break;
|
||||||
case QMediaRecorder::RecordingState:
|
case QMediaRecorder::RecordingState:
|
||||||
if (m_session->state() == QCamera::ActiveState) {
|
|
||||||
|
if (m_session->state() != QCamera::ActiveState) {
|
||||||
|
emit error(QMediaRecorder::ResourceError, tr("Service has not been started"));
|
||||||
|
} else if (!m_session->cameraControl()->resourcePolicy()->canCapture()) {
|
||||||
|
emit error(QMediaRecorder::ResourceError, tr("Recording permissions are not available"));
|
||||||
|
} else {
|
||||||
m_session->recordVideo();
|
m_session->recordVideo();
|
||||||
m_state = state;
|
m_state = state;
|
||||||
m_status = QMediaRecorder::RecordingStatus;
|
m_status = QMediaRecorder::RecordingStatus;
|
||||||
emit actualLocationChanged(m_session->outputLocation());
|
emit actualLocationChanged(m_session->outputLocation());
|
||||||
} else {
|
|
||||||
emit error(QMediaRecorder::ResourceError, tr("Service has not been started"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ public slots:
|
|||||||
void setMuted(bool);
|
void setMuted(bool);
|
||||||
void setVolume(qreal volume);
|
void setVolume(qreal volume);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void updateStatus();
|
void updateStatus();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ QT_BEGIN_NAMESPACE
|
|||||||
CamerabinResourcePolicy::CamerabinResourcePolicy(QObject *parent) :
|
CamerabinResourcePolicy::CamerabinResourcePolicy(QObject *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
m_resourceSet(NoResources),
|
m_resourceSet(NoResources),
|
||||||
m_releasingResources(false)
|
m_releasingResources(false),
|
||||||
|
m_canCapture(false)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_RESOURCE_POLICY
|
#ifdef HAVE_RESOURCE_POLICY
|
||||||
//loaded resource set is also kept requested for image and video capture sets
|
//loaded resource set is also kept requested for image and video capture sets
|
||||||
@@ -65,10 +66,13 @@ CamerabinResourcePolicy::CamerabinResourcePolicy(QObject *parent) :
|
|||||||
m_resource->initAndConnect();
|
m_resource->initAndConnect();
|
||||||
|
|
||||||
connect(m_resource, SIGNAL(resourcesGranted(const QList<ResourcePolicy::ResourceType>)),
|
connect(m_resource, SIGNAL(resourcesGranted(const QList<ResourcePolicy::ResourceType>)),
|
||||||
SIGNAL(resourcesGranted()));
|
SLOT(handleResourcesGranted()));
|
||||||
connect(m_resource, SIGNAL(resourcesDenied()), SIGNAL(resourcesDenied()));
|
connect(m_resource, SIGNAL(resourcesDenied()), SIGNAL(resourcesDenied()));
|
||||||
connect(m_resource, SIGNAL(lostResources()), SIGNAL(resourcesLost()));
|
connect(m_resource, SIGNAL(lostResources()), SLOT(handleResourcesLost()));
|
||||||
connect(m_resource, SIGNAL(resourcesReleased()), SLOT(handleResourcesReleased()));
|
connect(m_resource, SIGNAL(resourcesReleased()), SLOT(handleResourcesReleased()));
|
||||||
|
connect(m_resource, SIGNAL(resourcesBecameAvailable(QList<ResourcePolicy::ResourceType>)),
|
||||||
|
this, SLOT(resourcesAvailable()));
|
||||||
|
connect(m_resource, SIGNAL(updateOK()), this, SLOT(updateCanCapture()));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,17 +116,13 @@ void CamerabinResourcePolicy::setResourceSet(CamerabinResourcePolicy::ResourceSe
|
|||||||
break;
|
break;
|
||||||
case LoadedResources:
|
case LoadedResources:
|
||||||
requestedTypes << ResourcePolicy::LensCoverType //to detect lens cover is opened/closed
|
requestedTypes << ResourcePolicy::LensCoverType //to detect lens cover is opened/closed
|
||||||
<< ResourcePolicy::VideoRecorderType //to open camera device
|
<< ResourcePolicy::VideoRecorderType; //to open camera device
|
||||||
<< ResourcePolicy::SnapButtonType; //to detect capture button events
|
|
||||||
break;
|
break;
|
||||||
case ImageCaptureResources:
|
case ImageCaptureResources:
|
||||||
requestedTypes << ResourcePolicy::LensCoverType
|
requestedTypes << ResourcePolicy::LensCoverType
|
||||||
<< ResourcePolicy::VideoPlaybackType
|
<< ResourcePolicy::VideoPlaybackType
|
||||||
<< ResourcePolicy::VideoRecorderType
|
<< ResourcePolicy::VideoRecorderType
|
||||||
<< ResourcePolicy::AudioPlaybackType
|
<< ResourcePolicy::LedsType;
|
||||||
<< ResourcePolicy::ScaleButtonType
|
|
||||||
<< ResourcePolicy::LedsType
|
|
||||||
<< ResourcePolicy::SnapButtonType;
|
|
||||||
break;
|
break;
|
||||||
case VideoCaptureResources:
|
case VideoCaptureResources:
|
||||||
requestedTypes << ResourcePolicy::LensCoverType
|
requestedTypes << ResourcePolicy::LensCoverType
|
||||||
@@ -130,9 +130,7 @@ void CamerabinResourcePolicy::setResourceSet(CamerabinResourcePolicy::ResourceSe
|
|||||||
<< ResourcePolicy::VideoRecorderType
|
<< ResourcePolicy::VideoRecorderType
|
||||||
<< ResourcePolicy::AudioPlaybackType
|
<< ResourcePolicy::AudioPlaybackType
|
||||||
<< ResourcePolicy::AudioRecorderType
|
<< ResourcePolicy::AudioRecorderType
|
||||||
<< ResourcePolicy::ScaleButtonType
|
<< ResourcePolicy::LedsType;
|
||||||
<< ResourcePolicy::LedsType
|
|
||||||
<< ResourcePolicy::SnapButtonType;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,6 +146,14 @@ void CamerabinResourcePolicy::setResourceSet(CamerabinResourcePolicy::ResourceSe
|
|||||||
ResourcePolicy::LensCoverResource *lensCoverResource = new ResourcePolicy::LensCoverResource;
|
ResourcePolicy::LensCoverResource *lensCoverResource = new ResourcePolicy::LensCoverResource;
|
||||||
lensCoverResource->setOptional(true);
|
lensCoverResource->setOptional(true);
|
||||||
m_resource->addResourceObject(lensCoverResource);
|
m_resource->addResourceObject(lensCoverResource);
|
||||||
|
} else if (resourceType == ResourcePolicy::AudioPlaybackType) {
|
||||||
|
ResourcePolicy::Resource *resource = new ResourcePolicy::AudioResource;
|
||||||
|
resource->setOptional(true);
|
||||||
|
m_resource->addResourceObject(resource);
|
||||||
|
} else if (resourceType == ResourcePolicy::AudioRecorderType) {
|
||||||
|
ResourcePolicy::Resource *resource = new ResourcePolicy::AudioRecorderResource;
|
||||||
|
resource->setOptional(true);
|
||||||
|
m_resource->addResourceObject(resource);
|
||||||
} else {
|
} else {
|
||||||
m_resource->addResource(resourceType);
|
m_resource->addResource(resourceType);
|
||||||
}
|
}
|
||||||
@@ -164,6 +170,7 @@ void CamerabinResourcePolicy::setResourceSet(CamerabinResourcePolicy::ResourceSe
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Q_UNUSED(oldSet);
|
Q_UNUSED(oldSet);
|
||||||
|
updateCanCapture();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,6 +184,18 @@ bool CamerabinResourcePolicy::isResourcesGranted() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CamerabinResourcePolicy::handleResourcesLost()
|
||||||
|
{
|
||||||
|
updateCanCapture();
|
||||||
|
emit resourcesLost();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CamerabinResourcePolicy::handleResourcesGranted()
|
||||||
|
{
|
||||||
|
updateCanCapture();
|
||||||
|
emit resourcesGranted();
|
||||||
|
}
|
||||||
|
|
||||||
void CamerabinResourcePolicy::handleResourcesReleased()
|
void CamerabinResourcePolicy::handleResourcesReleased()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_RESOURCE_POLICY
|
#ifdef HAVE_RESOURCE_POLICY
|
||||||
@@ -185,6 +204,35 @@ void CamerabinResourcePolicy::handleResourcesReleased()
|
|||||||
#endif
|
#endif
|
||||||
m_releasingResources = false;
|
m_releasingResources = false;
|
||||||
#endif
|
#endif
|
||||||
|
updateCanCapture();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CamerabinResourcePolicy::resourcesAvailable()
|
||||||
|
{
|
||||||
|
#ifdef HAVE_RESOURCE_POLICY
|
||||||
|
if (m_resourceSet != NoResources) {
|
||||||
|
m_resource->acquire();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CamerabinResourcePolicy::canCapture() const
|
||||||
|
{
|
||||||
|
return m_canCapture;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CamerabinResourcePolicy::updateCanCapture()
|
||||||
|
{
|
||||||
|
const bool wasAbleToRecord = m_canCapture;
|
||||||
|
m_canCapture = (m_resourceSet == VideoCaptureResources) || (m_resourceSet == ImageCaptureResources);
|
||||||
|
#ifdef HAVE_RESOURCE_POLICY
|
||||||
|
foreach (ResourcePolicy::Resource *resource, m_resource->resources()) {
|
||||||
|
if (resource->type() != ResourcePolicy::LensCoverType)
|
||||||
|
m_canCapture = m_canCapture && resource->isGranted();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (wasAbleToRecord != m_canCapture)
|
||||||
|
emit canCaptureChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|||||||
@@ -69,18 +69,27 @@ public:
|
|||||||
|
|
||||||
bool isResourcesGranted() const;
|
bool isResourcesGranted() const;
|
||||||
|
|
||||||
|
bool canCapture() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void resourcesDenied();
|
void resourcesDenied();
|
||||||
void resourcesGranted();
|
void resourcesGranted();
|
||||||
void resourcesLost();
|
void resourcesLost();
|
||||||
|
void canCaptureChanged();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void handleResourcesLost();
|
||||||
|
void handleResourcesGranted();
|
||||||
void handleResourcesReleased();
|
void handleResourcesReleased();
|
||||||
|
void resourcesAvailable();
|
||||||
|
void updateCanCapture();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ResourceSet m_resourceSet;
|
ResourceSet m_resourceSet;
|
||||||
ResourcePolicy::ResourceSet *m_resource;
|
ResourcePolicy::ResourceSet *m_resource;
|
||||||
bool m_releasingResources;
|
bool m_releasingResources;
|
||||||
|
bool m_canCapture;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ CameraBinService::CameraBinService(const QString &service, QObject *parent):
|
|||||||
QMediaService(parent)
|
QMediaService(parent)
|
||||||
{
|
{
|
||||||
m_captureSession = 0;
|
m_captureSession = 0;
|
||||||
m_cameraControl = 0;
|
|
||||||
m_metaDataControl = 0;
|
m_metaDataControl = 0;
|
||||||
|
|
||||||
m_audioInputSelector = 0;
|
m_audioInputSelector = 0;
|
||||||
@@ -108,8 +107,8 @@ CameraBinService::CameraBinService(const QString &service, QObject *parent):
|
|||||||
|
|
||||||
if (service == Q_MEDIASERVICE_CAMERA) {
|
if (service == Q_MEDIASERVICE_CAMERA) {
|
||||||
m_captureSession = new CameraBinSession(this);
|
m_captureSession = new CameraBinSession(this);
|
||||||
m_cameraControl = new CameraBinControl(m_captureSession);
|
m_videoInputDevice = new QGstreamerVideoInputDeviceControl(
|
||||||
m_videoInputDevice = new QGstreamerVideoInputDeviceControl(m_captureSession);
|
m_captureSession->buildCameraSource(), m_captureSession);
|
||||||
m_imageCaptureControl = new CameraBinImageCapture(m_captureSession);
|
m_imageCaptureControl = new CameraBinImageCapture(m_captureSession);
|
||||||
|
|
||||||
connect(m_videoInputDevice, SIGNAL(selectedDeviceChanged(QString)),
|
connect(m_videoInputDevice, SIGNAL(selectedDeviceChanged(QString)),
|
||||||
@@ -207,7 +206,7 @@ QMediaControl *CameraBinService::requestControl(const char *name)
|
|||||||
return m_captureSession->mediaContainerControl();
|
return m_captureSession->mediaContainerControl();
|
||||||
|
|
||||||
if (qstrcmp(name,QCameraControl_iid) == 0)
|
if (qstrcmp(name,QCameraControl_iid) == 0)
|
||||||
return m_cameraControl;
|
return m_captureSession->cameraControl();
|
||||||
|
|
||||||
if (qstrcmp(name,QMetaDataWriterControl_iid) == 0)
|
if (qstrcmp(name,QMetaDataWriterControl_iid) == 0)
|
||||||
return m_metaDataControl;
|
return m_metaDataControl;
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ private:
|
|||||||
void setAudioPreview(GstElement*);
|
void setAudioPreview(GstElement*);
|
||||||
|
|
||||||
CameraBinSession *m_captureSession;
|
CameraBinSession *m_captureSession;
|
||||||
CameraBinControl *m_cameraControl;
|
|
||||||
CameraBinMetaData *m_metaDataControl;
|
CameraBinMetaData *m_metaDataControl;
|
||||||
|
|
||||||
QAudioInputSelectorControl *m_audioInputSelector;
|
QAudioInputSelectorControl *m_audioInputSelector;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "camerabinsession.h"
|
#include "camerabinsession.h"
|
||||||
|
#include "camerabincontrol.h"
|
||||||
#include "camerabinrecorder.h"
|
#include "camerabinrecorder.h"
|
||||||
#include "camerabincontainer.h"
|
#include "camerabincontainer.h"
|
||||||
#include "camerabinaudioencoder.h"
|
#include "camerabinaudioencoder.h"
|
||||||
@@ -152,6 +153,7 @@ CameraBinSession::CameraBinSession(QObject *parent)
|
|||||||
m_busHelper = new QGstreamerBusHelper(m_bus, this);
|
m_busHelper = new QGstreamerBusHelper(m_bus, this);
|
||||||
m_busHelper->installMessageFilter(this);
|
m_busHelper->installMessageFilter(this);
|
||||||
|
|
||||||
|
m_cameraControl = new CameraBinControl(this);
|
||||||
m_audioEncodeControl = new CameraBinAudioEncoder(this);
|
m_audioEncodeControl = new CameraBinAudioEncoder(this);
|
||||||
m_videoEncodeControl = new CameraBinVideoEncoder(this);
|
m_videoEncodeControl = new CameraBinVideoEncoder(this);
|
||||||
m_imageEncodeControl = new CameraBinImageEncoder(this);
|
m_imageEncodeControl = new CameraBinImageEncoder(this);
|
||||||
@@ -169,6 +171,10 @@ CameraBinSession::CameraBinSession(QObject *parent)
|
|||||||
m_captureDestinationControl = new CameraBinCaptureDestination(this);
|
m_captureDestinationControl = new CameraBinCaptureDestination(this);
|
||||||
m_captureBufferFormatControl = new CameraBinCaptureBufferFormat(this);
|
m_captureBufferFormatControl = new CameraBinCaptureBufferFormat(this);
|
||||||
|
|
||||||
|
QByteArray envFlags = qgetenv("QT_GSTREAMER_CAMERABIN_FLAGS");
|
||||||
|
if (!envFlags.isEmpty())
|
||||||
|
g_object_set(G_OBJECT(m_camerabin), "flags", envFlags.toInt(), NULL);
|
||||||
|
|
||||||
//post image preview in RGB format
|
//post image preview in RGB format
|
||||||
g_object_set(G_OBJECT(m_camerabin), POST_PREVIEWS_PROPERTY, TRUE, NULL);
|
g_object_set(G_OBJECT(m_camerabin), POST_PREVIEWS_PROPERTY, TRUE, NULL);
|
||||||
|
|
||||||
@@ -197,19 +203,10 @@ GstPhotography *CameraBinSession::photography()
|
|||||||
return GST_PHOTOGRAPHY(m_camerabin);
|
return GST_PHOTOGRAPHY(m_camerabin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_videoSrc) {
|
GstElement * const source = buildCameraSource();
|
||||||
m_videoSrc = buildCameraSource();
|
|
||||||
|
|
||||||
if (m_videoSrc)
|
if (source && GST_IS_PHOTOGRAPHY(source))
|
||||||
g_object_set(m_camerabin, CAMERA_SOURCE_PROPERTY, m_videoSrc, NULL);
|
return GST_PHOTOGRAPHY(source);
|
||||||
else
|
|
||||||
g_object_get(m_camerabin, CAMERA_SOURCE_PROPERTY, &m_videoSrc, NULL);
|
|
||||||
|
|
||||||
m_videoInputHasChanged = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_videoSrc && GST_IS_PHOTOGRAPHY(m_videoSrc))
|
|
||||||
return GST_PHOTOGRAPHY(m_videoSrc);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -225,17 +222,8 @@ CameraBinSession::CameraRole CameraBinSession::cameraRole() const
|
|||||||
*/
|
*/
|
||||||
bool CameraBinSession::setupCameraBin()
|
bool CameraBinSession::setupCameraBin()
|
||||||
{
|
{
|
||||||
if (m_videoInputHasChanged) {
|
if (!buildCameraSource())
|
||||||
m_videoSrc = buildCameraSource();
|
return false;
|
||||||
|
|
||||||
if (m_videoSrc)
|
|
||||||
g_object_set(m_camerabin, CAMERA_SOURCE_PROPERTY, m_videoSrc, NULL);
|
|
||||||
else
|
|
||||||
g_object_get(m_camerabin, CAMERA_SOURCE_PROPERTY, &m_videoSrc, NULL);
|
|
||||||
|
|
||||||
m_videoInputHasChanged = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (m_viewfinderHasChanged) {
|
if (m_viewfinderHasChanged) {
|
||||||
if (m_viewfinderElement)
|
if (m_viewfinderElement)
|
||||||
@@ -370,28 +358,43 @@ GstElement *CameraBinSession::buildCameraSource()
|
|||||||
#if CAMERABIN_DEBUG
|
#if CAMERABIN_DEBUG
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
#endif
|
#endif
|
||||||
|
if (!m_videoInputHasChanged)
|
||||||
|
return m_videoSrc;
|
||||||
|
m_videoInputHasChanged = false;
|
||||||
|
|
||||||
GstElement *videoSrc = 0;
|
GstElement *videoSrc = 0;
|
||||||
|
g_object_get(G_OBJECT(m_camerabin), CAMERA_SOURCE_PROPERTY, &videoSrc, NULL);
|
||||||
|
|
||||||
QList<QByteArray> candidates;
|
// If the QT_GSTREAMER_CAMERABIN_SRC environment variable has been set use the source
|
||||||
candidates << "subdevsrc" << "wrappercamerabinsrc";
|
// it recommends.
|
||||||
QByteArray sourceElementName;
|
const QByteArray envCandidate = qgetenv("QT_GSTREAMER_CAMERABIN_SRC");
|
||||||
|
if (!m_videoSrc && !envCandidate.isEmpty()) {
|
||||||
foreach (sourceElementName, candidates) {
|
m_videoSrc = gst_element_factory_make(envCandidate.constData(), "camera_source");
|
||||||
videoSrc = gst_element_factory_make(sourceElementName.constData(), "camera_source");
|
|
||||||
if (videoSrc)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (videoSrc && !m_inputDevice.isEmpty()) {
|
// If gstreamer has set a default source use it.
|
||||||
|
if (!m_videoSrc)
|
||||||
|
m_videoSrc = videoSrc;
|
||||||
|
|
||||||
|
// If there's no better guidance try the names of some known camera source elements.
|
||||||
|
if (!m_videoSrc) {
|
||||||
|
const QList<QByteArray> candidates = QList<QByteArray>()
|
||||||
|
<< "subdevsrc"
|
||||||
|
<< "wrappercamerabinsrc";
|
||||||
|
|
||||||
|
foreach (const QByteArray &sourceElementName, candidates) {
|
||||||
|
m_videoSrc = gst_element_factory_make(sourceElementName.constData(), "camera_source");
|
||||||
|
if (m_videoSrc)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_videoSrc && !m_inputDevice.isEmpty()) {
|
||||||
#if CAMERABIN_DEBUG
|
#if CAMERABIN_DEBUG
|
||||||
qDebug() << "set camera device" << m_inputDevice;
|
qDebug() << "set camera device" << m_inputDevice;
|
||||||
#endif
|
#endif
|
||||||
if (sourceElementName == "subdevsrc") {
|
|
||||||
if (m_inputDevice == QLatin1String("secondary"))
|
if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSrc), "video-source")) {
|
||||||
g_object_set(G_OBJECT(videoSrc), "camera-device", 1, NULL);
|
|
||||||
else
|
|
||||||
g_object_set(G_OBJECT(videoSrc), "camera-device", 0, NULL);
|
|
||||||
} else if (sourceElementName == "wrappercamerabinsrc") {
|
|
||||||
GstElement *src = 0;
|
GstElement *src = 0;
|
||||||
|
|
||||||
if (m_videoInputFactory)
|
if (m_videoInputFactory)
|
||||||
@@ -401,12 +404,21 @@ GstElement *CameraBinSession::buildCameraSource()
|
|||||||
|
|
||||||
if (src) {
|
if (src) {
|
||||||
g_object_set(G_OBJECT(src), "device", m_inputDevice.toUtf8().constData(), NULL);
|
g_object_set(G_OBJECT(src), "device", m_inputDevice.toUtf8().constData(), NULL);
|
||||||
g_object_set(G_OBJECT(videoSrc), "video-source", src, NULL);
|
g_object_set(G_OBJECT(m_videoSrc), "video-source", src, NULL);
|
||||||
|
}
|
||||||
|
} else if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSrc), "camera-device")) {
|
||||||
|
if (m_inputDevice == QLatin1String("secondary")) {
|
||||||
|
g_object_set(G_OBJECT(m_videoSrc), "camera-device", 1, NULL);
|
||||||
|
} else {
|
||||||
|
g_object_set(G_OBJECT(m_videoSrc), "camera-device", 0, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return videoSrc;
|
if (m_videoSrc != videoSrc)
|
||||||
|
g_object_set(G_OBJECT(m_camerabin), CAMERA_SOURCE_PROPERTY, m_videoSrc, NULL);
|
||||||
|
|
||||||
|
return m_videoSrc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraBinSession::captureImage(int requestId, const QString &fileName)
|
void CameraBinSession::captureImage(int requestId, const QString &fileName)
|
||||||
@@ -440,6 +452,8 @@ void CameraBinSession::setCaptureMode(QCamera::CaptureModes mode)
|
|||||||
g_object_set(m_camerabin, MODE_PROPERTY, CAMERABIN_VIDEO_MODE, NULL);
|
g_object_set(m_camerabin, MODE_PROPERTY, CAMERABIN_VIDEO_MODE, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_recorderControl->updateStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
QUrl CameraBinSession::outputLocation() const
|
QUrl CameraBinSession::outputLocation() const
|
||||||
@@ -494,7 +508,7 @@ QString CameraBinSession::generateFileName(const QString &prefix, const QDir &di
|
|||||||
{
|
{
|
||||||
int lastClip = 0;
|
int lastClip = 0;
|
||||||
foreach(QString fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(ext))) {
|
foreach(QString fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(ext))) {
|
||||||
int imgNumber = fileName.mid(prefix.length(), fileName.size()-prefix.length()-ext.length()-1).toInt();
|
int imgNumber = fileName.midRef(prefix.length(), fileName.size()-prefix.length()-ext.length()-1).toInt();
|
||||||
lastClip = qMax(lastClip, imgNumber);
|
lastClip = qMax(lastClip, imgNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -626,9 +640,7 @@ void CameraBinSession::setState(QCamera::State newState)
|
|||||||
m_viewfinderInterface->stopRenderer();
|
m_viewfinderInterface->stopRenderer();
|
||||||
|
|
||||||
gst_element_set_state(m_camerabin, GST_STATE_NULL);
|
gst_element_set_state(m_camerabin, GST_STATE_NULL);
|
||||||
m_videoSrc = buildCameraSource();
|
buildCameraSource();
|
||||||
g_object_set(m_camerabin, CAMERA_SOURCE_PROPERTY, m_videoSrc, NULL);
|
|
||||||
m_videoInputHasChanged = false;
|
|
||||||
}
|
}
|
||||||
#ifdef USE_READY_STATE_ON_LOADED
|
#ifdef USE_READY_STATE_ON_LOADED
|
||||||
gst_element_set_state(m_camerabin, GST_STATE_READY);
|
gst_element_set_state(m_camerabin, GST_STATE_READY);
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class QGstreamerMessage;
|
class QGstreamerMessage;
|
||||||
class QGstreamerBusHelper;
|
class QGstreamerBusHelper;
|
||||||
|
class CameraBinControl;
|
||||||
class CameraBinAudioEncoder;
|
class CameraBinAudioEncoder;
|
||||||
class CameraBinVideoEncoder;
|
class CameraBinVideoEncoder;
|
||||||
class CameraBinImageEncoder;
|
class CameraBinImageEncoder;
|
||||||
@@ -117,6 +118,9 @@ public:
|
|||||||
QDir defaultDir(QCamera::CaptureModes mode) const;
|
QDir defaultDir(QCamera::CaptureModes mode) const;
|
||||||
QString generateFileName(const QString &prefix, const QDir &dir, const QString &ext) const;
|
QString generateFileName(const QString &prefix, const QDir &dir, const QString &ext) const;
|
||||||
|
|
||||||
|
GstElement *buildCameraSource();
|
||||||
|
|
||||||
|
CameraBinControl *cameraControl() const { return m_cameraControl; }
|
||||||
CameraBinAudioEncoder *audioEncodeControl() const { return m_audioEncodeControl; }
|
CameraBinAudioEncoder *audioEncodeControl() const { return m_audioEncodeControl; }
|
||||||
CameraBinVideoEncoder *videoEncodeControl() const { return m_videoEncodeControl; }
|
CameraBinVideoEncoder *videoEncodeControl() const { return m_videoEncodeControl; }
|
||||||
CameraBinImageEncoder *imageEncodeControl() const { return m_imageEncodeControl; }
|
CameraBinImageEncoder *imageEncodeControl() const { return m_imageEncodeControl; }
|
||||||
@@ -188,7 +192,6 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
bool setupCameraBin();
|
bool setupCameraBin();
|
||||||
void setupCaptureResolution();
|
void setupCaptureResolution();
|
||||||
GstElement *buildCameraSource();
|
|
||||||
static void updateBusyStatus(GObject *o, GParamSpec *p, gpointer d);
|
static void updateBusyStatus(GObject *o, GParamSpec *p, gpointer d);
|
||||||
|
|
||||||
QUrl m_sink;
|
QUrl m_sink;
|
||||||
@@ -209,6 +212,7 @@ private:
|
|||||||
QObject *m_viewfinder;
|
QObject *m_viewfinder;
|
||||||
QGstreamerVideoRendererInterface *m_viewfinderInterface;
|
QGstreamerVideoRendererInterface *m_viewfinderInterface;
|
||||||
|
|
||||||
|
CameraBinControl *m_cameraControl;
|
||||||
CameraBinAudioEncoder *m_audioEncodeControl;
|
CameraBinAudioEncoder *m_audioEncodeControl;
|
||||||
CameraBinVideoEncoder *m_videoEncodeControl;
|
CameraBinVideoEncoder *m_videoEncodeControl;
|
||||||
CameraBinImageEncoder *m_imageEncodeControl;
|
CameraBinImageEncoder *m_imageEncodeControl;
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ int QGstreamerImageCaptureControl::capture(const QString &fileName)
|
|||||||
int lastImage = 0;
|
int lastImage = 0;
|
||||||
QDir outputDir = QDir::currentPath();
|
QDir outputDir = QDir::currentPath();
|
||||||
foreach(QString fileName, outputDir.entryList(QStringList() << "img_*.jpg")) {
|
foreach(QString fileName, outputDir.entryList(QStringList() << "img_*.jpg")) {
|
||||||
int imgNumber = fileName.mid(4, fileName.size()-8).toInt();
|
int imgNumber = fileName.midRef(4, fileName.size()-8).toInt();
|
||||||
lastImage = qMax(lastImage, imgNumber);
|
lastImage = qMax(lastImage, imgNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ QString QGstreamerRecorderControl::generateFileName(const QDir &dir, const QStri
|
|||||||
|
|
||||||
int lastClip = 0;
|
int lastClip = 0;
|
||||||
foreach(QString fileName, dir.entryList(QStringList() << QString("clip_*.%1").arg(ext))) {
|
foreach(QString fileName, dir.entryList(QStringList() << QString("clip_*.%1").arg(ext))) {
|
||||||
int imgNumber = fileName.mid(5, fileName.size()-6-ext.length()).toInt();
|
int imgNumber = fileName.midRef(5, fileName.size()-6-ext.length()).toInt();
|
||||||
lastClip = qMax(lastClip, imgNumber);
|
lastClip = qMax(lastClip, imgNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ typedef enum {
|
|||||||
"video/x-raw-rgb; " \
|
"video/x-raw-rgb; " \
|
||||||
"video/x-raw-gray; " \
|
"video/x-raw-gray; " \
|
||||||
"video/x-surface; " \
|
"video/x-surface; " \
|
||||||
|
"video/x-android-buffer; " \
|
||||||
"audio/x-raw-int; " \
|
"audio/x-raw-int; " \
|
||||||
"audio/x-raw-float; " \
|
"audio/x-raw-float; " \
|
||||||
"text/plain; " \
|
"text/plain; " \
|
||||||
@@ -140,7 +141,12 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent)
|
|||||||
#else
|
#else
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
g_object_get(G_OBJECT(m_playbin), "flags", &flags, NULL);
|
g_object_get(G_OBJECT(m_playbin), "flags", &flags, NULL);
|
||||||
flags |= GST_PLAY_FLAG_NATIVE_VIDEO;
|
QByteArray envFlags = qgetenv("QT_GSTREAMER_PLAYBIN_FLAGS");
|
||||||
|
if (!envFlags.isEmpty()) {
|
||||||
|
flags |= envFlags.toInt();
|
||||||
|
} else {
|
||||||
|
flags |= GST_PLAY_FLAG_NATIVE_VIDEO;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
g_object_set(G_OBJECT(m_playbin), "flags", flags, NULL);
|
g_object_set(G_OBJECT(m_playbin), "flags", flags, NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ QString BbMediaStorageLocation::generateFileName(const QString &prefix, const QD
|
|||||||
if (lastMediaIndex == 0) {
|
if (lastMediaIndex == 0) {
|
||||||
// first run, find the maximum media number during the fist capture
|
// first run, find the maximum media number during the fist capture
|
||||||
Q_FOREACH (const QString &fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(extension))) {
|
Q_FOREACH (const QString &fileName, dir.entryList(QStringList() << QString("%1*.%2").arg(prefix).arg(extension))) {
|
||||||
const qint64 mediaIndex = fileName.mid(prefix.length(), fileName.size() - prefix.length() - extension.length() - 1).toInt();
|
const qint64 mediaIndex = fileName.midRef(prefix.length(), fileName.size() - prefix.length() - extension.length() - 1).toInt();
|
||||||
lastMediaIndex = qMax(lastMediaIndex, mediaIndex);
|
lastMediaIndex = qMax(lastMediaIndex, mediaIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -587,8 +587,8 @@ void MmRendererMediaPlayerControl::setMmBufferStatus(const QString &bufferStatus
|
|||||||
{
|
{
|
||||||
const int slashPos = bufferStatus.indexOf('/');
|
const int slashPos = bufferStatus.indexOf('/');
|
||||||
if (slashPos != -1) {
|
if (slashPos != -1) {
|
||||||
const int fill = bufferStatus.left(slashPos).toInt();
|
const int fill = bufferStatus.leftRef(slashPos).toInt();
|
||||||
const int capacity = bufferStatus.mid(slashPos + 1).toInt();
|
const int capacity = bufferStatus.midRef(slashPos + 1).toInt();
|
||||||
if (capacity != 0) {
|
if (capacity != 0) {
|
||||||
m_bufferStatus = fill / static_cast<float>(capacity) * 100.0f;
|
m_bufferStatus = fill / static_cast<float>(capacity) * 100.0f;
|
||||||
emit bufferStatusChanged(m_bufferStatus);
|
emit bufferStatusChanged(m_bufferStatus);
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ bool MmRendererMetaData::parse(const QString &contextName)
|
|||||||
|
|
||||||
const int separatorPos = line.indexOf(separator);
|
const int separatorPos = line.indexOf(separator);
|
||||||
if (separatorPos != -1) {
|
if (separatorPos != -1) {
|
||||||
const QString key = line.left(separatorPos);
|
const QStringRef key = line.leftRef(separatorPos);
|
||||||
const QString value = line.mid(separatorPos + separator.length());
|
const QStringRef value = line.midRef(separatorPos + separator.length());
|
||||||
|
|
||||||
if (key == durationKey)
|
if (key == durationKey)
|
||||||
m_duration = value.toLongLong();
|
m_duration = value.toLongLong();
|
||||||
@@ -113,15 +113,15 @@ bool MmRendererMetaData::parse(const QString &contextName)
|
|||||||
else if (key == pixelHeightKey)
|
else if (key == pixelHeightKey)
|
||||||
m_pixelHeight = value.toFloat();
|
m_pixelHeight = value.toFloat();
|
||||||
else if (key == titleKey)
|
else if (key == titleKey)
|
||||||
m_title = value;
|
m_title = value.toString();
|
||||||
else if (key == seekableKey)
|
else if (key == seekableKey)
|
||||||
m_seekable = !(value == QLatin1String("0"));
|
m_seekable = !(value == QLatin1String("0"));
|
||||||
else if (key == artistKey)
|
else if (key == artistKey)
|
||||||
m_artist = value;
|
m_artist = value.toString();
|
||||||
else if (key == commentKey)
|
else if (key == commentKey)
|
||||||
m_comment = value;
|
m_comment = value.toString();
|
||||||
else if (key == genreKey)
|
else if (key == genreKey)
|
||||||
m_genre = value;
|
m_genre = value.toString();
|
||||||
else if (key == yearKey)
|
else if (key == yearKey)
|
||||||
m_year = value.toInt();
|
m_year = value.toInt();
|
||||||
else if (key == bitRateKey)
|
else if (key == bitRateKey)
|
||||||
@@ -129,7 +129,7 @@ bool MmRendererMetaData::parse(const QString &contextName)
|
|||||||
else if (key == sampleKey)
|
else if (key == sampleKey)
|
||||||
m_sampleRate = value.toInt();
|
m_sampleRate = value.toInt();
|
||||||
else if (key == albumKey)
|
else if (key == albumKey)
|
||||||
m_album = value;
|
m_album = value.toString();
|
||||||
else if (key == trackKey)
|
else if (key == trackKey)
|
||||||
m_track = value.toInt();
|
m_track = value.toInt();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,8 @@
|
|||||||
|
|
||||||
ResourcePolicyImpl::ResourcePolicyImpl(QObject *parent)
|
ResourcePolicyImpl::ResourcePolicyImpl(QObject *parent)
|
||||||
: QMediaPlayerResourceSetInterface(parent)
|
: QMediaPlayerResourceSetInterface(parent)
|
||||||
|
, m_status(Initial)
|
||||||
|
, m_videoEnabled(false)
|
||||||
{
|
{
|
||||||
m_resourceSet = new ResourcePolicy::ResourceSet("player", this);
|
m_resourceSet = new ResourcePolicy::ResourceSet("player", this);
|
||||||
m_resourceSet->setAlwaysReply();
|
m_resourceSet->setAlwaysReply();
|
||||||
@@ -57,7 +59,6 @@ ResourcePolicyImpl::ResourcePolicyImpl(QObject *parent)
|
|||||||
audioResource->setStreamTag("media.name", "*");
|
audioResource->setStreamTag("media.name", "*");
|
||||||
m_resourceSet->addResourceObject(audioResource);
|
m_resourceSet->addResourceObject(audioResource);
|
||||||
|
|
||||||
m_resourceSet->addResource(ResourcePolicy::VideoPlaybackType);
|
|
||||||
m_resourceSet->update();
|
m_resourceSet->update();
|
||||||
|
|
||||||
connect(m_resourceSet, SIGNAL(resourcesGranted(const QList<ResourcePolicy::ResourceType>)),
|
connect(m_resourceSet, SIGNAL(resourcesGranted(const QList<ResourcePolicy::ResourceType>)),
|
||||||
|
|||||||
@@ -5,11 +5,15 @@ SUBDIRS += \
|
|||||||
qaudiodeviceinfo \
|
qaudiodeviceinfo \
|
||||||
qaudioinput \
|
qaudioinput \
|
||||||
qaudiooutput \
|
qaudiooutput \
|
||||||
qdeclarativevideooutput \
|
|
||||||
qdeclarativevideooutput_window \
|
|
||||||
qmediaplayerbackend \
|
qmediaplayerbackend \
|
||||||
qcamerabackend \
|
qcamerabackend \
|
||||||
qsoundeffect \
|
qsoundeffect \
|
||||||
qsound
|
qsound
|
||||||
|
|
||||||
|
qtHaveModule(quick) {
|
||||||
|
SUBDIRS += \
|
||||||
|
qdeclarativevideooutput \
|
||||||
|
qdeclarativevideooutput_window
|
||||||
|
}
|
||||||
|
|
||||||
!qtHaveModule(widgets): SUBDIRS -= qcamerabackend
|
!qtHaveModule(widgets): SUBDIRS -= qcamerabackend
|
||||||
|
|||||||
@@ -30,13 +30,7 @@ SUBDIRS += \
|
|||||||
qvideosurfaceformat \
|
qvideosurfaceformat \
|
||||||
qwavedecoder \
|
qwavedecoder \
|
||||||
qaudiobuffer \
|
qaudiobuffer \
|
||||||
qdeclarativeaudio \
|
|
||||||
qaudiodecoder \
|
qaudiodecoder \
|
||||||
qaudioprobe \
|
qaudioprobe \
|
||||||
qvideoprobe \
|
qvideoprobe \
|
||||||
qsamplecache
|
qsamplecache
|
||||||
|
|
||||||
disabled {
|
|
||||||
SUBDIRS += \
|
|
||||||
qdeclarativevideo
|
|
||||||
}
|
|
||||||
|
|||||||
10
tests/auto/unit/multimediaqml.pro
Normal file
10
tests/auto/unit/multimediaqml.pro
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
TEMPLATE = subdirs
|
||||||
|
SUBDIRS += \
|
||||||
|
qdeclarativeaudio \
|
||||||
|
|
||||||
|
disabled {
|
||||||
|
SUBDIRS += \
|
||||||
|
qdeclarativevideo
|
||||||
|
}
|
||||||
|
|
||||||
@@ -2,3 +2,4 @@ TEMPLATE = subdirs
|
|||||||
|
|
||||||
SUBDIRS += multimedia.pro
|
SUBDIRS += multimedia.pro
|
||||||
qtHaveModule(widgets): SUBDIRS += multimediawidgets.pro
|
qtHaveModule(widgets): SUBDIRS += multimediawidgets.pro
|
||||||
|
qtHaveModule(qml): SUBDIRS += multimediaqml.pro
|
||||||
|
|||||||
Reference in New Issue
Block a user