+* 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
-Version: 1.4.70
+Version: 1.4.71
Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
Source: emulator
/* 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);
}
}
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)
typedef struct MaruScreenshot {
unsigned char *pixel_data;
int request_screenshot;
+ int isReady;
} MaruScreenshot;
void maru_display_init(DisplayState *ds);
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;