summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
diff options
context:
space:
mode:
authorDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2011-08-02 14:33:38 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-05 07:50:59 +0200
commite70ebfd2ed8d522478f04ab823b527b48ed24671 (patch)
treeaa52d70121ab80a07ff5036aba3be30be8aba758 /src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
parent6eac3bd6488f8d8b368d97bdb8d701b804310be6 (diff)
Gstreamer media backend cleanup.
Moved controls specific bus/sync messages handling from player/camera/capture session to corresponding controls. Reviewed-by: Michael Goddard Change-Id: Ieb67976ed335b0ef1cde87dc60e8ad8da3409526 Reviewed-on: http://codereview.qt.nokia.com/2535 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Diffstat (limited to 'src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp')
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp37
1 files changed, 8 insertions, 29 deletions
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
index b092af281..b685f5466 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
@@ -96,8 +96,8 @@ QGstreamerCaptureSession::QGstreamerCaptureSession(QGstreamerCaptureSession::Cap
m_bus = gst_element_get_bus(m_pipeline);
m_busHelper = new QGstreamerBusHelper(m_bus, this);
- m_busHelper->installSyncEventFilter(this);
- connect(m_busHelper, SIGNAL(message(QGstreamerMessage)), SLOT(busMessage(QGstreamerMessage)));
+ m_busHelper->installMessageFilter(this);
+
m_audioEncodeControl = new QGstreamerAudioEncode(this);
m_videoEncodeControl = new QGstreamerVideoEncode(this);
m_imageEncodeControl = new QGstreamerImageEncode(this);
@@ -735,6 +735,8 @@ void QGstreamerCaptureSession::setVideoPreview(QObject *viewfinder)
this, SIGNAL(viewfinderChanged()));
disconnect(m_viewfinder, SIGNAL(readyChanged(bool)),
this, SIGNAL(readyChanged(bool)));
+
+ m_busHelper->removeMessageFilter(m_viewfinder);
}
m_viewfinder = viewfinder;
@@ -745,6 +747,8 @@ void QGstreamerCaptureSession::setVideoPreview(QObject *viewfinder)
this, SIGNAL(viewfinderChanged()));
connect(m_viewfinder, SIGNAL(readyChanged(bool)),
this, SIGNAL(readyChanged(bool)));
+
+ m_busHelper->installMessageFilter(m_viewfinder);
}
emit viewfinderChanged();
@@ -917,29 +921,7 @@ void QGstreamerCaptureSession::setMetaData(const QMap<QByteArray, QVariant> &dat
}
}
-bool QGstreamerCaptureSession::processSyncMessage(const QGstreamerMessage &message)
-{
- GstMessage* gm = message.rawMessage();
-
- if (gm && GST_MESSAGE_TYPE(gm) == GST_MESSAGE_ELEMENT) {
- if (GST_MESSAGE_SRC(gm) == GST_OBJECT_CAST(m_videoPreview))
- m_viewfinderInterface->handleSyncMessage(gm);
-
- if (gst_structure_has_name(gm->structure, "prepare-xwindow-id")) {
- if (m_audioPreviewFactory)
- m_audioPreviewFactory->prepareWinId();
-
- if (m_viewfinderInterface)
- m_viewfinderInterface->precessNewStream();
-
- return true;
- }
- }
-
- return false;
-}
-
-void QGstreamerCaptureSession::busMessage(const QGstreamerMessage &message)
+bool QGstreamerCaptureSession::processBusMessage(const QGstreamerMessage &message)
{
GstMessage* gm = message.rawMessage();
@@ -1027,11 +1009,8 @@ void QGstreamerCaptureSession::busMessage(const QGstreamerMessage &message)
}
//qDebug() << "New session state:" << ENUM_NAME(QGstreamerCaptureSession,"State",m_state);
}
-
- if (m_videoPreview && m_viewfinderInterface &&
- GST_MESSAGE_SRC(gm) == GST_OBJECT_CAST(m_videoPreview))
- m_viewfinderInterface->handleBusMessage(gm);
}
+ return false;
}
void QGstreamerCaptureSession::setMuted(bool muted)