From: giwoong.kim Date: Fri, 12 Apr 2013 09:35:14 +0000 (+0900) Subject: communication: added DRAW_FRAME protocol X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1011 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b24bf17edcfce11f6cfab2843f9568a0b252509;p=sdk%2Femulator%2Fqemu.git communication: added DRAW_FRAME protocol added DRAW_FRAME protocol Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java index 129711db65..725826d05d 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java @@ -1,7 +1,7 @@ /** * * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: * GiWoong Kim @@ -208,25 +208,26 @@ public interface ICommunicator extends Runnable { public enum SendCommand { /* This values must match the QEMU definitions */ - SEND_START( (short)1 ), - - SEND_MOUSE_EVENT( (short)10 ), - SEND_KEY_EVENT( (short)11 ), - SEND_HARD_KEY_EVENT( (short)12 ), - CHANGE_LCD_STATE( (short)13 ), - OPEN_SHELL( (short)14 ), - HOST_KBD( (short)15 ), - SCREEN_SHOT( (short)16 ), - DETAIL_INFO( (short)17 ), - RAM_DUMP( (short)18 ), - GUEST_DUMP( (short)19 ), - - RESPONSE_HEART_BEAT( (short)900 ), - CLOSE( (short)998 ), - RESPONSE_SHUTDOWN( (short)999 ); - + SEND_START((short) 1), + + SEND_MOUSE_EVENT((short) 10), + SEND_KEY_EVENT((short) 11), + SEND_HARD_KEY_EVENT((short) 12), + CHANGE_LCD_STATE((short) 13), + OPEN_SHELL((short) 14), + HOST_KBD((short) 15), + SCREEN_SHOT((short) 16), + DETAIL_INFO((short) 17), + RAM_DUMP((short) 18), + GUEST_DUMP((short) 19), + + RESPONSE_HEART_BEAT((short) 900), + RESPONSE_DRAW_FRAMEBUFFER((short) 901), + CLOSE((short) 998), + RESPONSE_SHUTDOWN((short) 999); + private short value; - SendCommand( short value ) { + SendCommand(short value) { this.value = value; } @@ -234,24 +235,24 @@ public interface ICommunicator extends Runnable { return this.value; } - public static SendCommand getValue( String val ) { + public static SendCommand getValue(String val) { SendCommand[] values = SendCommand.values(); for (int i = 0; i < values.length; i++) { - if( values[i].value == Short.parseShort( val ) ) { + if (values[i].value == Short.parseShort(val)) { return values[i]; } } - throw new IllegalArgumentException( val ); + throw new IllegalArgumentException(val); } - public static SendCommand getValue( short val ) { + public static SendCommand getValue(short val) { SendCommand[] values = SendCommand.values(); for (int i = 0; i < values.length; i++) { - if( values[i].value == val ) { + if (values[i].value == val) { return values[i]; } } - throw new IllegalArgumentException( Integer.toString(val) ); + throw new IllegalArgumentException(Integer.toString(val)); } } @@ -265,6 +266,7 @@ public interface ICommunicator extends Runnable { BOOTING_PROGRESS((short) 5), BRIGHTNESS_VALUE((short) 6), SENSOR_DAEMON_START((short) 800), + DRAW_FRAME((short) 900), SHUTDOWN((short) 999); private short value; @@ -276,24 +278,24 @@ public interface ICommunicator extends Runnable { return this.value; } - public static ReceiveCommand getValue( String val ) { + public static ReceiveCommand getValue(String val) { ReceiveCommand[] values = ReceiveCommand.values(); for (int i = 0; i < values.length; i++) { - if( values[i].value == Short.parseShort( val ) ) { + if (values[i].value == Short.parseShort(val)) { return values[i]; } } - throw new IllegalArgumentException( val ); + throw new IllegalArgumentException(val); } - public static ReceiveCommand getValue( short val ) { + public static ReceiveCommand getValue(short val) { ReceiveCommand[] values = ReceiveCommand.values(); for (int i = 0; i < values.length; i++) { - if( values[i].value == val ) { + if (values[i].value == val) { return values[i]; } } - throw new IllegalArgumentException( Integer.toString(val) ); + throw new IllegalArgumentException(Integer.toString(val)); } } diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java index 3caace2b34..0b5fc0aea7 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java @@ -387,10 +387,19 @@ public class SocketCommunicator implements ICommunicator { } break; } + case DRAW_FRAME: { + logger.info("received DRAW_FRAME from QEMU."); + + //TODO: + + break; + } case SHUTDOWN: { logger.info("received RESPONSE_SHUTDOWN from QEMU."); + sendToQEMU(SendCommand.RESPONSE_SHUTDOWN, null, false); terminate(); + break; } default: { diff --git a/tizen/src/skin/maruskin_server.c b/tizen/src/skin/maruskin_server.c index 4c76bbc757..106bcd1acf 100644 --- a/tizen/src/skin/maruskin_server.c +++ b/tizen/src/skin/maruskin_server.c @@ -1,7 +1,7 @@ /* * socket server for emulator skin * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: * GiWoong Kim @@ -110,6 +110,7 @@ enum { RECV_RAM_DUMP = 18, RECV_GUESTMEMORY_DUMP = 19, RECV_RESPONSE_HEART_BEAT = 900, + RECV_RESPONSE_DRAW_FRAME = 901, RECV_CLOSE = 998, RECV_RESPONSE_SHUTDOWN = 999, }; @@ -125,6 +126,7 @@ enum { SEND_BOOTING_PROGRESS = 5, SEND_BRIGHTNESS_VALUE = 6, SEND_SENSOR_DAEMON_START = 800, + SEND_DRAW_FRAME = 900, SEND_SHUTDOWN = 999, }; @@ -181,7 +183,7 @@ int start_skin_server(int argc, char** argv, parse_skinconfig_prop(); - // arguments have higher priority than '.skinconfig.properties' + /* arguments have higher priority than '.skinconfig.properties' */ parse_skin_args(); INFO("ignore_heartbeat:%d\n", ignore_heartbeat); @@ -191,8 +193,8 @@ int start_skin_server(int argc, char** argv, QemuThread qemu_thread; - qemu_thread_create( &qemu_thread, run_skin_server, NULL, - QEMU_THREAD_JOINABLE); + qemu_thread_create(&qemu_thread, run_skin_server, + NULL, QEMU_THREAD_JOINABLE); return 1; @@ -273,6 +275,23 @@ void shutdown_skin_server(void) pthread_mutex_destroy(&mutex_recv_heartbeat_count); } +void notify_draw_frame(void) +{ +#if 0 + INFO("notify_draw_frame\n"); +#endif + + if (client_sock) { + if (0 > send_skin_header_only( + client_sock, SEND_DRAW_FRAME, 1)) { + + ERR("fail to send SEND_DRAW_FRAME to skin.\n"); + } + } else { + INFO("skin client socket is not connected yet\n"); + } +} + void notify_sensor_daemon_start(void) { INFO("notify_sensor_daemon_start\n"); @@ -957,7 +976,15 @@ static void* run_skin_server(void* args) onoff_host_kbd(on); break; } + case RECV_RESPONSE_DRAW_FRAME: { + //TODO: + log_cnt += sprintf(log_buf + log_cnt, "RECV_RESPONSE_DRAW_FRAME ==\n"); +#if 0 + TRACE(log_buf); +#endif + break; + } case RECV_CLOSE: { log_cnt += sprintf(log_buf + log_cnt, "RECV_CLOSE ==\n"); TRACE(log_buf); diff --git a/tizen/src/skin/maruskin_server.h b/tizen/src/skin/maruskin_server.h index 59207972bb..6ad2986e72 100644 --- a/tizen/src/skin/maruskin_server.h +++ b/tizen/src/skin/maruskin_server.h @@ -1,7 +1,7 @@ /* * socket server for emulator skin * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: * GiWoong Kim @@ -35,6 +35,7 @@ int start_skin_server(int argc, char** argv, int qemu_argc, char** qemu_argv); void shutdown_skin_server(void); +void notify_draw_frame(void); void notify_sensor_daemon_start(void); void notify_ramdump_completed(void); void notify_booting_progress(int progress_value);