From: Evgeny Voevodin Date: Fri, 13 Jul 2012 03:55:13 +0000 (+0400) Subject: Merge remote-tracking branch 'score/develop' into tizen-arm-v1.1.0-develop X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1405^2~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c9a9e7a34284f4fa1df6266e04be7ccd96dd012;p=sdk%2Femulator%2Fqemu.git Merge remote-tracking branch 'score/develop' into tizen-arm-v1.1.0-develop Conflicts: target-i386/translate.c This kept unchanged since ARM emulator based on fresher qemu v1.1.0 tizen/src/maru_sdl.c Merged successfully. Signed-off-by: Evgeny Voevodin --- diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 967cd43e04..973b24a4df 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Package: emulator -Version: 1.2.100 +Version:1.2.99 OS: linux Build-host-os: linux Maintainer: Yeong-Kyoon Lee @@ -8,7 +8,7 @@ Source: emulator Description: Tizen Emulator Package: emulator -Version: 1.2.100 +Version:1.2.99 OS: windows Build-host-os: windows Maintainer: Yeong-Kyoon Lee diff --git a/tizen/src/VERSION b/tizen/src/VERSION index daadb8c2fa..be3fddb2ef 100644 --- a/tizen/src/VERSION +++ b/tizen/src/VERSION @@ -1 +1 @@ -2.0a2-rc3 +develop@2012-07-09_17-53-17 diff --git a/tizen/src/hw/maru_camera_win32_pci.c b/tizen/src/hw/maru_camera_win32_pci.c index acd1ee73b3..85bcce9d90 100644 --- a/tizen/src/hw/maru_camera_win32_pci.c +++ b/tizen/src/hw/maru_camera_win32_pci.c @@ -1343,6 +1343,10 @@ static STDMETHODIMP SetDefaultValues(void) DeleteMediaType(pmtConfig); } } + if (iFormat >= iCount) { + ERR("Maybe connected webcam does not support %ld x %ld resolution.\n", g_dwWidth, g_dwHeight); + hr = E_FAIL; + } } pSConfig->lpVtbl->Release(pSConfig); return hr; @@ -1375,6 +1379,9 @@ static STDMETHODIMP SetResolution(LONG width, LONG height) pvi->AvgTimePerFrame = g_dwAvgInterval; pvi->bmiHeader.biSizeImage = ((width * pvi->bmiHeader.biBitCount) >> 3 ) * height; hr = vsc->lpVtbl->SetFormat(vsc, pmt); + if (hr != S_OK) { + ERR("failed to set the resolution.(w:%ld, h:%ld), Maybe connected webcam does not support the resolution.\n", width, height); + } } DeleteMediaType(pmt); } @@ -1481,6 +1488,8 @@ void marucam_device_open(MaruCamState* state) ERR("SetDefaultValues\n"); goto error_failed; } + cur_frame_idx = 0; + cur_fmt_idx = 0; INFO("Open successfully!!!\n"); return; diff --git a/tizen/src/maru_sdl.c b/tizen/src/maru_sdl.c index 83d6c0a7f1..d8bb91ca65 100644 --- a/tizen/src/maru_sdl.c +++ b/tizen/src/maru_sdl.c @@ -36,6 +36,7 @@ #include "maru_finger.h" #include "hw/maru_pm.h" #include "debug_ch.h" +//#include "SDL_opengl.h" MULTI_DEBUG_CHANNEL(tizen, maru_sdl); @@ -232,36 +233,9 @@ static void qemu_ds_refresh(DisplayState *ds) switch (ev->type) { case SDL_VIDEORESIZE: { - int w, h, temp; - - //get current setting information and calculate screen size - scale_factor = get_emul_win_scale(); - w = get_emul_lcd_width() * scale_factor; - h = get_emul_lcd_height() * scale_factor; - - short rotaton_type = get_emul_rotation(); - if (rotaton_type == ROTATION_PORTRAIT) { - screen_degree = 0.0; - } else if (rotaton_type == ROTATION_LANDSCAPE) { - screen_degree = 90.0; - temp = w; - w = h; - h = temp; - } else if (rotaton_type == ROTATION_REVERSE_PORTRAIT) { - screen_degree = 180.0; - } else if (rotaton_type == ROTATION_REVERSE_LANDSCAPE) { - screen_degree = 270.0; - temp = w; - w = h; - h = temp; - } - pthread_mutex_lock(&sdl_mutex); - surface_screen = SDL_SetVideoMode(w, h, SDL_BPP, SDL_FLAGS); - if (surface_screen == NULL) { - ERR("Could not open SDL display (%dx%dx%d): %s\n", w, h, SDL_BPP, SDL_GetError()); - } + maruskin_sdl_init(0, get_emul_lcd_width(), get_emul_lcd_height(), true); pthread_mutex_unlock(&sdl_mutex); vga_hw_invalidate(); @@ -310,44 +284,50 @@ void maruskin_display_init(DisplayState *ds) dcl->dpy_refresh = qemu_ds_refresh; register_displaychangelistener(ds, dcl); - -#ifdef SDL_THREAD - if (sdl_thread_initialized == 0) { - sdl_thread_initialized = 1; - pthread_t thread_id; - INFO( "sdl update thread create\n"); - if (pthread_create(&thread_id, NULL, run_qemu_update, NULL) != 0) { - ERR( "pthread_create fail\n"); - return; - } - } -#endif } -void maruskin_sdl_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height) +void maruskin_sdl_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height, bool is_resize) { - int w, h; + int w, h, temp; gchar SDL_windowhack[32]; SDL_SysWMinfo info; long window_id = swt_handle; - sprintf(SDL_windowhack, "%ld", window_id); - g_setenv("SDL_WINDOWID", SDL_windowhack, 1); - INFO("register SDL environment variable. (SDL_WINDOWID = %s)\n", SDL_windowhack); + if (is_resize == FALSE) { + sprintf(SDL_windowhack, "%ld", window_id); + g_setenv("SDL_WINDOWID", SDL_windowhack, 1); + INFO("register SDL environment variable. (SDL_WINDOWID = %s)\n", SDL_windowhack); - if (SDL_Init(SDL_INIT_VIDEO) < 0 ) { - ERR( "unable to init SDL: %s", SDL_GetError() ); - exit(1); - } + if (SDL_Init(SDL_INIT_VIDEO) < 0 ) { + ERR( "unable to init SDL: %s", SDL_GetError() ); + exit(1); + } - set_emul_lcd_size(lcd_size_width, lcd_size_height); + set_emul_lcd_size(lcd_size_width, lcd_size_height); + set_emul_sdl_bpp(SDL_BPP); + } //get current setting information and calculate screen size scale_factor = get_emul_win_scale(); w = lcd_size_width * scale_factor; h = lcd_size_height * scale_factor; - set_emul_sdl_bpp(SDL_BPP); + short rotaton_type = get_emul_rotation(); + if (rotaton_type == ROTATION_PORTRAIT) { + screen_degree = 0.0; + } else if (rotaton_type == ROTATION_LANDSCAPE) { + screen_degree = 90.0; + temp = w; + w = h; + h = temp; + } else if (rotaton_type == ROTATION_REVERSE_PORTRAIT) { + screen_degree = 180.0; + } else if (rotaton_type == ROTATION_REVERSE_LANDSCAPE) { + screen_degree = 270.0; + temp = w; + w = h; + h = temp; + } INFO( "maru sdl initialization\n"); surface_screen = SDL_SetVideoMode(w, h, get_emul_sdl_bpp(), SDL_FLAGS); @@ -355,13 +335,27 @@ void maruskin_sdl_init(uint64 swt_handle, int lcd_size_width, int lcd_size_heigh ERR("Could not open SDL display (%dx%dx%d): %s\n", w, h, get_emul_sdl_bpp(), SDL_GetError()); } +#ifdef SDL_THREAD + if (sdl_thread_initialized == 0) { + sdl_thread_initialized = 1; + pthread_t thread_id; + INFO( "sdl update thread create\n"); + if (pthread_create(&thread_id, NULL, run_qemu_update, NULL) != 0) { + ERR( "pthread_create fail\n"); + return; + } + } +#endif + #ifndef _WIN32 SDL_VERSION(&info.version); SDL_GetWMInfo(&info); #endif - sdl_initialized = 1; - init_multi_touch_state(); + if (sdl_initialized == 0) { + sdl_initialized = 1; + init_multi_touch_state(); + } } void maruskin_sdl_resize(void) diff --git a/tizen/src/maru_sdl.h b/tizen/src/maru_sdl.h index 5221e8ec4c..7559bfec92 100644 --- a/tizen/src/maru_sdl.h +++ b/tizen/src/maru_sdl.h @@ -47,7 +47,7 @@ #define SDL_USER_EVENT_CODE_HARDKEY 1 void maruskin_display_init(DisplayState *ds); -void maruskin_sdl_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height); +void maruskin_sdl_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height, bool is_resize); void maruskin_sdl_resize(void); void maruskin_sdl_free(void); diff --git a/tizen/src/option.c b/tizen/src/option.c index 44f659197c..547cde94d6 100644 --- a/tizen/src/option.c +++ b/tizen/src/option.c @@ -129,6 +129,15 @@ int gethostDNS(char *dns1, char *dns2) } free(pAdapterAddr); #endif + + // by caramis... change DNS address if localhost has DNS server or DNS cache. + if(!strncmp(dns1, "127.0.0.1", 9) || !strncmp(dns1, "localhost", 9)) { + strncpy(dns1, "10.0.2.2", 9); + } + if(!strncmp(dns2, "127.0.0.1", 9) || !strncmp(dns2, "localhost", 9)) { + strncpy(dns2, "10.0.2.2", 9); + } + return 0; } diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java index 336a289ad7..297cdd7a95 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java @@ -1663,10 +1663,13 @@ public class EmulatorSkin { short rotationId = ( (Short) item.getData() ); + /* remove multi-touch finger points */ + KeyEventData clearMultiTouch = new KeyEventData(KeyEventType.RELEASED.value(), SWT.CTRL, SWT.LEFT); + communicator.sendToQEMU(SendCommand.SEND_KEY_EVENT, clearMultiTouch); + arrangeSkin( currentLcdWidth, currentLcdHeight, currentScale, rotationId ); LcdStateData lcdStateData = new LcdStateData( currentScale, rotationId ); communicator.sendToQEMU( SendCommand.CHANGE_LCD_STATE, lcdStateData ); - } }; diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index e353cce8c8..e6ab725825 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -67,7 +67,7 @@ void start_display(uint64 handle_id, int lcd_size_width, int lcd_size_height, do handle_id, lcd_size_width, lcd_size_height, scale_factor, rotation_type ); set_emul_win_scale(scale_factor); - maruskin_sdl_init(handle_id, lcd_size_width, lcd_size_height); + maruskin_sdl_init(handle_id, lcd_size_width, lcd_size_height, false); } void do_mouse_event( int event_type, int origin_x, int origin_y, int x, int y, int z ) @@ -204,7 +204,7 @@ void do_scale_event( double scale_factor ) void do_rotation_event( int rotation_type) { - INFO( "do_rotation_event rotation_type:%d", rotation_type); + INFO( "do_rotation_event rotation_type:%d\n", rotation_type); char send_buf[32] = { 0 };