Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-06-09 23:03:36 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-06-09 23:03:36 (GMT)
commit6645a9386a9b3564c067d3ffcffd529ae8c5dd4f (patch)
tree7e5e48c3c38c09ec1b5e764f69285aec38bb8aa7
parenta5a8115288ee3dc298a78db8d15182a11ed59edd (diff)
on the path to using gdkpixbufsink
-rw-r--r--plugins/camera_sensor/tacamera.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/camera_sensor/tacamera.py b/plugins/camera_sensor/tacamera.py
index 2177288..15824a1 100644
--- a/plugins/camera_sensor/tacamera.py
+++ b/plugins/camera_sensor/tacamera.py
@@ -23,14 +23,25 @@
import gst, time
GST_PIPE = ['v4l2src', 'ffmpegcolorspace', 'pngenc']
+# GST_PIPE = ['v4l2src', 'ffmpegcolorspace', 'gdkpixbufsink']
class Camera():
""" A class for representing the video camera """
def __init__(self, imagepath):
+ # self.imagepath = imagepath
GST_PIPE.append('filesink location=%s' % imagepath)
self.pipe = gst.parse_launch('!'.join(GST_PIPE))
self.bus = self.pipe.get_bus()
+ # self.bus.add_signal_watch()
+ # self.bus.connect('message', self._on_message)
+
+ def _on_message(self, bus, message):
+ ''' We get a message if a pixbuf is available '''
+ if message.structure is not None:
+ print message.structure.get_name()
+ if message.structure.get_name() == 'pixbuf':
+ message.structure['pixbuf'].save(self.imagepath, 'png')
def save_camera_input_to_file(self):
""" Grab a frame from the camera """