changed printf to g_print 93/93693/1 accepted/tizen/3.0/common/20161114.105231 accepted/tizen/common/20161025.155128 accepted/tizen/ivi/20161103.230447 accepted/tizen/mobile/20161103.230352 accepted/tizen/tv/20161103.230410 accepted/tizen/wearable/20161103.230428 submit/tizen/20161025.104308 submit/tizen/20161103.005314 submit/tizen_3.0_common/20161104.104000
authorSejun Park <sejun79.park@samsung.com>
Tue, 25 Oct 2016 10:00:24 +0000 (19:00 +0900)
committerSejun Park <sejun79.park@samsung.com>
Tue, 25 Oct 2016 10:00:24 +0000 (19:00 +0900)
Change-Id: I171c5ff58a0ee561f74934f4ac21c47c644c64ac

test/media_codec_test.c

index d5ab042..c1fda89 100755 (executable)
@@ -191,7 +191,7 @@ int g_menu_state = CURRENT_STATUS_MAINMENU;
 
 static int _create_app(void *data)
 {
-       printf("My app is going alive!\n");
+       g_print("My app is going alive!\n");
        App *app = (App*)data;
 
        g_mutex_init(&app->lock);
@@ -200,7 +200,7 @@ static int _create_app(void *data)
 
 static int _terminate_app(void *data)
 {
-       printf("My app is going gone!\n");
+       g_print("My app is going gone!\n");
        App *app = (App*)data;
 
        g_mutex_clear(&app->lock);
@@ -941,18 +941,18 @@ static void _mediacodec_process_input(App *app)
                if (have_frame) {
 #ifdef USE_POOL
                if (media_packet_pool_acquire_packet(pkt_pool, &pkt, -1) != MEDIA_PACKET_ERROR_NONE) {
-                       fprintf(stderr, "media_packet_pool_aquire_packet failed\n");
+                       g_print("media_packet_pool_aquire_packet failed\n");
                        return;
                }
 #else
                if (media_packet_create_alloc(fmt, NULL, NULL, &pkt) != MEDIA_PACKET_ERROR_NONE) {
-                       fprintf(stderr, "media_packet_create_alloc failed\n");
+                       g_print("media_packet_create_alloc failed\n");
                        return;
                }
 #endif
 
                        if (media_packet_set_pts(pkt, (uint64_t)(pts)) != MEDIA_PACKET_ERROR_NONE) {
-                               fprintf(stderr, "media_packet_set_pts failed\n");
+                               g_print("media_packet_set_pts failed\n");
                                return;
                        }
 
@@ -1061,17 +1061,17 @@ static gboolean read_data(App *app)
        if (have_frame) {
 #ifdef USE_POOL
                if (media_packet_pool_acquire_packet(pkt_pool, &pkt, -1) != MEDIA_PACKET_ERROR_NONE) {
-                       fprintf(stderr, "media_packet_pool_aquire_packet failed\n");
+                       g_print("media_packet_pool_aquire_packet failed\n");
                        return FALSE;
                }
 #else
                if (media_packet_create_alloc(fmt, NULL, NULL, &pkt) != MEDIA_PACKET_ERROR_NONE) {
-                       fprintf(stderr, "media_packet_create_alloc failed\n");
+                       g_print("media_packet_create_alloc failed\n");
                        return FALSE;
                }
 #endif
                if (media_packet_set_pts(pkt, (uint64_t)(pts)) != MEDIA_PACKET_ERROR_NONE) {
-                       fprintf(stderr, "media_packet_set_pts failed\n");
+                       g_print("media_packet_set_pts failed\n");
                        return FALSE;
                }
 
@@ -1232,7 +1232,7 @@ static bool _mediacodec_eos_cb(void *user_data)
 
 void _foreach_cb(mediacodec_codec_type_e codec_type, void *user_data)
 {
-       printf ("codec type : %x %s\n", codec_type, codec_type_to_string(codec_type));
+       g_print("codec type : %x %s\n", codec_type, codec_type_to_string(codec_type));
        return;
 }
 
@@ -1240,7 +1240,7 @@ static void _mediacodec_prepare(App *app, bool frame_all)
 {
        int ret;
 
-       printf("supported codec lists -internal-\n");
+       g_print("supported codec lists -internal-\n");
        mediacodec_foreach_supported_codec_static((mediacodec_supported_codec_cb)_foreach_cb, app);
 
        /* create instance */
@@ -1301,7 +1301,7 @@ static void _mediacodec_prepare(App *app, bool frame_all)
        }
 
        /* set callback */
-       printf("supported codec lists\n");
+       g_print("supported codec lists\n");
        mediacodec_foreach_supported_codec(app->mc_handle[0], (mediacodec_supported_codec_cb)_foreach_cb, app);
        mediacodec_set_input_buffer_used_cb(app->mc_handle[0], (mediacodec_input_buffer_used_cb)_mediacodec_inbuf_used_cb, NULL);
        mediacodec_set_output_buffer_available_cb(app->mc_handle[0], (mediacodec_output_buffer_available_cb) _mediacodec_outbuf_available_cb, app);
@@ -1324,7 +1324,7 @@ static void _mediacodec_prepare(App *app, bool frame_all)
                g_print("mediacodec_get_packet_pool failed\n");
                return;
        }
-       g_print("mediacodec start\n");
+       g_print("\n\nmediacodec start\n\n");
 
        return;
 }
@@ -1441,19 +1441,16 @@ static void _mediacodec_destroy(App *app)
 #ifdef USE_POOL
        if (media_packet_pool_deallocate(pkt_pool) != MEDIA_PACKET_ERROR_NONE) {
 
-               fprintf(stderr, "media_packet_pool_deallocatet failed\n");
-               g_print("PKT POOL deallocation failed \n");
+               g_print("media_packet_pool_deallocatet failed\n");
                return;
        }
-       g_print("PKT POOL deallocated! \n");
 
        if (media_packet_pool_destroy(pkt_pool) != MEDIA_PACKET_ERROR_NONE) {
 
-               fprintf(stderr, " media_packet_pool_destroy failed\n");
-               g_print("PKT POOL destroy failed \n");
+               g_print(" media_packet_pool_destroy failed\n");
                return;
        }
-       g_print("PKT POOL destroyed! \n");
+       g_print("media packet pool destroyed! \n");
 #endif
        mediacodec_destroy(app->mc_handle[0]);
 }
@@ -1842,18 +1839,18 @@ void mc_hex_dump(char *desc, void *addr, int len)
        unsigned char *pc = (unsigned char *)addr;
 
        if (desc != NULL)
-               printf("%s:\n", desc);
+               g_print("%s:\n", desc);
 
        for (i = 0; i < len; i++) {
 
                if ((i % 16) == 0) {
                        if (i != 0)
-                               printf("  %s\n", buff);
+                               g_print("  %s\n", buff);
 
-                       printf("  %04x ", i);
+                       g_print("  %04x ", i);
                }
 
-               printf(" %02x", pc[i]);
+               g_print(" %02x", pc[i]);
 
                if ((pc[i] < 0x20) || (pc[i] > 0x7e))
                        buff[i % 16] = '.';
@@ -1863,10 +1860,10 @@ void mc_hex_dump(char *desc, void *addr, int len)
        }
 
        while ((i % 16) != 0) {
-               printf("   ");
+               g_print("   ");
                i++;
        }
-       printf("  %s\n", buff);
+       g_print("  %s\n", buff);
 }
 
 static void decoder_output_dump(App *app, media_packet_h pkt)
@@ -1884,7 +1881,7 @@ static void decoder_output_dump(App *app, media_packet_h pkt)
        media_packet_get_video_plane_data_ptr(pkt, 0, &temp);
        media_packet_get_video_stride_width(pkt, 0, &stride_width);
        media_packet_get_video_stride_height(pkt, 0, &stride_height);
-       printf("stride : %d, %d\n", stride_width, stride_height);
+       g_print("stride : %d, %d\n", stride_width, stride_height);
 
        for (i = 0; i < app->height; i++) {
                ret = fwrite(temp, app->width, 1, fp);