From: sungmin ha Date: Wed, 23 Jan 2013 07:04:48 +0000 (+0900) Subject: modified screenshot operation when vga is not ready X-Git-Tag: TizenStudio_2.0_p2.3~990^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e27a29aaf281d2dfda29f8361b90f0c7a2bc7f8c;p=sdk%2Femulator%2Fqemu.git modified screenshot operation when vga is not ready --- diff --git a/package/changelog b/package/changelog index ec09bc2..b7384e0 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,6 @@ +* 1.4.71 +- modified screenshot operation when vga is not ready +== Sungmin Ha 2013-01-23 * 1.4.70 - remove shared memory leak on Mac == GiWoong Kim 2013-01-22 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 7732fc7..bfd6fab 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,4 +1,4 @@ -Version: 1.4.70 +Version: 1.4.71 Maintainer: Yeong-Kyoon Lee Source: emulator diff --git a/tizen/src/hw/maru_vga.c b/tizen/src/hw/maru_vga.c index 4f1c0e5..6007b5c 100644 --- a/tizen/src/hw/maru_vga.c +++ b/tizen/src/hw/maru_vga.c @@ -1490,15 +1490,12 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) /* for screenshot */ pthread_mutex_lock(&mutex_screenshot); MaruScreenshot* maru_screenshot = get_maru_screenshot(); - - if (!maru_screenshot) { - ERR("maru screenshot is NULL.\n"); - } else { + if (maru_screenshot) { + maru_screenshot->isReady = 1; if (maru_screenshot->request_screenshot == 1) { memcpy(maru_screenshot->pixel_data, s->ds->surface->data, s->ds->surface->linesize * s->ds->surface->height); maru_screenshot->request_screenshot = 0; - pthread_cond_signal(&cond_screenshot); } } diff --git a/tizen/src/maru_display.c b/tizen/src/maru_display.c index fae42b1..48d49b8 100644 --- a/tizen/src/maru_display.c +++ b/tizen/src/maru_display.c @@ -73,6 +73,7 @@ void maru_display_init(DisplayState *ds) maru_screenshot = g_malloc0(sizeof(MaruScreenshot)); maru_screenshot->pixel_data = NULL; maru_screenshot->request_screenshot = 0; + maru_screenshot->isReady = 0; } void maru_display_fini(void) diff --git a/tizen/src/maru_display.h b/tizen/src/maru_display.h index e8ae696..bebf480 100644 --- a/tizen/src/maru_display.h +++ b/tizen/src/maru_display.h @@ -36,6 +36,7 @@ typedef struct MaruScreenshot { unsigned char *pixel_data; int request_screenshot; + int isReady; } MaruScreenshot; void maru_display_init(DisplayState *ds); diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index a756e27..ec09d7c 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -357,13 +357,14 @@ QemuSurfaceInfo* get_screenshot_info(void) pthread_mutex_lock(&mutex_screenshot); MaruScreenshot* maru_screenshot = get_maru_screenshot(); - if ( !maru_screenshot ) { - ERR( "maru screenshot is NULL.\n" ); - return NULL; + if ( !maru_screenshot || maru_screenshot->isReady != 1) { + ERR( "maru screenshot is NULL or not ready.\n" ); + memset(info->pixel_data, 0x00, length); + } else { + maru_screenshot->pixel_data = info->pixel_data; + maru_screenshot->request_screenshot = 1; + pthread_cond_wait(&cond_screenshot, &mutex_screenshot); } - maru_screenshot->pixel_data = info->pixel_data; - maru_screenshot->request_screenshot = 1; - pthread_cond_wait(&cond_screenshot, &mutex_screenshot); pthread_mutex_unlock(&mutex_screenshot); info->pixel_data_length = length;