Home | Trees | Indices | Help |
---|
|
1 # -*- coding: utf-8 -*- 2 # Elisa - Home multimedia server 3 # Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com). 4 # All rights reserved. 5 # 6 # This file is available under one of two license agreements. 7 # 8 # This file is licensed under the GPL version 3. 9 # See "LICENSE.GPL" in the root of this distribution including a special 10 # exception to use Elisa with Fluendo's plugins. 11 # 12 # The GPL part of Elisa is also available under a commercial licensing 13 # agreement from Fluendo. 14 # See "LICENSE.Elisa" in the root directory of this distribution package 15 # for details on that license. 16 17 18 __maintainer__ = 'Florian Boucault <florian@fluendo.com>' 19 20 21 from elisa.base_components.input_provider import PushInputProvider 22 from elisa.core.input_event import * 23 24 import pygst 25 pygst.require ("0.10") 26 import gst 27 283011432 self.debug("input data=%r", data) 33 34 event = InputEvent(EventSource.KEYBOARD, 35 EventType.KEY_DOWN, 36 EventAction.NONE) 37 event.origin = self.origin 38 39 """ 40 if self._previous_direction * data < 0.0: 41 if data > 0.0: 42 event.action = EventAction.PAUSE 43 else: 44 event.action = EventAction.PLAY 45 """ 46 47 # if abs(data - self._previous_direction) > 50.0: 48 if data > 70.0: 49 event.action = EventAction.GO_LEFT 50 elif data < -40.0: 51 event.action = EventAction.GO_RIGHT 52 53 """ 54 if data == '\n': 55 event.value = EventValue.KEY_RETURN 56 return event 57 elif data in string.ascii_letters + string.digits: 58 event.value = eval("EventValue.KEY_%s" % data) 59 60 if data == 'z': 61 event.action = EventAction.GO_UP 62 elif data == 'q': 63 event.action = EventAction.GO_LEFT 64 elif data == 's': 65 event.action = EventAction.GO_DOWN 66 elif data == 'd': 67 event.action = EventAction.GO_RIGHT 68 elif data == 'o': 69 event.action = EventAction.PLAY 70 elif data == 'p': 71 event.action = EventAction.PAUSE 72 elif data == 'w': 73 event.action = EventAction.EXIT 74 elif data == '?': 75 self._display_help() 76 """ 77 78 return event79 8082 direction = element.props.direction 83 84 e = self.create_input_event(direction) 85 if (e and self.input_manager): 86 self.input_manager.process_event(e, self.path) 87 88 self._previous_direction = direction8991 """ 92 pipeline = gst.parse_launch("v4lsrc autoprobe-fps=false ! tee name=t ! \ 93 queue ! ffmpegcolorspace ! redgreentv name=rg red-weight=160.0 \ 94 green-weight=80.0 ! ffmpegcolorspace ! videoscale ! \ 95 video/x-raw-rgb,width=320,height=240 ! ximagesink t. ! queue ! \ 96 ffmpegcolorspace ! ximagesink") 97 """ 98 99 pipeline = gst.parse_launch("v4lsrc autoprobe-fps=false ! tee name=t ! \ 100 queue ! ffmpegcolorspace ! redgreentv name=rg red-weight=160.0 \ 101 green-weight=80.0 ! ffmpegcolorspace ! videoscale ! \ 102 video/x-raw-rgb,width=320,height=240 ! ximagesink t. ! queue ! \ 103 ffmpegcolorspace ! videoscale ! video/x-raw-rgb,width=320,height=240 ! ximagesink") 104 105 pipeline.set_state(gst.STATE_PLAYING) 106 107 rg = pipeline.get_by_name('rg') 108 rg.connect('notify::direction', self.dataReceived) 109 self._previous_direction = 0.0110 111
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Wed Jan 16 19:10:17 2008 | http://epydoc.sourceforge.net |