[UTC][player][Non-ACR][fix tc leak and add log]
authorNAMJEONGYOON <just.nam@samsung.com>
Wed, 6 Jul 2016 07:10:29 +0000 (16:10 +0900)
committerNAMJEONGYOON <just.nam@samsung.com>
Wed, 6 Jul 2016 07:11:05 +0000 (16:11 +0900)
Change-Id: If7a9e857d2b34922c6d2f4f2f98645f5eaf28464

src/utc/player/utc-media-player-callback.c
src/utc/player/utc-media-player-display.c
src/utc/player/utc-media-player-es.c
src/utc/player/utc-media-player-lifecycle.c
src/utc/player/utc-media-player-streaming.c
src/utc/player/utc-media-player.c

index 799e153..5f9849a 100755 (executable)
@@ -39,7 +39,7 @@ static char* subtitle_path=NULL;
 static GMainLoop *g_mainloop = NULL;
 static gboolean timeout_func(gpointer data)
 {
-    fprintf(stderr, "waited 5 seconds\n");
+    PRINT_UTC_LOG("[Line : %d][%s] waited 5 seconds\\n", __LINE__, API_NAMESPACE);
     g_main_loop_quit((GMainLoop *) data);
     return FALSE;
 }
@@ -105,7 +105,7 @@ void utc_media_player_callback_startup(void)
 
     ret = player_set_uri(player, media_path);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player didn't set uri\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player didn't set uri\\n", __LINE__, API_NAMESPACE);
         _is_broken = true;
     }
 }
@@ -124,7 +124,7 @@ void utc_media_player_callback_cleanup(void)
     if(player){
         ret = player_get_state (player, &state);
         if (PLAYER_ERROR_NONE != ret) {
-          fprintf(stderr, "player_get_state is failed\n");
+          PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
         }
         if (state != PLAYER_STATE_IDLE){
           player_unprepare(player);
@@ -176,25 +176,25 @@ int utc_media_player_set_buffering_cb_p(void)
     int repeat = 0;
     int ret = player_set_uri(player, DEFAULT_PATH);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_uri is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_uri is failed\\n", __LINE__, API_NAMESPACE);
     }
 
     ret = player_set_buffering_cb(player, player_buffer_cb, NULL);
     // if wifi isn't connected or internet modules don't exist, this error will be returned.
     // and it is wrongly detected as a fail. so we will skip the test on these cases.
     if(ret==PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) {
-        fprintf(stderr, "check network status\n");
+        PRINT_UTC_LOG("[Line : %d][%s] check network status\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
     assert_eq(ret, PLAYER_ERROR_NONE);
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
 
     ret = player_start(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't started\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't started\\n", __LINE__, API_NAMESPACE);
 
     for(repeat=0; repeat<11; repeat++) {
         wait_for_async();
@@ -206,7 +206,7 @@ int utc_media_player_set_buffering_cb_p(void)
 
     ret = player_stop(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't stopped\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't stopped\\n", __LINE__, API_NAMESPACE);
 
     return 0;
 }
@@ -265,15 +265,15 @@ int utc_media_player_set_completed_cb_p(void)
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
 
     ret = player_start(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't started\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't started\\n", __LINE__, API_NAMESPACE);
 
     ret = player_stop(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't stopped\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't stopped\\n", __LINE__, API_NAMESPACE);
 
     return 0;
 }
@@ -333,7 +333,7 @@ int utc_media_player_set_error_cb_p(void)
 
     ret = player_set_uri(player, INVALID_PATH);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_uri is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_uri is failed\\n", __LINE__, API_NAMESPACE);
     }
     player_prepare_async(player, player_complete_cb, NULL);
 
@@ -402,15 +402,15 @@ int utc_media_player_set_interrupted_cb_p(void)
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
 
     ret = player_start(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't started\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't started\\n", __LINE__, API_NAMESPACE);
 
     ret = player_stop(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't stopped\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't stopped\\n", __LINE__, API_NAMESPACE);
 
     return 0;
 }
@@ -470,18 +470,18 @@ int utc_media_player_set_subtitle_updated_cb_p(void)
     int repeat = 0;
     int ret = player_set_subtitle_path(player, subtitle_path);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "subtitle path isn't set\n");
+        PRINT_UTC_LOG("[Line : %d][%s] subtitle path isn't set\\n", __LINE__, API_NAMESPACE);
 
     ret = player_set_subtitle_updated_cb(player, player_subtitle_update_cb, NULL);
     assert_eq(ret, PLAYER_ERROR_NONE);
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
 
     ret = player_start(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't started\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't started\\n", __LINE__, API_NAMESPACE);
 
     for(repeat=0; repeat<5; repeat++) {
         wait_for_async();
@@ -493,7 +493,7 @@ int utc_media_player_set_subtitle_updated_cb_p(void)
 
     ret = player_stop(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't stopped\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't stopped\\n", __LINE__, API_NAMESPACE);
 
     return 0;
 }
index 2f051bf..4baf87c 100755 (executable)
@@ -36,7 +36,7 @@ static Evas_Object *g_win = NULL;
 
 static gboolean timeout_func(gpointer data)
 {
-    fprintf(stderr, "waited 5 seconds\n");
+    PRINT_UTC_LOG("[Line : %d][%s] waited 5 seconds\\n", __LINE__, API_NAMESPACE);
     g_main_loop_quit((GMainLoop *) data);
     return FALSE;
 }
@@ -95,7 +95,7 @@ static void create_window()
         evas_object_resize(g_win, w, h);
         elm_win_autodel_set(g_win, EINA_TRUE);
     } else {
-        fprintf(stderr, "fail to create window\n");
+        PRINT_UTC_LOG("[Line : %d][%s] fail to create window\\n", __LINE__, API_NAMESPACE);
     }
 }
 
@@ -133,7 +133,7 @@ void utc_media_player_display_startup(void)
 
     ret = player_set_uri(player, media_path);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player didn't set uri\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player didn't set uri\\n", __LINE__, API_NAMESPACE);
         _is_broken = true;
     }
 }
@@ -190,7 +190,7 @@ int utc_media_player_get_video_size_p(void)
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
     }
 
     int ret1 = player_start(player);
@@ -249,7 +249,7 @@ int utc_media_player_set_display_p(void)
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
     }
 
     return 0;
@@ -381,7 +381,7 @@ int utc_media_player_get_video_stream_info_p(void)
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
     }
 
     int ret1 = player_start(player);
@@ -424,7 +424,7 @@ int utc_media_player_get_video_stream_info_n2(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE)
       player_unprepare(player);
index 91f4d12..d6a2d81 100644 (file)
@@ -57,7 +57,7 @@ static GMainLoop *g_mainloop = NULL;
 
 static gboolean timeout_func(gpointer data)
 {
-    fprintf(stderr, "waited 10 seconds\n");
+    PRINT_UTC_LOG("[Line : %d][%s] waited 10 seconds\\n", __LINE__, API_NAMESPACE);
     g_main_loop_quit((GMainLoop *) data);
     return FALSE;
 }
@@ -79,19 +79,19 @@ static void seek_completed_cb(void *user_data)
 
 static void seek_start_cb(void *user_data)
 {
-    fprintf(stderr, "seek start callback\n");
+    PRINT_UTC_LOG("[Line : %d][%s] seek start callback\\n", __LINE__, API_NAMESPACE);
     int ret = player_set_play_position(player, 2, TRUE, seek_completed_cb, NULL);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player seek is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] fail to set position\\n", __LINE__, API_NAMESPACE);
     }
 }
 
 static void _player_prepared_cb(void *user_data)
 {
-    fprintf(stderr, "prepare callback\n");
+    PRINT_UTC_LOG("[Line : %d][%s] prepare callback\\n", __LINE__, API_NAMESPACE);
     int ret = player_start(player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_start is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] fail to start\\n", __LINE__, API_NAMESPACE);
     }
 
 }
@@ -233,42 +233,43 @@ static void feed_video_data()
     void *buf_data_ptr = NULL;
 
     if (media_packet_create_alloc(video_fmt, NULL, NULL, &video_pkt) != MEDIA_PACKET_ERROR_NONE) {
-        fprintf(stderr, "media_packet_create_alloc failed\n");
+                   PRINT_UTC_LOG("[Line : %d][%s] fail to alloc media_packet\\n", __LINE__, API_NAMESPACE);
         return;
     }
 
     if (media_packet_get_buffer_data_ptr(video_pkt, &buf_data_ptr) != MEDIA_PACKET_ERROR_NONE) {
-        fprintf(stderr, "media_packet_get_buffer_data_ptr failed\n");
-        return;
+        PRINT_UTC_LOG("[Line : %d][%s] media_packet_get_buffer_data_ptr failed\\n", __LINE__, API_NAMESPACE);
+        goto FREE_PACKET;
     }
 
     if (media_packet_set_pts(video_pkt, (uint64_t)(pts/1000000)) != MEDIA_PACKET_ERROR_NONE) {
-        fprintf(stderr, "media_packet_set_pts failed\n");
-        return;
+        PRINT_UTC_LOG("[Line : %d][%s] media_packet_set_pts failed\\n", __LINE__, API_NAMESPACE);
+        goto FREE_PACKET;
     }
     /* NOTE: In case of H.264 video, stream format for feeding is NAL unit.
     * And, SPS(0x67) and PPS(0x68) should be located before IDR.(0x65).
     */
     read = bytestream2nalunit(file_src, buf_data_ptr);
-    fprintf(stderr, "real length = %d\n", read);
     if (read == 0) {
-        fprintf(stderr, "input file read failed\n");
-        return;
+        PRINT_UTC_LOG("[Line : %d][%s] input file read failed\\n", __LINE__, API_NAMESPACE);
+        goto FREE_PACKET;
     }
 
     if (media_packet_set_buffer_size(video_pkt, (uint64_t)read) != MEDIA_PACKET_ERROR_NONE) {
-        fprintf(stderr, "media_packet_set_buffer_size failed\n");
-        return;
+        PRINT_UTC_LOG("[Line : %d][%s] media_packet_set_buffer_size failed\\n", __LINE__, API_NAMESPACE);
+        goto FREE_PACKET;
     }
 
     /* push media packet */
     g_ret = player_push_media_stream(player, video_pkt);
     pts += ES_DEFAULT_VIDEO_PTS_OFFSET;
 
-    /* destroy media packet after use*/
+    goto FREE_PACKET;
+
+FREE_PACKET:
+    /* destroy media packet after use */
     media_packet_destroy(video_pkt);
     video_pkt = NULL;
-
     return;
 }
 
@@ -351,18 +352,18 @@ void utc_media_player_es_startup(void)
 
     ret = player_set_uri(player, ES_FEEDING_PATH);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player didn't set uri\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player didn't set uri\\n", __LINE__, API_NAMESPACE);
         _is_broken = true;
     }
 
     /* get media format format */
     ret = media_format_create(&video_fmt);
     if (ret != MEDIA_FORMAT_ERROR_NONE) {
-        fprintf(stderr, "media_format_create(v) is failed");
+        PRINT_UTC_LOG("[Line : %d][%s] media_format_create(v) is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = media_format_create(&audio_fmt);
     if (ret != MEDIA_FORMAT_ERROR_NONE) {
-        fprintf(stderr, "media_format_create(a) is failed");
+        PRINT_UTC_LOG("[Line : %d][%s] media_format_create(a) is failed\\n", __LINE__, API_NAMESPACE);
     }
 
     /* set format */
@@ -385,7 +386,6 @@ void utc_media_player_es_cleanup(void)
 {
     player_state_e state;
     int ret = 0;
-    elm_shutdown();
 
     if (video_fmt)
         media_format_unref(video_fmt);
@@ -397,7 +397,7 @@ void utc_media_player_es_cleanup(void)
     if(player){
         ret = player_get_state (player, &state);
         if (PLAYER_ERROR_NONE != ret) {
-          fprintf(stderr, "player_get_state is failed\n");
+          PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
         }
         if (state != PLAYER_STATE_IDLE)
           player_unprepare(player);
@@ -409,6 +409,9 @@ void utc_media_player_es_cleanup(void)
       free(media_path);
     if(media_path2)
       free(media_path2);
+
+       destroy_window();
+       elm_shutdown();
 }
 
 /**
@@ -423,7 +426,7 @@ int utc_media_player_set_media_stream_info_p(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -431,14 +434,13 @@ int utc_media_player_set_media_stream_info_p(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_info(player, PLAYER_STREAM_TYPE_VIDEO, video_fmt);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_info is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_info is failed\\n", __LINE__, API_NAMESPACE);
     }
     assert_eq(ret, PLAYER_ERROR_NONE);
-    destroy_window();
 
     return 0;
 }
@@ -454,7 +456,7 @@ int utc_media_player_set_media_stream_info_n(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -462,11 +464,10 @@ int utc_media_player_set_media_stream_info_n(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_info(player, PLAYER_STREAM_TYPE_VIDEO, NULL);
     assert_eq(ret, PLAYER_ERROR_INVALID_OPERATION);
-    destroy_window();
 
     return 0;
 }
@@ -484,7 +485,7 @@ int utc_media_player_push_media_stream_p(void)
 
     ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -492,32 +493,32 @@ int utc_media_player_push_media_stream_p(void)
 
     ret = player_set_media_stream_buffer_status_cb(player, PLAYER_STREAM_TYPE_VIDEO, player_media_stream_buffer_status_callback, NULL);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_buffer_status_cb is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_buffer_status_cb is failed\\n", __LINE__, API_NAMESPACE);
     }
 
     ret = player_set_media_stream_buffer_max_size(player, PLAYER_STREAM_TYPE_VIDEO, ES_BUFFER_MAX_SIZE);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_buffer_status_cb is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_buffer_status_cb is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_seek_cb(player, PLAYER_STREAM_TYPE_VIDEO, player_media_stream_seek_callback, NULL);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_buffer_status_cb is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_buffer_status_cb is failed\\n", __LINE__, API_NAMESPACE);
     }
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_info(player, PLAYER_STREAM_TYPE_VIDEO, video_fmt);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_info is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_info is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_prepare_async(player, _player_prepared_cb, (void*)player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
     }
     if(pthread_create(&feeding_thread_id, NULL, (void*)feed_video_data_thread_func, NULL)<0) {
-        fprintf(stderr, "pthread_create is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] pthread_create is failed\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
 
@@ -528,7 +529,6 @@ int utc_media_player_push_media_stream_p(void)
 
     player_stop(player);
     player_unprepare(player);
-    destroy_window();
     feeding_thread_id = 0;
 
     return 0;
@@ -545,22 +545,21 @@ int utc_media_player_push_media_stream_n(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_info(player, PLAYER_STREAM_TYPE_AUDIO, audio_fmt);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_info is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_info is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_prepare_async(player, _player_prepared_cb, (void*)player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_push_media_stream(player, NULL);
     assert_eq(ret, PLAYER_ERROR_INVALID_PARAMETER);
 
     player_stop(player);
     player_unprepare(player);
-    destroy_window();
 
     return 0;
 }
@@ -577,7 +576,7 @@ int utc_player_set_media_stream_buffer_max_size_p(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -585,11 +584,10 @@ int utc_player_set_media_stream_buffer_max_size_p(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_buffer_max_size(player, PLAYER_STREAM_TYPE_VIDEO, 10);
     assert_eq(ret, PLAYER_ERROR_NONE);
-    destroy_window();
 
     return 0;
 }
@@ -605,7 +603,7 @@ int utc_player_set_media_stream_buffer_max_size_n(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -613,11 +611,10 @@ int utc_player_set_media_stream_buffer_max_size_n(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_buffer_max_size(NULL, PLAYER_STREAM_TYPE_VIDEO, 10);
     assert_eq(ret, PLAYER_ERROR_INVALID_PARAMETER);
-    destroy_window();
 
     return 0;
 }
@@ -635,7 +632,7 @@ int utc_player_get_media_stream_buffer_max_size_p(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -643,15 +640,14 @@ int utc_player_get_media_stream_buffer_max_size_p(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_buffer_max_size(player, PLAYER_STREAM_TYPE_VIDEO, 10);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_buffer_max_size is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_buffer_max_size is failed\\n", __LINE__, API_NAMESPACE);
     }
        ret = player_get_media_stream_buffer_max_size(player, PLAYER_STREAM_TYPE_VIDEO, &max_size);
     assert_eq(ret, PLAYER_ERROR_NONE);
-    destroy_window();
 
        return 0;
 }
@@ -668,7 +664,7 @@ int utc_player_get_media_stream_buffer_max_size_n(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -676,15 +672,14 @@ int utc_player_get_media_stream_buffer_max_size_n(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_buffer_max_size(player, PLAYER_STREAM_TYPE_VIDEO, 10);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_buffer_max_size is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_buffer_max_size is failed\\n", __LINE__, API_NAMESPACE);
     }
        ret = player_get_media_stream_buffer_max_size(NULL, PLAYER_STREAM_TYPE_VIDEO, &max_size);
     assert_eq(ret, PLAYER_ERROR_INVALID_PARAMETER);
-    destroy_window();
 
     return 0;
 }
@@ -701,7 +696,7 @@ int utc_player_set_media_stream_buffer_min_threshold_p(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -709,11 +704,10 @@ int utc_player_set_media_stream_buffer_min_threshold_p(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_buffer_min_threshold(player, PLAYER_STREAM_TYPE_VIDEO, 10);
     assert_eq(ret, PLAYER_ERROR_NONE);
-    destroy_window();
 
     return 0;
 
@@ -730,7 +724,7 @@ int utc_player_set_media_stream_buffer_min_threshold_n(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -738,11 +732,10 @@ int utc_player_set_media_stream_buffer_min_threshold_n(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_buffer_min_threshold(NULL, PLAYER_STREAM_TYPE_VIDEO, 10);
     assert_eq(ret, PLAYER_ERROR_INVALID_PARAMETER);
-    destroy_window();
 
     return 0;
 
@@ -761,7 +754,7 @@ int utc_player_get_media_stream_buffer_min_threshold_p(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -769,15 +762,14 @@ int utc_player_get_media_stream_buffer_min_threshold_p(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_buffer_min_threshold(player, PLAYER_STREAM_TYPE_VIDEO, 10);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_buffer_min_threshold is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_buffer_min_threshold is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_get_media_stream_buffer_min_threshold(player, PLAYER_STREAM_TYPE_VIDEO, &percent);
     assert_eq(ret, PLAYER_ERROR_NONE);
-    destroy_window();
 
        return 0;
 
@@ -795,7 +787,7 @@ int utc_player_get_media_stream_buffer_min_threshold_n(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -803,15 +795,14 @@ int utc_player_get_media_stream_buffer_min_threshold_n(void)
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_buffer_min_threshold(player, PLAYER_STREAM_TYPE_VIDEO, 10);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_buffer_min_threshold is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_buffer_min_threshold is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_get_media_stream_buffer_min_threshold(NULL, PLAYER_STREAM_TYPE_VIDEO, &percent);
     assert_eq(ret, PLAYER_ERROR_INVALID_PARAMETER);
-    destroy_window();
 
     return 0;
 
@@ -830,7 +821,7 @@ int utc_player_set_media_stream_buffer_status_cb_p(void)
 
     ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -838,28 +829,28 @@ int utc_player_set_media_stream_buffer_status_cb_p(void)
 
     ret = player_set_media_stream_buffer_status_cb(player, PLAYER_STREAM_TYPE_VIDEO, player_media_stream_buffer_status_callback, NULL);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_buffer_status_cb is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_buffer_status_cb is failed\\n", __LINE__, API_NAMESPACE);
     }
 
     ret = player_set_media_stream_buffer_max_size(player, PLAYER_STREAM_TYPE_VIDEO, ES_BUFFER_MAX_SIZE);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_buffer_status_cb is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_buffer_status_cb is failed\\n", __LINE__, API_NAMESPACE);
     }
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_info(player, PLAYER_STREAM_TYPE_VIDEO, video_fmt);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_info is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_info is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_prepare_async(player, _player_prepared_cb, (void*)player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
     }
     if(pthread_create(&feeding_thread_id, NULL, (void*)feed_video_data_thread_func, NULL)<0) {
-        fprintf(stderr, "pthread_create is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] pthread_create is failed\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
 
@@ -870,7 +861,6 @@ int utc_player_set_media_stream_buffer_status_cb_p(void)
 
     player_stop(player);
     player_unprepare(player);
-    destroy_window();
     feeding_thread_id = 0;
 
     assert(_is_pass);
@@ -890,7 +880,7 @@ int utc_player_set_media_stream_buffer_status_cb_n(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -913,7 +903,7 @@ int utc_player_unset_media_stream_buffer_status_cb_p(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -936,7 +926,7 @@ int utc_player_unset_media_stream_buffer_status_cb_p2(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -958,7 +948,7 @@ int utc_player_unset_media_stream_buffer_status_cb_n(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -982,7 +972,7 @@ int utc_player_set_media_stream_seek_cb_p(void)
 
     ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -990,28 +980,28 @@ int utc_player_set_media_stream_seek_cb_p(void)
 
     ret = player_set_media_stream_seek_cb(player, PLAYER_STREAM_TYPE_VIDEO, player_media_stream_seek_callback, NULL);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_seek_cb is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_seek_cb is failed\\n", __LINE__, API_NAMESPACE);
     }
     create_window();
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_display is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_info(player, PLAYER_STREAM_TYPE_VIDEO, video_fmt);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_info is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_info is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_set_media_stream_buffer_max_size(player, PLAYER_STREAM_TYPE_VIDEO, ES_BUFFER_MAX_SIZE);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_media_stream_buffer_max_size is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_media_stream_buffer_max_size is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_prepare_async(player, seek_start_cb, (void*)player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
     }
 
     if(pthread_create(&feeding_thread_id, NULL, (void*)feed_video_data_thread_func, NULL)<0) {
-        fprintf(stderr, "pthread_create is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] pthread_create is failed\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
 
@@ -1021,7 +1011,6 @@ int utc_player_set_media_stream_seek_cb_p(void)
     usleep(1000);
 
     player_unprepare(player);
-    destroy_window();
     feeding_thread_id = 0;
 
     assert(_is_pass);
@@ -1041,7 +1030,7 @@ int utc_player_set_media_stream_seek_cb_n(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
@@ -1108,19 +1097,19 @@ int utc_player_set_video_stream_changed_cb_p(void)
 
   int ret = player_get_state (player, &state);
   if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
   }
   if (state != PLAYER_STATE_IDLE){
     player_unprepare(player);
   }
   ret = player_set_uri(player, DRC_URI);
   if (PLAYER_ERROR_NONE != ret)
-      fprintf(stderr, "player_set_uri is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_set_uri is failed\\n", __LINE__, API_NAMESPACE);
 
   create_window();
   ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
   if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_set_display is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
   }
 
   ret = player_set_video_stream_changed_cb (player, player_video_stream_changed_callback, NULL);
@@ -1130,15 +1119,15 @@ int utc_player_set_video_stream_changed_cb_p(void)
   // if wifi isn't connected or internet modules don't exist, this error will be returned.
   // and it is wrongly detected as a fail. so we will skip the test on these cases.
   if(ret==PLAYER_ERROR_CONNECTION_FAILED) {
-      fprintf(stderr, "check network status");
+      PRINT_UTC_LOG("[Line : %d][%s] check network status\\n", __LINE__, API_NAMESPACE);
       return 0;
   }
   if (PLAYER_ERROR_NONE != ret)
-      fprintf(stderr, "player isn't prepared\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
 
   ret = player_start(player);
   if (PLAYER_ERROR_NONE != ret)
-      fprintf(stderr, "player isn't started\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player isn't started\\n", __LINE__, API_NAMESPACE);
 
   for(repeat=0; repeat<11; repeat++) {
       wait_for_async();
@@ -1148,8 +1137,7 @@ int utc_player_set_video_stream_changed_cb_p(void)
 
   ret = player_stop(player);
   if (PLAYER_ERROR_NONE != ret)
-      fprintf(stderr, "player isn't stopped\n");
-  destroy_window();
+      PRINT_UTC_LOG("[Line : %d][%s] player isn't stopped\\n", __LINE__, API_NAMESPACE);
 
   assert(_is_pass);
   _is_pass = false;
@@ -1168,7 +1156,7 @@ int utc_player_set_video_stream_changed_cb_n(void)
 
   int ret = player_get_state (player, &state);
   if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
   }
   if (state != PLAYER_STATE_IDLE){
       player_unprepare(player);
@@ -1191,35 +1179,34 @@ int utc_player_set_video_stream_changed_cb_n2(void)
 
   int ret = player_get_state (player, &state);
   if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
   }
   if (state != PLAYER_STATE_IDLE){
     player_unprepare(player);
   }
   ret = player_set_uri(player, DRC_URI);
   if (PLAYER_ERROR_NONE != ret)
-      fprintf(stderr, "player_set_uri is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_set_uri is failed\\n", __LINE__, API_NAMESPACE);
 
   create_window();
   ret = player_set_display(player, PLAYER_DISPLAY_TYPE_OVERLAY, g_win);
   if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_set_display is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_set_display is failed\\n", __LINE__, API_NAMESPACE);
   }
 
   ret = player_prepare(player);
   // if wifi isn't connected or internet modules don't exist, this error will be returned.
   // and it is wrongly detected as a fail. so we will skip the test on these cases.
   if(ret==PLAYER_ERROR_CONNECTION_FAILED) {
-      fprintf(stderr, "check network status");
+      PRINT_UTC_LOG("[Line : %d][%s] check network status\\n", __LINE__, API_NAMESPACE);
       return 0;
   }
   if (PLAYER_ERROR_NONE != ret)
-      fprintf(stderr, "player isn't prepared\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
 
   ret = player_set_video_stream_changed_cb (player, player_video_stream_changed_callback, NULL);
   assert_eq(ret, PLAYER_ERROR_INVALID_STATE);
 
-  destroy_window();
 #endif
   return 0;
 }
@@ -1259,26 +1246,26 @@ int utc_media_player_set_media_packet_video_frame_decoded_cb_p(void)
 {
     int ret = player_set_uri(player, media_path2);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player_set_uri failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_uri failed\\n", __LINE__, API_NAMESPACE);
 
     player_set_display(player, PLAYER_DISPLAY_TYPE_NONE, NULL);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player_set_display failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display failed\\n", __LINE__, API_NAMESPACE);
 
     ret = player_set_media_packet_video_frame_decoded_cb(player, _player_media_packet_decoded_cb, NULL);
     assert_eq(ret, PLAYER_ERROR_NONE);
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
 
     ret = player_start(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't started\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't started\\n", __LINE__, API_NAMESPACE);
 
     ret = player_stop(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't stopped\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't stopped\\n", __LINE__, API_NAMESPACE);
 
     return 0;
 }
@@ -1305,15 +1292,15 @@ int utc_media_player_set_media_packet_video_frame_decoded_cb_n2(void)
 {
     int ret = player_set_uri(player, media_path2);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player_set_uri failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_uri failed\\n", __LINE__, API_NAMESPACE);
 
     player_set_display(player, PLAYER_DISPLAY_TYPE_NONE, NULL);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player_set_display failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_display failed\\n", __LINE__, API_NAMESPACE);
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
 
     ret = player_set_media_packet_video_frame_decoded_cb(player, _player_media_packet_decoded_cb, NULL);
     assert_eq(ret, PLAYER_ERROR_INVALID_STATE);
index 7c5d195..6e3b6ae 100755 (executable)
@@ -78,7 +78,7 @@ void utc_media_player_lifecycle_cleanup(void)
     if(g_player){
         ret = player_get_state (g_player, &state);
         if (PLAYER_ERROR_NONE != ret) {
-          fprintf(stderr, "player_get_state is failed\n");
+          PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
         }
         if (state != PLAYER_STATE_IDLE){
           player_unprepare(g_player);
index 7ea374a..cbf545c 100755 (executable)
@@ -44,7 +44,7 @@ static GMainLoop *g_mainloop = NULL;
 
 static gboolean timeout_func(gpointer data)
 {
-    fprintf(stderr, "waited 10 seconds\n");
+    PRINT_UTC_LOG("[Line : %d][%s] waited 10 seconds\\n", __LINE__, API_NAMESPACE);
     g_main_loop_quit((GMainLoop *) data);
     return FALSE;
 }
@@ -142,7 +142,7 @@ static bool _check_network_supportable(void)
     if (wifi_supported || telepony_supported || ethernet_supported)
         return true;
 
-    fprintf(stderr, "network is not supportable.");
+    PRINT_UTC_LOG("[Line : %d][%s] network is not supportable.\\n", __LINE__, API_NAMESPACE);
     return false;
 }
 
@@ -159,18 +159,18 @@ void utc_media_player_streaming_startup(void)
 
     _is_network_supportable = _check_network_supportable();
 
-       char pszValue[CONFIG_VALUE_LEN_MAX] = {0,};
-       if ( true == GetValueForTCTSetting("DEVICE_SUITE_TARGET_30", pszValue, API_NAMESPACE ))
-       {
-               PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE,  pszValue);
-               unsigned int size_of_path = strlen(pszValue) + strlen(download) + 6;
-               download_path = (char*)malloc(size_of_path);
-               snprintf(download_path, size_of_path, "%s/res/%s", pszValue, download);
-       }
-       else
-       {
-               PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE);
-       }
+    char pszValue[CONFIG_VALUE_LEN_MAX] = {0,};
+    if ( true == GetValueForTCTSetting("DEVICE_SUITE_TARGET_30", pszValue, API_NAMESPACE ))
+    {
+        PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE,  pszValue);
+        unsigned int size_of_path = strlen(pszValue) + strlen(download) + 6;
+        download_path = (char*)malloc(size_of_path);
+        snprintf(download_path, size_of_path, "%s/res/%s", pszValue, download);
+    }
+    else
+    {
+        PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE);
+    }
 
     if ( true != _get_value_from_config("PLAYER_DOWNLOAD_PROGRESS_URL", g_media_path) )
     {
@@ -230,7 +230,7 @@ int utc_media_player_get_streaming_download_progress_p(void)
     // if wifi isn't connected or internet modules don't exist, this error will be returned.
     // and it is wrongly detected as a fail. so we will skip the test on these cases.
     if(ret3==PLAYER_ERROR_CONNECTION_FAILED) {
-        fprintf(stderr, "check network status");
+        PRINT_UTC_LOG("[Line : %d][%s] check network status\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
     assert_eq(ret3, PLAYER_ERROR_NONE);
@@ -274,7 +274,7 @@ int utc_media_player_get_streaming_download_progress_n(void)
     // if wifi isn't connected or internet modules don't exist, this error will be returned.
     // and it is wrongly detected as a fail. so we will skip the test on these cases.
     if(ret3==PLAYER_ERROR_CONNECTION_FAILED) {
-        fprintf(stderr, "check network status");
+        PRINT_UTC_LOG("[Line : %d][%s] check network status\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
     assert_eq(ret3, PLAYER_ERROR_NONE);
@@ -335,7 +335,7 @@ int utc_media_player_get_progressive_download_status_p(void)
     // and it is wrongly detected as a fail. so we will skip the test on these cases.
     if ((ret2==PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) &&
         (!_is_network_supportable)) {
-        fprintf(stderr, "network is not supportable.");
+        PRINT_UTC_LOG("[Line : %d][%s] network is not supportable.\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
     assert_eq(ret2, PLAYER_ERROR_NONE);
@@ -375,7 +375,7 @@ int utc_media_player_get_progressive_download_status_n(void)
     // and it is wrongly detected as a fail. so we will skip the test on these cases.
     if ((ret2==PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) &&
         (!_is_network_supportable)) {
-        fprintf(stderr, "network is not supportable.");
+        PRINT_UTC_LOG("[Line : %d][%s] network is not supportable.\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
     assert_eq(ret2, PLAYER_ERROR_NONE);
@@ -415,7 +415,7 @@ int utc_media_player_get_progressive_download_status_n2(void)
     // and it is wrongly detected as a fail. so we will skip the test on these cases.
     if ((ret2==PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) &&
         (!_is_network_supportable)) {
-        fprintf(stderr, "network is not supportable.");
+        PRINT_UTC_LOG("[Line : %d][%s] network is not supportable.\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
     assert_eq(ret2, PLAYER_ERROR_NONE);
@@ -441,7 +441,7 @@ int utc_media_player_set_progressive_download_path_p(void)
     // and it is wrongly detected as a fail. so we will skip the test on these cases.
     if ((ret2==PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) &&
         (!_is_network_supportable)) {
-        fprintf(stderr, "network is not supportable.");
+        PRINT_UTC_LOG("[Line : %d][%s] network is not supportable.\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
     assert_eq(ret2, PLAYER_ERROR_NONE);
@@ -478,38 +478,38 @@ int utc_media_player_set_progressive_download_message_cb_p(void)
 
     int ret = player_set_uri(player, g_media_path);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player_set_uri is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_uri is failed\\n", __LINE__, API_NAMESPACE);
 
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_NONE, NULL);
     if (PLAYER_ERROR_NONE != ret)
-      fprintf(stderr, "player_set_display failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_set_display failed\\n", __LINE__, API_NAMESPACE);
 
     ret = player_set_progressive_download_path(player, download_path);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player_set_progressive_download_path is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_progressive_download_path is failed\\n", __LINE__, API_NAMESPACE);
 
     ret = player_set_progressive_download_message_cb(player, _player_pd_message_cb, NULL);
     // if wifi isn't connected or internet modules don't exist, this error will be returned.
     // and it is wrongly detected as a fail. so we will skip the test on these cases.
     if ((ret==PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) &&
         (!_is_network_supportable)) {
-        fprintf(stderr, "network is not supportable.");
+        PRINT_UTC_LOG("[Line : %d][%s] network is not supportable.\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
     assert_eq(ret, PLAYER_ERROR_NONE);
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
 
     ret = player_start(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't started\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't started\\n", __LINE__, API_NAMESPACE);
 
     wait_for_async();
 
     if(_is_pass)
-      fprintf(stderr, "pd_message_callback is called!\n");
+      PRINT_UTC_LOG("[Line : %d][%s] pd_message_callback is called!\\n", __LINE__, API_NAMESPACE);
 
     return 0;
 }
@@ -536,27 +536,27 @@ int utc_media_player_set_progressive_download_message_cb_n2(void)
 {
     int ret = player_set_uri(player, g_media_path);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player_set_uri is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_uri is failed\\n", __LINE__, API_NAMESPACE);
 
     ret = player_set_display(player, PLAYER_DISPLAY_TYPE_NONE, NULL);
     if (PLAYER_ERROR_NONE != ret)
-      fprintf(stderr, "player_set_display failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_set_display failed\\n", __LINE__, API_NAMESPACE);
 
     ret = player_set_progressive_download_path(player, download_path);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player_set_progressive_download_path is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_progressive_download_path is failed\\n", __LINE__, API_NAMESPACE);
 
     ret = player_prepare(player);
     // if wifi isn't connected or internet modules don't exist, this error will be returned.
     // and it is wrongly detected as a fail. so we will skip the test on these cases.
     if(ret==PLAYER_ERROR_CONNECTION_FAILED) {
-        fprintf(stderr, "check network status");
+        PRINT_UTC_LOG("[Line : %d][%s] check network status\\n", __LINE__, API_NAMESPACE);
         return 0;
     }
 
     ret = player_start(player);
     if (PLAYER_ERROR_NONE != ret)
-        fprintf(stderr, "player isn't started\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't started\\n", __LINE__, API_NAMESPACE);
 
     ret = player_set_progressive_download_message_cb(player, _player_pd_message_cb, NULL);
     assert_eq(ret, PLAYER_ERROR_INVALID_STATE);
index 1bdf891..0698c41 100755 (executable)
@@ -32,17 +32,36 @@ static char* subtitle="subtitles_test_file.srt";
 static char* audio_path=NULL;
 static char* media_path=NULL;
 static char* subtitle_path=NULL;
-
+static int *band_levels = NULL;
+static char* code = NULL;
 static player_h player;
 static bool _is_broken = false;
 static bool _is_pass = false;
-sound_stream_info_h g_stream_info_h = NULL;
+static sound_stream_info_h g_stream_info_h = NULL;
+
+typedef struct{
+    char *album;
+    char *artist;
+    char *author;
+    char *genre;
+    char *title;
+    char *year;
+    char *audio_codec;
+    char *video_codec;
+    int audio_sample_rate;
+    int audio_channel;
+    int audio_bit_rate;
+    void *album_art;
+    int album_art_size;
+    int audio_tracks_count;
+}t_streamInfo;
+static t_streamInfo stream_info = {0};
 
 static GMainLoop *g_mainloop = NULL;
 
 static gboolean timeout_func(gpointer data)
 {
-    fprintf(stderr, "waited 5 seconds\n");
+    PRINT_UTC_LOG("[Line : %d][%s] waited 5 seconds\\n", __LINE__, API_NAMESPACE);
     g_main_loop_quit((GMainLoop *) data);
     return FALSE;
 }
@@ -85,11 +104,11 @@ static void set_sound_stream_info()
   int ret = SOUND_MANAGER_ERROR_NONE;
 
   if (g_stream_info_h) {
-    g_print("stream information is already set, please destory handle and try again\n");
+    g_print("stream information is already set, please destory handle and try again\\n", __LINE__, API_NAMESPACE);
     return;
   }
   if (sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, focus_cb, player, &g_stream_info_h)) {
-    g_print("failed to create stream_information()\n");
+    g_print("failed to create stream_information()\\n", __LINE__, API_NAMESPACE);
     return;
   }
   return;
@@ -137,13 +156,13 @@ void utc_media_player_startup(void)
 
     ret = player_set_uri(player, media_path);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player didn't set uri\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player didn't set uri\\n", __LINE__, API_NAMESPACE);
         _is_broken = true;
     }
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player isn't prepared\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player isn't prepared\\n", __LINE__, API_NAMESPACE);
         _is_broken = true;
     }
 
@@ -163,7 +182,7 @@ void utc_media_player_cleanup(void)
     if(player){
         ret = player_get_state (player, &state);
         if (PLAYER_ERROR_NONE != ret) {
-            fprintf(stderr, "player_get_state is failed\n");
+            PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
         }
         if (state != PLAYER_STATE_IDLE)
             player_unprepare(player);
@@ -180,27 +199,28 @@ void utc_media_player_cleanup(void)
       sound_manager_destroy_stream_information(g_stream_info_h);
       g_stream_info_h = NULL;
     }
+    if(band_levels)
+      free(band_levels);
+       if(code)
+      free(code);
+    if(stream_info.album)
+      free(stream_info.album);
+    if(stream_info.artist)
+      free(stream_info.artist);
+    if(stream_info.author)
+      free(stream_info.author);
+    if(stream_info.genre)
+      free(stream_info.genre);
+    if(stream_info.title)
+      free(stream_info.title);
+    if(stream_info.year)
+      free(stream_info.year);
+       if(stream_info.audio_codec)
+      free(stream_info.audio_codec);
+    if(stream_info.video_codec)
+      free(stream_info.video_codec);
 }
 
-typedef struct{
-    char *album;
-    char *artist;
-    char *author;
-    char *genre;
-    char *title;
-    char *year;
-    char *audio_codec;
-    char *video_codec;
-    int audio_sample_rate;
-    int audio_channel;
-    int audio_bit_rate;
-    void *album_art;
-    int album_art_size;
-    int audio_tracks_count;
-}t_streamInfo;
-
-static t_streamInfo stream_info = {0};
-
 /**
  * @testcase           utc_media_player_get_duration_p
  * @since_tizen                2.3.1
@@ -242,7 +262,7 @@ int utc_media_player_get_duration_n2(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE)
       player_unprepare(player);
@@ -300,7 +320,7 @@ int utc_media_player_set_play_position_n2(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE)
       player_unprepare(player);
@@ -361,7 +381,7 @@ int utc_media_player_get_play_position_n2(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE)
       player_unprepare(player);
@@ -444,7 +464,7 @@ int utc_media_player_set_playback_rate_n2(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE)
       player_unprepare(player);
@@ -468,7 +488,7 @@ int utc_media_player_set_looping_p(void)
 
     int ret = player_is_looping(player, &is);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_is_looping is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_is_looping is failed\\n", __LINE__, API_NAMESPACE);
     }
     if(!is)
       looping = true;
@@ -548,7 +568,7 @@ int utc_media_player_set_mute_p(void)
 
     int ret = player_is_muted(player, &is);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_is_muted is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_is_muted is failed\\n", __LINE__, API_NAMESPACE);
     }
     if(!is)
       mute = true;
@@ -1250,7 +1270,7 @@ int utc_media_player_audio_effect_set_equalizer_all_bands_p(void)
     int ret3 = player_audio_effect_get_equalizer_level_range(player, &min, &max);
     assert_eq(ret3, PLAYER_ERROR_NONE);
 
-    int *band_levels = (int*)malloc(sizeof(int) * count);
+    band_levels = (int*)malloc(sizeof(int) * count);
     assert(band_levels);
     for(i = 0; i < count; i++)
         band_levels[i] = min;
@@ -1264,11 +1284,6 @@ int utc_media_player_audio_effect_set_equalizer_all_bands_p(void)
         assert_eq(level, min);
     }
 
-    if(band_levels){
-        free(band_levels);
-        band_levels = NULL;
-    }
-
     return 0;
 }
 
@@ -1288,7 +1303,7 @@ int utc_media_player_audio_effect_set_equalizer_all_bands_n(void)
     int ret3 = player_audio_effect_get_equalizer_level_range(player, &min, &max);
     assert_eq(ret3, PLAYER_ERROR_NONE);
 
-    int *band_levels = (int*)malloc(sizeof(int) * count);
+    band_levels = (int*)malloc(sizeof(int) * count);
     assert(band_levels);
     for(i=0;i<count;i++)
         band_levels[i] = min;
@@ -1296,11 +1311,6 @@ int utc_media_player_audio_effect_set_equalizer_all_bands_n(void)
     int ret4 = player_audio_effect_set_equalizer_all_bands(player, band_levels, count + 5);
     assert_eq(ret4, PLAYER_ERROR_INVALID_PARAMETER);
 
-    if(band_levels){
-        free(band_levels);
-        band_levels = NULL;
-    }
-
     return 0;
 }
 
@@ -1373,18 +1383,18 @@ int utc_media_player_get_content_info_p(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
     }
     ret = player_set_uri(player, audio_path);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_uri is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_uri is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_prepare is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_prepare is failed\\n", __LINE__, API_NAMESPACE);
     }
 
     int ret2 = player_get_content_info(player, PLAYER_CONTENT_INFO_ALBUM, &stream_info.album);
@@ -1413,19 +1423,6 @@ int utc_media_player_get_content_info_p(void)
     assert(_is_pass);
     _is_pass = false;
 
-    if(stream_info.album)
-      free(stream_info.album);
-    if(stream_info.artist)
-      free(stream_info.artist);
-    if(stream_info.author)
-      free(stream_info.author);
-    if(stream_info.genre)
-      free(stream_info.genre);
-    if(stream_info.title)
-      free(stream_info.title);
-    if(stream_info.year)
-      free(stream_info.year);
-
     return 0;
 }
 
@@ -1453,14 +1450,14 @@ int utc_media_player_get_content_info_n2(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
     }
     ret = player_set_uri(player, audio_path);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_uri is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_uri is failed\\n", __LINE__, API_NAMESPACE);
     }
     ret = player_get_content_info(player, PLAYER_CONTENT_INFO_ALBUM, &stream_info.album);
     assert_eq(ret, PLAYER_ERROR_INVALID_STATE);
@@ -1490,11 +1487,6 @@ int utc_media_player_get_codec_info_p(void)
     assert(_is_pass);
     _is_pass = false;
 
-    if(stream_info.audio_codec)
-      free(stream_info.audio_codec);
-    if(stream_info.video_codec)
-      free(stream_info.video_codec);
-
     int ret3 = player_stop(player);
     assert_eq(ret3, PLAYER_ERROR_NONE);
 
@@ -1525,7 +1517,7 @@ int utc_media_player_get_codec_info_n2(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE)
       player_unprepare(player);
@@ -1585,7 +1577,7 @@ int utc_media_player_get_audio_stream_info_n2(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE)
       player_unprepare(player);
@@ -1609,19 +1601,19 @@ int utc_media_player_get_album_art_p(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_get_state is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE){
         player_unprepare(player);
     }
     ret = player_set_uri(player, audio_path);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_set_uri is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_set_uri is failed\\n", __LINE__, API_NAMESPACE);
     }
 
     ret = player_prepare(player);
     if (PLAYER_ERROR_NONE != ret) {
-        fprintf(stderr, "player_prepare is failed\n");
+        PRINT_UTC_LOG("[Line : %d][%s] player_prepare is failed\\n", __LINE__, API_NAMESPACE);
     }
 
     ret = player_get_album_art(player, &stream_info.album_art, &stream_info.album_art_size);
@@ -1662,7 +1654,7 @@ int utc_media_player_get_album_art_n2(void)
 
     int ret = player_get_state (player, &state);
     if (PLAYER_ERROR_NONE != ret) {
-      fprintf(stderr, "player_get_state is failed\n");
+      PRINT_UTC_LOG("[Line : %d][%s] player_get_state is failed\\n", __LINE__, API_NAMESPACE);
     }
     if (state != PLAYER_STATE_IDLE)
       player_unprepare(player);
@@ -1980,11 +1972,7 @@ int utc_player_get_current_track_n2(void)
  */
 int utc_player_get_track_language_code_p(void)
 {
-  char* code = NULL;
-
   int ret = player_get_track_language_code(player, PLAYER_STREAM_TYPE_AUDIO, 0, &code);
-  if(code)
-    free(code);
   assert_eq(ret, PLAYER_ERROR_NONE);
 
   return 0;
@@ -1997,11 +1985,7 @@ int utc_player_get_track_language_code_p(void)
  */
 int utc_player_get_track_language_code_n(void)
 {
-  char* code = NULL;
-
   int ret = player_get_track_language_code(player, PLAYER_STREAM_TYPE_TEXT, 0, &code);
-  if(code)
-    free(code);
   assert_eq(ret, PLAYER_ERROR_INVALID_OPERATION);
 
   return 0;
@@ -2014,14 +1998,10 @@ int utc_player_get_track_language_code_n(void)
  */
 int utc_player_get_track_language_code_n2(void)
 {
-  char* code = NULL;
-
   int ret = player_unprepare(player);
   assert_eq(ret, PLAYER_ERROR_NONE);
 
   ret = player_get_track_language_code(player, PLAYER_STREAM_TYPE_AUDIO, 0, &code);
-  if(code)
-    free(code);
   assert_eq(ret, PLAYER_ERROR_INVALID_STATE);
 
   return 0;