Merge remote-tracking branch 'score/develop' into tizen-arm-v1.1.0-develop
authorEvgeny Voevodin <e.voevodin@samsung.com>
Fri, 13 Jul 2012 03:55:13 +0000 (07:55 +0400)
committerEvgeny Voevodin <e.voevodin@samsung.com>
Fri, 13 Jul 2012 05:28:22 +0000 (09:28 +0400)
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 <e.voevodin@samsung.com>
package/pkginfo.manifest
tizen/src/VERSION
tizen/src/hw/maru_camera_win32_pci.c
tizen/src/maru_sdl.c
tizen/src/maru_sdl.h
tizen/src/option.c
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/maruskin_operation.c

index 967cd43e04b963e0a105f6d392f2216a99d0daa9..973b24a4dfb9a063999d30ab409e38ddc02ad0cb 100644 (file)
@@ -1,5 +1,5 @@
 Package: emulator
-Version: 1.2.100
+Version:1.2.99
 OS: linux
 Build-host-os: linux
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
@@ -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<yeongkyoon.lee@samsung.com>
index daadb8c2fa585759a9bac9d556530f4a917fc83b..be3fddb2efc6c3271734ed3ee6ea56b4da3737f7 100644 (file)
@@ -1 +1 @@
-2.0a2-rc3
+develop@2012-07-09_17-53-17
index acd1ee73b34be5839cbf1d0c5aaec9daf178f25c..85bcce9d906ce6e280705c799d24810e2ac7a858 100644 (file)
@@ -1343,6 +1343,10 @@ static STDMETHODIMP SetDefaultValues(void)
                 DeleteMediaType(pmtConfig);\r
             }\r
         }\r
+        if (iFormat >= iCount) {\r
+            ERR("Maybe connected webcam does not support %ld x %ld resolution.\n", g_dwWidth, g_dwHeight);\r
+            hr = E_FAIL;\r
+        }\r
     }\r
     pSConfig->lpVtbl->Release(pSConfig);\r
     return hr;\r
@@ -1375,6 +1379,9 @@ static STDMETHODIMP SetResolution(LONG width, LONG height)
             pvi->AvgTimePerFrame = g_dwAvgInterval;\r
             pvi->bmiHeader.biSizeImage = ((width * pvi->bmiHeader.biBitCount) >> 3 ) * height;\r
             hr = vsc->lpVtbl->SetFormat(vsc, pmt);\r
+            if (hr != S_OK) {\r
+                ERR("failed to set the resolution.(w:%ld, h:%ld), Maybe connected webcam does not support the resolution.\n", width, height);\r
+            }\r
         }\r
         DeleteMediaType(pmt);\r
     }\r
@@ -1481,6 +1488,8 @@ void marucam_device_open(MaruCamState* state)
         ERR("SetDefaultValues\n");\r
         goto error_failed;\r
     }\r
+    cur_frame_idx = 0;\r
+    cur_fmt_idx = 0;\r
 \r
     INFO("Open successfully!!!\n");\r
     return;\r
index 83d6c0a7f14aadeb06b5010eafe81e6d155ed8b1..d8bb91ca6550d4f50b34844a71de58ee9aa07385 100644 (file)
@@ -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)
index 5221e8ec4ce0e88ff56041bcba7ee6f9215bf1d7..7559bfec9259e2b51d25cf9b7f079902be5072c7 100644 (file)
@@ -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);
 
index 44f659197c84c19aaa738b13e32882986d47f050..547cde94d6cf8f771536a5e0d06fc9f3edbc75bc 100644 (file)
@@ -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;
 }
 
index 336a289ad776748d24f4e957bbdca06094cdd863..297cdd7a9592b3610272ca18bc4f76652d14ff82 100644 (file)
@@ -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 );
-
                        }
                };
 
index e353cce8c81b988735c8f0abc501313a30d9008e..e6ab725825dcbee10982d5160dda88f10531d5ce 100644 (file)
@@ -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 };