Commit 604fd1dc authored by Edward Hervey's avatar Edward Hervey

* pitivi/pitivi.py:

Call gtk.gdk.threads_init() to inform pygtk that we might be doing calls
from remote threads.
* pitivi/ui/viewer.py:
The fix to the threading issue was in fact to call
gtk.gdk.threads_enter() and _leave() before and after calls to gtk
being made from a non-main thread.


git-svn-id: svn+ssh://svn.gnome.org/svn/pitivi/trunk@766 d3729300-e425-0410-8a4c-d956edccc248
parent 7cda13be
2006-04-24 Edward Hervey <edward@fluendo.com>
* pitivi/pitivi.py:
Call gtk.gdk.threads_init() to inform pygtk that we might be doing calls
from remote threads.
* pitivi/ui/viewer.py:
The fix to the threading issue was in fact to call
gtk.gdk.threads_enter() and _leave() before and after calls to gtk
being made from a non-main thread.
2006-04-24 Edward Hervey <edward@fluendo.com>
* pitivi/playground.py:
......
......@@ -130,4 +130,7 @@ class Pitivi(gobject.GObject):
def main(argv):
check.initial_checks()
ptv = Pitivi(argv)
# we need to inform pygtk that we are going to be using gdk from other
# threads
gtk.gdk.threads_init()
gtk.main()
......@@ -183,10 +183,14 @@ class PitiviViewer(gtk.VBox):
par = caps[0]["pixel-aspect-ratio"]
except:
# set aspect ratio
gtk.gdk.threads_enter()
self.aframe.set_property("ratio", float(width) / float(height))
gtk.gdk.threads_leave()
gst.warning("setting aspectratio to %f" % (float(width) / float(height)))
else:
gtk.gdk.threads_enter()
self.aframe.set_property("ratio", float(width * par.num) / float(par.denom * height))
gtk.gdk.threads_leave()
gst.warning("setting aspectratio to %f" % (float(width * par.num) / float(par.denom * height)))
def _createSinkThreads(self):
......@@ -203,17 +207,7 @@ class PitiviViewer(gtk.VBox):
vsinkthread.videosink = self.videosink
vsinkthread.add_pad(gst.GhostPad("sink", cspace.get_pad('sink')))
# WARNING
# The notify has to be put on the downstream side of the queue. If it is
# put upstream, the notify will do some BadThings(tm) like screwup the
# resizing of the windows
# FIXME : Once we add videoscale, we should put it AFTER the queue, but
# keep the notify callback where it is right now so that we don't
# get the problems mentionned above AND we can't get the non-resi-
# zed caps.
vqueue.get_pad("src").connect("notify::caps", self._videosinkCapsNotifyCb)
vsinkthread.get_pad("sink").connect("notify::caps", self._videosinkCapsNotifyCb)
self.drawingarea.videosink = self.videosink
self.videosink.set_xwindow_id(self.drawingarea.window.xid)
......@@ -377,10 +371,12 @@ class PitiviViewer(gtk.VBox):
def _timelineDurationChangedCb(self, unused_composition, unused_start,
duration):
# deactivate record button is the duration is null
gtk.gdk.threads_enter()
self.record_button.set_sensitive((duration > 0) and True or False)
self.posadjust.upper = float(duration)
self.timelabel.set_markup("<tt>%s / %s</tt>" % (time_to_string(self.current_time), time_to_string(instance.PiTiVi.playground.current.length)))
gtk.gdk.threads_leave()
def _dndDataReceivedCb(self, unused_widget, context, unused_x, unused_y,
selection, targetType, ctime):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment