n._.Run(Lockable) : class documentation

Part of numm View In Hierarchy

Asynchronous looping interface.

This class converts inputs to numpy arrays and outputs from numpy arrays. I/O is done using a set of callbacks.

When video output is being produced, the following key bindings are defined by default:

Method __init__ This class takes a set of callbacks and, when run is
Method set_audio_in Undocumented
Method set_audio_out Undocumented
Method set_video_in Undocumented
Method set_video_out Undocumented
Method set_keyboard_in Undocumented
Method set_mouse_in Undocumented
Method run Enter the mainloop.
Method toggle_fps Undocumented
Method begin_video_capture Begin capturing video output frames to disk.
Method end_video_capture Complement to begin_video_capture.
Method toggle_video_capture Undocumented
Method profile_all Profile each callback the next time it is called.
Method _get_stream_position Undocumented
Method _sync_state Undocumented
Method _got_audio_data Undocumented
Method _need_audio_data Undocumented
Method _got_video_data Undocumented
Method _need_video_data Undocumented
Method _get_actual_audio_sink Undocumented
Method _get_actual_video_sink Undocumented
Method _bus_message Undocumented
Method _fps_timeout Undocumented
Method _terminal_input Undocumented
Method _run_with_terminal_input Undocumented
Method _mouse_event Undocumented
Method _keyboard_event Undocumented
Method _event Undocumented
Method _video_out_event Undocumented
Method _find_next_capture_index Undocumented

Inherited from Lockable:

Method __enter__ Undocumented
Method __exit__ Undocumented
def __init__(self, audio_out=None, video_out=None, audio_in=None, video_in=None, mouse_in=None, keyboard_in=None, exit_on_window_close=True, video_src=None, video_sink=None, **kw):
This class takes a set of callbacks and, when run is called, runs in a loop, calling them as appropriate.

Audio and video callback take an array which contains data which was input (in the case of the "_in" functions) or to which data to be output should be written (in the case of the "_out" functions).

If video_out is specified, a window is created for video output.

The keyboard_in function takes an event type, and a string representing the key. The event type is either "key-press" or "key-release".

The mouse_in function takes an event type, X and Y positions, and a button. The event type is "mouse-move" or "mouse-button-press" or "mouse-button-release".

Parametersaudio_inAudio input received.
audio_outAudio output wanted.
video_inVideo input received.
video_outVideo output wanted.
keyboard_inKeyboard input received.
mouse_inMouse input received.
exit_on_window_closeWhether the run method should return when the output window (if any) is closed.
(type: Boolean. )
video_srcThe GStreamer element to use as a source for video input.
(type: String. )
video_sinkThe GStreamer element to use as a source for video input.
(type: String. )
def _get_stream_position(self):
Undocumented
def _sync_state(self, element):
Undocumented
def _got_audio_data(self, appsink):
Undocumented
def set_audio_in(self, callback):
Undocumented
def _need_audio_data(self, appsrc, n):
Undocumented
def set_audio_out(self, callback):
Undocumented
def _got_video_data(self, appsink):
Undocumented
def set_video_in(self, callback):
Undocumented
def _need_video_data(self, appsrc, n):
Undocumented
def set_video_out(self, callback):
Undocumented
def set_keyboard_in(self, callback):
Undocumented
def set_mouse_in(self, callback):
Undocumented
def _get_actual_audio_sink(self):
Undocumented
def _get_actual_video_sink(self):
Undocumented
def _bus_message(self, bus, message):
Undocumented
def _fps_timeout(self):
Undocumented
def _terminal_input(self, _fd, _condition):
Undocumented
def _run_with_terminal_input(self):
Undocumented
def run(self):
Enter the mainloop.
def _mouse_event(self, type, pointer_x, pointer_y, button):
Undocumented
def _keyboard_event(self, type, key):
Undocumented
def _event(self, event):
Undocumented
def _video_out_event(self, pad, event):
Undocumented
def _find_next_capture_index(self):
Undocumented
def toggle_fps(self):
Undocumented
def begin_video_capture(self):
Begin capturing video output frames to disk.

Frames are captured as a series of PNGs.

def end_video_capture(self):
Complement to begin_video_capture.
def toggle_video_capture(self):
Undocumented
def profile_all(self):
Profile each callback the next time it is called.

Profiling results are printed to standard output.

API Documentation for numm, generated by pydoctor at 2012-04-04 22:10:45.