#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
/* 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 {
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);
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);
}
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);