From 119b6080a67ed1379c5fcca7b6249ce53737bfa0 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Wed, 5 Mar 2014 18:01:26 +0900 Subject: [PATCH] Use the pixel size which comes from master Change-Id: Iaf03a8cd7f7c1374ed566002247c32430c6f95a3 --- packaging/liblivebox-viewer.spec | 2 +- src/fb.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packaging/liblivebox-viewer.spec b/packaging/liblivebox-viewer.spec index dc96b83..8566bcd 100644 --- a/packaging/liblivebox-viewer.spec +++ b/packaging/liblivebox-viewer.spec @@ -1,6 +1,6 @@ Name: liblivebox-viewer Summary: Library for developing the application -Version: 0.20.9 +Version: 0.21.0 Release: 1 Group: HomeTF/Livebox License: Flora diff --git a/src/fb.c b/src/fb.c index 1dda034..0e90ad1 100644 --- a/src/fb.c +++ b/src/fb.c @@ -47,6 +47,7 @@ struct fb_info { int bufsz; void *buffer; + int pixels; int handle; }; @@ -64,14 +65,12 @@ struct buffer { /*!< Must has to be sync with slave & provider */ static struct { Display *disp; int screen; - int depth; Visual *visual; int disp_is_opened; } s_info = { .disp = NULL, .disp_is_opened = 0, .screen = -1, - .depth = 0, .visual = NULL, }; @@ -87,7 +86,6 @@ int fb_init(void *disp) s_info.visual = DefaultVisualOfScreen(screen); } - s_info.depth = sizeof(int); //DefaultDepthOfScreen(screen); return 0; } @@ -101,13 +99,12 @@ int fb_fini(void) s_info.disp_is_opened = 0; s_info.visual = NULL; s_info.screen = -1; - s_info.depth = 0; return 0; } static inline void update_fb_size(struct fb_info *info) { - info->bufsz = info->w * info->h * s_info.depth; + info->bufsz = info->w * info->h * info->pixels; } static inline int sync_for_file(struct fb_info *info) @@ -243,7 +240,7 @@ static inline __attribute__((always_inline)) int sync_for_pixmap(struct fb_info * Use the 24 bits Pixmap for Video player */ xim = XShmCreateImage(s_info.disp, s_info.visual, - (s_info.depth << 3), ZPixmap, NULL, + (info->pixels << 3), ZPixmap, NULL, &si, info->w, info->h); if (xim == NULL) { @@ -326,10 +323,12 @@ struct fb_info *fb_create(const char *id, int w, int h) return NULL; } + info->pixels = sizeof(int); /* Use the default pixels(depth) */ + if (sscanf(info->id, SCHEMA_SHM "%d", &info->handle) == 1) { DbgPrint("SHMID: %d is gotten\n", info->handle); - } else if (sscanf(info->id, SCHEMA_PIXMAP "%d", &info->handle) == 1) { - DbgPrint("PIXMAP-SHMID: %d is gotten\n", info->handle); + } else if (sscanf(info->id, SCHEMA_PIXMAP "%d:%d", &info->handle, &info->pixels) == 2) { + DbgPrint("PIXMAP-SHMID: %d is gotten (%d)\n", info->handle, info->pixels); } else { info->handle = LB_STATUS_ERROR_INVALID; } -- 2.7.4