From 503ce57258077ab1296db0fb09517b9296d966a3 Mon Sep 17 00:00:00 2001 From: NAMJEONGYOON Date: Tue, 1 Nov 2016 18:26:25 +0900 Subject: [PATCH] update debugging information Change-Id: Ib2a8afb7639618e1e02dbca26d0c641fa8081c9a --- src/mm_evas_renderer.c | 69 ++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/src/mm_evas_renderer.c b/src/mm_evas_renderer.c index ae15ca6..d983d41 100755 --- a/src/mm_evas_renderer.c +++ b/src/mm_evas_renderer.c @@ -167,7 +167,7 @@ static void _evas_render_pre_cb(void *data, Evas *e, void *event_info) mm_evas_info *evas_info = data; if (!evas_info || !evas_info->eo) { - LOGW("there is no esink info.... esink : %p, or eo is NULL returning", evas_info); + LOGW("there is no evas_info.... evas_info : %p, or eo is NULL", evas_info); return; } @@ -176,7 +176,7 @@ static void _evas_render_pre_cb(void *data, Evas *e, void *event_info) if (evas_info->retrieve_packet) { g_mutex_lock(&evas_info->idx_lock); if (_flush_packets(evas_info) != MM_ERROR_NONE) - LOGE("flushing packets are failed"); + LOGE("flushing packets is failed"); g_mutex_unlock(&evas_info->idx_lock); } MMER_FLEAVE(); @@ -206,7 +206,7 @@ static void _evas_pipe_cb(void *data, void *buffer, update_info info) mm_evas_info *evas_info = data; if (!evas_info) { - LOGW("evas_info is NULL", evas_info); + LOGW("evas_info is NULL"); return; } @@ -253,17 +253,19 @@ static void _evas_pipe_cb(void *data, void *buffer, update_info info) LOGD("received (idx %d, packet %p)", cur_idx, evas_info->pkt_info[cur_idx].packet); tbm_format tbm_fmt = tbm_surface_get_format(evas_info->pkt_info[cur_idx].tbm_surf); + gchar *s_fmt = NULL; switch (tbm_fmt) { case TBM_FORMAT_NV12: - LOGD("tbm_surface format : TBM_FORMAT_NV12"); + s_fmt = "TBM_FORMAT_NV12"; break; case TBM_FORMAT_YUV420: - LOGD("tbm_surface format : TBM_FORMAT_YUV420"); + s_fmt = "TBM_FORMAT_YUV420"; break; default: - LOGW("tbm_surface format : unknown %d", tbm_fmt); + s_fmt = "unknown"; break; } + LOGD("format(%d) : %s", tbm_fmt, s_fmt); Evas_Native_Surface surf = { 0 }; surf.type = EVAS_NATIVE_SURFACE_TBM; @@ -362,12 +364,14 @@ static int __dump_pkt(media_packet_h pkt, int width, int height) FILE *fp = NULL; int i = 0; int stride_width, stride_height; + uint32_t plane_num = 0; sprintf(filename, "/tmp/DUMP_IN_IMG_%2.2d.dump", g_cnt_in); fp = fopen(filename, "wb"); if (fp == NULL) return 1; + media_packet_get_number_of_video_planes(pkt, &plane_num); /* temporary expedient to decide format */ media_packet_get_video_plane_data_ptr(pkt, 0, &data); media_packet_get_video_stride_width(pkt, 0, &stride_width); media_packet_get_video_stride_height(pkt, 0, &stride_height); @@ -378,29 +382,34 @@ static int __dump_pkt(media_packet_h pkt, int width, int height) fwrite(data, width, 1, fp); data += stride_width; } -#if 0 //hw format(NV12) - media_packet_get_video_plane_data_ptr(pkt, 1, &data); - media_packet_get_video_stride_width(pkt, 1, &stride_width); - for (i = 0; i < height/2; i++) { - fwrite(data, width, 1, fp); - data += stride_width; - } -#else - media_packet_get_video_plane_data_ptr(pkt, 1, &data); - media_packet_get_video_stride_width(pkt, 1, &stride_width); - for (i = 0; i < height/2; i++) { - fwrite(data, width/2, 1, fp); - data += stride_width; - } - LOGI("[1]stride : %d, %d", stride_width, stride_height); - media_packet_get_video_plane_data_ptr(pkt, 2, &data); - media_packet_get_video_stride_width(pkt, 2, &stride_width); - for (i = 0; i < height/2; i++) { - fwrite(data, width/2, 1, fp); - data += stride_width; + if (plane_num == 2) { /* hw codec(NV12) */ + media_packet_get_video_plane_data_ptr(pkt, 1, &data); + media_packet_get_video_stride_width(pkt, 1, &stride_width); + for (i = 0; i < height/2; i++) { + fwrite(data, width, 1, fp); + data += stride_width; + } + } else if (plane_num == 3) { /* sw codec(YUV420) */ + media_packet_get_video_plane_data_ptr(pkt, 1, &data); + media_packet_get_video_stride_width(pkt, 1, &stride_width); + for (i = 0; i < height/2; i++) { + fwrite(data, width/2, 1, fp); + data += stride_width; + } + LOGI("[1]stride : %d, %d", stride_width, stride_height); + media_packet_get_video_plane_data_ptr(pkt, 2, &data); + media_packet_get_video_stride_width(pkt, 2, &stride_width); + for (i = 0; i < height/2; i++) { + fwrite(data, width/2, 1, fp); + data += stride_width; + } + LOGI("[2]stride : %d, %d", stride_width, stride_height); + } else { + LOGW("plane_num %d", plane_num); + fclose(fp); + return 1; } - LOGI("[2]stride : %d, %d", stride_width, stride_height); -#endif + LOGI("DUMP_IN_IMG_%2.2d : buffer size(%d) data(%p)", g_cnt_in, (int)size, data); fclose(fp); @@ -514,7 +523,7 @@ static int _flush_packets(mm_evas_info *evas_info) int i = 0; if (!evas_info) { - LOGW("there is no esink info"); + LOGW("there is no evas_info"); return MM_ERROR_EVASRENDER_INVALID_ARGUMENT; } @@ -966,7 +975,7 @@ static int _mm_evas_renderer_retrieve_all_packets(mm_evas_info *evas_info, bool if (pid == tid) { /* in this case, we deem it is main thread */ if (_flush_packets(evas_info) != MM_ERROR_NONE) { - LOGE("flushing packets are failed"); + LOGE("flushing packets is failed"); ret = MM_ERROR_EVASRENDER_INTERNAL; } } else { -- 2.7.4