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>
This commit is contained in:
Dmytro Poplavskiy
2011-08-02 14:33:38 +10:00
committed by Qt by Nokia
parent 6eac3bd648
commit e70ebfd2ed
20 changed files with 211 additions and 165 deletions

View File

@@ -179,10 +179,36 @@ bool QGstreamerVideoWidgetControl::eventFilter(QObject *object, QEvent *e)
return false;
}
void QGstreamerVideoWidgetControl::precessNewStream()
bool QGstreamerVideoWidgetControl::processSyncMessage(const QGstreamerMessage &message)
{
setOverlay();
QMetaObject::invokeMethod(this, "updateNativeVideoSize", Qt::QueuedConnection);
GstMessage* gm = message.rawMessage();
if (gm && (GST_MESSAGE_TYPE(gm) == GST_MESSAGE_ELEMENT) &&
gst_structure_has_name(gm->structure, "prepare-xwindow-id")) {
setOverlay();
QMetaObject::invokeMethod(this, "updateNativeVideoSize", Qt::QueuedConnection);
return true;
}
return false;
}
bool QGstreamerVideoWidgetControl::processBusMessage(const QGstreamerMessage &message)
{
GstMessage* gm = message.rawMessage();
if (GST_MESSAGE_TYPE(gm) == GST_MESSAGE_STATE_CHANGED &&
GST_MESSAGE_SRC(gm) == GST_OBJECT_CAST(m_videoSink)) {
GstState oldState;
GstState newState;
gst_message_parse_state_changed(gm, &oldState, &newState, 0);
if (oldState == GST_STATE_READY && newState == GST_STATE_PAUSED)
updateNativeVideoSize();
}
return false;
}
void QGstreamerVideoWidgetControl::setOverlay()