summaryrefslogtreecommitdiff
path: root/src/screenshooter.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename screenshooter protocol to weston_screenshooterJonas Ådahl2015-11-191-5/+5
| | | | | | | | | Due to the effort of moving a way from non-prefixed protocols, rename the weston specific screenshooter protocol to weston_screenshooter. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* screenshooter: correct output ordering of screencast recording when Y-flip ↵Tomohito Esaki2015-10-141-3/+3
| | | | | | | | | | | | | is off The screenshooter encoder wrote the output from either top-to-bottom or bottom-to-top, depending on the Y-flip setting, but wcap-decode only decodes from bottom-to-top. Make the encoder always output from bottom-to-top, to match the decoder, and flip the input (source) according to the Y-flip setting. Signed-off-by: Tomohito Esaki <etom@igel.co.jp> Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
* input: Pass the appropriate pointer type to bindings instead of a seatDerek Foreman2015-07-161-7/+7
| | | | | | | | | | | | | | | | | Normally we need to check if a seat's [device_type]_count is > 0 before we can use the associated pointer. However, in a binding you're guaranteed that the seat has a device of that type. If we pass in that type instead of the seat, it's obvious we don't have to test it. The bindings can still get the seat pointer via whatever->seat if they need it. This is preparation for a follow up patch that prevents direct access to seat->device_type pointers, and this will save us a few tests at that point. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* Unified multiple definitions of container_of() macro.Jon Cruz2015-06-151-0/+1
| | | | | | | | | Removed duplicate definitions of the container_of() macro and refactored sources to use the single implementation. Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* Remove redundant #include path component.Jon Cruz2015-06-151-1/+1
| | | | | | | | | Using the parent '../' path component in #include statements makes the codebase more rigid and is redundant due to proper -I use. Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* src: Update boilerplate from MIT X11 license to MIT Expat licenseBryce Harrington2015-06-151-16/+19
|
* screenshooter: clean up recorder_binding a littleDerek Foreman2015-06-041-1/+1
| | | | | | | We already have a pointer to the compositor so change seat->compositor to ec Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* screenshooter: remove useless castDerek Foreman2015-02-021-2/+1
| | | | Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* screenshooter: fix various memory handlingMarek Chalupa2014-12-121-8/+17
| | | | | | | | | | | There were unchecked malloc and no free for this memory. Also simplify error handling in one function. v2. remove check if memory is NULL, according to man pages, free(NULL) is a no-op Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Use zalloc rather than malloc and manually setting members to 0Bryce Harrington2014-11-281-7/+2
| | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* fix asprintf warningsPekka Paalanen2014-09-051-2/+8
| | | | | | | | | | | | | | | | | | Fix recently introduced compiler warnings: desktop-shell/shell.c: In function 'shell_configuration': desktop-shell/shell.c:588:10: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result] src/screenshooter.c: In function ‘screenshooter_binding’: src/screenshooter.c:291:10: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result] src/text-backend.c: In function ‘text_backend_configuration’: src/text-backend.c:944:10: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: allow running make check without make installDerek Foreman2014-08-221-1/+5
| | | | | | | | | | | | | desktop shell and weston keyboard both refer to themselves prefixed by LIBEXECDIR, however this is only valid once installed. make check will currently either fail or run pre-existing versions. This patch adds a way to override that location by setting the env var WESTON_BUILD_DIR - which is then set by the test env script so make check will test the versions in the build directory regardless of whether they're installed or not. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* screenshooter: Add a missing return; in an error pathJasper St. Pierre2014-08-081-0/+1
|
* Don't bother destroying resources after sending an errorJasper St. Pierre2014-08-081-1/+0
| | | | | | | | | | An error makes the client exit, which cleans up the resources anyway. Note (Jason Ekstrand): This is safe for two reasons. First, we should be handling object destruction nicely anyway. Second, in each of these cases, the resources don't have any implementation or destruction set so it has absolutely no effect on the rest of weston whether we destroy it now or later.
* Check zalloc return for out of memory situationBryce W. Harrington2014-04-251-13/+20
| | | | | | | Most zalloc calls in weston are checked, this fixes a handful that were being ignored. As found by `grep -EIsr "[^x]zalloc\(" . -A1` Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
* compositor: let the shells create the screenshooterGiulio Camuffo2014-04-021-1/+1
|
* compositor: add an exported function to take a screenshot of an outputGiulio Camuffo2014-04-021-23/+57
| | | | | This allows other screenshooter protocols to use the same code to copy the screen to a buffer.
* screenshooter: check for NULL malloc and fix memleaksU. Artie Eoff2014-01-191-1/+12
| | | | Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* screenshooter: silence a warningPekka Paalanen2014-01-081-1/+1
| | | | | | | | | | | screenshooter.c: In function ‘recorder_binding’: screenshooter.c:509:5: warning: ‘listener’ may be used uninitialized in this function [-Wuninitialized] This was not really a problem so far, because the variable was uninitialized only in the case where Weston had no outputs. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* screenshooter: Choose output to record from based on keyboard focusAnder Conselvan de Oliveira2013-12-191-67/+29
| | | | | | | | | | | Record from the output of the surface that has keyboard focus for the seat used to activate the recorder key binding. If there is no focused surface, record from the first one. Also, use the weston_transformed_region() to transform the damage region of the output into the coordinates expected by read_pixels(). https://bugs.freedesktop.org/show_bug.cgi?id=71401
* screenshooter: Record one extra frame when recording stopsAnder Conselvan de Oliveira2013-12-171-2/+10
| | | | | | | | | If the compositor hasn't been rendering for a while when the recording stops, the time difference between the last rendered frame and that moment won't be in the encoded video. Fix that by forcing one extra frame to be recorded when the user presses the recorder key binding. https://bugs.freedesktop.org/show_bug.cgi?id=71142
* Add calls to wl_shm_buffer_begin/end_accessNeil Roberts2013-11-131-0/+4
| | | | | | This wraps all accesses to an SHM buffer between wl_shm_buffer_begin and end so that wayland-shm can install a handler for SIGBUS and catch attempts to pass the compositor a buffer that is too small.
* Rename current, origin, scale, origin_scaleHardening2013-09-211-26/+26
| | | | This patch renames that fields to have consistent names.
* compositor: Handle OOM in weston_buffer_from_resource()Kristian Høgsberg2013-08-151-0/+4
| | | | Handle NULL-return in call-sites as well.
* malloc + memset -> zallocPeter Hutterer2013-08-081-2/+1
| | | | | | And for clients using the xmalloc helper, use xzalloc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Convert to wl_global_create/destroy()Kristian Høgsberg2013-07-091-4/+4
|
* Use wl_resource_create() for creating resourcesJason Ekstrand2013-07-031-2/+5
| | | | | | | | | | This commit sets the version numbers for all added/created objects. The wl_compositor.create_surface implementation was altered to create a surface with the same version as the underlying wl_compositor. Since no other "child interfaces" have version greater than 1, they were all hard-coded to version 1. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* compositor: Remove a few legacy uses of wl_objectKristian Høgsberg2013-06-251-4/+0
|
* Add a weston_buffer structure to replace wl_bufferJason Ekstrand2013-06-211-5/+10
| | | | | | | | | This commit adds a weston_buffer structure to replace wl_buffer. This way we can hold onto buffers by just their resource. In order to do this, the every renderer.attach function has to fill in the weston_buffer.width and weston_buffer.height fields. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* output: Use wl_resource_get accessors for weston_output resourcesJason Ekstrand2013-06-141-1/+2
| | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* configure.ac: Enable AC_USE_SYSTEM_EXTENSIONSDaniel Stone2013-06-051-0/+2
| | | | | | | | | | | | | | | | | | AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar macros to expose the largest extent of functionality supported by the underlying system. This is required since these macros are often limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually on some systems hide declarations which are not part of the X/Open spec. Since this goes into config.h rather than the command line, ensure all source is consistently including config.h before anything else, including system libraries. This doesn't need to be guarded by a HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org modular transition. Signed-off-by: Daniel Stone <daniel@fooishbar.org> [pq: rebased and converted more files]
* screenshooter: Scale damage by output scale in screen recorderAlexander Larsson2013-05-291-0/+5
| | | | | The damage region is in compositor coords, we need to scale it by the output scale when using the damage to read output buffer data.
* screenshoter: Make recorder handle PIXMAN_x8r8g8b8Alexander Larsson2013-05-291-0/+1
| | | | This is what the pixman renderer reports for the read format.
* screenshooter: print info to logPekka Paalanen2013-05-221-2/+3
| | | | | | | | Print the recording info to Weston log, not stderr. Also fix the frame counter. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor: add capability CAPTURE_YFLIPPekka Paalanen2013-05-221-20/+76
| | | | | | | | | | | | | | | | | Both GL and pixman renderer (pixman probably only because GL did?) return the screen capture image as y-flipped, therefore Weston y-flips it again. However, the future rpi-renderer can produce only right-way-up (non-flipped) screen captures, and does not need an y-flip. Add a capability flag for y-flip, which the rpi-renderer will not set, to get screen captures the right way up. The wcap recording code needs yet another temporary buffer for the non-flipped case, since the WCAP format is flipped, and the code normally overwrites the input image as it compresses it. This becomes difficult, if the compressor is supposed to flip while processing. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* input: Merge wl_seat into weston_seatKristian Høgsberg2013-05-071-2/+2
|
* screenshooter: Free allocated memory where missing from some return pathsRob Bradford2013-01-101-0/+2
|
* screenshoter: add cases for x8r8g8b8 and x8b8g8r8 formatsVasily Khoruzhick2013-01-071-0/+2
| | | | | | | These formats are used by pixman renderer for framebuffer surface, without this patch screenshoter produces empty image. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
* screenshoter: don't use hardcoded bpp valueVasily Khoruzhick2013-01-071-1/+1
| | | | Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
* screenshooter: Report an error if we fail to open the fileRob Bradford2012-12-061-3/+8
|
* screenshooter: Abandon recording rather than use unitialised formatRob Bradford2012-12-061-1/+1
| | | | | Abandon the recording if the format is not known - this prevents the use of an unitialised member is the header struct.
* compositor: Move buffer damage fields from weston_output to gl-rendererAnder Conselvan de Oliveira2012-11-161-12/+3
| | | | | | | | | Move fields current_buffer and buffer_damage out of weston_output into gl_output_state, since they are actually specific to the renderer. Also bring back the previous_damage field so that the screenshooter can get the damage for the previous frame in a renderer independent way.
* wcap: Transform damage rectangles according to output tranformKristian Høgsberg2012-11-141-0/+52
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=56697
* screenshooter: Use the renderer function for reading out pixelsJohn Kåre Alsaker2012-11-131-12/+15
| | | | This also changes the compositor's read_format to a pixman format.
* compositor: Generalize output previous damage into per buffer damageAnder Conselvan de Oliveira2012-09-141-3/+12
| | | | | | | | | | | This is a more generic fix for the issue solved in 4f521731 where damage obscured by overlays could be lost in one of the output buffers due to rapid move of a surface in an overlay plane. This changes the renderer so it keeps track of the damage in each buffer. Every time a new frame is drawn, the damage of the frame is added to all the buffers and the rendered regions are cleared from the current buffer's damage.
* compositor-drm: Disable planes when zoomed or capturingKristian Høgsberg2012-08-031-0/+6
| | | | | | | When the entire output is transformed or we're capturing the output for screenshot or video, disable all output specific overlays (drm planes, hw cursors etc) and move all surfaces into the primary plane.
* compositor: Introduce weston_output_schedule_repaint()Kristian Høgsberg2012-06-201-1/+1
| | | | This lets us schedule a repaint on just the output that needs it.
* recorder: Always initialize prev when computing the run-lengthKristian Høgsberg2012-06-201-1/+1
| | | | | | | We need to initialize prev when we handle the initial pixel in a rectangle, or we may detect the following pixel as identical or different when it's not. This causes the top-left pixel in a rectangle to occasionally be wrong leaving a trail of "dirty pixels" in the capture.
* compositor: Pass weston_output as the frame_signal argumentKristian Høgsberg2012-06-201-9/+5
| | | | | The frame time is in weston_output, so passing weston_output itself is more useful.
* screenshooter: Just use frame signal for screenshots tooKristian Høgsberg2012-06-201-36/+38
| | | | We'll remove the odd do_read_pixels callback next.