当前位置: 首页>>代码示例>>Python>>正文


Python Controller.click_video方法代码示例

本文整理汇总了Python中gstswitch.controller.Controller.click_video方法的典型用法代码示例。如果您正苦于以下问题:Python Controller.click_video方法的具体用法?Python Controller.click_video怎么用?Python Controller.click_video使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gstswitch.controller.Controller的用法示例。


在下文中一共展示了Controller.click_video方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_unpack

# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import click_video [as 别名]
 def test_unpack(self):
     """Test if unpack fails"""
     controller = Controller(address='unix:abstract=abcde')
     controller.establish_connection = Mock(return_value=None)
     controller.connection = MockConnection(True)
     with pytest.raises(ConnectionReturnError):
         controller.click_video(1, 2, 3, 4)
开发者ID:bossjones,项目名称:gst-switch,代码行数:9,代码来源:test_controller_unit.py

示例2: click_video

# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import click_video [as 别名]
    def click_video(self,
                    xpos,
                    ypos,
                    width,
                    heigth,
                    index,
                    generate_frames=False):
        """Create Controller object and call click_video method"""
        for _ in range(self.NUM):
            serv = Server(path=PATH, video_format="debug")
            try:
                serv.run()
                sources = TestSources(video_port=3000)
                preview = PreviewSinks()
                preview.run()
                out_file = "output-{0}.data".format(index)
                video_sink = VideoFileSink(3001, out_file)
                sources.new_test_video(pattern=4)
                sources.new_test_video(pattern=5)
                controller = Controller()
                time.sleep(1)
                res = controller.click_video(xpos, ypos, width, heigth)
                print(res)
                time.sleep(1)
                sources.terminate_video()
                preview.terminate()
                video_sink.terminate()
                serv.terminate(1)
                if not generate_frames:
                    assert res is not None
                    assert self.verify_output(index, out_file) is True

            finally:
                serv.terminate_and_output_status(cov=True)
开发者ID:mithro,项目名称:gst-switch,代码行数:36,代码来源:test_controller.py

示例3: test_action_fails

# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import click_video [as 别名]
 def test_action_fails(self):
     """Test what happens if the requested action fails"""
     controller = Controller(address='unix:abstract=abcde')
     controller.establish_connection = Mock(return_value=None)
     controller.connection = MockConnection(
         return_variant=True, should_fail=True)
     assert controller.click_video(1, 2, 3, 4) is False
开发者ID:a740122,项目名称:gst-switch,代码行数:9,代码来源:test_controller_unit.py

示例4: click_video

# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import click_video [as 别名]
    def click_video(
        self,
        xpos,
        ypos,
        width,
        heigth,
        index,
            generate_frames=False):
        """Create Controller object and call click_video method"""
        for _ in range(self.NUM):
            serv = Server(path=PATH)
            try:
                serv.run()
                sources = TestSources(video_port=3000)
                preview = PreviewSinks()
                preview.run()
                out_file = "output-{0}.data".format(index)
                video_sink = VideoFileSink(PATH, 3001, out_file)
                sources.new_test_video(pattern=4)
                sources.new_test_video(pattern=5)
                controller = Controller()
                time.sleep(1)
                res = controller.click_video(xpos, ypos, width, heigth)
                print res
                time.sleep(1)
                sources.terminate_video()
                preview.terminate()
                video_sink.terminate()
                serv.terminate(1)
                if not generate_frames:
                    assert res is not None
                    assert self.verify_output(index, out_file) is True

            finally:
                if serv.proc:
                    poll = serv.proc.poll()
                    print self.__class__
                    if poll == -11:
                        print "SEGMENTATION FAULT OCCURRED"
                    print "ERROR CODE - {0}".format(poll)
                    serv.terminate(1)
                    log = open('server.log')
                    print log.read()
开发者ID:bossjones,项目名称:gst-switch,代码行数:45,代码来源:test_controller.py

示例5: test_normal_unpack

# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import click_video [as 别名]
 def test_normal_unpack(self):
     """Test if valid"""
     controller = Controller(address='unix:abstract=abcdef')
     controller.establish_connection = Mock(return_value=None)
     controller.connection = MockConnection(False)
     assert controller.click_video(1, 2, 3, 4) is True
开发者ID:bossjones,项目名称:gst-switch,代码行数:8,代码来源:test_controller_unit.py


注:本文中的gstswitch.controller.Controller.click_video方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。