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


Python Controller.get_audio_port方法代码示例

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


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

示例1: get_audio_port

# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import get_audio_port [as 别名]
def get_audio_port(num):
        """Test get_audio_port"""
        audio_port = 8000
        serv = Server(path=PATH, audio_port=audio_port)
        try:
            serv.run()
            sources = TestSources(audio_port=audio_port)
            sources.new_test_audio()
            
            expected_res = [3003] * num

            controller = Controller()
            controller.establish_connection()
            res = []
            for _ in range(num):
                res.append(controller.get_audio_port())

            assert expected_res == res

        finally:
            if serv.proc:
                    poll = serv.proc.poll()
                    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,代码行数:30,代码来源:performance_dbus.py

示例2: get_audio_port

# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import get_audio_port [as 别名]
 def get_audio_port(self):
     """Create Controller object and call get_audio_port method"""
     res = []
     controller = Controller()
     controller.establish_connection()
     for _ in range(self.NUM * self.FACTOR):
         res.append(controller.get_audio_port())
     return res
开发者ID:mithro,项目名称:gst-switch,代码行数:10,代码来源:test_controller.py

示例3: test_normal_unpack

# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import get_audio_port [as 别名]
 def test_normal_unpack(self):
     """Test if valid"""
     controller = Controller(address='unix:abstract=abcdef')
     controller.connection = MockConnection(False)
     assert controller.get_audio_port() == 4000
开发者ID:bossjones,项目名称:gst-switch,代码行数:7,代码来源:test_controller_unit.py

示例4: test_unpack

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

示例5: do_get_audio_port

# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import get_audio_port [as 别名]
 def do_get_audio_port(self, line):
     c = Controller()
     c.establish_connection()
     print c.get_audio_port()
开发者ID:a740122,项目名称:gst-switch,代码行数:6,代码来源:console.py


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