Add a built-in screencast recording facility
For development and demonstration purposes, it's neat to be able to record a screencast of gnome-shell without any external setup. Built-in recording can also give much better quality than is possible with a generic desktop recording, since we hook right into the paint loop. src/shell-recorder.[ch]: A general-purposes object to record a Clutter stage to a GStreamer stream. src/shell-recorder-src.[ch]: A simple GStreamer source element (similar to appsrc in the most recent versions of GStreamer) for injecting captured data into a GStreamer pipeline. src/test-recorder.c: Test program that records a simple animation. configure.ac src/Makefile.am: Add machinery to conditionally build ShellRecorder. tools/build/gnome-shell-build-setup.sh: Add gstreamer packages to the list of required packages for Fedora. js/ui/main.js: Hook up the recorder to a MetaScreen ::toggle-recording keybinding. http://bugzilla.gnome.org/show_bug.cgi?id=575290
This commit is contained in:
@ -20,6 +20,7 @@ let overlay = null;
|
||||
let overlayActive = false;
|
||||
let runDialog = null;
|
||||
let wm = null;
|
||||
let recorder = null;
|
||||
|
||||
function start() {
|
||||
let global = Shell.Global.get();
|
||||
@ -71,6 +72,24 @@ function start() {
|
||||
show_overlay();
|
||||
}
|
||||
};
|
||||
|
||||
global.screen.connect('toggle-recording', function() {
|
||||
if (recorder == null) {
|
||||
// We have to initialize GStreamer first. This isn't done
|
||||
// inside ShellRecorder to make it usable inside projects
|
||||
// with other usage of GStreamer.
|
||||
let Gst = imports.gi.Gst;
|
||||
Gst.init(null, null);
|
||||
recorder = new Shell.Recorder({ stage: global.stage });
|
||||
}
|
||||
|
||||
if (recorder.is_recording()) {
|
||||
recorder.pause();
|
||||
} else {
|
||||
recorder.record();
|
||||
}
|
||||
});
|
||||
|
||||
display.connect('overlay-key', toggleOverlay);
|
||||
global.connect('panel-main-menu', toggleOverlay);
|
||||
|
||||
|
Reference in New Issue
Block a user