Merge branch 'stable' into dev
Conflicts: .qmake.conf Change-Id: Id3427cb1a80956ba61373313c21b4b9aa007ea54
@@ -6,6 +6,6 @@ QT += quick qml multimedia
|
|||||||
SOURCES += qmlcamera.cpp
|
SOURCES += qmlcamera.cpp
|
||||||
RESOURCES += declarative-camera.qrc
|
RESOURCES += declarative-camera.qrc
|
||||||
|
|
||||||
target.path = $$[QT_INSTALL_EXAMPLES]/multimediawidgets/declarative-camera
|
target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/declarative-camera
|
||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 778 B |
|
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 717 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 610 B After Width: | Height: | Size: 610 B |
|
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 717 B |
|
Before Width: | Height: | Size: 945 B After Width: | Height: | Size: 945 B |
|
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 625 B |
|
Before Width: | Height: | Size: 554 B After Width: | Height: | Size: 554 B |
|
Before Width: | Height: | Size: 600 B After Width: | Height: | Size: 600 B |
|
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 587 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -13,8 +13,9 @@ qtHaveModule(widgets) {
|
|||||||
audiooutput \
|
audiooutput \
|
||||||
}
|
}
|
||||||
|
|
||||||
qtHaveModule(gui):qtHaveModule(qml) {
|
qtHaveModule(quick) {
|
||||||
SUBDIRS += \
|
SUBDIRS += \
|
||||||
|
declarative-camera \
|
||||||
declarative-radio \
|
declarative-radio \
|
||||||
video
|
video
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,13 +129,11 @@ int main(int argc, char *argv[])
|
|||||||
rootObject, SLOT(qmlFramePainted()));
|
rootObject, SLOT(qmlFramePainted()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QUrl videoPath;
|
|
||||||
const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
|
const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
|
||||||
if (moviesLocation.isEmpty()) {
|
const QUrl videoPath =
|
||||||
QUrl appPath(QString("file://%1").arg(app.applicationDirPath()));
|
QUrl::fromLocalFile(moviesLocation.isEmpty() ?
|
||||||
videoPath = appPath.resolved(QUrl("./"));
|
app.applicationDirPath() :
|
||||||
} else
|
moviesLocation.front());
|
||||||
videoPath = QString("file://%1").arg(moviesLocation.first());
|
|
||||||
viewer.rootContext()->setContextProperty("videoPath", videoPath);
|
viewer.rootContext()->setContextProperty("videoPath", videoPath);
|
||||||
|
|
||||||
QMetaObject::invokeMethod(rootObject, "init");
|
QMetaObject::invokeMethod(rootObject, "init");
|
||||||
|
|||||||
@@ -101,7 +101,10 @@ Rectangle {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
function launch() {
|
function launch() {
|
||||||
var path = "file://" + filePath;
|
var path = "file://";
|
||||||
|
if (filePath.length > 2 && filePath[1] === ':') // Windows drive logic, see QUrl::fromLocalFile()
|
||||||
|
path += '/';
|
||||||
|
path += filePath;
|
||||||
if (folders.isFolder(index))
|
if (folders.isFolder(index))
|
||||||
down(path);
|
down(path);
|
||||||
else
|
else
|
||||||
@@ -306,7 +309,7 @@ Rectangle {
|
|||||||
MouseArea { id: upRegion; anchors.centerIn: parent
|
MouseArea { id: upRegion; anchors.centerIn: parent
|
||||||
width: 56
|
width: 56
|
||||||
height: 56
|
height: 56
|
||||||
onClicked: if (folders.parentFolder != "") up()
|
onClicked: up()
|
||||||
}
|
}
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
@@ -352,6 +355,8 @@ Rectangle {
|
|||||||
|
|
||||||
function up() {
|
function up() {
|
||||||
var path = folders.parentFolder;
|
var path = folders.parentFolder;
|
||||||
|
if (path.toString().length === 0 || path.toString() === 'file:')
|
||||||
|
return;
|
||||||
if (folders == folders1) {
|
if (folders == folders1) {
|
||||||
view = view2
|
view = view2
|
||||||
folders = folders2;
|
folders = folders2;
|
||||||
|
|||||||
@@ -9,8 +9,3 @@ qtHaveModule(widgets) {
|
|||||||
player \
|
player \
|
||||||
customvideosurface
|
customvideosurface
|
||||||
}
|
}
|
||||||
|
|
||||||
qtHaveModule(gui):qtHaveModule(qml) {
|
|
||||||
disabled:SUBDIRS += declarative-camera
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ win32 {
|
|||||||
qtCompileTest(directshow)
|
qtCompileTest(directshow)
|
||||||
qtCompileTest(wmsdk)
|
qtCompileTest(wmsdk)
|
||||||
qtCompileTest(wmp)
|
qtCompileTest(wmp)
|
||||||
qtCompileTest(wmf)
|
contains(QT_CONFIG, wmf-backend): qtCompileTest(wmf)
|
||||||
qtCompileTest(evr)
|
qtCompileTest(evr)
|
||||||
} else:mac {
|
} else:mac {
|
||||||
qtCompileTest(avfoundation)
|
qtCompileTest(avfoundation)
|
||||||
|
|||||||
@@ -147,9 +147,20 @@ public:
|
|||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void contextReady();
|
void contextReady();
|
||||||
|
void contextFailed();
|
||||||
void volumeChanged();
|
void volumeChanged();
|
||||||
|
|
||||||
private:
|
private Q_SLOTS:
|
||||||
|
void onContextFailed()
|
||||||
|
{
|
||||||
|
release();
|
||||||
|
|
||||||
|
// Try to reconnect later
|
||||||
|
QTimer::singleShot(30000, this, SLOT(prepare()));
|
||||||
|
|
||||||
|
emit contextFailed();
|
||||||
|
}
|
||||||
|
|
||||||
void prepare()
|
void prepare()
|
||||||
{
|
{
|
||||||
m_vol = PA_VOLUME_NORM;
|
m_vol = PA_VOLUME_NORM;
|
||||||
@@ -196,12 +207,23 @@ private:
|
|||||||
m_prepared = true;
|
m_prepared = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
void release()
|
void release()
|
||||||
{
|
{
|
||||||
if (!m_prepared) return;
|
if (!m_prepared)
|
||||||
pa_context_unref(m_context);
|
return;
|
||||||
pa_threaded_mainloop_stop(m_mainLoop);
|
|
||||||
pa_threaded_mainloop_free(m_mainLoop);
|
if (m_context) {
|
||||||
|
pa_context_unref(m_context);
|
||||||
|
m_context = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_mainLoop) {
|
||||||
|
pa_threaded_mainloop_stop(m_mainLoop);
|
||||||
|
pa_threaded_mainloop_free(m_mainLoop);
|
||||||
|
m_mainLoop = 0;
|
||||||
|
}
|
||||||
|
|
||||||
m_prepared = false;
|
m_prepared = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,6 +243,9 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
QMetaObject::invokeMethod(self, "contextReady", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(self, "contextReady", Qt::QueuedConnection);
|
||||||
break;
|
break;
|
||||||
|
case PA_CONTEXT_FAILED:
|
||||||
|
QMetaObject::invokeMethod(self, "onContextFailed", Qt::QueuedConnection);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -511,7 +536,8 @@ void QSoundEffectPrivate::updateVolume()
|
|||||||
PulseDaemonLocker locker;
|
PulseDaemonLocker locker;
|
||||||
pa_cvolume volume;
|
pa_cvolume volume;
|
||||||
volume.channels = m_pulseSpec.channels;
|
volume.channels = m_pulseSpec.channels;
|
||||||
pa_operation_unref(pa_context_set_sink_input_volume(pulseDaemon()->context(), m_sinkInputId, pulseDaemon()->calcVolume(&volume, m_volume), setvolume_callback, m_ref->getRef()));
|
if (pulseDaemon()->context())
|
||||||
|
pa_operation_unref(pa_context_set_sink_input_volume(pulseDaemon()->context(), m_sinkInputId, pulseDaemon()->calcVolume(&volume, m_volume), setvolume_callback, m_ref->getRef()));
|
||||||
Q_ASSERT(pa_cvolume_valid(&volume));
|
Q_ASSERT(pa_cvolume_valid(&volume));
|
||||||
#ifdef QT_PA_DEBUG
|
#ifdef QT_PA_DEBUG
|
||||||
qDebug() << this << "updateVolume =" << pa_cvolume_max(&volume);
|
qDebug() << this << "updateVolume =" << pa_cvolume_max(&volume);
|
||||||
@@ -535,7 +561,8 @@ void QSoundEffectPrivate::updateMuted()
|
|||||||
if (m_sinkInputId < 0)
|
if (m_sinkInputId < 0)
|
||||||
return;
|
return;
|
||||||
PulseDaemonLocker locker;
|
PulseDaemonLocker locker;
|
||||||
pa_operation_unref(pa_context_set_sink_input_mute(pulseDaemon()->context(), m_sinkInputId, m_muted, setmuted_callback, m_ref->getRef()));
|
if (pulseDaemon()->context())
|
||||||
|
pa_operation_unref(pa_context_set_sink_input_mute(pulseDaemon()->context(), m_sinkInputId, m_muted, setmuted_callback, m_ref->getRef()));
|
||||||
#ifdef QT_PA_DEBUG
|
#ifdef QT_PA_DEBUG
|
||||||
qDebug() << this << "updateMuted = " << m_muted;
|
qDebug() << this << "updateMuted = " << m_muted;
|
||||||
#endif
|
#endif
|
||||||
@@ -705,7 +732,7 @@ void QSoundEffectPrivate::sampleReady()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
if (pa_context_get_state(pulseDaemon()->context()) != PA_CONTEXT_READY) {
|
if (!pulseDaemon()->context() || pa_context_get_state(pulseDaemon()->context()) != PA_CONTEXT_READY) {
|
||||||
connect(pulseDaemon(), SIGNAL(contextReady()), SLOT(contextReady()));
|
connect(pulseDaemon(), SIGNAL(contextReady()), SLOT(contextReady()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -741,6 +768,7 @@ void QSoundEffectPrivate::unloadPulseStream()
|
|||||||
pa_stream_disconnect(m_pulseStream);
|
pa_stream_disconnect(m_pulseStream);
|
||||||
pa_stream_unref(m_pulseStream);
|
pa_stream_unref(m_pulseStream);
|
||||||
disconnect(pulseDaemon(), SIGNAL(volumeChanged()), this, SLOT(updateVolume()));
|
disconnect(pulseDaemon(), SIGNAL(volumeChanged()), this, SLOT(updateVolume()));
|
||||||
|
disconnect(pulseDaemon(), SIGNAL(contextFailed()), this, SLOT(contextFailed()));
|
||||||
m_pulseStream = 0;
|
m_pulseStream = 0;
|
||||||
m_reloadCategory = false; // category will be reloaded when we connect anyway
|
m_reloadCategory = false; // category will be reloaded when we connect anyway
|
||||||
}
|
}
|
||||||
@@ -895,6 +923,9 @@ void QSoundEffectPrivate::createPulseStream()
|
|||||||
qDebug() << this << "createPulseStream";
|
qDebug() << this << "createPulseStream";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!pulseDaemon()->context())
|
||||||
|
return;
|
||||||
|
|
||||||
pa_proplist *propList = pa_proplist_new();
|
pa_proplist *propList = pa_proplist_new();
|
||||||
if (m_category.isNull()) {
|
if (m_category.isNull()) {
|
||||||
// Meant to be one of the strings "video", "music", "game", "event", "phone", "animation", "production", "a11y", "test"
|
// Meant to be one of the strings "video", "music", "game", "event", "phone", "animation", "production", "a11y", "test"
|
||||||
@@ -906,6 +937,7 @@ void QSoundEffectPrivate::createPulseStream()
|
|||||||
pa_proplist_free(propList);
|
pa_proplist_free(propList);
|
||||||
|
|
||||||
connect(pulseDaemon(), SIGNAL(volumeChanged()), this, SLOT(updateVolume()));
|
connect(pulseDaemon(), SIGNAL(volumeChanged()), this, SLOT(updateVolume()));
|
||||||
|
connect(pulseDaemon(), SIGNAL(contextFailed()), this, SLOT(contextFailed()));
|
||||||
|
|
||||||
if (stream == 0) {
|
if (stream == 0) {
|
||||||
qWarning("QSoundEffect(pulseaudio): Failed to create stream");
|
qWarning("QSoundEffect(pulseaudio): Failed to create stream");
|
||||||
@@ -947,6 +979,12 @@ void QSoundEffectPrivate::contextReady()
|
|||||||
createPulseStream();
|
createPulseStream();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QSoundEffectPrivate::contextFailed()
|
||||||
|
{
|
||||||
|
unloadPulseStream();
|
||||||
|
connect(pulseDaemon(), SIGNAL(contextReady()), this, SLOT(contextReady()));
|
||||||
|
}
|
||||||
|
|
||||||
void QSoundEffectPrivate::stream_write_callback(pa_stream *s, size_t length, void *userdata)
|
void QSoundEffectPrivate::stream_write_callback(pa_stream *s, size_t length, void *userdata)
|
||||||
{
|
{
|
||||||
Q_UNUSED(length);
|
Q_UNUSED(length);
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ private Q_SLOTS:
|
|||||||
void sampleReady();
|
void sampleReady();
|
||||||
void uploadSample();
|
void uploadSample();
|
||||||
void contextReady();
|
void contextReady();
|
||||||
|
void contextFailed();
|
||||||
void underRun();
|
void underRun();
|
||||||
void prepare();
|
void prepare();
|
||||||
void streamReady();
|
void streamReady();
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ QT += multimediawidgets
|
|||||||
|
|
||||||
\section2 Examples
|
\section2 Examples
|
||||||
\list
|
\list
|
||||||
\li \l{QML Camera Example}
|
|
||||||
\li \l{Camera Example}
|
\li \l{Camera Example}
|
||||||
\li \l{Media Player Example}
|
\li \l{Media Player Example}
|
||||||
\li \l{Video Graphics Item Example}
|
\li \l{Video Graphics Item Example}
|
||||||
|
|||||||