This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 9910a9b5e922bd0493e5c76efb27474c4310ca34 (commit) from e9d8edec450a97a0b8741273bb5d5e90fb94c821 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/gfxprim.git/commit/9910a9b5e922bd0493e5c76efb27474c4310ca3...
commit 9910a9b5e922bd0493e5c76efb27474c4310ca34 Author: Cyril Hrubis metan@ucw.cz Date: Sat Dec 19 22:28:16 2015 +0100
demos: c_simple: v4l2_show: Handle SYS_RESIZE
Adds SYS_RESIZE event handling and centers the image in the window.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/c_simple/v4l2_show.c b/demos/c_simple/v4l2_show.c index 97467b5..443d6d4 100644 --- a/demos/c_simple/v4l2_show.c +++ b/demos/c_simple/v4l2_show.c @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) GP_Backend *backend; GP_Grabber *grabber; const char *v4l2_device = "/dev/video0"; - unsigned int w = 320, h = 240; + unsigned int w = 640, h = 480; int mode = 0; int opt;
@@ -113,7 +113,10 @@ int main(int argc, char *argv[]) break; }
- GP_Blit_Clipped(res, 0, 0, res->w, res->h, backend->context, 0, 0); + unsigned int c_x = (backend->context->w - res->w) / 2; + unsigned int c_y = (backend->context->h - res->h) / 2; + + GP_Blit_Clipped(res, 0, 0, res->w, res->h, backend->context, c_x, c_y); GP_BackendFlip(backend);
if (mode) @@ -150,6 +153,13 @@ int main(int argc, char *argv[]) mode = 0; break; } + break; + case GP_EV_SYS: + if (ev.code == GP_EV_SYS_RESIZE) { + GP_BackendResizeAck(backend); + GP_Fill(backend->context, 0); + } + break; } } }
-----------------------------------------------------------------------
Summary of changes: demos/c_simple/v4l2_show.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.