From f74787f4bc5d288f0853000145e96d3a077c9c6a Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 7 Dec 2016 17:01:02 +0100 Subject: [PATCH] vidi/Timeline.py: support setting the canvas size --- vidi/Timeline.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vidi/Timeline.py b/vidi/Timeline.py index da8e83c..ef04c99 100755 --- a/vidi/Timeline.py +++ b/vidi/Timeline.py @@ -35,13 +35,20 @@ TITLE_OUTLINE_COLOR = 0x00000000 TITLE_FONT_DESC = "Georgia, 24" class Timeline(object): - def __init__(self): + def __init__(self, canvas_size=None): self.project = GES.Project(extractable_type=GES.Timeline) self.timeline = GES.Asset.extract(self.project) audio_track = GES.AudioTrack.new() video_track = GES.VideoTrack.new() + if canvas_size: + width, height = canvas_size + caps = Gst.Caps.new_empty_simple("video/x-raw") + caps.set_value("width", width) + caps.set_value("height", height) + video_track.set_restriction_caps(caps) + self.timeline.add_track(audio_track) self.timeline.add_track(video_track) -- 2.1.4