rearrange stream start sequence

This commit is contained in:
petrucci4prez 2017-06-11 18:29:55 -04:00
parent 7e8b302e7c
commit e13e871577
1 changed files with 7 additions and 10 deletions

View File

@ -71,13 +71,13 @@ class ThreadedPipeline:
pName = self._pipeline.get_name() pName = self._pipeline.get_name()
stateChange = self._pipeline.set_state(Gst.State.PAUSED) stateChange = self._pipeline.set_state(Gst.State.PAUSED)
_gstPrintMsg(pName, 'Setting to PAUSED', level=logging.INFO) _gstPrintMsg(pName, 'Setting to PAUSED', level=logging.INFO)
if stateChange == Gst.StateChangeReturn.FAILURE: # we should always end up here because live
if stateChange == Gst.StateChangeReturn.NO_PREROLL:
_gstPrintMsg(pName, 'Live and does not need preroll')
elif stateChange == Gst.StateChangeReturn.FAILURE:
_gstPrintMsg(pName, 'Cannot set to PAUSE', level=logging.INFO) _gstPrintMsg(pName, 'Cannot set to PAUSE', level=logging.INFO)
self._eventLoop(block=False, doProgress=False, targetState=Gst.State.VOID_PENDING) self._eventLoop(block=False, doProgress=False, targetState=Gst.State.VOID_PENDING)
# we should always end up here because live
elif stateChange == Gst.StateChangeReturn.NO_PREROLL:
_gstPrintMsg(pName, 'Live and does not need preroll')
elif stateChange == Gst.StateChangeReturn.ASYNC: elif stateChange == Gst.StateChangeReturn.ASYNC:
_gstPrintMsg(pName, 'Prerolling') _gstPrintMsg(pName, 'Prerolling')
try: try:
@ -105,11 +105,8 @@ class ThreadedPipeline:
err = self._pipeline.get_bus().pop_filtered(Gst.MessageType.Error) err = self._pipeline.get_bus().pop_filtered(Gst.MessageType.Error)
_processErrorMessage(pName, msgSrcName, err) _processErrorMessage(pName, msgSrcName, err)
# ...we end up here and loop until Tool releases their next album # ...we end up here and fork to a child thread
try: self._mainLoop()
self._mainLoop()
except:
raise GstException
# TODO: this might not all be necessary # TODO: this might not all be necessary
def stop(self): def stop(self):