本文整理汇总了Python中gstswitch.controller.Controller.adjust_pip方法的典型用法代码示例。如果您正苦于以下问题:Python Controller.adjust_pip方法的具体用法?Python Controller.adjust_pip怎么用?Python Controller.adjust_pip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gstswitch.controller.Controller
的用法示例。
在下文中一共展示了Controller.adjust_pip方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import adjust_pip [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.adjust_pip(1, 2, 3, 4)
示例2: do_adjust_pip
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import adjust_pip [as 别名]
def do_adjust_pip(self, line):
c = Controller()
c.establish_connection()
if len(line.split()) != 4:
print "Inavlid number of arguments"
return
print c.adjust_pip(*map(int, line.split()))
示例3: permutate_adjust_pip
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import adjust_pip [as 别名]
def permutate_adjust_pip(num, delay):
"""Adjust_pip num number of times"""
import random
video_port = 3000
serv = Server(path=PATH, video_port=video_port)
try:
serv.run()
sources = TestSources(video_port=video_port)
sources.new_test_video(pattern=6)
sources.new_test_video(pattern=5)
preview = PreviewSinks()
preview.run()
controller = Controller()
for _ in range(num):
xpos = random.randrange(-20, 20)
ypos = random.randrange(-20, 20)
res = controller.adjust_pip(xpos, ypos, 0, 0)
time.sleep(delay)
assert res is not None
preview.terminate()
sources.terminate_video()
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()
示例4: adjust_pip
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import adjust_pip [as 别名]
def adjust_pip(self,
xpos,
ypos,
width,
heigth,
index,
generate_frames=False):
"""Create Controller object and call adjust_pip"""
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()
controller.set_composite_mode(Controller.COMPOSITE_PIP)
time.sleep(3)
res = controller.adjust_pip(xpos, ypos, width, heigth)
time.sleep(3)
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)
示例5: adjust_pip
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import adjust_pip [as 别名]
def adjust_pip(
self,
xpos,
ypos,
width,
heigth,
index,
generate_frames=False):
"""Create Controller object and call adjust_pip"""
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()
controller.set_composite_mode(1)
time.sleep(3)
res = controller.adjust_pip(xpos, ypos, width, heigth)
time.sleep(3)
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()
示例6: test_normal_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import adjust_pip [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.adjust_pip(1, 2, 3, 4) == 1