本文整理汇总了Python中pipeline.Pipeline.play方法的典型用法代码示例。如果您正苦于以下问题:Python Pipeline.play方法的具体用法?Python Pipeline.play怎么用?Python Pipeline.play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pipeline.Pipeline
的用法示例。
在下文中一共展示了Pipeline.play方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PipelineTests
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import play [as 别名]
class PipelineTests(unittest.TestCase):
VIDEO_DEV = "/dev/video0"
def setUp(self):
import gobject
gobject.threads_init()
from pipeline import Pipeline
self.p = Pipeline([])
def test_empty_devices_list(self):
self.p.play()
time.sleep(4)
def test_add_unexistent(self):
self.p.play()
try:
self.p.add_source("/dev/video666")
except AttributeError:
pass
time.sleep(4)
def test_switch_to_unexistent(self):
self.p.play()
try:
self.p.switch_to("/dev/video666")
except AttributeError:
pass
time.sleep(4)
def test_switch(self):
self.p.add_source(PipelineTests.VIDEO_DEV)
time.sleep(4)
self.p.switch_to(PipelineTests.VIDEO_DEV)
self.p.play()
time.sleep(4)
def test_switch_to_fake(self):
self.p.add_source(PipelineTests.VIDEO_DEV)
time.sleep(4)# FIXME: without the sleep it hangs
self.p.switch_to(PipelineTests.VIDEO_DEV)
time.sleep(4)
self.p.switch_to("fake")
time.sleep(4)
def test_add_source(self):
self.p.play()
self.p.add_source(PipelineTests.VIDEO_DEV)
time.sleep(4)
def tearDown(self):
self.p.kill()