return m_state;
}
-void QGstreamerCaptureSession::waitForStopped()
-{
- GstState state = GST_STATE_PLAYING;
- gst_element_get_state(m_pipeline, &state, 0, 0);
-
- while (state != GST_STATE_NULL) {
- qApp->processEvents();
- gst_element_get_state(m_pipeline, &state, 0, 0);
- }
-}
-
void QGstreamerCaptureSession::setState(QGstreamerCaptureSession::State newState)
{
if (newState == m_pendingState && !m_waitingForEos)
gst_element_set_state(m_pipeline, GST_STATE_NULL);
- //It would be better to do this async. but
- //gstreamer doesn't notify about pipeline went to NULL state
- waitForStopped();
if (!rebuildGraph(newMode)) {
m_pendingState = StoppedState;
m_state = StoppedState;