modified screenshot operation when vga is not ready
authorsungmin ha <sungmin82.ha@samsung.com>
Wed, 23 Jan 2013 07:04:48 +0000 (16:04 +0900)
committersungmin ha <sungmin82.ha@samsung.com>
Wed, 23 Jan 2013 07:04:48 +0000 (16:04 +0900)
package/changelog
package/pkginfo.manifest
tizen/src/hw/maru_vga.c
tizen/src/maru_display.c
tizen/src/maru_display.h
tizen/src/skin/maruskin_operation.c

index ec09bc2..b7384e0 100644 (file)
@@ -1,3 +1,6 @@
+* 1.4.71
+- modified screenshot operation when vga is not ready
+== Sungmin Ha <sungmin82.ha@samsung.com> 2013-01-23
 * 1.4.70
 - remove shared memory leak on Mac
 == GiWoong Kim <giwoong.kim@samsung.com> 2013-01-22
index 7732fc7..bfd6fab 100644 (file)
@@ -1,4 +1,4 @@
-Version: 1.4.70
+Version: 1.4.71
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
 Source: emulator
 
index 4f1c0e5..6007b5c 100644 (file)
@@ -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);
         }
     }
index fae42b1..48d49b8 100644 (file)
@@ -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)
index e8ae696..bebf480 100644 (file)
@@ -36,6 +36,7 @@
 typedef struct MaruScreenshot {
     unsigned char *pixel_data;
     int request_screenshot;
+    int isReady;
 } MaruScreenshot;
 
 void maru_display_init(DisplayState *ds);
index a756e27..ec09d7c 100644 (file)
@@ -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;