Gst capture: don't wait for pipeline to stop
State changes to lower state are synchronous in gstreamer Change-Id: Ib87eabfeee9ec100f24efbaa989ec909ac7f9a1b Reviewed-by: Lev Zelenskiy <lev.zelenskiy@nokia.com> Reviewed-by: Ling Hu <ling.hu@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
b6848df7c2
commit
799a33e34d
@@ -773,17 +773,6 @@ QGstreamerCaptureSession::State QGstreamerCaptureSession::state() const
|
|||||||
return m_state;
|
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)
|
void QGstreamerCaptureSession::setState(QGstreamerCaptureSession::State newState)
|
||||||
{
|
{
|
||||||
if (newState == m_pendingState && !m_waitingForEos)
|
if (newState == m_pendingState && !m_waitingForEos)
|
||||||
@@ -829,9 +818,6 @@ void QGstreamerCaptureSession::setState(QGstreamerCaptureSession::State newState
|
|||||||
|
|
||||||
gst_element_set_state(m_pipeline, GST_STATE_NULL);
|
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)) {
|
if (!rebuildGraph(newMode)) {
|
||||||
m_pendingState = StoppedState;
|
m_pendingState = StoppedState;
|
||||||
m_state = StoppedState;
|
m_state = StoppedState;
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ private:
|
|||||||
GstElement *buildVideoPreview();
|
GstElement *buildVideoPreview();
|
||||||
GstElement *buildImageCapture();
|
GstElement *buildImageCapture();
|
||||||
|
|
||||||
void waitForStopped();
|
|
||||||
bool rebuildGraph(QGstreamerCaptureSession::PipelineMode newMode);
|
bool rebuildGraph(QGstreamerCaptureSession::PipelineMode newMode);
|
||||||
|
|
||||||
GstPad *getAudioProbePad();
|
GstPad *getAudioProbePad();
|
||||||
|
|||||||
Reference in New Issue
Block a user