From: Sangchul Lee Date: Tue, 22 Jun 2021 09:25:29 +0000 (+0900) Subject: webrtc_test: Revise layout for rendering surfaces X-Git-Tag: submit/tizen/20210729.023123~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af4f7ec83023e8ddfc80d16b74bf3883a7c44f6c;p=platform%2Fcore%2Fapi%2Fwebrtc.git webrtc_test: Revise layout for rendering surfaces It is limited to evas surface type. [Version] 0.2.20 [Issue Type] Improvement Change-Id: I5e8ce24ba096897dd144727614da8093c29eea8a Signed-off-by: Sangchul Lee --- diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index f0fbf8f2..35e09dab 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -1,6 +1,6 @@ Name: capi-media-webrtc Summary: A WebRTC library in Tizen Native API -Version: 0.2.19 +Version: 0.2.20 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/test/webrtc_test.c b/test/webrtc_test.c index f7a287bf..32fa3f8f 100644 --- a/test/webrtc_test.c +++ b/test/webrtc_test.c @@ -44,7 +44,7 @@ #define MAX_STRING_LEN 512 #define MAX_CHANNEL_LEN 10 -#define MAX_CONNECTION_LEN 4 +#define MAX_CONNECTION_LEN 3 #define MAX_MEDIA_PACKET_SOURCE_LEN 4 #define MAX_EXPECTED_SIZE 1024 * 1024 * 1024 @@ -117,10 +117,12 @@ static const char* g_webrtc_transceiver_direction_str[] = { /* for video display */ static Evas_Object *g_win_id; +static Evas_Object *g_eo_mine; typedef struct { Evas_Object *win; - Evas_Object *layout_main; + int win_width; + int win_height; } appdata_s; typedef struct { @@ -199,11 +201,9 @@ static void win_del(void *data, Evas_Object *obj, void *event) elm_exit(); } -static Evas_Object *create_win(const char *name) +static Evas_Object *create_win(const char *name, int *w, int *h) { Evas_Object *eo = NULL; - int w = 0; - int h = 0; g_print("[%s][%d] name=%s\n", __func__, __LINE__, name); @@ -212,9 +212,9 @@ static Evas_Object *create_win(const char *name) elm_win_title_set(eo, name); elm_win_borderless_set(eo, EINA_TRUE); evas_object_smart_callback_add(eo, "delete,request", win_del, NULL); - elm_win_screen_size_get(eo, NULL, NULL, &w, &h); - g_print("window size: %d x %d\n", w, h); - evas_object_resize(eo, w, h); + elm_win_screen_size_get(eo, NULL, NULL, w, h); + g_print("window size: %d x %d\n", *w, *h); + evas_object_resize(eo, *w, *h); elm_win_autodel_set(eo, EINA_TRUE); elm_win_alpha_set(eo, EINA_TRUE); } @@ -264,33 +264,37 @@ void create_render_rect_and_bg(Evas_Object *win) evas_object_show(win); } -#define EO_ONE_SIDE_LEN 512 -#define PADDING_HIGHT 480 - static int app_create(void *data) { appdata_s *ad = data; Evas_Object *win = NULL; int i; + Evas_Object **eo; /* use gl backend */ elm_config_accel_preference_set("opengl"); /* create window */ - win = create_win(PACKAGE); + win = create_win(PACKAGE, &ad->win_width, &ad->win_height); if (win == NULL) return -1; ad->win = win; g_win_id = win; create_render_rect_and_bg(ad->win); - /* Create evas image object for EVAS surface */ - for (i = 0; i < MAX_CONNECTION_LEN; i++) { - g_conns[i].eo = create_image_object(ad->win); - evas_object_image_size_set(g_conns[i].eo, EO_ONE_SIDE_LEN, EO_ONE_SIDE_LEN); - evas_object_image_fill_set(g_conns[i].eo, 0, 0, EO_ONE_SIDE_LEN, EO_ONE_SIDE_LEN); - evas_object_resize(g_conns[i].eo, EO_ONE_SIDE_LEN, EO_ONE_SIDE_LEN); - evas_object_move(g_conns[i].eo, (i % 2) * EO_ONE_SIDE_LEN, ((i / 2) * EO_ONE_SIDE_LEN) + PADDING_HIGHT); + /* Create evas image object for EVAS surface. + * _________________________________________ * + * | eo (mine) | eo (remote0) | * + * |____________________|____________________| * + * | eo (remote1) | eo (remote2) | * + * |____________________|____________________| */ + for (i = 0; i < MAX_CONNECTION_LEN + 1; i++) { + eo = (i == 0) ? &g_eo_mine : &g_conns[i - 1].eo; + *eo = create_image_object(ad->win); + evas_object_image_size_set(*eo, ad->win_width / 2, ad->win_height / 2); + evas_object_image_fill_set(*eo, 0, 0, ad->win_width / 2, ad->win_height / 2); + evas_object_resize(*eo, ad->win_width / 2, ad->win_height / 2); + evas_object_move(*eo, (i % 2) * (ad->win_width / 2), (i / 2) * (ad->win_height / 2)); } elm_win_activate(win); evas_object_show(win);