2
# -*- coding: utf-8 -*-
6
__authors__ = ["Jan Jokela <janjokela@gmail.com>"]
7
__licenses__ = ["LICENSE.LGPL"]
8
__description__ = "Tests for the video widget"
19
# Change sys path to glitter path
20
glitter_path = os.path.split(sys.path[0])[0]
21
sys.path[0] = glitter_path
23
from window import Window
24
from video import Video
26
# Importing glitter.video messes up sys.path because in its turn, it import gst
27
# which messes up sys.path
28
glitter_path = os.path.split(sys.path[0])[0]
29
sys.path[0] = glitter_path
31
class TestVideo(object):
32
""" Tests for the video widget """
34
def __init__(self, video_uri, aspect_ratio):
36
self.video_uri = video_uri
37
self.aspect_ratio = aspect_ratio
39
self.window = Window("Glitter tests")
40
self.window.connect("destroy", self.destroy)
42
self.stage = self.window.get_stage()
43
self.stage.connect('notify::width', self.do_resize)
44
self.stage.connect('notify::height', self.do_resize)
46
self.video = Video(video_uri, aspect_ratio)
47
self.stage.add(self.video)
48
self.video._update_layout()
51
self.window.show_all()
54
def destroy(self, widget, data=None):
57
def do_resize(self, stage, event):
58
self.video._update_layout()
60
if __name__ == '__main__':
61
if len(sys.argv) != 3:
62
print "Missing arguments, correct usage is: "
63
print "python video.py video_file_uri [ex: glitter.mov] " + \
64
"mode [native, widescreen, tv, smart]"
67
TestVideo(sys.argv[1], sys.argv[2])