Merge remote branch 'adamcik/gstreamer' into gstreamer
This commit is contained in:
commit
0882011a71
@ -20,8 +20,11 @@ class GStreamerOutput(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, core_queue, output_queue):
|
def __init__(self, core_queue, output_queue):
|
||||||
process = GStreamerProcess(core_queue, output_queue)
|
self.process = GStreamerProcess(core_queue, output_queue)
|
||||||
process.start()
|
self.process.start()
|
||||||
|
|
||||||
|
def destroy(self):
|
||||||
|
self.process.terminate()
|
||||||
|
|
||||||
class GStreamerMessagesThread(threading.Thread):
|
class GStreamerMessagesThread(threading.Thread):
|
||||||
def run(self):
|
def run(self):
|
||||||
@ -156,10 +159,10 @@ class GStreamerProcess(BaseProcess):
|
|||||||
:type state_name: string
|
:type state_name: string
|
||||||
:rtype: :class:`True` or :class:`False`
|
:rtype: :class:`True` or :class:`False`
|
||||||
"""
|
"""
|
||||||
# XXX Setting state to PLAYING often returns False even if it works
|
state = getattr(gst, 'STATE_' + state_name)
|
||||||
result = self.gst_pipeline.set_state(
|
self.gst_pipeline.set_state(state)
|
||||||
getattr(gst, 'STATE_' + state_name))
|
new_state = self.gst_pipeline.get_state()[1]
|
||||||
if result == gst.STATE_CHANGE_SUCCESS:
|
if new_state == state:
|
||||||
logger.debug('Setting GStreamer state to %s: OK', state_name)
|
logger.debug('Setting GStreamer state to %s: OK', state_name)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user