From: Eunhye Choi Date: Tue, 20 Jul 2021 10:35:10 +0000 (+0900) Subject: [0.3.143] get bo addr as video key X-Git-Tag: submit/tizen/20210722.070651^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17c67e7d7ad8b942dc2ef2b0069afd4d1fffed46;p=platform%2Fcore%2Fapi%2Fplayer.git [0.3.143] get bo addr as video key - use bo addr as video key to remove unsupported tbm_key interface Change-Id: I7b0e0f276c81b037ae24017719d1f710ef4bc537 --- diff --git a/include/player_private.h b/include/player_private.h index a8de5a3..5b54dc2 100644 --- a/include/player_private.h +++ b/include/player_private.h @@ -137,7 +137,7 @@ typedef struct { } player_event_queue; typedef struct { - int key[4]; + intptr_t key; tbm_surface_h tsurf; } player_tsurf_info_s; diff --git a/packaging/capi-media-player.spec b/packaging/capi-media-player.spec index 5e13c91..1d5880a 100644 --- a/packaging/capi-media-player.spec +++ b/packaging/capi-media-player.spec @@ -1,6 +1,6 @@ Name: capi-media-player Summary: A Media Player API -Version: 0.3.142 +Version: 0.3.143 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/player.c b/src/player.c index 1081f01..90686b2 100644 --- a/src/player.c +++ b/src/player.c @@ -799,15 +799,15 @@ static void __player_remove_tsurf_list(player_cli_s *pc) return; } -static player_tsurf_info_s *__player_get_tsurf_from_list(callback_cb_info_s *cb_info, int *key, int height, int width) +static player_tsurf_info_s *__player_get_tsurf_from_list(callback_cb_info_s *cb_info, intptr_t key, int height, int width) { GList *l = NULL; g_mutex_lock(&cb_info->data_mutex); for (l = g_list_first(cb_info->tsurf_list); l; l = g_list_next(l)) { player_tsurf_info_s *tmp = (player_tsurf_info_s *)l->data; - if (tmp && key && (tmp->key[0] == key[0])) { - LOGD("found tsurf_data of tbm_key %d", key[0]); + if (tmp && key && (tmp->key == key)) { + LOGD("found tsurf_data of tbm_key %" PRIdPTR, key); /* need to check tsuf info to support DRC */ if ((tbm_surface_get_height(tmp->tsurf) != height) || @@ -856,7 +856,6 @@ static media_packet_rotate_method_e __convert_packet_orient_info(int orientation static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _player_recv_data *recv_data) { tbm_bo bo[4] = { NULL, }; - int key[4] = { INVALID_DEFAULT_VALUE, }; tbm_surface_info_s sinfo; char *surface_info = (char *)&sinfo; media_packet_h pkt = NULL; @@ -867,6 +866,7 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _ bool make_pkt_fmt = false; int ret = MEDIA_FORMAT_ERROR_NONE; _media_pkt_video_fin_data *fin_data = NULL; + intptr_t key = 0; intptr_t v_data = 0; uint64_t pts = 0; int i = 0, orientation = 0; @@ -874,10 +874,7 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _ void *jobj = muse_core_msg_object_new(recv_data->buffer, NULL, &err); if (!jobj || - !muse_core_msg_object_get_value("key[0]", jobj, MUSE_TYPE_ANY, &key[0]) || - !muse_core_msg_object_get_value("key[1]", jobj, MUSE_TYPE_ANY, &key[1]) || - !muse_core_msg_object_get_value("key[2]", jobj, MUSE_TYPE_ANY, &key[2]) || - !muse_core_msg_object_get_value("key[3]", jobj, MUSE_TYPE_ANY, &key[3]) || + !muse_core_msg_object_get_value("key", jobj, MUSE_TYPE_POINTER, &key) || !muse_core_msg_object_get_value("v_data", jobj, MUSE_TYPE_POINTER, &v_data) || !muse_core_msg_object_get_value("mimetype", jobj, MUSE_TYPE_ANY, &mimetype) || !muse_core_msg_object_get_value("pts", jobj, MUSE_TYPE_INT64, &pts) || @@ -931,14 +928,12 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s *cb_info, _ LOGE("failed to alloc tsurf info"); goto ERROR; } - memset(tsurf_data->key, INVALID_DEFAULT_VALUE, sizeof(tsurf_data->key)); - - memcpy(tsurf_data->key, key, sizeof(tsurf_data->key)); + tsurf_data->key = key; tsurf_data->tsurf = tsurf; g_mutex_lock(&cb_info->data_mutex); cb_info->tsurf_list = g_list_append(cb_info->tsurf_list, tsurf_data); - LOGD("key %d is added to the pool", key[0]); + LOGD("key %" PRIdPTR " is added to the pool", key); if (cb_info->video_frame_pool_size < g_list_length(cb_info->tsurf_list)) LOGE("need to check the pool size: %d < %d", cb_info->video_frame_pool_size, g_list_length(cb_info->tsurf_list)); g_mutex_unlock(&cb_info->data_mutex);