pitivi r1197 - in branches/SOC_2008_SLAKSHMAN: . pitivi pitivi/ui



Author: slynux
Date: Sun Jul 20 07:21:36 2008
New Revision: 1197
URL: http://svn.gnome.org/viewvc/pitivi?rev=1197&view=rev

Log:
Rewriting Webcam manager dialog

Modified:
   branches/SOC_2008_SLAKSHMAN/ChangeLog
   branches/SOC_2008_SLAKSHMAN/pitivi/bin.py
   branches/SOC_2008_SLAKSHMAN/pitivi/playground.py
   branches/SOC_2008_SLAKSHMAN/pitivi/ui/viewer.py
   branches/SOC_2008_SLAKSHMAN/pitivi/ui/webcam_managerdialog.py

Modified: branches/SOC_2008_SLAKSHMAN/pitivi/bin.py
==============================================================================
--- branches/SOC_2008_SLAKSHMAN/pitivi/bin.py	(original)
+++ branches/SOC_2008_SLAKSHMAN/pitivi/bin.py	Sun Jul 20 07:21:36 2008
@@ -522,7 +522,7 @@
 
     def __init__(self):
         gst.log("Creating new smartcapturebin")
-        self.videosrc = gst.element_factory_make("videotestsrc", "vsrc")
+        self.videosrc = gst.element_factory_make("v4l2src", "vsrc")
         
         SmartBin.__init__(self, "smartcapturebin", has_video=True, has_audio=False,
                           width=720, height=576)

Modified: branches/SOC_2008_SLAKSHMAN/pitivi/playground.py
==============================================================================
--- branches/SOC_2008_SLAKSHMAN/pitivi/playground.py	(original)
+++ branches/SOC_2008_SLAKSHMAN/pitivi/playground.py	Sun Jul 20 07:21:36 2008
@@ -31,6 +31,8 @@
 
 from gettext import gettext as _
 
+
+
 class PlayGround(gobject.GObject):
     """
     Holds all the applications pipelines.
@@ -492,3 +494,4 @@
             gst.TIME_ARGS(pos),
             gst.TIME_ARGS(target)))
         self.seekInCurrent(target)
+

Modified: branches/SOC_2008_SLAKSHMAN/pitivi/ui/viewer.py
==============================================================================
--- branches/SOC_2008_SLAKSHMAN/pitivi/ui/viewer.py	(original)
+++ branches/SOC_2008_SLAKSHMAN/pitivi/ui/viewer.py	Sun Jul 20 07:21:36 2008
@@ -511,5 +511,3 @@
             self.set_image(gtk.image_new_from_stock(gtk.STOCK_MEDIA_PAUSE, gtk.ICON_SIZE_BUTTON))
             self.playing = True
 
-
-

Modified: branches/SOC_2008_SLAKSHMAN/pitivi/ui/webcam_managerdialog.py
==============================================================================
--- branches/SOC_2008_SLAKSHMAN/pitivi/ui/webcam_managerdialog.py	(original)
+++ branches/SOC_2008_SLAKSHMAN/pitivi/ui/webcam_managerdialog.py	Sun Jul 20 07:21:36 2008
@@ -31,19 +31,70 @@
 import gst
 import tempfile
 from gettext import gettext as _
-
+import plumber
 from sourcefactories import SourceFactoriesWidget
-from pitivi.bin import *
+from pitivi.bin import SmartCaptureBin
 from pitivi.playground import PlayGround
-import plumber
+
 
 
 
 class WebcamManagerDialog(object):
 
 	def __init__(self):
-		
-		player = SmartCaptureBin()		
-		instance.PiTiVi.playground._playTemporaryBin(player)
+	
 
+		# Create gtk widget using glade model 
+		glade_dir = os.path.dirname(os.path.abspath(__file__))
+		self.cam_ui = gtk.glade.XML(os.path.join(glade_dir, "cam_capture.glade"))
+		self.cam_window = self.cam_ui.get_widget("cam_capture")
+		self.draw_window = self.cam_ui.get_widget("draw_window")
+		self.record_btn = self.cam_ui.get_widget("record_btn")
+		self.close_btn = self.cam_ui.get_widget("close_btn")
+
+		#self.close_btn.connect("clicked",self.close)
+		#self.record_btn.connect("clicked", self.do_recording)
+		#self.cam_window.connect("destroy",self.close)
+		
+		self.record_btn = self.record_btn.get_children()[0]
+		self.record_btn = self.record_btn.get_children()[0].get_children()[1]
+		self.record_btn.set_label("Start Recording")
 	
+
+
+		self.playground = PlayGround()
+		bin = SmartCaptureBin()		
+
+		self.videosink = plumber.get_video_sink()
+		vsinkthread = gst.Bin('vsinkthread')
+		vqueue = gst.element_factory_make('queue')
+		cspace = gst.element_factory_make('ffmpegcolorspace')
+		vscale = gst.element_factory_make('videoscale')
+		vscale.props.method = 1
+		vsinkthread.add(self.videosink, vqueue, vscale, cspace)
+		vqueue.link(self.videosink)
+		cspace.link(vscale)
+		vscale.link(vqueue)
+		vsinkthread.videosink = self.videosink
+		vsinkthread.add_pad(gst.GhostPad("sink", cspace.get_pad('sink')))
+
+		self.playground.setVideoSinkThread(vsinkthread)
+
+
+		self.playground.connect('element-message', self.on_sync_message)
+
+
+
+		self.playground._playTemporaryBin(bin)
+        			
+        
+	def on_sync_message(self, bus, message):
+		if message.structure is None:
+			return
+		message_name = message.structure.get_name()
+		if message_name == 'prepare-xwindow-id':
+			# Assign the viewport
+			imagesink = message.src
+			imagesink.set_property('force-aspect-ratio', True)
+			imagesink.set_xwindow_id(self.draw_window.window.xid)
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]