MMPLAYER_ATTRS_DISPLAY_WIN_ROI_WIDTH, /* 40 */
MMPLAYER_ATTRS_DISPLAY_WIN_ROI_HEIGHT,
MMPLAYER_ATTRS_DISPLAY_SURFACE_TYPE,
+ MMPLAYER_ATTRS_DISPLAY_EXPORTED_SHELL_HANDLE,
MMPLAYER_ATTRS_SOUND_STREAM_TYPE,
MMPLAYER_ATTRS_SOUND_STREAM_INDEX,
MMPLAYER_ATTRS_SOUND_LATENCY_MODE,
MMPLAYER_ATTRS_PCM_EXTRACTION_SAMPLERATE,
MMPLAYER_ATTRS_PCM_EXTRACTION_CHANNELS,
MMPLAYER_ATTRS_ACCURATE_SEEK,
- MMPLAYER_ATTRS_PCM_EXTRACTION_FORMAT,
- MMPLAYER_ATTRS_DRC_MODE, /* 50 */
+ MMPLAYER_ATTRS_PCM_EXTRACTION_FORMAT, /* 50 */
+ MMPLAYER_ATTRS_DRC_MODE,
MMPLAYER_ATTRS_GAPLESS_MODE,
MMPLAYER_ATTRS_ENABLE_VIDEO_DECODED_CB,
MMPLAYER_ATTRS_VIDEO_CODEC_TYPE,
MMPLAYER_ATTRS_VIDEO_BUFFER_EXTRA_SIZE,
MMPLAYER_ATTRS_PREBUFFER_MS,
MMPLAYER_ATTRS_REBUFFER_MS,
- MMPLAYER_ATTRS_PITCH_CONTROL,
- MMPLAYER_ATTRS_PITCH_VALUE, /* 60 */
+ MMPLAYER_ATTRS_PITCH_CONTROL, /* 60 */
+ MMPLAYER_ATTRS_PITCH_VALUE,
MMPLAYER_ATTRS_AUDIO_OFFLOAD,
MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT,
MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT,
mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &surface_type);
LOGD("display_surface_type (%d)", surface_type);
- if ((surface_type == MM_DISPLAY_SURFACE_OVERLAY) &&
+ if ((surface_type == MM_DISPLAY_SURFACE_OVERLAY || surface_type == MM_DISPLAY_SURFACE_OVERLAY_SYNC_UI) &&
(_mmplayer_acquire_hw_resource(player, MMPLAYER_RESOURCE_TYPE_VIDEO_OVERLAY) != MM_ERROR_NONE)) {
LOGE("failed to acquire video overlay resource");
goto ERROR;
MMPLAYER_FENTER();
/* check video sinkbin is created */
- if (!_mmplayer_is_videosink_ready(player, MM_DISPLAY_SURFACE_OVERLAY))
+ if (!(_mmplayer_is_videosink_ready(player, MM_DISPLAY_SURFACE_OVERLAY) ||
+ _mmplayer_is_videosink_ready(player, MM_DISPLAY_SURFACE_OVERLAY_SYNC_UI)))
return;
attrs = MMPLAYER_GET_ATTRS(player);
win_roi_x, win_roi_y, win_roi_width, win_roi_height);
}
+static void __mmplayer_video_param_set_display_overlay_sync_ui(mmplayer_t *player)
+{
+ MMHandleType attrs = 0;
+ gchar *handle = NULL;
+
+ /* check video sinkbin is created */
+ if (!_mmplayer_is_videosink_ready(player, MM_DISPLAY_SURFACE_OVERLAY_SYNC_UI))
+ return;
+
+ attrs = MMPLAYER_GET_ATTRS(player);
+ MMPLAYER_RETURN_IF_FAIL(attrs);
+
+ /* common case if using overlay surface */
+ mm_attrs_get_string_by_name(attrs, "exported_shell_handle", &handle);
+ MMPLAYER_RETURN_IF_FAIL(handle);
+ g_object_set(player->pipeline->videobin[MMPLAYER_V_SINK].gst, "exported-shell-handle", handle, NULL);
+ LOGD("set video param: exported_shell_handle (%s)", handle);
+}
+
static void __mmplayer_video_param_set_display_overlay(mmplayer_t *player)
{
MMHandleType attrs = 0;
_mmplayer_update_video_overlay_param(mmplayer_t *player, const char *param_name)
{
gboolean update_all_param = FALSE;
+ int curr_type = MM_DISPLAY_SURFACE_NUM;
MMPLAYER_FENTER();
- if (!_mmplayer_is_videosink_ready(player, MM_DISPLAY_SURFACE_OVERLAY)) {
+ mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &curr_type);
+
+ if (curr_type != MM_DISPLAY_SURFACE_OVERLAY && curr_type != MM_DISPLAY_SURFACE_OVERLAY_SYNC_UI) {
+ LOGE("current type(%d) is wrong", curr_type);
+ return MM_ERROR_PLAYER_INTERNAL;
+ }
+
+ if (!player || !player->pipeline || !player->pipeline->mainbin || !player->pipeline->videobin ||
+ !player->pipeline->videobin[MMPLAYER_V_BIN].gst ||
+ !player->pipeline->videobin[MMPLAYER_V_SINK].gst) {
LOGW("videosink is not ready yet");
return MM_ERROR_PLAYER_NOT_INITIALIZED;
}
if (!g_strcmp0(param_name, "update_all_param"))
update_all_param = TRUE;
+ if (curr_type == MM_DISPLAY_SURFACE_OVERLAY_SYNC_UI) {
+ __mmplayer_video_param_set_display_overlay_sync_ui(player);
+ MMPLAYER_FLEAVE();
+ return MM_ERROR_NONE;
+ }
if (update_all_param || !g_strcmp0(param_name, "display_overlay"))
__mmplayer_video_param_set_display_overlay(player);
if (update_all_param || !g_strcmp0(param_name, "display_method"))
if (update_all_param)
__mmplayer_video_param_set_video_roi_area(player);
-
MMPLAYER_FLEAVE();
return MM_ERROR_NONE;
}
LOGD("enable overlay");
__mmplayer_video_param_set_display_overlay(player);
+ __mmplayer_video_param_set_display_overlay_sync_ui(player);
g_object_set(player->pipeline->videobin[MMPLAYER_V_SINK].gst, "disable-overlay", FALSE, NULL);
}
goto EXIT;
}
- if (surface_type != MM_DISPLAY_SURFACE_OVERLAY || player->set_mode.video_zc) {
+ if ((surface_type != MM_DISPLAY_SURFACE_OVERLAY &&
+ surface_type != MM_DISPLAY_SURFACE_OVERLAY_SYNC_UI) ||
+ player->set_mode.video_zc) {
LOGD("skip creating the videoconv and rotator");
return MM_ERROR_NONE;
}
switch (surface_type) {
case MM_DISPLAY_SURFACE_OVERLAY:
+ /* fall through */
+ case MM_DISPLAY_SURFACE_OVERLAY_SYNC_UI:
if (strlen(player->ini.videosink_element_overlay) > 0)
factory_name = player->ini.videosink_element_overlay;
break;
case MM_DISPLAY_SURFACE_REMOTE:
+ /* fall through */
case MM_DISPLAY_SURFACE_NULL:
if (strlen(player->ini.videosink_element_fake) > 0)
factory_name = player->ini.videosink_element_fake;
return MM_ERROR_PLAYER_INTERNAL;
}
- if (surface_type == MM_DISPLAY_SURFACE_OVERLAY) {
+ if (surface_type == MM_DISPLAY_SURFACE_OVERLAY || surface_type == MM_DISPLAY_SURFACE_OVERLAY_SYNC_UI) {
bool use_tbm = (player->set_mode.video_zc || (player->is_360_feature_enabled && player->is_content_spherical));
if (strncmp(factory_name, "tizenwlsink", strlen(factory_name)) == 0) {
g_object_set(player->pipeline->videobin[MMPLAYER_V_SINK].gst,