tbm_surface_info_s info;
const char *ext;
char file[TDM_PATH_LEN];
- int ret, bw;
+ int ret, bw, bh;
TDM_RETURN_IF_FAIL(buffer != NULL);
TDM_RETURN_IF_FAIL(dir != NULL);
ret = tbm_surface_get_info(buffer, &info);
TDM_RETURN_IF_FAIL(ret == TBM_SURFACE_ERROR_NONE);
- if (info.format == TBM_FORMAT_ARGB8888 || info.format == TBM_FORMAT_XRGB8888) {
+ if (IS_RGB(info.format))
ext = file_exts[0];
- bw = info.planes[0].stride >> 2;
- } else {
+ else
ext = file_exts[1];
- bw = info.planes[0].stride;
- }
- snprintf(file, TDM_PATH_LEN, "%s/%c%c%c%c_%dx%d_%s.%s",
- dir, FOURCC_STR(info.format), bw, info.height, str, ext);
+ tdm_helper_get_buffer_full_size(buffer, &bw, &bh);
+
+ snprintf(file, TDM_PATH_LEN, "%s/%c%c%c%c_%dx%d_%dx%d_%s.%s",
+ dir, FOURCC_STR(info.format), bw, bh, info.width, info.height, str, ext);
tdm_helper_dump_buffer(buffer, file);
}
int len, ret;
const char *ext;
int bo_cnt;
+ int bw, bh;
TDM_RETURN_IF_FAIL(buffer != NULL);
TDM_RETURN_IF_FAIL(file != NULL);
TDM_RETURN_IF_FAIL(ret == TBM_SURFACE_ERROR_NONE);
len = strnlen(file, 1024);
- if (info.format == TBM_FORMAT_ARGB8888 || info.format == TBM_FORMAT_XRGB8888)
+ if (IS_RGB(info.format))
ext = file_exts[0];
else
ext = file_exts[1];
return;
}
+ tdm_helper_get_buffer_full_size(buffer, &bw, &bh);
+
bo_cnt = tbm_surface_internal_get_num_bos(buffer);
- TDM_DBG("buffer: bo_cnt(%d) %dx%d %c%c%c%c, plane: (%p+%d, %d,%d) (%p+%d, %d,%d) (%p+%d, %d,%d)",
- bo_cnt, info.width, info.height, FOURCC_STR(info.format),
+ TDM_DBG("buffer: bo_cnt(%d) %dx%d(%dx%d) %c%c%c%c, plane: (%p+%d, %d,%d) (%p+%d, %d,%d) (%p+%d, %d,%d)",
+ bo_cnt, bw, bh, info.width, info.height, FOURCC_STR(info.format),
info.planes[0].ptr, info.planes[0].offset, info.planes[0].stride, info.planes[0].size,
info.planes[1].ptr, info.planes[1].offset, info.planes[1].stride, info.planes[1].size,
info.planes[2].ptr, info.planes[2].offset, info.planes[2].stride, info.planes[2].size);
switch (info.format) {
case TBM_FORMAT_ARGB8888:
case TBM_FORMAT_XRGB8888:
- _tdm_helper_dump_png(file, info.planes[0].ptr,
- info.planes[0].stride >> 2, info.height);
+ _tdm_helper_dump_png(file, info.planes[0].ptr, bw, bh);
break;
case TBM_FORMAT_YVU420:
case TBM_FORMAT_YUV420:
_tdm_helper_dump_raw(file,
info.planes[0].ptr,
- info.planes[0].stride * info.height,
+ info.planes[0].size,
info.planes[1].ptr,
- info.planes[1].stride * (info.height >> 1),
+ info.planes[1].size,
info.planes[2].ptr,
- info.planes[2].stride * (info.height >> 1));
+ info.planes[2].size);
break;
case TBM_FORMAT_NV12:
case TBM_FORMAT_NV21:
- if (bo_cnt == 1 &&
- (info.planes[0].ptr + info.planes[0].stride * info.height) != info.planes[1].ptr)
- TDM_WRN("%p != %p", info.planes[0].ptr + info.planes[0].stride * info.height, info.planes[1].ptr);
-
_tdm_helper_dump_raw(file,
info.planes[0].ptr,
- info.planes[0].stride * info.height,
+ info.planes[0].size,
info.planes[1].ptr,
- info.planes[1].stride * (info.height >> 1), NULL,
+ info.planes[1].size, NULL,
0);
break;
case TBM_FORMAT_YUYV:
case TBM_FORMAT_UYVY:
_tdm_helper_dump_raw(file,
info.planes[0].ptr,
- info.planes[0].stride * info.height, NULL, 0,
+ info.planes[0].size, NULL, 0,
NULL, 0);
break;
default: