update tbm surface info to support DRC 57/78557/1 accepted/tizen/common/20160707.171332 accepted/tizen/ivi/20160706.132854 accepted/tizen/mobile/20160706.132252 accepted/tizen/tv/20160706.132307 accepted/tizen/wearable/20160706.132423 submit/tizen/20160706.103825
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 6 Jul 2016 05:34:19 +0000 (14:34 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Wed, 6 Jul 2016 05:34:19 +0000 (14:34 +0900)
Change-Id: I7adbdbc93cbc0229f1e086f11e4d9a268d150d91

packaging/capi-media-player.spec
src/player.c

index c907699..4dc7804 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-player
 Summary:    A Media Player API
-Version:    0.3.13
+Version:    0.3.14
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 2261d0f..f82175a 100644 (file)
@@ -546,7 +546,7 @@ static void __player_remove_tsurf_list(player_cli_s * pc)
        return;
 }
 
-static player_tsurf_info_t* __player_get_tsurf_from_list(callback_cb_info_s * cb_info, tbm_key key)
+static player_tsurf_info_t* __player_get_tsurf_from_list(callback_cb_info_s * cb_info, tbm_key key, tbm_surface_info_s sinfo)
 {
        GList *l = NULL;
 
@@ -555,8 +555,23 @@ static player_tsurf_info_t* __player_get_tsurf_from_list(callback_cb_info_s * cb
                player_tsurf_info_t *tmp = (player_tsurf_info_t *)l->data;
                if (tmp && (tmp->key == key)) {
                        LOGD("found tsurf_data of tbm_key %d", key);
-                       g_mutex_unlock(&cb_info->data_mutex);
-                       return tmp;
+
+                       /* need to check tsuf info to support DRC */
+                       if ((tbm_surface_get_height(tmp->tsurf) != sinfo.height) ||
+                               (tbm_surface_get_width(tmp->tsurf) != sinfo.width)) {
+
+                               cb_info->tsurf_list = g_list_remove(cb_info->tsurf_list, tmp);
+                               LOGW("tsurf info is changed. need to create new tsurf.");
+                               tbm_surface_destroy(tmp->tsurf);
+                               g_free(tmp);
+
+                               g_mutex_unlock(&cb_info->data_mutex);
+                               return NULL;
+
+                       } else {
+                               g_mutex_unlock(&cb_info->data_mutex);
+                               return tmp;
+                       }
                }
        }
        g_mutex_unlock(&cb_info->data_mutex);
@@ -622,7 +637,7 @@ static void __media_packet_video_frame_cb_handler(callback_cb_info_s * cb_info,
                }
        }
 
-       tsurf_data = __player_get_tsurf_from_list(cb_info, key[0]);
+       tsurf_data = __player_get_tsurf_from_list(cb_info, key[0], sinfo);
        if (!tsurf_data) {
                tsurf_data = g_new(player_tsurf_info_t, 1);
                if (!tsurf_data) {