implementation tizen_screenshooter 60/38460/1
authorBoram Park <boram1288.park@samsung.com>
Fri, 17 Apr 2015 09:05:00 +0000 (18:05 +0900)
committerBoram Park <boram1288.park@samsung.com>
Tue, 21 Apr 2015 05:54:48 +0000 (14:54 +0900)
Change-Id: I67f7b0afc47b2b875b70383f9b5bbf7b27f61a9a

src/modules/Makefile_wl_screenshot.mk
src/modules/wl_screenshot/e_mod_main.c
src/modules/wl_screenshot/e_tizen_screenshooter_server.c [new file with mode: 0644]
src/modules/wl_screenshot/e_tizen_screenshooter_server.h [new file with mode: 0644]
src/modules/wl_screenshot/e_tizen_screenshooter_server_protocol.c [new file with mode: 0644]
src/modules/wl_screenshot/e_tizen_screenshooter_server_protocol.h [new file with mode: 0644]

index 9be71cd032c8bfaf688a0312bfa35939423ffa26..063abd9386987a281332312aa2399958e5f27f26 100644 (file)
@@ -4,7 +4,12 @@ src/modules/wl_screenshot/e_screenshooter_client_protocol.h \
 src/modules/wl_screenshot/e_screenshooter_client_protocol.c \
 src/modules/wl_screenshot/e_screenshooter_server.h \
 src/modules/wl_screenshot/e_screenshooter_server.c \
-src/modules/wl_screenshot/e_screenshooter_server_protocol.h
+src/modules/wl_screenshot/e_screenshooter_server_protocol.h \
+src/modules/wl_screenshot/e_tizen_screenshooter_server.c \
+src/modules/wl_screenshot/e_tizen_screenshooter_server.h \
+src/modules/wl_screenshot/e_tizen_screenshooter_server_protocol.c \
+src/modules/wl_screenshot/e_tizen_screenshooter_server_protocol.h
+
 
 if USE_MODULE_WL_SCREENSHOT
 wl_screenshotdir = $(MDIR)/wl_screenshot
@@ -25,7 +30,11 @@ src_modules_wl_screenshot_module_la_SOURCES = src/modules/wl_screenshot/e_mod_ma
                             src/modules/wl_screenshot/e_screenshooter_client_protocol.c \
                             src/modules/wl_screenshot/e_screenshooter_server.h \
                             src/modules/wl_screenshot/e_screenshooter_server.c \
-                            src/modules/wl_screenshot/e_screenshooter_server_protocol.h
+                            src/modules/wl_screenshot/e_screenshooter_server_protocol.h \
+                            src/modules/wl_screenshot/e_tizen_screenshooter_server.c \
+                            src/modules/wl_screenshot/e_tizen_screenshooter_server.h \
+                            src/modules/wl_screenshot/e_tizen_screenshooter_server_protocol.c \
+                            src/modules/wl_screenshot/e_tizen_screenshooter_server_protocol.h
 
 PHONIES += wl_screenshot install-wl_screenshot
 wl_screenshot: $(wl_screenshotpkg_LTLIBRARIES) $(wl_screenshot_DATA)
index 9a92fbfd5b00aa98f98ba3535d7e81ec1aade3c5..4fa89243db139b8cc1bafec3d5f35cc657b2f32d 100644 (file)
@@ -4,6 +4,7 @@
 #include <sys/mman.h>
 #include "e_screenshooter_client_protocol.h"
 #include "e_screenshooter_server.h"
+#include "e_tizen_screenshooter_server.h"
 
 typedef struct _Instance Instance;
 struct _Instance
@@ -67,7 +68,11 @@ e_modapi_init(E_Module *m)
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, NULL);
    engine_name = ecore_evas_engine_name_get(e_comp->ee);
    if (!strncmp(engine_name, "drm", 3) || !strncmp(engine_name, "fb", 2))
-     return e_screenshooter_server_init(m);
+     {
+        e_screenshooter_server_init(m);
+        e_tizen_screenshooter_server_init(m);
+               return m;
+     }
 
    if (!ecore_wl_init(NULL)) return NULL;
 
