[0.2.136] Add PLAYER_DISPLAY_TYPE_OVERLAY_SYNC_UI for sync UI and video 29/258229/9 accepted/tizen/unified/20210720.123537 submit/tizen/20210719.045446
authorHyunil <hyunil46.park@samsung.com>
Wed, 12 May 2021 10:58:16 +0000 (19:58 +0900)
committerHyunil <hyunil46.park@samsung.com>
Mon, 14 Jun 2021 05:56:49 +0000 (14:56 +0900)
- Add exported_shell_handle to wl_win_msg_type
- Add exported_shell_handle to legacy_player_set_display as a input argument

Change-Id: I4f2ffc1d7487f6af66c223b9f04d721aeb298dd4
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
legacy/include/legacy_player.h
legacy/src/legacy_player.c
muse/include/muse_player_msg.h
muse/src/muse_player.c
packaging/mmsvc-player.spec

index c37ff5a..5c111e7 100644 (file)
@@ -97,9 +97,11 @@ typedef enum {
  * @since_tizen 2.3
  */
 typedef enum {
-       PLAYER_DISPLAY_TYPE_OVERLAY = 0,    /**< Overlay surface display */
-       PLAYER_DISPLAY_TYPE_EVAS,           /**< Evas image object surface display */
-       PLAYER_DISPLAY_TYPE_NONE,           /**< This disposes off buffers */
+       PLAYER_DISPLAY_TYPE_OVERLAY = 0,         /**< Overlay surface display */
+       PLAYER_DISPLAY_TYPE_EVAS,                /**< Evas image object surface display */
+       PLAYER_DISPLAY_TYPE_NONE,                /**< This disposes off buffers */
+       PLAYER_DISPLAY_TYPE_OVERLAY_EXT,         /**< Added to match mm_display_type_e */
+       PLAYER_DISPLAY_TYPE_OVERLAY_SYNC_UI      /**< For sync between UI and video */
 } player_display_type_e;
 
 /**
@@ -685,6 +687,7 @@ int legacy_player_is_looping(legacy_player_h player, bool *looping);
  * @param[in]   player The handle to the media player
  * @param[in]   type The display type
  * @param[in]   wl_surface_id Wayland surface global id
+ * @param[in]   exported_shell_handle Exported shell handle
  * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #PLAYER_ERROR_NONE Successful
@@ -694,7 +697,7 @@ int legacy_player_is_looping(legacy_player_h player, bool *looping);
  * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
  * @see legacy_player_set_display_rotation
  */
-int legacy_player_set_display(legacy_player_h player, player_display_type_e type, int wl_surface_id);
+int legacy_player_set_display(legacy_player_h player, player_display_type_e type, int wl_surface_id, const char *exported_shell_handle);
 
 int legacy_player_release_video_stream_bo(legacy_player_h player, void *bo);
 
index eba73d5..982c133 100644 (file)
@@ -546,8 +546,10 @@ static MMDisplaySurfaceType __lplayer_convert_display_type(player_display_type_e
        switch (type) {
        case PLAYER_DISPLAY_TYPE_OVERLAY:
                return MM_DISPLAY_SURFACE_OVERLAY;
+       case PLAYER_DISPLAY_TYPE_OVERLAY_SYNC_UI:
+               return MM_DISPLAY_SURFACE_OVERLAY_SYNC_UI;
        case PLAYER_DISPLAY_TYPE_EVAS:  /* fall through */
-       case PLAYER_DISPLAY_TYPE_NONE:  /* fall through */
+       case PLAYER_DISPLAY_TYPE_NONE:  /* fall through */
        default:
                return MM_DISPLAY_SURFACE_NULL;
        }
@@ -2433,15 +2435,15 @@ int legacy_player_set_roi_area(legacy_player_h player, int x, int y, int w, int
        return PLAYER_ERROR_NONE;
 }
 
-int legacy_player_set_display(legacy_player_h player, player_display_type_e type, int wl_surface_id)
+int legacy_player_set_display(legacy_player_h player, player_display_type_e type, int wl_surface_id, const char *exported_shell_handle)
 {
        legacy_player_t *handle = (legacy_player_t *)player;
        int ret = MM_ERROR_NONE;
-       static const char * display_str[] = {"OVERLAY", "EVAS", "NONE"};
+       static const char * display_str[] = {"OVERLAY", "EVAS", "NONE", "EXT", "OVERLAY_SYNC_UI"};
        MMDisplaySurfaceType surface_type = __lplayer_convert_display_type(type);
 
        PLAYER_INSTANCE_CHECK(player);
-       PLAYER_RANGE_ARG_CHECK(type, PLAYER_DISPLAY_TYPE_OVERLAY, PLAYER_DISPLAY_TYPE_NONE);
+       PLAYER_RANGE_ARG_CHECK(type, PLAYER_DISPLAY_TYPE_OVERLAY, PLAYER_DISPLAY_TYPE_OVERLAY_SYNC_UI);
 
        if (!_lplayer_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("PLAYER_ERROR_INVALID_STATE : current state - %d", handle->state);
@@ -2455,6 +2457,14 @@ int legacy_player_set_display(legacy_player_h player, player_display_type_e type
                        ret = mm_player_set_attribute(handle->mm_handle, NULL,
                                                "display_surface_type", surface_type,
                                                "display_overlay", wl_surface_id, NULL);
+               } else if (type == PLAYER_DISPLAY_TYPE_OVERLAY_SYNC_UI) {
+                       if (exported_shell_handle == NULL) {
+                               LOGE("exported shell handle is NULL");
+                               return PLAYER_ERROR_INVALID_PARAMETER;
+                       }
+                       ret = mm_player_set_attribute(handle->mm_handle, NULL,
+                                               "display_surface_type", surface_type,
+                                               "exported_shell_handle", exported_shell_handle, strlen(exported_shell_handle), NULL);
                }
        } else {
                ret = mm_player_change_videosink(handle->mm_handle, surface_type, wl_surface_id);
index b15eeaf..a0e4167 100644 (file)
@@ -26,6 +26,7 @@ extern "C" {
 #include <media_format.h>
 #include <muse_server.h>
 #include <mm_error.h>
+#define MAX_EXPORTED_SHELL_HANDLE_LEN 128
 
 typedef int32_t INT;
 typedef int64_t INT64;
@@ -60,6 +61,7 @@ typedef struct {
        int win_roi_y;
        int win_roi_width;
        int win_roi_height;
+       char exported_shell_handle[MAX_EXPORTED_SHELL_HANDLE_LEN];
 } wl_win_msg_type;
 
 extern int _mplayer_disp_send_msg(int send_fd, char *msg, int *tfd);
index 4450223..daf5f13 100644 (file)
@@ -1764,7 +1764,8 @@ int player_disp_set_display(muse_module_h module)
 
        muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
        player_msg_get_array(wl_win_msg, muse_server_module_get_msg(module));
-       ret = legacy_player_set_display(muse_player->player_handle, wl_win.type, wl_win.surface_id);
+       ret = legacy_player_set_display(muse_player->player_handle,
+                               wl_win.type, wl_win.surface_id, wl_win.exported_shell_handle);
        PLAYER_RETURN_MSG(api, ret, module);
 
        return ret;
index 8c40d16..cf923d9 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.135
+Version:    0.2.136
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0