summaryrefslogtreecommitdiff
path: root/src/screenshooter.c
diff options
context:
space:
mode:
authorTomohito Esaki <etom@igel.co.jp>2015-07-07 19:06:05 +0900
committerBryce Harrington <bryce@osg.samsung.com>2015-10-14 16:09:52 -0700
commit9054e4c8c4d0d1aa5d996458d2f142edac7833c8 (patch)
tree6a5ae4d83327eff02b355dc5af0b7cefafaa4122 /src/screenshooter.c
parenta6714fa0faf7515585fd436faa5411dd71382186 (diff)
downloadweston-9054e4c8c4d0d1aa5d996458d2f142edac7833c8.tar.gz
screenshooter: correct output ordering of screencast recording when Y-flip 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>
Diffstat (limited to 'src/screenshooter.c')
-rw-r--r--src/screenshooter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/screenshooter.c b/src/screenshooter.c
index d54b47de..6e1af659 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -417,14 +417,14 @@ weston_recorder_frame_notify(struct wl_listener *listener, void *data)
compositor->read_format, recorder->rect,
r[i].x1, y_orig, width, height);
- s = recorder->rect;
p = outbuf;
run = prev = 0; /* quiet gcc */
for (j = 0; j < height; j++) {
if (do_yflip)
- y_orig = r[i].y2 - j - 1;
+ s = recorder->rect + width * j;
else
- y_orig = r[i].y1 + j;
+ s = recorder->rect + width * (height - j - 1);
+ y_orig = r[i].y2 - j - 1;
d = recorder->frame + stride * y_orig + r[i].x1;
for (k = 0; k < width; k++) {