From aa50ca622e407df6213d8deb3b77de9d63842d8b Mon Sep 17 00:00:00 2001 From: hyades Date: Fri, 12 Jul 2013 00:04:17 +0530 Subject: [PATCH] removed unneccesarry commented code --- python-api/gstswitch/connection.py | 40 +++++++-------- python-api/gstswitch/gstswitch.py | 80 ------------------------------ 2 files changed, 20 insertions(+), 100 deletions(-) diff --git a/python-api/gstswitch/connection.py b/python-api/gstswitch/connection.py index 6f3b5f7..0bd1988 100644 --- a/python-api/gstswitch/connection.py +++ b/python-api/gstswitch/connection.py @@ -137,24 +137,24 @@ def click_video(self, x, y, fw, fh): None) return result - # def mark_face(self, faces): - # """mark_face(in a(iiii) faces); - # """ - # args = GLib.Variant('a(iiii)', faces) - # connection = self.get_connection() - # result = connection.call_sync( - # self.name, self.object_path, 'info.duzy.gst.switch.SwitchControllerInterface', 'set_encode_mode', - # args, GLib.VariantType.new("(b)"), Gio.DBusCallFlags.NONE, -1, - # None) - # return result + def mark_face(self, faces): + """mark_face(in a(iiii) faces); + """ + args = GLib.Variant('a(iiii)', faces) + connection = self.get_connection() + result = connection.call_sync( + self.name, self.object_path, 'info.duzy.gst.switch.SwitchControllerInterface', 'set_encode_mode', + args, GLib.VariantType.new("(b)"), Gio.DBusCallFlags.NONE, -1, + None) + return result - # def mark_tracking(self, faces): - # """mark_tracking(in a(iiii) faces); - # """ - # args = GLib.Variant('a(iiii)', faces) - # connection = self.get_connection() - # result = connection.call_sync( - # self.name, self.object_path, 'info.duzy.gst.switch.SwitchControllerInterface', 'set_encode_mode', - # args, GLib.VariantType.new("(b)"), Gio.DBusCallFlags.NONE, -1, - # None) - # return result + def mark_tracking(self, faces): + """mark_tracking(in a(iiii) faces); + """ + args = GLib.Variant('a(iiii)', faces) + connection = self.get_connection() + result = connection.call_sync( + self.name, self.object_path, 'info.duzy.gst.switch.SwitchControllerInterface', 'set_encode_mode', + args, GLib.VariantType.new("(b)"), Gio.DBusCallFlags.NONE, -1, + None) + return result diff --git a/python-api/gstswitch/gstswitch.py b/python-api/gstswitch/gstswitch.py index f42ef8a..051dc1d 100644 --- a/python-api/gstswitch/gstswitch.py +++ b/python-api/gstswitch/gstswitch.py @@ -65,83 +65,3 @@ def connect_controller(self, Controller=None): """ pass - - -# class TestVideoSrc(object): -# """docstring for TestVideoSrc""" - - -# def __init__(self, port, width=300, height=200, pattern=None, timeoverlay=False, clockoverlay=False): -# super(TestVideoSrc, self).__init__() -# """Contructor for TestVideoSrc class -# Returns: -# None -# Parameters: -# videotestsrc pattern(optional): chooses random if not specified -# #some other optional -# """ - -# if timeoverlay: -# self.TIMEOVERLAY = True -# else: -# self.TIMEOVERLAY = False -# if clockoverlay: -# self.CLOCKOVERLAY = True -# else: -# self.CLOCKOVERLAY = False -# self.WIDTH = width -# self.HEIGHT = height -# self.port = port -# self.pattern = self.get_pattern(pattern) - -# self.proc = None -# self.proc = self.run() -# if self.proc == None: -# pass -# def run(self): -# """Launches a Test Source - -# """ -# if self.TIMEOVERLAY == True: -# timeoverlay = """timeoverlay font-desc="Verdana bold 50" ! """ -# else: -# timeoverlay = " " -# if self.CLOCKOVERLAY: -# clockoverlay = """clockoverlay font-desc="Verdana bold 50" ! """ -# else: -# clockoverlay = " " -# # @TO-DO: do using gi.repository.Gst - gst-launch-1.0 -# cmd = """gst-launch-1.0 \ -# videotestsrc pattern=%s ! \ -# video/x-raw,width=%s,height=%s ! \ -# %s \ -# %s \ -# gdppay ! \ -# tcpclientsink port=%s """ %(self.pattern, self.WIDTH, self.HEIGHT, timeoverlay, clockoverlay, str(self.port)) -# print cmd -# proc = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, bufsize=-1, shell=False) -# print "created process:", proc, proc.pid -# return proc - -# def end(self): -# """Stops the TestVideoSrc -# """ -# proc = self.proc -# ret = True -# try: -# proc.terminate() -# print "TestVideo pattern:%s killed" %(self.pattern) -# except: -# ret = False -# return ret - - -# def get_pattern(self, pattern): -# """Generates a random patern if not specified -# """ -# print pattern -# if pattern==None: -# pattern = random.randint(0,20) -# pattern = str(pattern) -# print pattern -# return pattern