Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugins/camera_sensor/tacamera.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/camera_sensor/tacamera.py')
-rw-r--r--plugins/camera_sensor/tacamera.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/camera_sensor/tacamera.py b/plugins/camera_sensor/tacamera.py
index 40bd53d..ec43641 100644
--- a/plugins/camera_sensor/tacamera.py
+++ b/plugins/camera_sensor/tacamera.py
@@ -20,8 +20,9 @@
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#THE SOFTWARE.
-import gst, time
+import time
from gi.repository import GObject
+from gi.repository import Gst
from TurtleArt.tautils import debug_output
@@ -34,7 +35,7 @@ class Camera():
def __init__(self):
''' Prepare camera pipeline to pixbuf and signal watch '''
- self.pipe = gst.parse_launch('!'.join(GST_PIPE))
+ 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)
@@ -51,11 +52,11 @@ class Camera():
''' Start grabbing '''
self.pixbuf = None
self.image_ready = False
- self.pipe.set_state(gst.STATE_PLAYING)
+ self.pipe.set_state(Gst.State.PLAYING)
while not self.image_ready:
- self.bus.poll(gst.MESSAGE_ANY, -1)
+ self.bus.poll(Gst.MessageType.ANY, -1)
# self.stop_camera_input()
def stop_camera_input(self):
''' Stop grabbing '''
- self.pipe.set_state(gst.STATE_NULL)
+ self.pipe.set_state(Gst.State.NULL)