static gboolean __mmplayer_mused_gst_callback(GstBus *bus, GstMessage *msg, gpointer data);
static GstBusSyncReply __mmplayer_mused_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data);
static int __mmplayer_mused_set_state(mm_player_t* player, int state);
-static void __evas_resize_cb (void *data, Evas *e, Evas_Object *eo, void *event_info);
-static void __evas_del_cb (void *data, Evas *e, Evas_Object *eo, void *event_info);
/*===========================================================================================
| |
return MM_ERROR_NONE;
}
-int mm_player_mused_set_evas_object_cb(MMHandleType player, Evas_Object * eo)
-{
- mm_player_t* handle = (mm_player_t*) player;
-
- MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
- MMPLAYER_RETURN_VAL_IF_FAIL(eo, MM_ERROR_INVALID_ARGUMENT);
-
- if(handle->have_evas_callback && handle->eo == eo) {
- LOGW("evas object had callback already %p", handle->eo);
- return MM_ERROR_INVALID_ARGUMENT;
- }
- handle->eo = eo;
-
- evas_object_event_callback_add (eo, EVAS_CALLBACK_RESIZE, __evas_resize_cb, handle);
- evas_object_event_callback_add (eo, EVAS_CALLBACK_DEL, __evas_del_cb, handle);
- LOGD("evas callback add %p", handle->eo);
- handle->have_evas_callback = TRUE;
-
- return MM_ERROR_NONE;
-}
-
-int mm_player_mused_unset_evas_object_cb(MMHandleType player)
-{
- mm_player_t* handle = (mm_player_t*) player;
-
- MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
- MMPLAYER_RETURN_VAL_IF_FAIL(handle->eo, MM_ERROR_INVALID_ARGUMENT);
-
- evas_object_event_callback_del (handle->eo, EVAS_CALLBACK_RESIZE, __evas_resize_cb);
- evas_object_event_callback_del (handle->eo, EVAS_CALLBACK_DEL, __evas_del_cb);
- LOGD("evas callback del %p", handle->eo);
- handle->eo = NULL;
- handle->have_evas_callback = FALSE;
-
- return MM_ERROR_NONE;
-}
-
-static void __evas_resize_cb (void *data, Evas *e, Evas_Object *eo, void *event_info)
-{
- MMHandleType handle = data;
-
- int wl_window_x = 0;
- int wl_window_y = 0;
- int wl_window_width = 0;
- int wl_window_height = 0;
-
- evas_object_geometry_get(eo, &wl_window_x, &wl_window_y, &wl_window_width, &wl_window_height);
- LOGI("get window rectangle: x(%d) y(%d) width(%d) height(%d)", wl_window_x, wl_window_y, wl_window_width, wl_window_height);
-
-
- int ret = mm_player_set_attribute(handle, NULL,
- "wl_window_render_x", wl_window_x,
- "wl_window_render_y", wl_window_y,
- "wl_window_render_width", wl_window_width,
- "wl_window_render_height", wl_window_height,
- (char *)NULL);
- if (ret != MM_ERROR_NONE)
- LOGE("resizing is failed");
-}
-
-
-static void __evas_del_cb (void *data, Evas *e, Evas_Object *eo, void *event_info)
-{
- mm_player_t* handle = (mm_player_t*) data;
-
- evas_object_event_callback_del (eo, EVAS_CALLBACK_RESIZE, __evas_resize_cb);
- evas_object_event_callback_del (eo, EVAS_CALLBACK_DEL, __evas_del_cb);
-
- LOGD("evas callback del %p", eo);
- handle->have_evas_callback = FALSE;
-}
-
case MM_DISPLAY_SURFACE_OVERLAY:
{
/* ximagesink or xvimagesink */
- void *surface = NULL;
+ void *handle = NULL;
int display_method = 0;
int roi_x = 0;
int roi_y = 0;
#ifdef HAVE_WAYLAND
/*set wl_display*/
- void* wl_display = NULL;
- GstContext *context = NULL;
int wl_window_x = 0;
int wl_window_y = 0;
int wl_window_width = 0;
int wl_window_height = 0;
- mm_attrs_get_data_by_name(attrs, "wl_display", &wl_display);
- if (wl_display)
- context = gst_wayland_display_handle_context_new(wl_display);
- if (context)
- gst_element_set_context(GST_ELEMENT(player->pipeline->videobin[MMPLAYER_V_SINK].gst), context);
-
/*It should be set after setting window*/
mm_attrs_get_int_by_name(attrs, "wl_window_render_x", &wl_window_x);
mm_attrs_get_int_by_name(attrs, "wl_window_render_y", &wl_window_y);
mm_attrs_get_int_by_name(attrs, "wl_window_render_height", &wl_window_height);
#endif
/* common case if using x surface */
- mm_attrs_get_data_by_name(attrs, "display_overlay", &surface);
- if ( surface )
+ mm_attrs_get_data_by_name(attrs, "display_overlay", &handle);
+ if ( handle )
{
#ifdef HAVE_WAYLAND
- guintptr wl_surface = (guintptr)surface;
- LOGD("set video param : wayland surface %p", surface);
+ unsigned int parent_id = 0;
+ parent_id = *(int*)handle;
+ LOGD("set video param : parent_id %d %p",parent_id, *(int*)handle);
gst_video_overlay_set_window_handle(
GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ),
- wl_surface );
+ *(int*)handle );
/* After setting window handle, set render rectangle */
gst_video_overlay_set_render_rectangle(
GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ),
wl_window_x,wl_window_y,wl_window_width,wl_window_height);
#else // HAVE_X11
int xwin_id = 0;
- xwin_id = *(int*)surface;
- LOGD("set video param : xid %p", *(int*)surface);
+ xwin_id = *(int*)handle;
+ LOGD("set video param : xid %p", *(int*)handle);
if (xwin_id)
{
- gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ), *(int*)surface );
+ gst_video_overlay_set_window_handle( GST_VIDEO_OVERLAY( player->pipeline->videobin[MMPLAYER_V_SINK].gst ), *(int*)handle );
}
#endif
}
/* do nothing */
}
break;
- case MM_DISPLAY_SURFACE_REMOTE:
- {
- /* do nothing */
- }
- break;
}
MMPLAYER_FLEAVE();
else
goto ERROR;
break;
- case MM_DISPLAY_SURFACE_REMOTE:
- if (strlen(player->ini.videosink_element_remote) > 0)
- videosink_element = player->ini.videosink_element_remote;
- else
- goto ERROR;
- break;
default:
LOGE("unidentified surface type");
goto ERROR;
}
break;
}
- case MM_DISPLAY_SURFACE_REMOTE:
- {
- char *stream_path = NULL;
- /* video_zc is the result of check ST12/SN12 */
- bool use_tbm = player->set_mode.video_zc;
- int attr_ret = mm_attrs_get_string_by_name (
- attrs, "shm_stream_path", &stream_path );
- if(attr_ret == MM_ERROR_NONE && stream_path) {
- g_object_set(G_OBJECT(player->pipeline->videobin[MMPLAYER_V_SINK].gst),
- "socket-path", stream_path,
- "wait-for-connection", FALSE,
- "sync", TRUE,
- "perms", 0777,
- "use-tbm", use_tbm,
- NULL);
- LOGD("set path \"%s\" for shmsink", stream_path);
- } else {
- LOGE("Not set attribute of shm_stream_path");
- goto ERROR;
- }
- break;
- }
default:
break;
}
mm_attrs_set_int_by_name(attrs, "content_video_found", TRUE);
- if(surface_type == MM_DISPLAY_SURFACE_REMOTE &&
- MMPLAYER_IS_HTTP_PD(player) )
- {
- MMMessageParamType msg = {0, };
- msg.data = gst_caps_to_string(caps);
- MMPLAYER_POST_MSG ( player, MM_MESSAGE_VIDEO_BIN_CREATED, &msg );
- }
-
MMPLAYER_FLEAVE();
return MM_ERROR_NONE;
case MM_DISPLAY_SURFACE_EVAS:
case MM_DISPLAY_SURFACE_GL:
case MM_DISPLAY_SURFACE_NULL:
- case MM_DISPLAY_SURFACE_REMOTE:
if (__mmplayer_gst_create_plain_text_elements(player) != MM_ERROR_NONE)
{
LOGE("failed to make plain text elements\n");