Add tizen remote surface buffer changed callback 11/110511/1
authorHyunho Kang <hhstark.kang@samsung.com>
Tue, 17 Jan 2017 01:00:29 +0000 (10:00 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Tue, 17 Jan 2017 01:05:43 +0000 (10:05 +0900)
tizen remote surface version up to 3.

Change-Id: I1e4b5fab125903ac7b63c8a1a97314accb576380
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
screen_connector_watcher/src/screen_connector_watcher.c
screen_connector_watcher_evas/src/screen_connector_watcher_evas.c

index c1bcfb1..9077d76 100644 (file)
@@ -71,7 +71,6 @@ static void __buffer_missing(void *data, struct tizen_remote_surface *trs)
                watcher_h->missing_cb(trs, watcher_h->data);
 }
 
-#if 0
 static void __buffer_changed(void *data, struct tizen_remote_surface *trs, uint32_t type, struct wl_buffer *tbm,
                int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys)
 {
@@ -86,12 +85,6 @@ static const struct tizen_remote_surface_listener __rs_listener = {
        __buffer_missing,
        __buffer_changed,
 };
-#else
-static const struct tizen_remote_surface_listener __rs_listener = {
-       __buffer_updated,
-       __buffer_missing,
-};
-#endif
 
 static void __app_removed(const char *appid, const int pid, void *data)
 {
index 4cb233e..a690fff 100644 (file)
@@ -357,7 +357,7 @@ static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type,
        }
 
        /* check type of given buffer */
-       if (type == 0) {
+       if (type == TIZEN_REMOTE_SURFACE_BUFFER_TYPE_TBM) {
                /* get tbm surface from buffer */
                tbm_surface = wl_buffer_get_user_data(tbm);
                width = tbm_surface_get_width(tbm_surface);
@@ -372,7 +372,7 @@ static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type,
                evas_object_image_size_set(watcher_evas_h->img_tbm, width, height);
                evas_object_image_native_surface_set(watcher_evas_h->img_tbm, &ns); /* set native surface */
                evas_object_image_pixels_dirty_set(watcher_evas_h->img_tbm, EINA_TRUE); /* set dirty for image updating */
-       } else if (type == 1) {
+       } else if (type == TIZEN_REMOTE_SURFACE_BUFFER_TYPE_IMAGE_FILE) {
                if (!watcher_evas_h->img_file)
                        watcher_evas_h->img_file = evas_object_image_filled_add(evas_object_evas_get(__viewer_win));
 
@@ -406,7 +406,7 @@ static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type,
 
 static void __watcher_update_cb(struct tizen_remote_surface *trs, struct wl_buffer *buffer, uint32_t time, void *data)
 {
-       __watcher_change_cb(trs, 0, buffer, 0, 0, 0, NULL, data);
+       __watcher_change_cb(trs, TIZEN_REMOTE_SURFACE_BUFFER_TYPE_TBM, buffer, 0, 0, 0, NULL, data);
 }
 
 static void __free_watcher_evas_h(screen_connector_watcher_evas_h watcher_evas_h)