Commit Graph

85 Commits

Author SHA1 Message Date
Niels De Graef
28ab1f4af4 Ensure G_PARAM_STATIC_STRINGS for all properties
In `st`, we can do this by using `ST_PARAM_*`. In the other code files,
just use `G_PARAM_STATIC_STRINGS` directly.

This is just a minor convenience to prevent a few unnecessary string
copies.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/646
2019-07-30 13:58:44 +00:00
Illya Klymov
55b036170b shell-recorder: Restore cursor recording
Due to changes introduced in 5357e0a1 cursor recording interaction with
magnifier was reversed. This fix restores original correct behavior
Related issue: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1208
2019-07-08 21:08:51 +00:00
Marco Trevisan (Treviño)
5357e0a18c st/settings: Add magnifier activation property and bind to settings
The same code for reading the current magnifier state is repeated in both
shell-recorder, shell-screenshot and magnifier itself.
So to move this inside a property of st-settings so that we can refer to it
all over the places removing duplications.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/473
2019-04-02 20:28:54 +00:00
Marco Trevisan (Treviño)
6d6c2e5b99 shell-recorder: Use clutter-computed sizes and scaling for the capture
Get from clutter the capture sizes and scale and don't mind
about doing any rounding here, as it might be different
from the one done at clutter level (causing mismatch and
not-working videos). Delegate this to clutter, and forget
about the internal details.

These values are then used to composte the image and set the video caps.

https://bugzilla.gnome.org/show_bug.cgi?id=7650111
2019-03-01 17:12:53 +00:00
Carlos Garnacho
0fdfebdb67 shell: Drop some unused headers and Gdk variables
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Jonas Ådahl
47ea10b7c9 Remove usage of MetaScreen
Remove any usage of MetaScreen, as it has been removed from libmutter
in the API version 3. The corresponding functionality has been moved
into three different places: MetaDisplay, MetaX11Display (for X11
specific functionality) and MetaWorkspaceManager.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:56:19 +02:00
Florian Zwoch
6f0c187cf4 shell-recorder: save cursor's image hot x/y coordinates
Whenever a new cursor image is loaded also save it's hot x/y
coordinates. The drawing code already respects these values, however
they were never set. This change will place the cursor image at the
correct location as seen on screen. shell-screenshot.c served as
reference.

https://bugzilla.gnome.org/show_bug.cgi?id=792860
2018-02-07 13:16:36 +01:00
Jonas Ådahl
f9ef80749a recorder: Composite captured images before passing into gstreamer
Mutter may capture the screen in multiple capture regions. If this is
done, take these images and composite them onto one large image, which
is then passed into the gstreamer source.
2016-09-06 15:22:23 +08:00
Timm Bäder
d658a5148a recorder: Print absolute path if output file can't be opened 2016-08-20 16:03:31 +02:00
Jonas Ådahl
f5c058a036 Use clutter_stage_capture instead of cogl's read_pixels
There is no longer any guarantee that there'll be one single
framebuffer to read pixels from. In order to still read pixels from the
stage, use the new clutter_stage_capture API.

https://bugzilla.gnome.org/show_bug.cgi?id=768979
2016-07-20 14:15:32 +08:00
Rui Matos
2a7f9f70b8 shell-recorder: Avoid a crash when the cursor texture is NULL
When running as a wayland compositor, MetaCursorTracker might
legitimately not have a displayed cursor because e.g. a client unsets
the cursor surface.

Note that, under an X session, the assumption that the tracker always
has a cursor texture is true because XFixesGetCursorImage() always
returns data even if the cursor isn't visible.

https://bugzilla.gnome.org/show_bug.cgi?id=767001
2016-06-28 19:03:33 +02:00
Rui Matos
c91085caf7 shell-recorder: Ensure we remove the redraw timeout on finalize
Otherwise we may end up using freed memory and crashing

https://bugzilla.gnome.org/show_bug.cgi?id=767001
2016-06-28 19:03:32 +02:00
Florian Müllner
c039a3ddda recorder: Fall back to ~ if XDG_VIDEOS_DIR doesn't exist
Unlike screenshots, recordings fail when the default directory doesn't
exist. Fall back to home instead.

https://bugzilla.gnome.org/show_bug.cgi?id=765015
2016-04-13 21:25:31 +02:00
Florian Müllner
00814dd159 shell: Fix another indentation warning
The compiler doesn't know about preprocessor conditionals, so indentation
changes confuse -Wmisleading-indentation.
2016-02-16 18:05:14 +01:00
Florian Müllner
294702d3f1 shell: Use G_DECLARE_*_TYPE macros
Cut down on boilerplate by using the (no longer that) new helper
macros. We don't care about breaking ABI in private libraries, so
use G_DECLARE_FINAL_TYPE even where the class struct used to be
exposed in the header, except for types we inherit from ourselves
(obviously) or where the class exposes any vfuncs (where changes
could affect inheritance in extensions).
2015-10-15 22:58:28 +02:00
Florian Müllner
82f84416a9 recorder: Rewrite switch statement
Avoid compiler warnings about unhandled enum values by using a
regular if-else statement.
2015-09-23 21:32:49 +02:00
Raul Gutierrez Segales
7d058901ef Update comment about the pipeline used
We now use webm instead of theora so the previous
comment doesn't apply anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=652742
2015-02-27 17:36:11 +01:00
Sebastian Dröge
c4a775e94a shell-recorder: Timestamp buffers from the pipeline clock, not the wall clock
This should give more accurate timestamps on the video buffers, and especially
keep A/V sync when audio is also recorded.