diff --git a/src/modules/wl_screenshot/e_tizen_screenshooter_server.c b/src/modules/wl_screenshot/e_tizen_screenshooter_server.c
new file mode 100644 (file)
index 0000000..3ee7f3c
--- /dev/null
@@ -0,0 +1,398 @@
+#define E_COMP_WL
+#include "e.h"
+#include <wayland-server.h>
+#include <Ecore_Wayland.h>
+#include "e_tizen_screenshooter_server_protocol.h"
+#include "e_tizen_screenshooter_server.h"
+
+#define SW_DUMP_FPS     30
+#define SW_DUMP_TIMEOUT ((double)1/SW_DUMP_FPS)
+
+typedef struct _Mirror
+{
+   struct wl_resource *resource;
+   struct wl_resource *shooter;
+   struct wl_resource *output;
+
+   Eina_Bool started;
+
+   Ecore_Timer *sw_timer;
+
+   Eina_List *buffer_queue;
+} Mirror;
+
+typedef struct _Mirror_Buffer
+{
+   struct wl_resource *resource;
+
+   Mirror *mirror;
+
+   struct wl_shm_buffer *shm_buffer;
+   int32_t stride;
+   int32_t w, h;
+   uint32_t format;
+   void *data;
+   Eina_Bool in_use;
+
+   struct wl_signal destroy_signal;
+   struct wl_listener destroy_listener;
+} Mirror_Buffer;
+
+static void _e_tizen_screenmirror_buffer_dequeue(Mirror_Buffer *buffer);
+
+static void
+_e_tizen_screenmirror_center_rect (int src_w, int src_h, int dst_w, int dst_h, Eina_Rectangle *fit)
+{
+   float rw, rh;
+
+   if (src_w <= 0 || src_h <= 0 || dst_w <= 0 || dst_h <= 0 || !fit)
+     return;
+
+   rw = (float)src_w / dst_w;
+   rh = (float)src_h / dst_h;
+
+   if (rw > rh)
+     {
+        fit->w = dst_w;
+        fit->h = src_h * rw;
+        fit->x = 0;
+        fit->y = (dst_h - fit->h) / 2;
+     }
+   else if (rw < rh)
+     {
+        fit->w = src_w * rw;
+        fit->h = dst_h;
+        fit->x = (dst_w - fit->w) / 2;
+        fit->y = 0;
+     }
+   else
+     {
+        fit->w = dst_w;
+        fit->h = dst_h;
+        fit->x = 0;
+        fit->y = 0;
+     }
+}
+
+static void
+_e_tizen_screenmirror_sw_dump(Mirror_Buffer *buffer)
+{
+   Mirror *mirror = buffer->mirror;
+   E_Comp_Wl_Output *output = wl_resource_get_user_data(mirror->output);
+   Eina_Rectangle center = {0,};
+
+   _e_tizen_screenmirror_center_rect(output->w, output->h, buffer->w, buffer->h, &center);
+
+   printf ("@@@ %s(%d) %dx%d %dx%d d(%d,%d,%d,%d)\n", __FUNCTION__, __LINE__,
+           output->w, output->h, buffer->w, buffer->h,
+           center.x, center.y, center.w, center.h);
+
+   wl_shm_buffer_begin_access(buffer->shm_buffer);
+   evas_render_copy(e_comp->evas, buffer->data, buffer->stride,
+                    buffer->w, buffer->h, buffer->format,
+                    output->x, output->y, output->w, output->h,
+                    center.x, center.y, center.w, center.h);
+   wl_shm_buffer_end_access(buffer->shm_buffer);
+}
+
+static Eina_Bool
+_e_tizen_screenmirror_sw_do_dump(void *data)
+{
+   Mirror *mirror = data;
+   Mirror_Buffer *buffer;
+
+   buffer = eina_list_nth(mirror->buffer_queue, 0);
+   if (buffer)
+     {
+        _e_tizen_screenmirror_sw_dump(buffer);
+        _e_tizen_screenmirror_buffer_dequeue(buffer);
+     }
+
+   if (!eina_list_nth_list(mirror->buffer_queue, 0))
+     {
+        mirror->sw_timer = NULL;
+        return ECORE_CALLBACK_CANCEL;
+     }
+   else
+     return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool
+_e_tizen_screenmirror_buffer_queue(Mirror_Buffer *buffer)
+{
+   Mirror *mirror = buffer->mirror;
+
+   if (mirror->started && !mirror->sw_timer)
+     mirror->sw_timer = ecore_timer_add(SW_DUMP_TIMEOUT,
+                                        _e_tizen_screenmirror_sw_do_dump, mirror);
+
+   mirror->buffer_queue = eina_list_append(mirror->buffer_queue, buffer);
+
+   return EINA_TRUE;
+}
+
+static void
+_e_tizen_screenmirror_buffer_dequeue(Mirror_Buffer *buffer)
+{
+   Mirror *mirror = buffer->mirror;
+
+   if (!eina_list_data_find_list(mirror->buffer_queue, buffer))
+     return;
+
+   mirror->buffer_queue = eina_list_remove(mirror->buffer_queue, buffer);
+   tizen_screenmirror_send_dequeued(mirror->resource, buffer->resource);
+
+   if (!eina_list_nth_list(mirror->buffer_queue, 0))
+     if (mirror->sw_timer)
+       {
+          ecore_timer_del(mirror->sw_timer);
+          mirror->sw_timer = NULL;
+       }
+}
+
+static void
+_e_tizen_screenmirror_buffer_cb_destroy(struct wl_listener *listener, void *data)
+{
+   Mirror_Buffer *buffer = container_of(listener, Mirror_Buffer, destroy_listener);
+
+   /* first, inform to other */
+   wl_signal_emit(&buffer->destroy_signal, buffer);
+
+   if (buffer->in_use) printf("%s: buffer in use\n", __FUNCTION__);
+
+   /* then, dequeue and send dequeue event */
+   _e_tizen_screenmirror_buffer_dequeue(buffer);
+
+   free(buffer);
+}
+
+static Mirror_Buffer*
+_e_tizen_screenmirror_buffer_get(Mirror *mirror, struct wl_resource *resource)
+{
+   Mirror_Buffer *buffer = NULL;
+   struct wl_listener *listener;
+
+   listener = wl_resource_get_destroy_listener(resource, _e_tizen_screenmirror_buffer_cb_destroy);
+   if (listener)
+     return container_of(listener, Mirror_Buffer, destroy_listener);
+
+   if (!(buffer = E_NEW(Mirror_Buffer, 1))) return NULL;
+
+   buffer->mirror = mirror;
+   buffer->resource = resource;
+
+   buffer->shm_buffer = wl_shm_buffer_get(resource);
+   buffer->stride = wl_shm_buffer_get_stride(buffer->shm_buffer);
+   buffer->w = wl_shm_buffer_get_width(buffer->shm_buffer);
+   buffer->h = wl_shm_buffer_get_height(buffer->shm_buffer);
+   buffer->format = wl_shm_buffer_get_format(buffer->shm_buffer);
+   buffer->data = wl_shm_buffer_get_data(buffer->shm_buffer);
+
+   wl_signal_init(&buffer->destroy_signal);
+
+   buffer->destroy_listener.notify = _e_tizen_screenmirror_buffer_cb_destroy;
+   wl_resource_add_destroy_listener(resource, &buffer->destroy_listener);
+
+   return buffer;
+}
+
+static Mirror*
+_e_tizen_screenmirror_create(void)
+{
+   Mirror *mirror;
+
+   if (!(mirror = E_NEW(Mirror, 1))) return NULL;
+
+   return mirror;
+}
+
+static void
+_e_tizen_screenmirror_destroy(Mirror *mirror)
+{
+   Mirror_Buffer *buffer;
+
+   if (mirror->sw_timer) ecore_timer_del(mirror->sw_timer);
+
+   EINA_LIST_FREE(mirror->buffer_queue, buffer)
+     if (buffer) _e_tizen_screenmirror_buffer_dequeue(buffer);
+
+   free(mirror);
+}
+
+static void
+destroy_screenmirror(struct wl_resource *resource)
+{
+   Mirror *mirror = wl_resource_get_user_data(resource);
+
+   _e_tizen_screenmirror_destroy(mirror);
+}
+
+static void
+_e_tizen_screenmirror_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
+{
+   wl_resource_destroy(resource);
+}
+
+static void
+_e_tizen_screenmirror_cb_queue(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *buffer_resource)
+{
+   Mirror *mirror = wl_resource_get_user_data(resource);
+   Mirror_Buffer *buffer;
+
+   if (!wl_shm_buffer_get(buffer_resource))
+     {
+        wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
+                               "tizen_screenshooter failed: wrong buffer resource");
+        return;
+     }
+
+   buffer = _e_tizen_screenmirror_buffer_get(mirror, buffer_resource);
+   if (!buffer)
+     {
+        wl_resource_post_no_memory(resource);
+        return;
+     }
+
+   _e_tizen_screenmirror_buffer_queue(buffer);
+}
+
+static void
+_e_tizen_screenmirror_cb_dequeue(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *buffer_resource)
+{
+   Mirror *mirror = wl_resource_get_user_data(resource);
+   Mirror_Buffer *buffer;
+
+   if (!wl_shm_buffer_get(buffer_resource))
+     {
+        wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
+                               "tizen_screenshooter failed: wrong buffer resource");
+        return;
+     }
+
+   buffer = _e_tizen_screenmirror_buffer_get(mirror, buffer_resource);
+   if (!eina_list_data_find_list(mirror->buffer_queue, buffer))
+     return;
+
+   _e_tizen_screenmirror_buffer_dequeue(buffer);
+}
+
+static void
+_e_tizen_screenmirror_cb_start(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
+{
+   Mirror *mirror = wl_resource_get_user_data(resource);
+
+   if (mirror->started) return;
+
+   mirror->sw_timer = ecore_timer_add(SW_DUMP_TIMEOUT,
+                                      _e_tizen_screenmirror_sw_do_dump, mirror);
+   if (mirror->sw_timer)
+     tizen_screenmirror_send_content(resource, TIZEN_SCREENMIRROR_CONTENT_NORMAL);
+
+   mirror->started = EINA_TRUE;
+}
+
+static void
+_e_tizen_screenmirror_cb_stop(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
+{
+   Mirror *mirror = wl_resource_get_user_data(resource);
+
+   if (!mirror->started) return;
+
+   mirror->started = EINA_FALSE;
+
+   tizen_screenmirror_send_stop(resource);
+}
+
+static const struct tizen_screenmirror_interface _e_tizen_screenmirror_interface = {
+   _e_tizen_screenmirror_cb_destroy,
+   _e_tizen_screenmirror_cb_queue,
+   _e_tizen_screenmirror_cb_dequeue,
+   _e_tizen_screenmirror_cb_start,
+   _e_tizen_screenmirror_cb_stop
+};
+
+static void
+_e_tizen_screenshooter_get_screenmirror(struct wl_client *client,
+                                        struct wl_resource *resource,
+                                        uint32_t id,
+                                        struct wl_resource *output)
+{
+   int version = wl_resource_get_version(resource);
+   struct wl_resource *res;
+   Mirror *mirror;
+
+   mirror = _e_tizen_screenmirror_create();
+   if (!mirror)
+     {
+        wl_resource_post_no_memory(resource);
+        return;
+     }
+
+   res = wl_resource_create(client, &tizen_screenmirror_interface, version, id);
+   if (res == NULL)
+     {
+        _e_tizen_screenmirror_destroy(mirror);
+        wl_client_post_no_memory(client);
+        return;
+     }
+
+   mirror->resource = res;
+   mirror->shooter = resource;
+   mirror->output = output;
+
+   wl_resource_set_implementation(res, &_e_tizen_screenmirror_interface,
+                                  mirror, destroy_screenmirror);
+}
+
+static const struct tizen_screenshooter_interface _e_tizen_screenshooter_interface =
+{
+   _e_tizen_screenshooter_get_screenmirror
+};
+
+static void
+_e_tizen_screenshooter_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
+{
+   E_Comp_Data *cdata;
+   struct wl_resource *res;
+
+   if (!(cdata = data))
+     {
+        wl_client_post_no_memory(client);
+        return;
+     }
+
+   if (!(res = wl_resource_create(client, &tizen_screenshooter_interface, MIN(version, 1), id)))
+     {
+        ERR("Could not create tizen_screenshooter resource: %m");
+        wl_client_post_no_memory(client);
+        return;
+     }
+
+   wl_resource_set_implementation(res, &_e_tizen_screenshooter_interface, cdata, NULL);
+}
+
+void*
+e_tizen_screenshooter_server_init(E_Module *m)
+{
+   E_Comp_Data *cdata;
+
+   if (!e_comp) return EINA_FALSE;
+   if (!(cdata = e_comp->wl_comp_data)) return EINA_FALSE;
+   if (!cdata->wl.disp) return EINA_FALSE;
+
+   /* try to add tizen_screenshooter to wayland globals */
+   if (!wl_global_create(cdata->wl.disp, &tizen_screenshooter_interface, 1,
+                         cdata, _e_tizen_screenshooter_cb_bind))
+     {
+        ERR("Could not add tizen_screenshooter to wayland globals: %m");
+        return EINA_FALSE;
+     }
+
+   return m;
+}
+
+int
+e_tizen_screenshooter_server_shutdown(E_Module *m)
+{
+   return 1;
+}
diff --git a/src/modules/wl_screenshot/e_tizen_screenshooter_server.h b/src/modules/wl_screenshot/e_tizen_screenshooter_server.h
new file mode 100644 (file)
index 0000000..f7f7855
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef E_TIZEN_SCREENSHOOTER_SERVER_H
+#define E_TIZEN_SCREENSHOOTER_SERVER_H
+
+void* e_tizen_screenshooter_server_init(E_Module *m);
+int   e_tizen_screenshooter_server_shutdown(E_Module *m);
+
+#endif
diff --git a/src/modules/wl_screenshot/e_tizen_screenshooter_server_protocol.c b/src/modules/wl_screenshot/e_tizen_screenshooter_server_protocol.c
new file mode 100644 (file)
index 0000000..b51dd01
--- /dev/null
@@ -0,0 +1,46 @@
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface tizen_screenmirror_interface;
+extern const struct wl_interface wl_buffer_interface;
+extern const struct wl_interface wl_output_interface;
+
+static const struct wl_interface *types[] = {
+       NULL,
+       &tizen_screenmirror_interface,
+       &wl_output_interface,
+       &wl_buffer_interface,
+       &wl_buffer_interface,
+       &wl_buffer_interface,
+};
+
+static const struct wl_message tizen_screenshooter_requests[] = {
+       { "get_screenmirror", "no", types + 1 },
+};
+
+WL_EXPORT const struct wl_interface tizen_screenshooter_interface = {
+       "tizen_screenshooter", 1,
+       1, tizen_screenshooter_requests,
+       0, NULL,
+};
+
+static const struct wl_message tizen_screenmirror_requests[] = {
+       { "destroy", "", types + 0 },
+       { "queue", "o", types + 3 },
+       { "dequeue", "o", types + 4 },
+       { "start", "", types + 0 },
+       { "stop", "", types + 0 },
+};
+
+static const struct wl_message tizen_screenmirror_events[] = {
+       { "dequeued", "o", types + 5 },
+       { "content", "u", types + 0 },
+       { "stop", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface tizen_screenmirror_interface = {
+       "tizen_screenmirror", 1,
+       5, tizen_screenmirror_requests,
+       3, tizen_screenmirror_events,
+};
diff --git a/src/modules/wl_screenshot/e_tizen_screenshooter_server_protocol.h b/src/modules/wl_screenshot/e_tizen_screenshooter_server_protocol.h
new file mode 100644 (file)
index 0000000..1a2bfd2
--- /dev/null
@@ -0,0 +1,132 @@
+#ifndef TIZEN_SCREENSHOOTER_SERVER_PROTOCOL_H
+#define TIZEN_SCREENSHOOTER_SERVER_PROTOCOL_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+struct wl_client;
+struct wl_resource;
+
+struct tizen_screenshooter;
+struct tizen_screenmirror;
+
+extern const struct wl_interface tizen_screenshooter_interface;
+extern const struct wl_interface tizen_screenmirror_interface;
+
+/**
+ * tizen_screenshooter - interface for tizen-screenshooter
+ * @get_screenmirror: create a screenmirror object
+ *
+ * Clients can get a screenmirror object from this interface.
+ */
+struct tizen_screenshooter_interface {
+       /**
+        * get_screenmirror - create a screenmirror object
+        * @id: new screenmirror object
+        * @output: output object for screenmirror
+        *
+        * Before using screenmirror, a client should get a screenmirror
+        * object from display server.
+        */
+       void (*get_screenmirror)(struct wl_client *client,
+                                struct wl_resource *resource,
+                                uint32_t id,
+                                struct wl_resource *output);
+};
+
+
+#ifndef TIZEN_SCREENMIRROR_CONTENT_ENUM
+#define TIZEN_SCREENMIRROR_CONTENT_ENUM
+enum tizen_screenmirror_content {
+       TIZEN_SCREENMIRROR_CONTENT_NORMAL = 0,
+       TIZEN_SCREENMIRROR_CONTENT_VIDEO = 1,
+};
+#endif /* TIZEN_SCREENMIRROR_CONTENT_ENUM */
+
+/**
+ * tizen_screenmirror - interface for screenmirror
+ * @destroy: (none)
+ * @queue: queue a buffer
+ * @dequeue: dequeue a buffer
+ * @start: (none)
+ * @stop: (none)
+ *
+ * A client can use this interface to get stream images of screen. Before
+ * starting, queue all buffers. Then, start a screenmirror. After starting,
+ * a dequeued event will occur when drawing a captured image on a buffer is
+ * finished. You might need to queue the dequeued buffer again to get a new
+ * image from display server.
+ */
+struct tizen_screenmirror_interface {
+       /**
+        * destroy - (none)
+        */
+       void (*destroy)(struct wl_client *client,
+                       struct wl_resource *resource);
+       /**
+        * queue - queue a buffer
+        * @buffer: buffer object for screenmirror
+        *
+        *
+        */
+       void (*queue)(struct wl_client *client,
+                     struct wl_resource *resource,
+                     struct wl_resource *buffer);
+       /**
+        * dequeue - dequeue a buffer
+        * @buffer: buffer object for screenmirror
+        *
+        * A user can dequeue a buffer from display server when he wants
+        * to take back it from server.
+        */
+       void (*dequeue)(struct wl_client *client,
+                       struct wl_resource *resource,
+                       struct wl_resource *buffer);
+       /**
+        * start - (none)
+        */
+       void (*start)(struct wl_client *client,
+                     struct wl_resource *resource);
+       /**
+        * stop - (none)
+        */
+       void (*stop)(struct wl_client *client,
+                    struct wl_resource *resource);
+};
+
+#define TIZEN_SCREENMIRROR_DEQUEUED    0
+#define TIZEN_SCREENMIRROR_CONTENT     1
+#define TIZEN_SCREENMIRROR_STOP        2
+
+#define TIZEN_SCREENMIRROR_DEQUEUED_SINCE_VERSION      1
+#define TIZEN_SCREENMIRROR_CONTENT_SINCE_VERSION       1
+#define TIZEN_SCREENMIRROR_STOP_SINCE_VERSION  1
+
+static inline void
+tizen_screenmirror_send_dequeued(struct wl_resource *resource_, struct wl_resource *buffer)
+{
+       wl_resource_post_event(resource_, TIZEN_SCREENMIRROR_DEQUEUED, buffer);
+}
+
+static inline void
+tizen_screenmirror_send_content(struct wl_resource *resource_, uint32_t content)
+{
+       wl_resource_post_event(resource_, TIZEN_SCREENMIRROR_CONTENT, content);
+}
+
+static inline void
+tizen_screenmirror_send_stop(struct wl_resource *resource_)
+{
+       wl_resource_post_event(resource_, TIZEN_SCREENMIRROR_STOP);
+}
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif