RET_VAL_IF(ret != MM_ERROR_NONE, WEBRTC_ERROR_INVALID_OPERATION, "failed to mm_display_interface_set_display_mainloop_sync()");
/* FIXE: get mode and rotation value from handle */
- ret = mm_display_interface_evas_set_mode(display->mm_display, 0); /* 0: letter box, 1: origin size, 2: full screen */
+ ret = mm_display_interface_evas_set_mode(display->mm_display, (int)display->mode); /* 0: letter box, 1: origin size, 2: full screen */
RET_VAL_IF(ret != MM_ERROR_NONE, WEBRTC_ERROR_INVALID_OPERATION, "failed to mm_display_interface_evas_set_mode()");
ret = mm_display_interface_evas_set_rotation(display->mm_display, 0); /* 0: not rotate, 1: 90 degree, 2, 180 degree, 3, 270 degree */
RET_VAL_IF(ret != MM_ERROR_NONE, WEBRTC_ERROR_INVALID_OPERATION, "failed to mm_display_interface_evas_set_rotation()");
- ret = mm_display_interface_evas_set_visible(display->mm_display, true);
+ ret = mm_display_interface_evas_set_visible(display->mm_display, display->visible);
RET_VAL_IF(ret != MM_ERROR_NONE, WEBRTC_ERROR_INVALID_OPERATION, "failed to mm_display_interface_evas_set_visible()");
- display->mode = WEBRTC_DISPLAY_MODE_LETTER_BOX;
- display->visible = true;
-
LOG_INFO("surface[%p], mode[%u], visible[%u]", display->surface, display->mode, display->visible);
return WEBRTC_ERROR_NONE;
else
LOG_DEBUG("init mm_display[%p]", display->mm_display);
- LOG_DEBUG("alloc display[%p]", display);
+ display->mode = WEBRTC_DISPLAY_MODE_LETTER_BOX;
+ display->visible = true;
+
+ LOG_DEBUG("alloc display[%p, mode:%u, visible:%u]", display, display->mode, display->visible);
return display;
}
case WEBRTC_DISPLAY_TYPE_OVERLAY:
case WEBRTC_DISPLAY_TYPE_ECORE_WL:
LOG_INFO("it's %s type, mode[%d]", display->type == WEBRTC_DISPLAY_TYPE_OVERLAY ? "OVERLAY" : "ECORE_WL", mode);
- RET_VAL_IF(display->sink_element == NULL, WEBRTC_ERROR_INVALID_OPERATION, "sink_element is NULL");
- RET_VAL_IF(!g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(display->sink_element)), "display-geometry-method"),
- WEBRTC_ERROR_INVALID_OPERATION, "could not find 'display-geometry-method'");
-
- g_object_set(G_OBJECT(display->sink_element), "display-geometry-method", (gint)mode, NULL);
+ if (display->sink_element) {
+ RET_VAL_IF(!g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(display->sink_element)), "display-geometry-method"),
+ WEBRTC_ERROR_INVALID_OPERATION, "could not find 'display-geometry-method' property");
+ g_object_set(G_OBJECT(display->sink_element), "display-geometry-method", (gint)mode, NULL);
+ }
display->mode = mode;
break;
case WEBRTC_DISPLAY_TYPE_OVERLAY:
case WEBRTC_DISPLAY_TYPE_ECORE_WL:
LOG_INFO("it's %s type, visible[%u]", display->type == WEBRTC_DISPLAY_TYPE_OVERLAY ? "OVERLAY" : "ECORE_WL", visible);
- RET_VAL_IF(display->sink_element == NULL, WEBRTC_ERROR_INVALID_OPERATION, "sink_element is NULL");
- RET_VAL_IF(!g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(display->sink_element)), "visible"),
- WEBRTC_ERROR_INVALID_OPERATION, "could not find 'visible'");
-
- g_object_set(G_OBJECT(display->sink_element), "visible", (gboolean)visible, NULL);
+ if (display->sink_element) {
+ RET_VAL_IF(!g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(display->sink_element)), "visible"),
+ WEBRTC_ERROR_INVALID_OPERATION, "could not find 'visible' property");
+ g_object_set(G_OBJECT(display->sink_element), "visible", (gboolean)visible, NULL);
+ }
display->visible = visible;
break;
if (sink->display->type == WEBRTC_DISPLAY_TYPE_OVERLAY ||
sink->display->type == WEBRTC_DISPLAY_TYPE_ECORE_WL) {
gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(videosink), sink->display->overlay_surface_id);
+ RET_VAL_IF(!g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(videosink)), "display-geometry-method"),
+ WEBRTC_ERROR_INVALID_OPERATION, "could not find 'display-geometry-method' property");
+ RET_VAL_IF(!g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(videosink)), "visible"),
+ WEBRTC_ERROR_INVALID_OPERATION, "could not find 'visible' property");
g_object_set(G_OBJECT(videosink),
- "display-geometry-method", (gint)0, /* 0: letter box, 1: origin size, 2: full screen */
- "visible", TRUE,
+ "display-geometry-method", (gint)sink->display->mode, /* 0: letter box, 1: origin size, 2: full screen */
+ "visible", (gboolean)sink->display->visible,
NULL);
- sink->display->mode = WEBRTC_DISPLAY_MODE_LETTER_BOX;
- sink->display->visible = true;
} else if (sink->display->type == WEBRTC_DISPLAY_TYPE_EVAS) {
g_object_set(G_OBJECT(videosink),
if (source->display->type == WEBRTC_DISPLAY_TYPE_OVERLAY ||
source->display->type == WEBRTC_DISPLAY_TYPE_ECORE_WL) {
gst_video_overlay_set_wl_window_wl_surface_id(GST_VIDEO_OVERLAY(videosink), source->display->overlay_surface_id);
+ RET_VAL_IF(!g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(videosink)), "display-geometry-method"),
+ WEBRTC_ERROR_INVALID_OPERATION, "could not find 'display-geometry-method' property");
+ RET_VAL_IF(!g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(videosink)), "visible"),
+ WEBRTC_ERROR_INVALID_OPERATION, "could not find 'visible' property");
g_object_set(G_OBJECT(videosink),
- "display-geometry-method", (gint)0, /* 0: letter box, 1: origin size, 2: full screen */
- "visible", TRUE,
+ "display-geometry-method", (gint)source->display->mode, /* 0: letter box, 1: origin size, 2: full screen */
+ "visible", (gboolean)source->display->visible,
NULL);
- source->display->mode = WEBRTC_DISPLAY_MODE_LETTER_BOX;
- source->display->visible = true;
- source->display->sink_element = videosink;
} else if (source->display->type == WEBRTC_DISPLAY_TYPE_EVAS) {
g_object_set(videosink, "signal-handoffs", TRUE, NULL);
return WEBRTC_ERROR_INVALID_OPERATION;
}
+ source->display->sink_element = videosink;
+
return WEBRTC_ERROR_NONE;
}