https://bugzilla.gnome.org/show_bug.cgi?id=744642
2015-02-19 10:21:19 +02:00
Jasper St. Pierre
513d1a195d recorder: Remove unused field 2015-02-11 01:00:11 -08:00
Adel Gadllah
538272bb23 recorder: Cleanups 2015-01-11 15:48:05 +01:00
Adel Gadllah
985e909876 recorder: Don't compute the buffer size twice 2015-01-11 15:42:38 +01:00
Adel Gadllah
d183f13456 recorder: Switch to vp9
Currently we have been using the vp8 codec because it was the best unencumbered codec at that time. With vp9 we now have a successor that leads to smaller
files at at the same video quality and has been supported by current browsers
for a while.

With the raise of hidpi and 4K displays we need a better codec that handles
those resolutions better, so switch to vp9.

https://bugzilla.gnome.org/show_bug.cgi?id=742744
2015-01-11 15:35:31 +01:00
Adel Gadllah
e150a9cff2 recorder: Stop using deprecated cogl_read_pixels 2015-01-11 12:53:13 +01:00
Adel Gadllah
bd3dfb8f6a Fix wrong comment 2014-10-09 14:55:13 +02:00
Adel Gadllah
1b3c89f32b shell-recorder: Disable unredirection while recording
This is required to be able to record windows that would
otherwise be unredirected.

https://bugzilla.gnome.org/show_bug.cgi?id=738226
2014-10-09 14:52:25 +02:00
Jasper St. Pierre
91c4408d23 shell-recorder: Don't use XI2 in the recorder to query the pointer
Just use the normal MetaCursorTracker, which works under Wayland.
2014-07-26 10:51:48 -04:00
Carlos Garnacho
9f460a36f6 recorder: Fix typo
Both stage width and height are meant to be tracked.
2014-06-28 00:47:53 +02:00
Wim Taymans
17f481f6fe shell-recorder: send EOS to the pipeline
Send EOS to the complete pipeline instead of only to our own source.

When there are multiple sources in the pipeline (for example when we also
record audio), the pipeline will send the EOS to all sources in order to
shut down the complete pipeline.
2014-06-23 17:16:55 +02:00
Wim Taymans
b057e786a4 shell-recorder: depth and bpp are no more in 1.0
Remove 0.10 style bpp and depth, they are not needed anymore, the
format specifies the layout completely.
2014-06-23 17:15:44 +02:00
Florian Müllner
93c9e031e3 Update (allow-none) annotations
The annotation has been deprecated in favor of (nullable) and/or
(optional).
2014-05-28 22:01:55 +02:00
Bastien Nocera
85f811f147 src: Name all the timeouts and idles
https://bugzilla.gnome.org/show_bug.cgi?id=727983
2014-04-10 19:38:04 +02:00
Giovanni Campagna
d52c95a15f ShellRecorder: update to use MetaCursorTracker
Replace more direct XFixes usage with a the appropriate abstraction
API from mutter, which is guaranteed to work in wayland too.

It doesn't yet replace pointer position tracking, although probably
it should.
Also, because now we're using Mutter API, we lose the standalone
test case.

https://bugzilla.gnome.org/show_bug.cgi?id=705911
2013-08-19 16:14:12 +02:00
Jasper St. Pierre
d4942858ba Add a screencast indicator for when we're recording
This will replace the indicator painted on the stage right now.

This unfortunately does not work for the recorder triggered by the
keybinding -- we'll simply replace the in-shell code with a keybinding
powered by gnome-settings-daemon.
2013-08-14 20:39:07 -04:00
Florian Müllner
4fe1360b2c recorder: Hide cursor while magnifier is active
The magnifier adds its own copy of the system cursor to apply the
expected transformations, so we don't need to add it again in the
recorder; this avoids two different cursors showing up in recordings,
but doesn't address the case where the cursor should not be recorded
at all, but the magnifier adds it anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=700488
2013-05-22 18:33:16 +02:00
Florian Müllner
248a0c1b6c recorder: Use workarea to position the recording icon
It looks a bit unpolished to overlap our own chrome with the recording
icon, which may happen when an existing adds UI at the bottom edge.
Fix this by using the primary monitor's workarea for the position rather
than the entire monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=700409
2013-05-18 14:29:26 +02:00
Florian Müllner
dc3082e66d shell-recorder: Make drawing the cursor optional
As with screenshots, showing the cursor in a recording may not be
desirable, so add a property to control whether the cursor is drawn
or not.

https://bugzilla.gnome.org/show_bug.cgi?id=696247
2013-05-10 19:49:01 +02:00
Florian Müllner
c61573a8b7 shell-recorder: Support specifying the recorded area
Currently we will always record the entire screen. It has been requested
to support recording a specified area analogous to the screenshot API as
well, so add a set_area() method which allows this.

https://bugzilla.gnome.org/show_bug.cgi?id=696247
2013-05-10 19:49:01 +02:00
Florian Müllner
3b95560d32 shell-recorder: Optionally return the filename of the recording
It is currently not always possible to predict the actual output filename
of a recording - the file-template does not necessarily use an absolute
path and may contain %d and %t escape sequences.
This is OK for fire-and-forget uses like the existing keyboard shortcut,
but we will soon expose the functionality on DBus and consumers of that
API might very well need to access the file after the recording. So do
the same as our screenshot API and add an optional (out) parameter to
record().

https://bugzilla.gnome.org/show_bug.cgi?id=696247
2013-05-10 19:49:01 +02:00
Adel Gadllah
07de96ede9 recorder: Disconnect stage signals when not recording
This causes unnecessary work, so only connect them when needed i.e
while recording.

https://bugzilla.gnome.org/show_bug.cgi?id=695650
2013-03-11 20:11:18 +01:00
Ray Strode
ddced79475 recorder: port to XInput2
Pointer tracking is broken when the pointer is over the stage input
area.  This is apparently fallout from mutter going to XInput2.

This commit changes the mouse event handling code to also use XInput2.

https://bugzilla.gnome.org/show_bug.cgi?id=695324
2013-03-11 13:11:08 -04:00
Ray Strode
e80795b7f0 recorder: don't bother selecting for enter/leave/motion events
Mutter already handles that for us.

https://bugzilla.gnome.org/show_bug.cgi?id=695324
2013-03-11 12:35:38 -04:00
Adel Gadllah
f4b61a7f24 recorder: Show icon and indicator on the primary monitor
https://bugzilla.gnome.org/show_bug.cgi?id=688470
2012-11-19 19:16:24 +01:00
Adel Gadllah
d1a9aec526 recorder: Remove dead code
This calls are nops (already called a few lines above) so just remove them.
2012-11-16 19:28:23 +01:00
Neil Roberts
7f8bfcc939 Remove shell-screen-grabber
The screen grabber was a workaround for an extremely slow path in Mesa
when reading back pixel data from the frame buffer. It was using pixel
buffer objects by directly calling into GL to hit a fast blit path in
Intel's driver. This should no longer be necessary with the latest
Mesa because the normal read pixels path now has a fast path to just
memcpy the data. Using PBOs in that case just adds an extra
indirection because the data is read into an intermediate buffer and
then copied back out again.

We want to be able to remove the dependency on linking against libGL
directly from Gnome Shell because that will not work if Cogl is
actually using GLES. Also libGL includes GLX which means gnome-shell
ends up with a hard dependency on Xlib which hinders the goal of
getting Gnome Shell to be a Wayland compositor.

https://bugs.freedesktop.org/show_bug.cgi?id=46631

https://bugzilla.gnome.org/show_bug.cgi?id=685915
2012-11-12 19:07:57 +01:00
Ray Strode
eb09f34114 recorder: save recorded video as recent item
Often the first thing a user wants to do after making a recording
is post it somewhere.

This commit adds the video to recently used items, so that it shows
up prominently in open file choosers.

https://bugzilla.gnome.org/show_bug.cgi?id=680647
2012-10-26 13:29:30 -04:00
Ray Strode
fbeb446ed7 recorder: rename "filename" property to "file-template"
The filename property is actually a template string with
substitution variables, not a filename.

This commit renames for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=680647
2012-10-26 13:29:30 -04:00
Ray Strode
9171bab5e5 recorder: keep recorder object alive until pipeline finishes
We want to make sure the recorder isn't finalized until the
saved recording hits disk.  This means the pipeline object needs
a hard reference on the recorder.

https://bugzilla.gnome.org/show_bug.cgi?id=680647
2012-10-26 13:29:30 -04:00
Adel Gadllah
e71c016477 recorder: Port to new gstreamer vp8enc api
The speed and quality properties have been removed in favor of properties
closer to the upstream library.

Removing the properies from the pipeline would result into a huge
slowdown so we have to map the old values to the new ones.

According to the source code of the old vp8enc element quality maps to
(int)(63 - quality * 6.2) for min_quantizer and max_quantizer, while
speed maps to cpu-used = speed == 0 ? 0 : (speed - 1).

So set min_quantizer and min_quantizer to 13, and cpu-used to 5 based on
the above formulas.

https://bugzilla.gnome.org/show_bug.cgi?id=684206
2012-09-17 19:49:04 +02:00
Jasper St. Pierre
14d0a96999 shell-recorder: Fix warning message about unknown escapes
We were showing the percent character here.

https://bugzilla.gnome.org/show_bug.cgi?id=677434
2012-09-04 19:21:30 -03:00
Jasper St. Pierre
f0474ffccc shell-recorder: Remove the ability to pause the timeline
https://bugzilla.gnome.org/show_bug.cgi?id=677434
2012-09-04 19:21:30 -03:00