[pitivi] pipeline: Reimplement connectWithViewer for glimagesink
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] pipeline: Reimplement connectWithViewer for glimagesink
- Date: Wed, 24 Sep 2014 17:04:41 +0000 (UTC)
commit 13809971498fa11c3aceba8005e97c56a199f457
Author: Thibault Saunier <tsaunier gnome org>
Date: Wed Sep 24 16:12:43 2014 +0200
pipeline: Reimplement connectWithViewer for glimagesink
pitivi/mediafilespreviewer.py | 7 +++----
pitivi/utils/pipeline.py | 11 +++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/mediafilespreviewer.py b/pitivi/mediafilespreviewer.py
index d7105c6..fc55ea5 100644
--- a/pitivi/mediafilespreviewer.py
+++ b/pitivi/mediafilespreviewer.py
@@ -89,13 +89,13 @@ class PreviewWidget(Gtk.Grid, Loggable):
self.discoverer = GstPbutils.Discoverer.new(Gst.SECOND)
- #playbin for play pics
+ # playbin for play pics
self.player = AssetPipeline(clip=None, name="preview-player")
self.player.connect('eos', self._pipelineEosCb)
self.player.connect('error', self._pipelineErrorCb)
self.player._bus.connect('message::tag', self._tag_found_cb)
- #some global variables for preview handling
+ # some global variables for preview handling
self.is_playing = False
self.original_dims = (PREVIEW_WIDTH, PREVIEW_HEIGHT)
self.countinuous_seek = False
@@ -125,7 +125,7 @@ class PreviewWidget(Gtk.Grid, Loggable):
self.play_button.connect("clicked", self._on_start_stop_clicked_cb)
self.bbox.pack_start(self.play_button, False, False, 0)
- #Scale for position handling
+ # Scale for position handling
self.pos_adj = Gtk.Adjustment()
self.seeker = Gtk.Scale.new(Gtk.Orientation.HORIZONTAL, self.pos_adj)
self.seeker.connect('button-press-event', self._on_seeker_press_cb)
@@ -246,7 +246,6 @@ class PreviewWidget(Gtk.Grid, Loggable):
self.preview_video.set_size_request(w, h)
self.preview_video.setDisplayAspectRatio(float(video_width) / video_height)
self.preview_video.show()
- self.player.connectWithViewer(self.preview_video)
self.bbox.show()
self.play_button.show()
self.seeker.show()
diff --git a/pitivi/utils/pipeline.py b/pitivi/utils/pipeline.py
index 93255f9..77c625c 100644
--- a/pitivi/utils/pipeline.py
+++ b/pitivi/utils/pipeline.py
@@ -24,6 +24,9 @@
"""
High-level pipelines
"""
+
+import platform
+
from pitivi.utils.loggable import Loggable
from pitivi.utils.signal import Signallable
from pitivi.utils.misc import format_ns
@@ -517,6 +520,14 @@ class AssetPipeline(SimplePipeline):
def setClipUri(self, uri):
self._pipeline.set_property("uri", uri)
+ def connectWithViewer(self, widget):
+ if platform.system() == 'Windows':
+ handle = widget.drawing_area.get_window().get_handle()
+ else:
+ handle = widget.drawing_area.get_window().get_xid()
+
+ self._opengl_sink.set_window_handle(handle)
+
class Pipeline(GES.Pipeline, SimplePipeline):
"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]